Unite Gallery Lite - Version 1.7.54

Version Description

The plugin don't have upgrades yet

Download this release

Release Info

Developer valiano
Plugin Icon 128x128 Unite Gallery Lite
Version 1.7.54
Comparing to
See all releases

Version 1.7.54

Files changed (317) hide show
  1. css/admin.css +1343 -0
  2. css/font/egfont.eot +0 -0
  3. css/font/egfont.svg +213 -0
  4. css/font/egfont.ttf +0 -0
  5. css/font/egfont.woff +0 -0
  6. css/font/index.html +0 -0
  7. css/index.html +0 -0
  8. css/jui/index.html +0 -0
  9. css/jui/new/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
  10. css/jui/new/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
  11. css/jui/new/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
  12. css/jui/new/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
  13. css/jui/new/images/ui-bg_glass_75_dadada_1x400.png +0 -0
  14. css/jui/new/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
  15. css/jui/new/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
  16. css/jui/new/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
  17. css/jui/new/images/ui-icons_222222_256x240.png +0 -0
  18. css/jui/new/images/ui-icons_2e83ff_256x240.png +0 -0
  19. css/jui/new/images/ui-icons_454545_256x240.png +0 -0
  20. css/jui/new/images/ui-icons_888888_256x240.png +0 -0
  21. css/jui/new/images/ui-icons_cd0a0a_256x240.png +0 -0
  22. css/jui/new/index.html +0 -0
  23. css/jui/new/jquery-ui-1.9.2.custom.css +462 -0
  24. css/jui/new/jquery-ui-1.9.2.custom.min.css +5 -0
  25. css/jui/new/jquery-ui.structure.min.css +5 -0
  26. css/jui/new/jquery-ui.theme.min.css +5 -0
  27. css/media_dialog.css +238 -0
  28. css/tipsy.css +12 -0
  29. css/unitegallery_manager.css +435 -0
  30. css/unitegallery_styles.css +120 -0
  31. galleries/index.html +0 -0
  32. galleries/order.xml +13 -0
  33. galleries/ugcore_carousel/client_output.php +14 -0
  34. galleries/ugcore_carousel/config.xml +12 -0
  35. galleries/ugcore_carousel/inc_php/index.html +0 -0
  36. galleries/ugcore_carousel/inc_php/output.class.php +85 -0
  37. galleries/ugcore_carousel/includes.php +9 -0
  38. galleries/ugcore_carousel/index.html +0 -0
  39. galleries/ugcore_carousel/release_log.txt +3 -0
  40. galleries/ugcore_carousel/settings/gallery_options.php +14 -0
  41. galleries/ugcore_carousel/settings/gallery_options.xml +54 -0
  42. galleries/ugcore_carousel/settings/gallery_settings.php +38 -0
  43. galleries/ugcore_carousel/settings/gallery_settings.xml +151 -0
  44. galleries/ugcore_carousel/settings/index.html +0 -0
  45. galleries/ugcore_carousel/views/index.html +0 -0
  46. galleries/ugcore_carousel/views/preview.php +10 -0
  47. galleries/ugcore_compact/ajax_actions.php +21 -0
  48. galleries/ugcore_compact/client_output.php +11 -0
  49. galleries/ugcore_compact/config.xml +11 -0
  50. galleries/ugcore_compact/inc_php/helper.class.php +169 -0
  51. galleries/ugcore_compact/inc_php/index.html +0 -0
  52. galleries/ugcore_compact/inc_php/output.class.php +88 -0
  53. galleries/ugcore_compact/includes.php +12 -0
  54. galleries/ugcore_compact/index.html +0 -0
  55. galleries/ugcore_compact/js/compact_admin.js +95 -0
  56. galleries/ugcore_compact/js/index.html +0 -0
  57. galleries/ugcore_compact/release_log.txt +3 -0
  58. galleries/ugcore_compact/scripts.php +7 -0
  59. galleries/ugcore_compact/settings/gallery_settings.php +45 -0
  60. galleries/ugcore_compact/settings/gallery_settings.xml +55 -0
  61. galleries/ugcore_compact/settings/index.html +0 -0
  62. galleries/ugcore_compact/views/index.html +0 -0
  63. galleries/ugcore_compact/views/preview.php +10 -0
  64. galleries/ugcore_compact/views/settings_before_draw.php +22 -0
  65. galleries/ugcore_default/client_output.php +12 -0
  66. galleries/ugcore_default/config.xml +11 -0
  67. galleries/ugcore_default/inc_php/index.html +0 -0
  68. galleries/ugcore_default/inc_php/output.class.php +69 -0
  69. galleries/ugcore_default/includes.php +9 -0
  70. galleries/ugcore_default/index.html +0 -0
  71. galleries/ugcore_default/release_log.txt +3 -0
  72. galleries/ugcore_default/settings/gallery_settings.php +58 -0
  73. galleries/ugcore_default/settings/gallery_settings.xml +66 -0
  74. galleries/ugcore_default/settings/index.html +0 -0
  75. galleries/ugcore_default/views/index.html +0 -0
  76. galleries/ugcore_default/views/preview.php +10 -0
  77. galleries/ugcore_grid/ajax_actions.php +23 -0
  78. galleries/ugcore_grid/client_output.php +13 -0
  79. galleries/ugcore_grid/config.xml +11 -0
  80. galleries/ugcore_grid/inc_php/helper.class.php +163 -0
  81. galleries/ugcore_grid/inc_php/index.html +0 -0
  82. galleries/ugcore_grid/inc_php/output.class.php +88 -0
  83. galleries/ugcore_grid/includes.php +12 -0
  84. galleries/ugcore_grid/index.html +0 -0
  85. galleries/ugcore_grid/js/grid_admin.js +95 -0
  86. galleries/ugcore_grid/js/index.html +0 -0
  87. galleries/ugcore_grid/release_log.txt +3 -0
  88. galleries/ugcore_grid/scripts.php +7 -0
  89. galleries/ugcore_grid/settings/gallery_settings.php +37 -0
  90. galleries/ugcore_grid/settings/gallery_settings.xml +62 -0
  91. galleries/ugcore_grid/settings/index.html +0 -0
  92. galleries/ugcore_grid/views/index.html +0 -0
  93. galleries/ugcore_grid/views/preview.php +10 -0
  94. galleries/ugcore_grid/views/settings_before_draw.php +23 -0
  95. galleries/ugcore_slider/client_output.php +13 -0
  96. galleries/ugcore_slider/config.xml +11 -0
  97. galleries/ugcore_slider/inc_php/index.html +0 -0
  98. galleries/ugcore_slider/inc_php/output.class.php +52 -0
  99. galleries/ugcore_slider/includes.php +10 -0
  100. galleries/ugcore_slider/index.html +0 -0
  101. galleries/ugcore_slider/release_log.txt +3 -0
  102. galleries/ugcore_slider/settings/gallery_settings.php +40 -0
  103. galleries/ugcore_slider/settings/gallery_settings.xml +16 -0
  104. galleries/ugcore_slider/settings/index.html +0 -0
  105. galleries/ugcore_slider/views/index.html +0 -0
  106. galleries/ugcore_slider/views/preview.php +10 -0
  107. galleries/ugcore_tilescolumns/client_output.php +13 -0
  108. galleries/ugcore_tilescolumns/config.xml +12 -0
  109. galleries/ugcore_tilescolumns/inc_php/index.html +0 -0
  110. galleries/ugcore_tilescolumns/inc_php/output.class.php +106 -0
  111. galleries/ugcore_tilescolumns/includes.php +9 -0
  112. galleries/ugcore_tilescolumns/index.html +0 -0
  113. galleries/ugcore_tilescolumns/release_log.txt +3 -0
  114. galleries/ugcore_tilescolumns/settings/gallery_options.php +15 -0
  115. galleries/ugcore_tilescolumns/settings/gallery_options.xml +146 -0
  116. galleries/ugcore_tilescolumns/settings/gallery_settings.php +34 -0
  117. galleries/ugcore_tilescolumns/settings/gallery_settings.xml +19 -0
  118. galleries/ugcore_tilescolumns/settings/index.html +0 -0
  119. galleries/ugcore_tilescolumns/views/index.html +0 -0
  120. galleries/ugcore_tilescolumns/views/preview.php +10 -0
  121. galleries/ugcore_tilesgrid/client_output.php +13 -0
  122. galleries/ugcore_tilesgrid/config.xml +12 -0
  123. galleries/ugcore_tilesgrid/inc_php/index.html +0 -0
  124. galleries/ugcore_tilesgrid/inc_php/output.class.php +108 -0
  125. galleries/ugcore_tilesgrid/includes.php +9 -0
  126. galleries/ugcore_tilesgrid/index.html +0 -0
  127. galleries/ugcore_tilesgrid/release_log.txt +3 -0
  128. galleries/ugcore_tilesgrid/settings/gallery_options.php +15 -0
  129. galleries/ugcore_tilesgrid/settings/gallery_options.xml +99 -0
  130. galleries/ugcore_tilesgrid/settings/gallery_settings.php +39 -0
  131. galleries/ugcore_tilesgrid/settings/gallery_settings.xml +108 -0
  132. galleries/ugcore_tilesgrid/settings/index.html +0 -0
  133. galleries/ugcore_tilesgrid/views/index.html +0 -0
  134. galleries/ugcore_tilesgrid/views/preview.php +10 -0
  135. galleries/ugcore_tilesjustified/client_output.php +13 -0
  136. galleries/ugcore_tilesjustified/config.xml +12 -0
  137. galleries/ugcore_tilesjustified/inc_php/index.html +0 -0
  138. galleries/ugcore_tilesjustified/inc_php/output.class.php +100 -0
  139. galleries/ugcore_tilesjustified/includes.php +9 -0
  140. galleries/ugcore_tilesjustified/index.html +0 -0
  141. galleries/ugcore_tilesjustified/release_log.txt +3 -0
  142. galleries/ugcore_tilesjustified/settings/gallery_options.php +14 -0
  143. galleries/ugcore_tilesjustified/settings/gallery_options.xml +97 -0
  144. galleries/ugcore_tilesjustified/settings/gallery_settings.php +32 -0
  145. galleries/ugcore_tilesjustified/settings/gallery_settings.xml +18 -0
  146. galleries/ugcore_tilesjustified/settings/index.html +0 -0
  147. galleries/ugcore_tilesjustified/views/index.html +0 -0
  148. galleries/ugcore_tilesjustified/views/preview.php +10 -0
  149. galleries/ugcore_tilesnested/client_output.php +13 -0
  150. galleries/ugcore_tilesnested/config.xml +12 -0
  151. galleries/ugcore_tilesnested/inc_php/index.html +0 -0
  152. galleries/ugcore_tilesnested/inc_php/output.class.php +110 -0
  153. galleries/ugcore_tilesnested/includes.php +9 -0
  154. galleries/ugcore_tilesnested/index.html +0 -0
  155. galleries/ugcore_tilesnested/release_log.txt +3 -0
  156. galleries/ugcore_tilesnested/settings/gallery_options.php +15 -0
  157. galleries/ugcore_tilesnested/settings/gallery_options.xml +114 -0
  158. galleries/ugcore_tilesnested/settings/gallery_settings.php +32 -0
  159. galleries/ugcore_tilesnested/settings/gallery_settings.xml +18 -0
  160. galleries/ugcore_tilesnested/settings/index.html +0 -0
  161. galleries/ugcore_tilesnested/views/index.html +0 -0
  162. galleries/ugcore_tilesnested/views/preview.php +10 -0
  163. galleries/ugcore_video/ajax_actions.php +61 -0
  164. galleries/ugcore_video/client_output.php +12 -0
  165. galleries/ugcore_video/config.xml +12 -0
  166. galleries/ugcore_video/inc_php/index.html +0 -0
  167. galleries/ugcore_video/inc_php/output.class.php +104 -0
  168. galleries/ugcore_video/includes.php +11 -0
  169. galleries/ugcore_video/index.html +0 -0
  170. galleries/ugcore_video/js/video_admin.js +134 -0
  171. galleries/ugcore_video/release_log.txt +3 -0
  172. galleries/ugcore_video/scripts.php +13 -0
  173. galleries/ugcore_video/settings/gallery_settings.php +19 -0
  174. galleries/ugcore_video/settings/gallery_settings.xml +46 -0
  175. galleries/ugcore_video/settings/index.html +0 -0
  176. galleries/ugcore_video/views/index.html +0 -0
  177. galleries/ugcore_video/views/preview.php +10 -0
  178. galleries/ugcore_video/views/settings_before_draw.php +24 -0
  179. helpers/classes/include_classes.php +8 -0
  180. helpers/classes/index.html +0 -0
  181. helpers/classes/output_ug.class.php +1617 -0
  182. helpers/classes/settings_ug.class.php +88 -0
  183. helpers/index.html +0 -0
  184. helpers/settings/advancedtab_main.php +22 -0
  185. helpers/settings/advancedtab_params.php +9 -0
  186. helpers/settings/advancedtab_params.xml +28 -0
  187. helpers/settings/categorytab_main.php +26 -0
  188. helpers/settings/categorytab_params.php +12 -0
  189. helpers/settings/categorytab_params.xml +506 -0
  190. helpers/settings/general.php +12 -0
  191. helpers/settings/general.xml +114 -0
  192. helpers/settings/grid_panel.php +18 -0
  193. helpers/settings/grid_panel.xml +210 -0
  194. helpers/settings/index.html +0 -0
  195. helpers/settings/lightbox.php +11 -0
  196. helpers/settings/lightbox.xml +420 -0
  197. helpers/settings/loadmore.php +15 -0
  198. helpers/settings/loadmore.xml +16 -0
  199. helpers/settings/main.php +63 -0
  200. helpers/settings/main_tiles.php +59 -0
  201. helpers/settings/position.php +4 -0
  202. helpers/settings/position.xml +21 -0
  203. helpers/settings/position_tiles.php +4 -0
  204. helpers/settings/position_tiles.xml +21 -0
  205. helpers/settings/slider_main.php +45 -0
  206. helpers/settings/slider_main.xml +443 -0
  207. helpers/settings/slider_textpanel.php +10 -0
  208. helpers/settings/slider_textpanel.xml +182 -0
  209. helpers/settings/strip_panel.php +18 -0
  210. helpers/settings/strip_panel.xml +194 -0
  211. helpers/settings/thumbnail.php +27 -0
  212. helpers/settings/thumbnail.xml +204 -0
  213. helpers/settings/tiles_design.php +10 -0
  214. helpers/settings/tiles_design.xml +331 -0
  215. helpers/settings/tiles_textpanel.php +9 -0
  216. helpers/settings/tiles_textpanel.xml +127 -0
  217. helpers/settings/troubleshooting.php +14 -0
  218. helpers/settings/troubleshooting.xml +48 -0
  219. helpers/templates/gallery_advanced.php +91 -0
  220. helpers/templates/gallery_categorytabs.php +56 -0
  221. helpers/templates/gallery_edit.php +92 -0
  222. helpers/templates/gallery_edit_buttons.php +22 -0
  223. helpers/templates/gallery_edit_tabs.php +84 -0
  224. helpers/templates/gallery_new.php +38 -0
  225. helpers/templates/gallery_new_buttons.php +17 -0
  226. helpers/templates/header.php +9 -0
  227. helpers/templates/index.html +0 -0
  228. helpers/views/advanced.php +46 -0
  229. helpers/views/categorytabs.php +35 -0
  230. helpers/views/index.html +0 -0
  231. helpers/views/settings_common.php +59 -0
  232. images/close.png +0 -0
  233. images/delete.png +0 -0
  234. images/duplicate.png +0 -0
  235. images/edit.png +0 -0
  236. images/eye.png +0 -0
  237. images/eyes.png +0 -0
  238. images/grain.png +0 -0
  239. images/icon-16-unitegallery.png +0 -0
  240. images/icon-general.png +0 -0
  241. images/icon-jump-disabled.png +0 -0
  242. images/icon-jump.png +0 -0
  243. images/icon-position.png +0 -0
  244. images/icon-preview.png +0 -0
  245. images/icon-published.png +0 -0
  246. images/icon-unpublished.png +0 -0
  247. images/icon_drag.png +0 -0
  248. images/icon_html5video_32.png +0 -0
  249. images/icon_notdrag.png +0 -0
  250. images/icon_vimeo.png +0 -0
  251. images/icon_vimeo_32.png +0 -0
  252. images/icon_wistia_32.png +0 -0
  253. images/icon_youtube.png +0 -0
  254. images/icon_youtube_32.png +0 -0
  255. images/index.html +0 -0
  256. images/loader-status.gif +0 -0
  257. images/loader.gif +0 -0
  258. images/preview.png +0 -0
  259. images/red-grad.png +0 -0
  260. images/timeline.png +0 -0
  261. images/timerdot.png +0 -0
  262. images/tipsy.gif +0 -0
  263. images/trans_tile.png +0 -0
  264. images/trans_tile2.png +0 -0
  265. images/transparent.jpg +0 -0
  266. images/transparent.png +0 -0
  267. images/transtiled.png +0 -0
  268. images/update.png +0 -0
  269. images/white-grad.png +0 -0
  270. images/wp-arrows.png +0 -0
  271. inc_php/framework/base_admin.class.php +165 -0
  272. inc_php/framework/base_output.class.php +311 -0
  273. inc_php/framework/cssparser.class.php +270 -0
  274. inc_php/framework/db.class.php +437 -0
  275. inc_php/framework/elements_base.class.php +25 -0
  276. inc_php/framework/functions.class.php +1026 -0
  277. inc_php/framework/functions.php +25 -0
  278. inc_php/framework/helper_base.class.php +79 -0
  279. inc_php/framework/image_view.class.php +534 -0
  280. inc_php/framework/include_framework.php +37 -0
  281. inc_php/framework/index.html +0 -0
  282. inc_php/framework/provider/assets/provider_admin.css +63 -0
  283. inc_php/framework/provider/assets/provider_admin.js +128 -0
  284. inc_php/framework/provider/assets/unitegallery_post_page.js +83 -0
  285. inc_php/framework/provider/functions_wordpress.class.php +1316 -0
  286. inc_php/framework/provider/provider_admin.class.php +375 -0
  287. inc_php/framework/provider/provider_db.class.php +83 -0
  288. inc_php/framework/provider/provider_front.class.php +236 -0
  289. inc_php/framework/provider/provider_functions.class.php +742 -0
  290. inc_php/framework/provider/provider_main_file.php +94 -0
  291. inc_php/framework/provider/settings/general_settings_provider.xml +16 -0
  292. inc_php/framework/provider/unitegallery_widget.class.php +116 -0
  293. inc_php/framework/settings.class.php +1396 -0
  294. inc_php/framework/settings_advances.class.php +231 -0
  295. inc_php/framework/settings_output.class.php +254 -0
  296. inc_php/framework/settings_product.class.php +793 -0
  297. inc_php/framework/settings_product_sidebar.class.php +900 -0
  298. inc_php/framework/translate.class.php +107 -0
  299. inc_php/framework/zip.class.php +105 -0
  300. inc_php/index.html +0 -0
  301. inc_php/unitegallery_categories.class.php +353 -0
  302. inc_php/unitegallery_category.class.php +294 -0
  303. inc_php/unitegallery_galleries.class.php +388 -0
  304. inc_php/unitegallery_gallery.class.php +533 -0
  305. inc_php/unitegallery_gallery_type.class.php +210 -0
  306. inc_php/unitegallery_globals.class.php +171 -0
  307. inc_php/unitegallery_globals_gallery.class.php +66 -0
  308. inc_php/unitegallery_helper.class.php +505 -0
  309. inc_php/unitegallery_helper_gallery.class.php +255 -0
  310. inc_php/unitegallery_item.class.php +686 -0
  311. inc_php/unitegallery_items.class.php +1090 -0
  312. inc_php/unitegallery_manager.class.php +591 -0
  313. inc_php/unitegallery_manager_inline.class.php +175 -0
  314. inc_php/unitegallery_manager_main.class.php +269 -0
  315. inc_php/unitegallery_operations.class.php +459 -0
  316. includes.php +46 -0
  317. js/admin.js +740 -0
css/admin.css ADDED
@@ -0,0 +1,1343 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+
3
+ #----------------FRAMEWORK------------------{}
4
+
5
+ /* ====================================== */
6
+ /* FRAMEWORK
7
+ /* ====================================== */
8
+
9
+ html{
10
+ overflow-y:visible !important;
11
+ }
12
+
13
+ #div_debug{
14
+ xpadding:10px;
15
+ display:none;
16
+ }
17
+
18
+ .unite_error_message, .unite_success_message{
19
+ width:500px;
20
+ margin:10px;
21
+ padding:5px;
22
+ padding-left:10px;
23
+ padding-right:10px;
24
+ border-radius: 3px 3px 3px 3px;
25
+ color:#000000;
26
+ }
27
+
28
+ .unite_error_message{
29
+ border:1px solid #FA7C7C;
30
+ background-color:#FEE2E2;
31
+ }
32
+
33
+ .unite_success_message{
34
+ border:1px solid #7ED090;
35
+ background-color:#E3F5E7;
36
+ }
37
+
38
+ .unite-color-red{
39
+ color:#ff0000 !important;
40
+ }
41
+
42
+ .mtop_5{
43
+ margin-top:5px !important;
44
+ }.mtop_10{
45
+ margin-top:10px !important;
46
+ }.mtop_15{
47
+ margin-top:15px !important;
48
+ }.mtop_20{
49
+ margin-top:20px !important;
50
+ }.mtop_25{
51
+ margin-top:25px !important;
52
+ }.mtop_30{
53
+ margin-top:30px !important;
54
+ }
55
+
56
+ .mleft_5{
57
+ margin-left:5px !important;
58
+ }.mleft_10{
59
+ margin-left:10px !important;
60
+ }.mleft_15{
61
+ margin-left:15px !important;
62
+ }.mleft_20{
63
+ margin-left:20px !important;
64
+ }.mleft_25{
65
+ margin-left:25px !important;
66
+ }.mleft_30{
67
+ margin-left:30px !important;
68
+ }
69
+
70
+ .mbottom_5{
71
+ margin-bottom:5px !important;
72
+ }.mbottom_10{
73
+ margin-bottom:10px !important;
74
+ }.mbottom_15{
75
+ margin-bottom:15px !important;
76
+ }.mbottom_20{
77
+ margin-bottom:20px !important;
78
+ }.mbottom_25{
79
+ margin-bottom:25px !important;
80
+ }.mbottom_30{
81
+ margin-bottom:30px !important;
82
+ }
83
+
84
+ .mright_5{
85
+ margin-right:5px !important;
86
+ }.mright_10{
87
+ margin-right:10px !important;
88
+ }.mright_15{
89
+ margin-right:15px !important;
90
+ }.mright_20{
91
+ margin-right:20px !important;
92
+ }.mright_25{
93
+ margin-right:25px !important;
94
+ }.mright_30{
95
+ margin-right:30px !important;
96
+ }.mright_50{
97
+ margin-right:50px !important;
98
+ }
99
+
100
+ .unselectable{
101
+ -webkit-user-select: none; /* make unselectable */
102
+ -moz-user-select: none;
103
+ -ms-user-select: none;
104
+ }
105
+
106
+ .vert_sap10{
107
+ clear: both;
108
+ height: 10px;
109
+ width: 100%;
110
+ }.vert_sap20{
111
+ clear: both;
112
+ height: 20px;
113
+ width: 100%;
114
+ }.vert_sap40{
115
+ clear: both;
116
+ height: 40px;
117
+ width: 100%;
118
+ }.vert_sap50{
119
+ clear: both;
120
+ height: 50px;
121
+ width: 100%;
122
+ }
123
+
124
+ .hor_sap{
125
+ padding-right:15px;
126
+ }
127
+
128
+
129
+ .unite_table_items *{
130
+ box-sizing: content-box;
131
+ }
132
+
133
+ .unite_table_items{
134
+ box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
135
+ border-left: medium none;
136
+ border-right: medium none;
137
+ background: none repeat scroll 0 0 #fff;
138
+ border-collapse:collapse;
139
+ }
140
+
141
+
142
+ .unite_table_items thead th{
143
+ line-height:1.4em;
144
+ border-bottom: 1px solid #e1e1e1;
145
+ text-align:left;
146
+ font-weight: 400;
147
+ overflow: hidden;
148
+ padding: 8px 10px;
149
+ border-spacing: 0;
150
+ }
151
+
152
+
153
+ .unite_table_items tr td{
154
+ padding: 8px 10px;
155
+ line-height: 23px;
156
+ vertical-align: middle;
157
+ color: #555;
158
+ overflow: hidden;
159
+ font-size:13px;
160
+ }
161
+
162
+ .unite_table_items tr td a{
163
+ font-size:14px;
164
+ text-decoration:none;
165
+ color:#025a8d;
166
+ }
167
+
168
+ .unite_table_items tr td a:hover{
169
+ text-decoration:underline;
170
+ color:#025a8d;
171
+ }
172
+
173
+
174
+ .loader_round{
175
+ width:16px;
176
+ height:16px;
177
+ background-image:url('../images/loader.gif');
178
+ background-repeat:no-repeat;
179
+ padding-left:20px;
180
+ display:inline-block;
181
+ }
182
+
183
+ .loader_text{
184
+ min_height:16px;
185
+ background-image:url('../images/loader.gif');
186
+ background-repeat:no-repeat;
187
+ padding-left:22px;
188
+ }
189
+
190
+ .success_message{
191
+ color:green;
192
+ }
193
+
194
+ .unite-inputs input[type="text"],
195
+ .unite-inputs textarea{
196
+ padding:5px;
197
+ }
198
+
199
+ .unite-input-wide{
200
+ width: 350px;
201
+ }
202
+
203
+ .unite-disabled{
204
+ color:#939393;
205
+ }
206
+
207
+
208
+ #----------------MAIN------------------{}
209
+
210
+ /* ====================================== */
211
+ /* MAIN
212
+ /* ====================================== */
213
+
214
+ .unite-view-wrapper{
215
+ position:relative;
216
+ font-size:14px;
217
+ }
218
+
219
+ .unite-admin ul{
220
+ list-style:none;
221
+ margin:0px;
222
+ padding:0px;
223
+ display:block;
224
+ }
225
+
226
+ .unite-admin ul li{
227
+ list-style:none;
228
+ }
229
+
230
+ .unite-admin p{
231
+ margin:0px;
232
+ padding:0px;
233
+ }
234
+
235
+ .unite-dialog-inside{
236
+ margin-top:10px;
237
+ margin-bottom:10px;
238
+ }
239
+ .unite-clear{
240
+ clear:both;
241
+ display:block;
242
+ }
243
+
244
+ .unite_header_wrapper{
245
+ padding-bottom:20px;
246
+ xclear: both;
247
+ }
248
+
249
+ .unite_header_wrapper .top_menu_wrapper{
250
+ xborder:1px solid black;
251
+ height:40px;
252
+ float:right;
253
+ }
254
+
255
+ ul.unite-top-main-menu{
256
+ padding:0px;
257
+ margin:0px;
258
+ }
259
+
260
+ ul.unite-top-main-menu li{
261
+ float:left;
262
+ margin-left:10px;
263
+ }
264
+
265
+ ul.unite-top-main-menu li a{
266
+
267
+ }
268
+
269
+ ul.unite-top-main-menu li.active a{
270
+ color:green;
271
+ }
272
+
273
+ .unite-plugin-version-line{
274
+ text-align:left;
275
+ padding-top:50px;
276
+ }
277
+
278
+ .unite-plugin-version-line a{
279
+ text-decoration:none;
280
+ }
281
+
282
+ .unite-plugin-version-line a:hover{
283
+ text-decoration:underline;
284
+ }
285
+
286
+ .unite-view-wrapper .title_line{
287
+ height:40px;
288
+ float:left;
289
+ }
290
+
291
+ .title_line_text{
292
+ float:left;
293
+ font-size:24px;
294
+ font-weight:500;
295
+ }
296
+
297
+ #----------------DIALOG------------------{}
298
+
299
+ .ui-dialog-content .unite-dialog-title{
300
+ font-weight:bold;
301
+ padding-top:20px;
302
+ padding-bottom:20px;
303
+ }
304
+
305
+ .ui-dialog-content .unite-dialog-desc{
306
+ font-style:italic;
307
+ padding-bottom:10px;
308
+ }
309
+
310
+ .ui-dialog-content .unite-dialog-fileinput{
311
+ width:500px;
312
+ }
313
+
314
+
315
+ .unite-dialog-inside{
316
+ margin-top:10px;
317
+ margin-bottom:10px;
318
+ }
319
+
320
+ #----------------BUTTONS------------------{}
321
+
322
+ /* ====================================== */
323
+ /* Buttons
324
+ /* ====================================== */
325
+
326
+ .unite-button-primary,
327
+ .unite-button-secondary{
328
+ text-decoration:none;
329
+ font-size:12px;
330
+ border-radius: 0px;
331
+ border-style: solid;
332
+ border-width: 1px;
333
+ box-sizing: border-box;
334
+ cursor: pointer;
335
+ display: inline-block;
336
+ font-size: 13px;
337
+ height: 28px;
338
+ line-height: 26px;
339
+ margin: 0;
340
+ padding: 0 10px 1px;
341
+ text-decoration: none;
342
+ white-space: nowrap;
343
+ margin-top:2px;
344
+ margin-bottom:2px;
345
+ }
346
+
347
+ .unite-button-secondary{
348
+ border:1px solid #C5C3C3;
349
+ background: #ffffff; /* Old browsers */
350
+ background: -moz-linear-gradient(top, #ffffff 0%, #f1f1f1 100%); /* FF3.6+ */
351
+ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#ffffff), color-stop(100%,#f1f1f1)); /* Chrome,Safari4+ */
352
+ background: -webkit-linear-gradient(top, #ffffff 0%,#f1f1f1 100%); /* Chrome10+,Safari5.1+ */
353
+ background: -o-linear-gradient(top, #ffffff 0%,#f1f1f1 100%); /* Opera 11.10+ */
354
+ background: -ms-linear-gradient(top, #ffffff 0%,#f1f1f1 100%); /* IE10+ */
355
+ background: linear-gradient(to bottom, #ffffff 0%,#f1f1f1 100%); /* W3C */
356
+ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#f1f1f1',GradientType=0 ); /* IE6-9 */
357
+ border-radius:3px;
358
+ color:#000000 !important;
359
+ box-shadow:1px 2px 2px rgba(0,0,0,0.1);
360
+ font-family: Arial,​Helvetica,​sans-serif;
361
+ font-size:14px;
362
+ }
363
+
364
+ .unite-button-secondary:hover{
365
+ border:1px solid #AAA8A8;
366
+ background: #f1f1f1; /* Old browsers */
367
+ background: -moz-linear-gradient(top, #f1f1f1 0%, #e1e1e1 100%); /* FF3.6+ */
368
+ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f1f1f1), color-stop(100%,#e1e1e1)); /* Chrome,Safari4+ */
369
+ background: -webkit-linear-gradient(top, #f1f1f1 0%,#e1e1e1 100%); /* Chrome10+,Safari5.1+ */
370
+ background: -o-linear-gradient(top, #f1f1f1 0%,#e1e1e1 100%); /* Opera 11.10+ */
371
+ background: -ms-linear-gradient(top, #f1f1f1 0%,#e1e1e1 100%); /* IE10+ */
372
+ background: linear-gradient(to bottom, #f1f1f1 0%,#e1e1e1 100%); /* W3C */
373
+ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f1f1f1', endColorstr='#e1e1e1',GradientType=0 ); /* IE6-9 */
374
+
375
+ text-decoration:none !important;
376
+ }
377
+
378
+
379
+ .unite-button-primary{
380
+ box-shadow:1px 2px 2px rgba(0,0,0,0.1);
381
+ background: #00b7ea; /* Old browsers */
382
+ background: -moz-linear-gradient(top, #00b7ea 0%, #009ec3 100%); /* FF3.6+ */
383
+ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#00b7ea), color-stop(100%,#009ec3)); /* Chrome,Safari4+ */
384
+ background: -webkit-linear-gradient(top, #00b7ea 0%,#009ec3 100%); /* Chrome10+,Safari5.1+ */
385
+ background: -o-linear-gradient(top, #00b7ea 0%,#009ec3 100%); /* Opera 11.10+ */
386
+ background: -ms-linear-gradient(top, #00b7ea 0%,#009ec3 100%); /* IE10+ */
387
+ background: linear-gradient(to bottom, #00b7ea 0%,#009ec3 100%); /* W3C */
388
+ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#00b7ea', endColorstr='#009ec3',GradientType=0 ); /* IE6-9 */
389
+ color:white !important;
390
+ border:1px solid #006B96 !important;
391
+ border-radius:3px;
392
+ font-size:12px;
393
+ cursor:pointer;
394
+ font-family: Arial,​Helvetica,​sans-serif;
395
+ font-size:14px;
396
+ }
397
+
398
+ .unite-button-primary:hover{
399
+ background: #26daf2; /* Old browsers */
400
+ background: -moz-linear-gradient(top, #26daf2 0%, #009ec3 100%); /* FF3.6+ */
401
+ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#26daf2), color-stop(100%,#009ec3)); /* Chrome,Safari4+ */
402
+ background: -webkit-linear-gradient(top, #26daf2 0%,#009ec3 100%); /* Chrome10+,Safari5.1+ */
403
+ background: -o-linear-gradient(top, #26daf2 0%,#009ec3 100%); /* Opera 11.10+ */
404
+ background: -ms-linear-gradient(top, #26daf2 0%,#009ec3 100%); /* IE10+ */
405
+ background: linear-gradient(to bottom, #26daf2 0%,#009ec3 100%); /* W3C */
406
+ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#26daf2', endColorstr='#009ec3',GradientType=0 ); /* IE6-9 */
407
+ text-decoration:none !important;
408
+ }
409
+
410
+ .unite-button-secondary.button-disabled{
411
+ border:1px solid #AAA8A8;
412
+ background-color:#DCDCDC;
413
+ cursor:default;
414
+ color:#A3A3A3 !important;
415
+ }
416
+
417
+ .unite-button-blue
418
+ {background: #00b7ea; /* Old browsers */
419
+ background: -moz-linear-gradient(top, #00b7ea 0%, #009ec3 100%); /* FF3.6+ */
420
+ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#00b7ea), color-stop(100%,#009ec3)); /* Chrome,Safari4+ */
421
+ background: -webkit-linear-gradient(top, #00b7ea 0%,#009ec3 100%); /* Chrome10+,Safari5.1+ */
422
+ background: -o-linear-gradient(top, #00b7ea 0%,#009ec3 100%); /* Opera 11.10+ */
423
+ background: -ms-linear-gradient(top, #00b7ea 0%,#009ec3 100%); /* IE10+ */
424
+ background: linear-gradient(to bottom, #00b7ea 0%,#009ec3 100%); /* W3C */
425
+ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#00b7ea', endColorstr='#009ec3',GradientType=0 ); /* IE6-9 */
426
+ color:white !important;
427
+ border:1px solid #006B96 !important;
428
+ }
429
+ .unite-button-blue:hover
430
+ { background: #26daf2; /* Old browsers */
431
+ background: -moz-linear-gradient(top, #26daf2 0%, #009ec3 100%); /* FF3.6+ */
432
+ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#26daf2), color-stop(100%,#009ec3)); /* Chrome,Safari4+ */
433
+ background: -webkit-linear-gradient(top, #26daf2 0%,#009ec3 100%); /* Chrome10+,Safari5.1+ */
434
+ background: -o-linear-gradient(top, #26daf2 0%,#009ec3 100%); /* Opera 11.10+ */
435
+ background: -ms-linear-gradient(top, #26daf2 0%,#009ec3 100%); /* IE10+ */
436
+ background: linear-gradient(to bottom, #26daf2 0%,#009ec3 100%); /* W3C */
437
+ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#26daf2', endColorstr='#009ec3',GradientType=0 ); /* IE6-9 */
438
+ text-decoration:none !important;
439
+ }
440
+
441
+
442
+
443
+ #-------------unite-context-menu---------------{}
444
+
445
+ /* ====================================== */
446
+ /* Context Menu
447
+ /* ====================================== */
448
+
449
+ ul.unite-context-menu{
450
+ border:1px solid black;
451
+ list-style:none;
452
+ width:130px;
453
+ margin:0px;
454
+ padding:0px;
455
+ position:absolute;
456
+ top:0px;
457
+ left:0px;
458
+ background-color:#ffffff;
459
+ }
460
+
461
+ ul.unite-context-menu li{
462
+ padding:0px !important;
463
+ margin:0px !important;
464
+ }
465
+
466
+ ul.unite-context-menu li a{
467
+ text-decoration:none;
468
+ padding-left:10px;
469
+ display:block;
470
+ padding-top:4px;
471
+ padding-bottom:6px;
472
+ color:#000000;
473
+ background-color:#ffffff;
474
+ }
475
+
476
+ ul.unite-context-menu li a:hover{
477
+ background-color:#E2E8FE;
478
+ color:#000000;
479
+ text-decoration:none;
480
+ }
481
+
482
+ ul.unite-context-menu li a:focus{
483
+ box-shadow:none !important;
484
+ color:#000000;
485
+ text-decoration:none;
486
+ }
487
+
488
+ /* ====================================== */
489
+ /* Settings Wide
490
+ /* ====================================== */
491
+
492
+ .content_wrapper{
493
+ position:relative;
494
+ }
495
+
496
+ .unite_settings_wide hr{
497
+ border:0px;
498
+ border-top:1px dashed #656565;
499
+ margin:auto;
500
+ }
501
+
502
+ .unite_settings_wide .setting-disabled th,
503
+ .unite_settings_wide .setting-disabled td,
504
+ .unite_settings_wide .setting-disabled input,
505
+ .unite_settings_wide .setting-disabled .description,
506
+ .unite_settings_wide .setting-disabled{
507
+ color:#6D6D6D;
508
+ }
509
+
510
+ .unite_settings_wide .setting-disabled input,
511
+ .unite_settings_wide .setting-disabled textarea{
512
+ background-color:#F0F0F0;
513
+ }
514
+
515
+ /* ====================================== */
516
+ /* Textbox Classes
517
+ /* ====================================== */
518
+
519
+ .textbox-small{
520
+ width:60px !important;
521
+ }
522
+
523
+ .text-sidebar{
524
+ width:70px !important;
525
+ }
526
+
527
+ .text-sidebar-normal{
528
+ width:100px !important;
529
+ }
530
+
531
+ .text-sidebar-long{
532
+ width:125px !important;
533
+ }
534
+
535
+ .text-sidebar-link{
536
+ width:340px !important;
537
+ }
538
+
539
+
540
+ /* ====================================== */
541
+ /* Settings
542
+ /* ====================================== */
543
+
544
+ #------------------SETTINGS--------------------{}
545
+
546
+
547
+
548
+ .settings_panel{
549
+ margin:0px;
550
+ background-color:white;
551
+ }
552
+
553
+ .settings_panel_single{
554
+ padding-left:20px;
555
+ padding-right:20px;
556
+ }
557
+
558
+ .settings_panel .settings_panel_left{
559
+ display: table-cell;
560
+ float: none;
561
+ min-width: 630px;
562
+ vertical-align: top;
563
+ width: 71%;
564
+ border-left:1px solid lightgray;
565
+ }
566
+
567
+ .settings_panel .settings_panel_right{
568
+ display: table-cell;
569
+ float: none;
570
+ min-width: 360px;
571
+ vertical-align: top;
572
+ width: 30%;
573
+ border-right:1px solid lightgray;
574
+ }
575
+
576
+ .unite-postbox,
577
+ .settings_panel .settings_panel_box{
578
+ background: none repeat scroll 0 0 #fff;
579
+ border: medium none !important;
580
+ position: relative;
581
+ box-sizing: border-box;
582
+ }
583
+
584
+ .settings_panel_right .unite-postbox{
585
+ margin-bottom:20px;
586
+ }
587
+
588
+ .settings_panel .settings_panel_left_inner{
589
+ margin-right: 20px;
590
+ padding:10px;
591
+ padding-top:30px;
592
+ }
593
+
594
+ .settings_wrapper .setting_required{
595
+ font-size:16px;
596
+ color:red;
597
+ }
598
+
599
+ .unite_settings_wide .description{
600
+ display:block;
601
+ color: #999;
602
+ font-size: 13px;
603
+ font-style: italic;
604
+ font-weight: 300;
605
+ line-height: 30px;
606
+ }
607
+
608
+ .settings_wrapper{
609
+ font-family:"Open Sans", sans-serif;
610
+ }
611
+
612
+ .settings_wrapper input[type="text"],
613
+ .settings_wrapper input[type="radio"]{
614
+ margin:1px;
615
+ padding-top: 3px;
616
+ padding-right: 5px;
617
+ padding-bottom: 3px;
618
+ padding-left: 5px;
619
+ box-shadow: 0 1px 2px rgba(0, 0, 0, 0.07) inset;
620
+ width:auto;
621
+ display:inline;
622
+ }
623
+
624
+ .settings_wrapper input.small-text{
625
+ width:70px !important;
626
+ }
627
+
628
+ .settings_wrapper .inputColorPicker{
629
+ width:100px !important;
630
+ }
631
+
632
+ .unite_settings_wide{
633
+ font-size:14px;
634
+ }
635
+
636
+ .unite_settings_wide label{
637
+ cursor:pointer;
638
+ }
639
+
640
+ ul.list-tabs-settings{
641
+ margin:0px;
642
+ padding:0px;
643
+ xdisplay:block;
644
+ list-style:none;
645
+ }
646
+
647
+ ul.list-tabs-settings li{
648
+ float:left;
649
+ margin-bottom:0px !important;
650
+ }
651
+
652
+ ul.list-tabs-settings li.unite-tab-hidden{
653
+ display: none;
654
+ }
655
+
656
+
657
+ ul.list-tabs-settings li a{
658
+ padding-left:20px;
659
+ padding-right:20px;
660
+ padding-top:15px;
661
+ padding-bottom:15px;
662
+ border-left:1px solid #E1E1E1;
663
+ border-right:1px solid #E1E1E1;
664
+
665
+ background-color:#ffffff;
666
+ text-decoration:none;
667
+ display:table-cell;
668
+ color:gray;
669
+ font-size:16px;
670
+ background-color:#eee;
671
+ text-decoration:none !important;
672
+ }
673
+
674
+
675
+ ul.list-tabs-settings li a:hover{
676
+ background-color:#ddd;
677
+ box-shadow:none !important;
678
+ text-decoration:none !important;
679
+ color:gray !important;
680
+ }
681
+
682
+ ul.list-tabs-settings li a:focus{
683
+ box-shadow:none !important;
684
+ }
685
+
686
+ ul.list-tabs-settings li.selected a,
687
+ ul.list-tabs-settings li.selected a:hover{
688
+ background-color:#fff;
689
+ color:black;
690
+ cursor:default;
691
+ border-left:1px solid lightgray;
692
+ border-right:1px solid lightgray;
693
+ border-top:1px solid lightgray;
694
+ text-decoration:none !important;
695
+ }
696
+
697
+
698
+
699
+ .unite-postbox{
700
+ width:380px;
701
+ font-size:13px;
702
+ }
703
+
704
+ .unite-postbox hr{
705
+ border:none;
706
+ border-top:1px dashed #ACACAC;
707
+ margin-bottom:10px;
708
+ margin-top:10px;
709
+ }
710
+
711
+ .unite-postbox .unite-postbox-title{
712
+ cursor: pointer !important;
713
+ height: 25px;
714
+ margin: 0;
715
+ max-width: 100% !important;
716
+ padding: 10px;
717
+ position: relative;
718
+ border-bottom: 1px solid #eee;
719
+ }
720
+
721
+ .unite-postbox .unite-postbox-title.no-accordion{
722
+ cursor:default;
723
+ }
724
+
725
+ .unite-postbox .unite-postbox-title .unite-postbox-arrow{
726
+ width:25px;
727
+ height:25px;
728
+ float:right;
729
+ background-image:url('../images/wp-arrows.png');
730
+ background-repeat:no-repeat;
731
+ background-position:right 5px;
732
+ margin-right:4px;
733
+ }
734
+
735
+ .unite-postbox .unite-postbox-title.box_closed .unite-postbox-arrow{
736
+ background-position:right -66px;
737
+ }
738
+
739
+ .unite-postbox .unite-postbox-title span{
740
+ color: #34495e;
741
+ display: block;
742
+ float: left;
743
+ line-height: 18px;
744
+ max-width: 250px;
745
+ padding-left: 10px;
746
+ padding-top: 3px;
747
+ font-size: 14px;
748
+ font-weight:600;
749
+ }
750
+
751
+ .unite-postbox .inside{
752
+ padding:12px;
753
+ }
754
+
755
+ /* style disabled input */
756
+ .unite-postbox li.setting-disabled input,
757
+ .unite-postbox li.setting-disabled textarea,
758
+ .unite-postbox input[type='text'][disabled='disabled']{
759
+ color:#6D6D6D;
760
+ background-color:#f6f6f6;
761
+ }
762
+
763
+ /* color picker */
764
+ #divColorPicker{
765
+ position:absolute;
766
+ }
767
+
768
+
769
+ .settings_wrapper select{
770
+ min-width:80px;
771
+ width:auto;
772
+ }
773
+
774
+
775
+ table.unite_table_settings_wide{
776
+ border-collapse:collapse;
777
+ width:100%;
778
+ }
779
+
780
+ table.unite_table_settings_wide tr td,
781
+ table.unite_table_settings_wide tr th{
782
+ padding-top:8px;
783
+ padding-bottom:8px;
784
+ padding-left:5px;
785
+ padding-right:5px;
786
+ }
787
+
788
+ table.unite_table_settings_wide tr th{
789
+ text-align:left;
790
+ font-weight:normal;
791
+ padding-top:12px;
792
+ }
793
+
794
+ .settings_panel_single .unite_table_settings_wide tr th,
795
+ .settings_panel_left .unite_table_settings_wide tr th{
796
+ width:160px;
797
+ }
798
+
799
+ table.unite_table_settings_wide input[type="text"]{
800
+ padding:5px;
801
+ display:inline !important;
802
+ }
803
+
804
+ .unite-inputs .input-regular,
805
+ table.unite_table_settings_wide .input-regular{
806
+ width:300px;
807
+ }
808
+
809
+ table.unite_table_settings_wide .input-alias{
810
+ width:250px;
811
+ }
812
+
813
+ .unite-inputs .input-readonly,
814
+ table.unite_table_settings_wide .input-readonly{
815
+ background-color:#F0F0F0;
816
+ }
817
+
818
+ .unite-inputs .input-link,
819
+ table.unite_table_settings_wide .input-link{
820
+ width:400px;
821
+ }
822
+
823
+ .unite-inputs .input-number,
824
+ table.unite_table_settings_wide .input-number{
825
+ width:50px;
826
+ }
827
+
828
+ .unite-inputs select{
829
+ padding:2px;
830
+ }
831
+
832
+ .unite-inputs select option{
833
+ padding:2px;
834
+ }
835
+
836
+ table.unite_table_settings_wide textarea{
837
+ width:100%;
838
+ padding:5px;
839
+ }
840
+
841
+ table.unite_table_settings_wide label{
842
+ display:inline;
843
+ }
844
+
845
+ table.unite_table_settings{
846
+ border-collapse:collapse;
847
+ }
848
+
849
+ .setting_onecell_horsap{
850
+ padding-right:20px;
851
+ }
852
+
853
+ .setting_onecell_text{
854
+ padding-right:5px;
855
+ }
856
+
857
+ .unite_table_settings_wide select{
858
+ margin-top:2px;
859
+ }
860
+
861
+ .list_settings{
862
+ padding:0px;
863
+ margin:0px;
864
+ }
865
+
866
+ .list_settings li{
867
+ display:table-row;
868
+ padding:0px;
869
+ }
870
+
871
+ .list_settings li.hrrow{
872
+ display:list-item;
873
+ }
874
+
875
+ .list_settings li.setting-disabled{
876
+ color:#6D6D6D;
877
+ }
878
+
879
+
880
+ .list_settings li .setting_text{
881
+ display: table-cell;
882
+ line-height: 35px;
883
+ position: relative;
884
+ text-align: left;
885
+ white-space: normal !important;
886
+ min-width: 190px;
887
+ padding-right:5px;
888
+ cursor:default;
889
+ }
890
+
891
+ .list_settings li .setting_input{
892
+ box-sizing: border-box;
893
+ display: table-cell;
894
+ padding-right: 5px;
895
+ position: relative;
896
+ text-align: left;
897
+ }
898
+
899
+ .list_settings li .setting_input input[type="button"]{
900
+ cursor:pointer;
901
+ padding:3px;
902
+ background: linear-gradient(to bottom, #ffffff 0%, #f1f1f1 100%) repeat scroll 0 0 rgba(0, 0, 0, 0);
903
+ border: 1px solid #c5c3c3;
904
+ border-radius: 3px;
905
+ box-shadow: 1px 2px 2px rgba(0, 0, 0, 0.1);
906
+ color: #000000 !important;
907
+ font-size:12px;
908
+ }
909
+
910
+ .list_settings li .setting_input input[type="button"]:hover{
911
+ border:1px solid #AAA8A8;
912
+ background: #f1f1f1; /* Old browsers */
913
+ background: -moz-linear-gradient(top, #f1f1f1 0%, #e1e1e1 100%); /* FF3.6+ */
914
+ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f1f1f1), color-stop(100%,#e1e1e1)); /* Chrome,Safari4+ */
915
+ background: -webkit-linear-gradient(top, #f1f1f1 0%,#e1e1e1 100%); /* Chrome10+,Safari5.1+ */
916
+ background: -o-linear-gradient(top, #f1f1f1 0%,#e1e1e1 100%); /* Opera 11.10+ */
917
+ background: -ms-linear-gradient(top, #f1f1f1 0%,#e1e1e1 100%); /* IE10+ */
918
+ background: linear-gradient(to bottom, #f1f1f1 0%,#e1e1e1 100%); /* W3C */
919
+ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f1f1f1', endColorstr='#e1e1e1',GradientType=0 ); /* IE6-9 */
920
+
921
+ text-decoration:none !important;
922
+ }
923
+
924
+ .list_settings li.setting_row_textarea{
925
+ display:block;
926
+ }
927
+
928
+ .list_settings li.setting_row_textarea .setting_input{
929
+ display:block;
930
+ }
931
+
932
+ .list_settings li textarea{
933
+ width:100%;
934
+ font-size:1em;
935
+ }
936
+
937
+ .list_settings li .setting_unit{
938
+ display:inline;
939
+ padding-left:0px;
940
+ padding-top:3px;
941
+ }
942
+
943
+ .list_settings li .settings_addhtml{
944
+ padding-left:10px;
945
+ }
946
+
947
+ .list_settings li .setting_input select{
948
+ min-width:60px;
949
+ padding:2px;
950
+ }
951
+
952
+ .list_settings li .setting_input select option{
953
+ padding:3px;
954
+ }
955
+
956
+ .list_settings .inputColorPicker{
957
+ width:80px;
958
+ }
959
+
960
+
961
+ .list_settings .settings_buttons{
962
+ padding-top:15px;
963
+ padding-bottom:5px;
964
+ }
965
+
966
+ .list_settings .button-image-select{
967
+ margin-right:13px;
968
+ }
969
+
970
+ .list_settings .setting-image-preview{
971
+ border:1px dashed black;
972
+ width:100px;
973
+ height:70px;
974
+ display:block;
975
+ margin-right:10px;
976
+ float:left;
977
+ }
978
+
979
+ ul.list_settings label
980
+ {
981
+ display:inline !important;
982
+ }
983
+
984
+ ul.list_settings select {
985
+ width: 118px !important;
986
+ }
987
+ .settings_wrapper
988
+ {
989
+ padding-top:20px;
990
+ }
991
+ .settings_wrapper .unite-postbox-title
992
+ {
993
+ background-color:#f1f1f1;
994
+ box-sizing: content-box;
995
+ }
996
+
997
+ /****************************
998
+ * Custom Unitegallery Settings
999
+ ****************************/
1000
+
1001
+ #-----------------CUSTOM_SETTINGS----------------{}
1002
+
1003
+ #-----------------CODEMIRROR----------------{}
1004
+
1005
+ /****************************
1006
+ * Code Mirror Editor
1007
+ ****************************/
1008
+
1009
+
1010
+
1011
+ .CodeMirror{
1012
+ font-size: 14px;
1013
+ border:1px solid #949494;
1014
+ }
1015
+
1016
+
1017
+ #---------------DROP_DOWN_SELECTOR---------------------{}
1018
+
1019
+ /****************************
1020
+ * DROP DOWN SELECTOR PLUGIN
1021
+ ****************************/
1022
+
1023
+ .unite-drop-down-wrapper select{
1024
+ width:250px;
1025
+ height:150px !important;
1026
+ }
1027
+
1028
+ div.unite-drop-down-wrapper a.remove{
1029
+ position: absolute;
1030
+ right: 3px;
1031
+ top: 5px;
1032
+ display: block;
1033
+ cursor: pointer;
1034
+ width: 18px;
1035
+ height: 18px;
1036
+ background: url(../images/close.png) no-repeat;
1037
+ }
1038
+
1039
+ .unite-selected-items{
1040
+ position: relative;
1041
+ }
1042
+
1043
+ .unite-selected-items .label{
1044
+
1045
+ position: absolute;
1046
+ left: -171px;
1047
+ top: 25px;
1048
+ }
1049
+
1050
+ .unite-selected-items ul{
1051
+ list-style: none;
1052
+ display: inline-block;
1053
+ padding: 15px 0px 0px 0px;
1054
+ }
1055
+
1056
+ .unite-selected-items ul>li {
1057
+ float: left;
1058
+ margin-top: 3px;
1059
+ }
1060
+
1061
+ .unite-selected-items ul>li>div{
1062
+ height: 29px;
1063
+ line-height: 29px;
1064
+ background: #333;
1065
+ border-radius: 3px;
1066
+ display: block;
1067
+ margin-left: 6px;
1068
+ padding: 0 20px 0 10px;
1069
+ font-family: arial;
1070
+ font-size: 12px;
1071
+ color: #fff;
1072
+ text-decoration: none;
1073
+ cursor: pointer;
1074
+ position: relative;
1075
+ }
1076
+
1077
+ .unite-selected-items ul>li>div:hover {
1078
+ background: #89bf43;
1079
+ }
1080
+
1081
+
1082
+
1083
+ #------------------ICONS--------------------{}
1084
+
1085
+ /****************************
1086
+ * Fontello Icons
1087
+ ****************************/
1088
+
1089
+ @font-face {
1090
+ font-family: 'eg-font';
1091
+ src: url('font/egfont.eot?85610117');
1092
+ src: url('font/egfont.eot?85610117#iefix') format('embedded-opentype'),
1093
+ url('font/egfont.woff?85610117') format('woff'),
1094
+ url('font/egfont.ttf?85610117') format('truetype'),
1095
+ url('font/egfont.svg?85610117#egfont') format('svg');
1096
+ font-weight: normal;
1097
+ font-style: normal;
1098
+
1099
+ }
1100
+
1101
+ [class^="eg-icon-"]:before, [class*=" eg-icon-"]:before {
1102
+ font-family: "eg-font";
1103
+ font-style: normal;
1104
+ font-weight: normal;
1105
+ speak: none;
1106
+ color:#34495e;
1107
+
1108
+ display: inline-block;
1109
+ text-decoration: inherit;
1110
+ width: 1em;
1111
+ margin-right: .2em;
1112
+ text-align: center;
1113
+ /* opacity: .8; */
1114
+
1115
+ /* For safety - reset parent styles, that can break glyph codes*/
1116
+ font-variant: normal;
1117
+ text-transform: none;
1118
+
1119
+ /* fix buttons height, for twitter bootstrap */
1120
+ line-height: 1em;
1121
+
1122
+ /* Animation center compensation - margins should be symmetric */
1123
+ /* remove if not needed */
1124
+ margin-left: .2em;
1125
+
1126
+ /* you can be more comfortable with increased icons size */
1127
+ /* font-size: 120%; */
1128
+
1129
+ /* Uncomment for 3D effect */
1130
+ /* text-shadow: 1px 1px 1px rgba(127, 127, 127, 0.3); */
1131
+ }
1132
+
1133
+ .unite-preview-wrapper
1134
+ {
1135
+ background-color:white;
1136
+ border-left:1px solid lightgray;
1137
+ border-right:1px solid lightgray;
1138
+ border-bottom:1px solid lightgray;
1139
+ }
1140
+
1141
+ .eg-icon-music:before { content: '\e858'; } /* '' */
1142
+ .eg-icon-color-adjust:before { content: '\e862'; } /* 'î¡¢' */
1143
+ .eg-icon-mail:before { content: '\e868'; } /* '' */
1144
+ .eg-icon-mail-alt:before { content: '\e869'; } /* 'î¡©' */
1145
+ .eg-icon-heart:before { content: '\e86a'; } /* '' */
1146
+ .eg-icon-heart-empty:before { content: '\e86b'; } /* 'î¡«' */
1147
+ .eg-icon-star:before { content: '\e86c'; } /* '' */
1148
+ .eg-icon-star-empty:before { content: '\e86d'; } /* 'î¡­' */
1149
+ .eg-icon-user:before { content: '\e879'; } /* '' */
1150
+ .eg-icon-male:before { content: '\e87a'; } /* '' */
1151
+ .eg-icon-female:before { content: '\e87b'; } /* 'î¡»' */
1152
+ .eg-icon-video:before { content: '\e805'; } /* 'î …' */
1153
+ .eg-icon-videocam:before { content: '\e859'; } /* 'î¡™' */
1154
+ .eg-icon-picture-1:before { content: '\e803'; } /* 'î ƒ' */
1155
+ .eg-icon-camera:before { content: '\e85a'; } /* 'î¡š' */
1156
+ .eg-icon-camera-alt:before { content: '\e85b'; } /* 'î¡›' */
1157
+ .eg-icon-th-large:before { content: '\e83c'; } /* 'î ¼' */
1158
+ .eg-icon-th:before { content: '\e83d'; } /* 'î ½' */
1159
+ .eg-icon-ok:before { content: '\e80d'; } /* 'î �' */
1160
+ .eg-icon-ok-circled2:before { content: '\e877'; } /* 'î¡·' */
1161
+ .eg-icon-ok-squared:before { content: '\e878'; } /* '' */
1162
+ .eg-icon-cancel:before { content: '\e80a'; } /* 'î Š' */
1163
+ .eg-icon-plus:before { content: '\e86e'; } /* 'î¡®' */
1164
+ .eg-icon-plus-circled:before { content: '\e876'; } /* '' */
1165
+ .eg-icon-plus-squared:before { content: '\e875'; } /* '' */
1166
+ .eg-icon-minus:before { content: '\e86f'; } /* '' */
1167
+ .eg-icon-minus-circled:before { content: '\e870'; } /* 'î¡°' */
1168
+ .eg-icon-minus-squared:before { content: '\e871'; } /* '' */
1169
+ .eg-icon-minus-squared-alt:before { content: '\e872'; } /* '' */
1170
+ .eg-icon-info-circled:before { content: '\e80f'; } /* 'î �' */
1171
+ .eg-icon-info:before { content: '\e844'; } /* 'î¡„' */
1172
+ .eg-icon-home:before { content: '\e843'; } /* '' */
1173
+ .eg-icon-link:before { content: '\e80e'; } /* 'î Ž' */
1174
+ .eg-icon-unlink:before { content: '\e83f'; } /* 'î ¿' */
1175
+ .eg-icon-link-ext:before { content: '\e840'; } /* 'î¡€' */
1176
+ .eg-icon-lock:before { content: '\e856'; } /* 'î¡–' */
1177
+ .eg-icon-lock-open:before { content: '\e857'; } /* '�' */
1178
+ .eg-icon-eye:before { content: '\e841'; } /* '�' */
1179
+ .eg-icon-eye-off:before { content: '\e842'; } /* 'î¡‚' */
1180
+ .eg-icon-tag:before { content: '\e85c'; } /* '' */
1181
+ .eg-icon-thumbs-up:before { content: '\e887'; } /* '' */
1182
+ .eg-icon-thumbs-up-alt:before { content: '\e888'; } /* '' */
1183
+ .eg-icon-download:before { content: '\e88a'; } /* '' */
1184
+ .eg-icon-upload:before { content: '\e889'; } /* '' */
1185
+ .eg-icon-reply:before { content: '\e8a6'; } /* '' */
1186
+ .eg-icon-forward:before { content: '\e874'; } /* 'î¡´' */
1187
+ .eg-icon-export-1:before { content: '\e873'; } /* '' */
1188
+ .eg-icon-print:before { content: '\e886'; } /* '' */
1189
+ .eg-icon-gamepad:before { content: '\e837'; } /* 'î ·' */
1190
+ .eg-icon-trash:before { content: '\e801'; } /* 'î �' */
1191
+ .eg-icon-doc-text:before { content: '\e885'; } /* '' */
1192
+ .eg-icon-doc-inv:before { content: '\e884'; } /* '' */
1193
+ .eg-icon-folder-1:before { content: '\e83e'; } /* 'î ¾' */
1194
+ .eg-icon-folder-open:before { content: '\e883'; } /* '' */
1195
+ .eg-icon-folder-open-empty:before { content: '\e882'; } /* '' */
1196
+ .eg-icon-rss:before { content: '\e880'; } /* '' */
1197
+ .eg-icon-rss-squared:before { content: '\e881'; } /* '�' */
1198
+ .eg-icon-phone:before { content: '\e87f'; } /* 'î¡¿' */
1199
+ .eg-icon-menu:before { content: '\e830'; } /* 'î °' */
1200
+ .eg-icon-cog-alt:before { content: '\e847'; } /* '' */
1201
+ .eg-icon-wrench:before { content: '\e848'; } /* '' */
1202
+ .eg-icon-basket-1:before { content: '\e87c'; } /* '' */
1203
+ .eg-icon-calendar:before { content: '\e87d'; } /* '' */
1204
+ .eg-icon-calendar-empty:before { content: '\e87e'; } /* '' */
1205
+ .eg-icon-lightbulb:before { content: '\e88b'; } /* '' */
1206
+ .eg-icon-resize-full-alt:before { content: '\e845'; } /* 'î¡…' */
1207
+ .eg-icon-move:before { content: '\e846'; } /* '' */
1208
+ .eg-icon-down-dir:before { content: '\e838'; } /* 'î ¸' */
1209
+ .eg-icon-up-dir:before { content: '\e839'; } /* 'î ¹' */
1210
+ .eg-icon-left-dir:before { content: '\e817'; } /* 'î �' */
1211
+ .eg-icon-right-dir:before { content: '\e818'; } /* 'î ˜' */
1212
+ .eg-icon-down-open:before { content: '\e83b'; } /* 'î »' */
1213
+ .eg-icon-left-open:before { content: '\e819'; } /* 'î ™' */
1214
+ .eg-icon-right-open:before { content: '\e81a'; } /* 'î š' */
1215
+ .eg-icon-angle-left:before { content: '\e820'; } /* 'î  ' */
1216
+ .eg-icon-angle-right:before { content: '\e81d'; } /* 'î �' */
1217
+ .eg-icon-angle-double-left:before { content: '\e892'; } /* '' */
1218
+ .eg-icon-angle-double-right:before { content: '\e893'; } /* '' */
1219
+ .eg-icon-left-big:before { content: '\e81f'; } /* 'î Ÿ' */
1220
+ .eg-icon-right-big:before { content: '\e81e'; } /* 'î ž' */
1221
+ .eg-icon-up-hand:before { content: '\e835'; } /* 'î µ' */
1222
+ .eg-icon-ccw-1:before { content: '\e891'; } /* '' */
1223
+ .eg-icon-shuffle-1:before { content: '\e849'; } /* '' */
1224
+ .eg-icon-play:before { content: '\e88c'; } /* '' */
1225
+ .eg-icon-play-circled:before { content: '\e88e'; } /* '' */
1226
+ .eg-icon-stop:before { content: '\e88f'; } /* '�' */
1227
+ .eg-icon-pause:before { content: '\e88d'; } /* '�' */
1228
+ .eg-icon-fast-fw:before { content: '\e890'; } /* '�' */
1229
+ .eg-icon-desktop:before { content: '\e85d'; } /* '�' */
1230
+ .eg-icon-laptop:before { content: '\e85e'; } /* 'î¡ž' */
1231
+ .eg-icon-tablet:before { content: '\e85f'; } /* 'î¡Ÿ' */
1232
+ .eg-icon-mobile:before { content: '\e860'; } /* 'î¡ ' */
1233
+ .eg-icon-flight:before { content: '\e894'; } /* '�' */
1234
+ .eg-icon-font:before { content: '\e851'; } /* 'î¡‘' */
1235
+ .eg-icon-bold:before { content: '\e852'; } /* 'î¡’' */
1236
+ .eg-icon-italic:before { content: '\e855'; } /* 'î¡•' */
1237
+ .eg-icon-text-height:before { content: '\e84f'; } /* '�' */
1238
+ .eg-icon-text-width:before { content: '\e850'; } /* '�' */
1239
+ .eg-icon-align-left:before { content: '\e84c'; } /* '' */
1240
+ .eg-icon-align-center:before { content: '\e84d'; } /* '�' */
1241
+ .eg-icon-align-right:before { content: '\e84e'; } /* 'î¡Ž' */
1242
+ .eg-icon-search:before { content: '\e802'; } /* 'î ‚' */
1243
+ .eg-icon-indent-left:before { content: '\e866'; } /* '' */
1244
+ .eg-icon-indent-right:before { content: '\e867'; } /* '' */
1245
+ .eg-icon-ajust:before { content: '\e84a'; } /* 'î¡Š' */
1246
+ .eg-icon-tint:before { content: '\e84b'; } /* 'î¡‹' */
1247
+ .eg-icon-chart-bar:before { content: '\e853'; } /* 'î¡“' */
1248
+ .eg-icon-magic:before { content: '\e807'; } /* 'î ‡' */
1249
+ .eg-icon-sort:before { content: '\e895'; } /* '' */
1250
+ .eg-icon-sort-alt-up:before { content: '\e863'; } /* 'î¡£' */
1251
+ .eg-icon-sort-alt-down:before { content: '\e864'; } /* '' */
1252
+ .eg-icon-sort-name-up:before { content: '\e854'; } /* '�' */
1253
+ .eg-icon-sort-name-down:before { content: '\e865'; } /* 'î¡¥' */
1254
+ .eg-icon-coffee:before { content: '\e896'; } /* '' */
1255
+ .eg-icon-food:before { content: '\e897'; } /* '�' */
1256
+ .eg-icon-medkit:before { content: '\e898'; } /* '' */
1257
+ .eg-icon-puzzle:before { content: '\e899'; } /* '' */
1258
+ .eg-icon-apple:before { content: '\e89a'; } /* '' */
1259
+ .eg-icon-facebook:before { content: '\e89b'; } /* '' */
1260
+ .eg-icon-gplus:before { content: '\e89c'; } /* '' */
1261
+ .eg-icon-tumblr:before { content: '\e8a0'; } /* '' */
1262
+ .eg-icon-twitter-squared:before { content: '\e8a2'; } /* '' */
1263
+ .eg-icon-twitter:before { content: '\e8a1'; } /* '' */
1264
+ .eg-icon-vimeo-squared:before { content: '\e89d'; } /* '�' */
1265
+ .eg-icon-youtube:before { content: '\e89f'; } /* '' */
1266
+ .eg-icon-youtube-squared:before { content: '\e89e'; } /* '' */
1267
+ .eg-icon-picture:before { content: '\e800'; } /* 'î €' */
1268
+ .eg-icon-check:before { content: '\e810'; } /* 'î �' */
1269
+ .eg-icon-back:before { content: '\e8a5'; } /* '' */
1270
+ .eg-icon-thumbs-up-1:before { content: '\e8a9'; } /* '' */
1271
+ .eg-icon-thumbs-down:before { content: '\e8aa'; } /* '' */
1272
+ .eg-icon-download-1:before { content: '\e8ab'; } /* '' */
1273
+ .eg-icon-upload-1:before { content: '\e8ac'; } /* '' */
1274
+ .eg-icon-reply-1:before { content: '\e8a8'; } /* '' */
1275
+ .eg-icon-forward-1:before { content: '\e8a7'; } /* '' */
1276
+ .eg-icon-export:before { content: '\e80b'; } /* 'î ‹' */
1277
+ .eg-icon-folder:before { content: '\e813'; } /* 'î “' */
1278
+ .eg-icon-rss-1:before { content: '\e8c8'; } /* '' */
1279
+ .eg-icon-cog:before { content: '\e832'; } /* 'î ²' */
1280
+ .eg-icon-tools:before { content: '\e815'; } /* 'î •' */
1281
+ .eg-icon-basket:before { content: '\e812'; } /* 'î ’' */
1282
+ .eg-icon-login:before { content: '\e833'; } /* 'î ³' */
1283
+ .eg-icon-logout:before { content: '\e834'; } /* 'î ´' */
1284
+ .eg-icon-resize-full:before { content: '\e816'; } /* 'î –' */
1285
+ .eg-icon-popup:before { content: '\e828'; } /* 'î ¨' */
1286
+ .eg-icon-arrow-combo:before { content: '\e827'; } /* 'î §' */
1287
+ .eg-icon-left-open-1:before { content: '\e82a'; } /* 'î ª' */
1288
+ .eg-icon-right-open-1:before { content: '\e82b'; } /* 'î «' */
1289
+ .eg-icon-left-open-mini:before { content: '\e822'; } /* 'î ¢' */
1290
+ .eg-icon-right-open-mini:before { content: '\e823'; } /* 'î £' */
1291
+ .eg-icon-left-open-big:before { content: '\e824'; } /* 'î ¤' */
1292
+ .eg-icon-right-open-big:before { content: '\e825'; } /* 'î ¥' */
1293
+ .eg-icon-left:before { content: '\e836'; } /* 'î ¶' */
1294
+ .eg-icon-right:before { content: '\e826'; } /* 'î ¦' */
1295
+ .eg-icon-ccw:before { content: '\e808'; } /* 'î ˆ' */
1296
+ .eg-icon-cw:before { content: '\e8c9'; } /* '' */
1297
+ .eg-icon-arrows-ccw:before { content: '\e806'; } /* 'î †' */
1298
+ .eg-icon-level-down:before { content: '\e8a3'; } /* '' */
1299
+ .eg-icon-level-up:before { content: '\e8a4'; } /* '' */
1300
+ .eg-icon-shuffle:before { content: '\e814'; } /* 'î �' */
1301
+ .eg-icon-palette:before { content: '\e829'; } /* 'î ©' */
1302
+ .eg-icon-list-add:before { content: '\e80c'; } /* '' */
1303
+ .eg-icon-back-in-time:before { content: '\e821'; } /* 'î ¡' */
1304
+ .eg-icon-monitor:before { content: '\e81b'; } /* 'î ›' */
1305
+ .eg-icon-paper-plane:before { content: '\e8ad'; } /* '' */
1306
+ .eg-icon-brush:before { content: '\e8ae'; } /* '' */
1307
+ .eg-icon-droplet:before { content: '\e81c'; } /* '' */
1308
+ .eg-icon-clipboard:before { content: '\e8b0'; } /* '' */
1309
+ .eg-icon-megaphone:before { content: '\e8b1'; } /* '' */
1310
+ .eg-icon-key:before { content: '\e8af'; } /* '' */
1311
+ .eg-icon-github:before { content: '\e8b3'; } /* '' */
1312
+ .eg-icon-github-circled:before { content: '\e8b4'; } /* '' */
1313
+ .eg-icon-flickr:before { content: '\e8b2'; } /* '' */
1314
+ .eg-icon-flickr-circled:before { content: '\e8b5'; } /* '' */
1315
+ .eg-icon-vimeo:before { content: '\e8b6'; } /* '' */
1316
+ .eg-icon-vimeo-circled:before { content: '\e8b7'; } /* '' */
1317
+ .eg-icon-twitter-1:before { content: '\e8b8'; } /* '' */
1318
+ .eg-icon-twitter-circled:before { content: '\e8b9'; } /* '' */
1319
+ .eg-icon-facebook-1:before { content: '\e8ba'; } /* '' */
1320
+ .eg-icon-facebook-circled:before { content: '\e8bb'; } /* '' */
1321
+ .eg-icon-facebook-squared:before { content: '\e8bc'; } /* '' */
1322
+ .eg-icon-gplus-1:before { content: '\e8bd'; } /* '' */
1323
+ .eg-icon-gplus-circled:before { content: '\e8be'; } /* '' */
1324
+ .eg-icon-pinterest:before { content: '\e8bf'; } /* '' */
1325
+ .eg-icon-pinterest-circled:before { content: '\e8c0'; } /* '' */
1326
+ .eg-icon-tumblr-1:before { content: '\e8c1'; } /* '�' */
1327
+ .eg-icon-tumblr-circled:before { content: '\e8c2'; } /* '' */
1328
+ .eg-icon-linkedin:before { content: '\e8c3'; } /* '' */
1329
+ .eg-icon-linkedin-circled:before { content: '\e8c4'; } /* '' */
1330
+ .eg-icon-dribbble:before { content: '\e8c5'; } /* '' */
1331
+ .eg-icon-dribbble-circled:before { content: '\e8c6'; } /* '' */
1332
+ .eg-icon-picasa:before { content: '\e8c7'; } /* '' */
1333
+ .eg-icon-ok-1:before { content: '\e811'; } /* 'î ‘' */
1334
+ .eg-icon-doc:before { content: '\e809'; } /* 'î ‰' */
1335
+ .eg-icon-left-open-outline:before { content: '\e82e'; } /* 'î ®' */
1336
+ .eg-icon-left-open-2:before { content: '\e82c'; } /* 'î ¬' */
1337
+ .eg-icon-right-open-outline:before { content: '\e82f'; } /* 'î ¯' */
1338
+ .eg-icon-right-open-2:before { content: '\e82d'; } /* 'î ­' */
1339
+ .eg-icon-equalizer:before { content: '\e83a'; } /* 'î º' */
1340
+ .eg-icon-layers-alt:before { content: '\e804'; } /* 'î „' */
1341
+ .eg-icon-pencil-1:before { content: '\e831'; } /* 'î ±' */
1342
+ .eg-icon-align-justify:before { content: '\e861'; } /* 'î¡¡' */
1343
+
css/font/egfont.eot ADDED
Binary file
css/font/egfont.svg ADDED
@@ -0,0 +1,213 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" standalone="no"?>
2
+ <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
3
+ <svg xmlns="http://www.w3.org/2000/svg">
4
+ <metadata>Copyright (C) 2014 by original authors @ fontello.com</metadata>
5
+ <defs>
6
+ <font id="egfont" horiz-adv-x="1000" >
7
+ <font-face font-family="egfont" font-weight="400" font-stretch="normal" units-per-em="1000" ascent="850" descent="-150" />
8
+ <missing-glyph horiz-adv-x="1000" />
9
+ <glyph glyph-name="music" unicode="&#xe858;" d="m857 725v-625q0-28-19-50t-48-33t-58-18t-53-6t-54 6t-58 18t-48 33t-19 50t19 50t48 33t58 18t54 6q58 0 107-22v300l-429-132v-396q0-28-19-50t-48-33t-58-18t-53-6t-54 6t-58 18t-48 33t-19 50t19 50t48 34t58 17t54 6q58 0 107-21v539q0 17 10 32t28 19l464 143q7 3 16 3q22 0 38-16t15-38z" horiz-adv-x="857.1" />
10
+ <glyph glyph-name="color-adjust" unicode="&#xe862;" d="m0 350q0 95 37 182t100 149t150 100t182 37t182-37t149-100t100-149t37-182t-37-182t-100-150t-149-100t-182-37t-182 37t-150 100t-100 150t-37 182z m397-226q0-46 32-79t79-32q3 0 11-1q81 12 148 60t105 120t39 158q0 90-44 167t-118 123t-164 51q60-95 60-209q0-81-31-154t-85-127q-32-33-32-77z" horiz-adv-x="937.5" />
11
+ <glyph glyph-name="mail" unicode="&#xe868;" d="m929 11v428q-18-20-39-37q-149-114-238-188q-28-24-46-38t-48-27t-57-13h-2q-26 0-57 13t-48 27t-46 38q-88 74-238 188q-21 17-39 37v-428q0-8 6-13t12-5h822q7 0 12 5t6 13z m0 586v14t-1 7t-1 7t-3 5t-5 4t-8 2h-822q-7 0-12-6t-6-12q0-94 82-159q108-85 224-177q4-2 20-16t25-21t25-18t28-15t24-5h2q11 0 24 5t28 15t25 18t25 21t20 16q116 92 224 177q30 24 56 65t26 73z m71 21v-607q0-37-26-63t-63-27h-822q-36 0-63 27t-26 63v607q0 37 26 63t63 26h822q37 0 63-26t26-63z" horiz-adv-x="1000" />
12
+ <glyph glyph-name="mail-alt" unicode="&#xe869;" d="m1000 454v-443q0-37-26-63t-63-27h-822q-36 0-63 27t-26 63v443q25-28 56-49q202-137 278-192q32-24 51-37t53-27t61-13h2q28 0 61 13t53 27t51 37q95 68 278 192q32 22 56 49z m0 164q0-44-27-84t-68-69q-210-146-262-181q-5-4-23-17t-30-22t-29-18t-33-15t-27-5h-2q-12 0-27 5t-33 15t-29 18t-30 22t-23 17q-51 35-147 101t-114 80q-35 23-65 64t-31 77q0 43 23 72t66 29h822q36 0 62-26t27-63z" horiz-adv-x="1000" />
13
+ <glyph glyph-name="heart" unicode="&#xe86a;" d="m500-79q-14 0-25 10l-348 336q-5 5-15 15t-31 36t-38 55t-30 67t-13 77q0 123 71 192t196 70q34 0 70-12t67-33t54-38t42-38q20 20 42 38t54 38t67 33t70 12q125 0 196-70t71-192q0-123-128-251l-347-335q-10-10-25-10z" horiz-adv-x="1000" />
14
+ <glyph glyph-name="heart-empty" unicode="&#xe86b;" d="m929 517q0 46-12 80t-31 55t-46 33t-52 18t-55 4t-62-14t-62-36t-48-40t-34-34q-10-13-27-13t-27 13q-14 15-34 34t-48 40t-62 36t-62 14t-55-4t-52-18t-46-33t-31-55t-12-80q0-93 105-198l324-312l324 312q105 105 105 198z m71 0q0-123-128-251l-347-335q-10-10-25-10t-25 10l-348 336q-5 5-15 15t-31 36t-38 55t-30 67t-13 77q0 123 71 192t196 70q34 0 70-12t67-33t54-38t42-38q20 20 42 38t54 38t67 33t70 12q125 0 196-70t71-192z" horiz-adv-x="1000" />
15
+ <glyph glyph-name="star" unicode="&#xe86c;" d="m929 489q0-12-15-27l-203-197l48-279q1-4 1-12q0-11-6-19t-17-9q-10 0-22 7l-251 132l-250-132q-13-7-23-7q-11 0-17 9t-6 19q0 4 1 12l48 279l-203 197q-14 15-14 27q0 21 31 26l280 40l126 254q11 23 27 23t28-23l125-254l280-40q32-5 32-26z" horiz-adv-x="928.6" />
16
+ <glyph glyph-name="star-empty" unicode="&#xe86d;" d="m634 290l171 165l-235 35l-106 213l-105-213l-236-35l171-165l-41-235l211 111l211-111z m295 199q0-12-15-27l-203-197l48-279q1-4 1-12q0-28-23-28q-10 0-22 7l-251 132l-250-132q-13-7-23-7q-11 0-17 9t-6 19q0 4 1 12l48 279l-203 197q-14 15-14 27q0 21 31 26l280 40l126 254q11 23 27 23t28-23l125-254l280-40q32-5 32-26z" horiz-adv-x="928.6" />
17
+ <glyph glyph-name="user" unicode="&#xe879;" d="m786 66q0-67-41-106t-108-39h-488q-67 0-108 39t-41 106q0 30 2 58t8 61t15 60t24 55t34 45t48 30t62 11q5 0 24-12t41-27t60-27t75-12t74 12t61 27t41 27t24 12q34 0 62-11t48-30t34-45t24-55t15-60t8-61t2-58z m-179 498q0-88-63-151t-151-63t-152 63t-62 151t62 152t152 63t151-63t63-152z" horiz-adv-x="785.7" />
18
+ <glyph glyph-name="male" unicode="&#xe87a;" d="m571 457v-232q0-22-15-38t-38-16t-38 16t-16 38v196h-35v-509q0-25-19-44t-44-18t-44 18t-18 44v259h-36v-259q0-25-19-44t-44-18t-44 18t-18 44v509h-36v-196q0-22-15-38t-38-16t-38 16t-16 38v232q0 45 31 76t76 31h357q45 0 76-31t31-76z m-160 250q0-52-37-88t-88-37t-89 37t-36 88t36 89t89 36t88-36t37-89z" horiz-adv-x="571.4" />
19
+ <glyph glyph-name="female" unicode="&#xe87b;" d="m714 261q0-23-15-38t-38-16q-29 0-45 24l-127 190h-25v-73l138-230q5-8 5-18q0-14-10-25t-26-11h-107v-152q0-25-18-44t-44-18h-89q-26 0-45 18t-18 44v152h-107q-15 0-25 11t-11 25q0 10 5 18l138 230v73h-25l-127-190q-16-24-44-24q-23 0-38 16t-16 38q0 16 9 29l143 215q41 59 98 59h214q58 0 99-59l142-215q9-13 9-29z m-232 446q0-52-36-88t-89-37t-88 37t-37 88t37 89t88 36t89-36t36-89z" horiz-adv-x="714.3" />
20
+ <glyph glyph-name="video" unicode="&#xe805;" d="m214-43v72q0 14-10 25t-25 10h-72q-14 0-25-10t-11-25v-72q0-14 11-25t25-11h72q14 0 25 11t10 25z m0 214v72q0 14-10 25t-25 11h-72q-14 0-25-11t-11-25v-72q0-14 11-25t25-10h72q14 0 25 10t10 25z m0 215v71q0 15-10 25t-25 11h-72q-14 0-25-11t-11-25v-71q0-15 11-25t25-11h72q14 0 25 11t10 25z m572-429v286q0 14-11 25t-25 11h-429q-14 0-25-11t-10-25v-286q0-14 10-25t25-11h429q15 0 25 11t11 25z m-572 643v71q0 15-10 26t-25 10h-72q-14 0-25-10t-11-26v-71q0-15 11-25t25-11h72q14 0 25 11t10 25z m786-643v72q0 14-11 25t-25 10h-71q-15 0-25-10t-11-25v-72q0-14 11-25t25-11h71q15 0 25 11t11 25z m-214 429v285q0 15-11 26t-25 10h-429q-14 0-25-10t-10-26v-285q0-15 10-25t25-11h429q15 0 25 11t11 25z m214-215v72q0 14-11 25t-25 11h-71q-15 0-25-11t-11-25v-72q0-14 11-25t25-10h71q15 0 25 10t11 25z m0 215v71q0 15-11 25t-25 11h-71q-15 0-25-11t-11-25v-71q0-15 11-25t25-11h71q15 0 25 11t11 25z m0 214v71q0 15-11 26t-25 10h-71q-15 0-25-10t-11-26v-71q0-15 11-25t25-11h71q15 0 25 11t11 25z m71 89v-750q0-37-26-63t-63-26h-893q-36 0-63 26t-26 63v750q0 37 26 63t63 27h893q37 0 63-27t26-63z" horiz-adv-x="1071.4" />
21
+ <glyph glyph-name="videocam" unicode="&#xe859;" d="m1000 654v-608q0-23-22-32q-7-3-14-3q-15 0-25 10l-225 225v-92q0-67-47-114t-113-47h-393q-67 0-114 47t-47 114v392q0 67 47 114t114 47h393q66 0 113-47t47-114v-92l225 225q10 10 25 10q7 0 14-3q22-9 22-32z" horiz-adv-x="1000" />
22
+ <glyph glyph-name="picture-1" unicode="&#xe803;" d="m357 529q0-45-31-76t-76-32t-76 32t-31 76t31 75t76 32t76-32t31-75z m572-215v-250h-786v107l178 179l90-89l285 285z m53 393h-893q-7 0-12-5t-6-13v-678q0-8 6-13t12-5h893q7 0 13 5t5 13v678q0 7-5 13t-13 5z m89-18v-678q0-37-26-63t-63-27h-893q-36 0-63 27t-26 63v678q0 37 26 63t63 27h893q37 0 63-27t26-63z" horiz-adv-x="1071.4" />
23
+ <glyph glyph-name="camera" unicode="&#xe85a;" d="m536 475q66 0 113-47t47-114t-47-113t-113-47t-114 47t-47 113t47 114t114 47z m393 232q59 0 101-42t41-101v-500q0-59-41-101t-101-42h-786q-59 0-101 42t-42 101v500q0 59 42 101t101 42h125l28 76q11 27 39 47t58 20h286q29 0 57-20t39-47l29-76h125z m-393-643q103 0 176 74t74 176t-74 177t-176 73t-177-73t-73-177t73-176t177-74z" horiz-adv-x="1071.4" />
24
+ <glyph glyph-name="camera-alt" unicode="&#xe85b;" d="m518 386q0 8-5 13t-13 5q-37 0-63-27t-26-63q0-8 5-13t13-5t12 5t5 13q0 23 16 38t38 16q8 0 13 5t5 13z m125-73q0-59-42-101t-101-42t-101 42t-42 101t42 101t101 42t101-42t42-101z m-572-320h858v71h-858v-71z m643 320q0 89-62 152t-152 62t-151-62t-63-152t63-151t151-63t152 63t62 151z m-571 358h214v72h-214v-72z m-72-107h858v143h-462l-36-71h-360v-72z m929 143v-714q0-30-21-51t-50-21h-858q-29 0-50 21t-21 51v714q0 30 21 51t50 21h858q29 0 50-21t21-51z" horiz-adv-x="1000" />
25
+ <glyph glyph-name="th-large" unicode="&#xe83c;" d="m429 279v-215q0-29-22-50t-50-21h-286q-29 0-50 21t-21 50v215q0 29 21 50t50 21h286q29 0 50-21t22-50z m0 428v-214q0-29-22-50t-50-22h-286q-29 0-50 22t-21 50v214q0 29 21 50t50 22h286q29 0 50-22t22-50z m500-428v-215q0-29-22-50t-50-21h-286q-29 0-50 21t-21 50v215q0 29 21 50t50 21h286q29 0 50-21t22-50z m0 428v-214q0-29-22-50t-50-22h-286q-29 0-50 22t-21 50v214q0 29 21 50t50 22h286q29 0 50-22t22-50z" horiz-adv-x="928.6" />
26
+ <glyph glyph-name="th" unicode="&#xe83d;" d="m286 154v-108q0-22-16-37t-38-16h-178q-23 0-38 16t-16 37v108q0 22 16 38t38 15h178q22 0 38-15t16-38z m0 285v-107q0-22-16-38t-38-15h-178q-23 0-38 15t-16 38v107q0 23 16 38t38 16h178q22 0 38-16t16-38z m357-285v-108q0-22-16-37t-38-16h-178q-23 0-38 16t-16 37v108q0 22 16 38t38 15h178q23 0 38-15t16-38z m-357 571v-107q0-22-16-38t-38-16h-178q-23 0-38 16t-16 38v107q0 22 16 38t38 16h178q22 0 38-16t16-38z m357-286v-107q0-22-16-38t-38-15h-178q-23 0-38 15t-16 38v107q0 23 16 38t38 16h178q23 0 38-16t16-38z m357-285v-108q0-22-16-37t-38-16h-178q-22 0-38 16t-16 37v108q0 22 16 38t38 15h178q23 0 38-15t16-38z m-357 571v-107q0-22-16-38t-38-16h-178q-23 0-38 16t-16 38v107q0 22 16 38t38 16h178q23 0 38-16t16-38z m357-286v-107q0-22-16-38t-38-15h-178q-22 0-38 15t-16 38v107q0 23 16 38t38 16h178q23 0 38-16t16-38z m0 286v-107q0-22-16-38t-38-16h-178q-22 0-38 16t-16 38v107q0 22 16 38t38 16h178q23 0 38-16t16-38z" horiz-adv-x="1000" />
27
+ <glyph glyph-name="ok" unicode="&#xe80d;" d="m932 534q0-22-15-38l-404-404l-76-76q-16-15-38-15t-38 15l-76 76l-202 202q-15 16-15 38t15 38l76 76q16 16 38 16t38-16l164-165l366 367q16 16 38 16t38-16l76-76q15-16 15-38z" horiz-adv-x="1000" />
28
+ <glyph glyph-name="ok-circled2" unicode="&#xe877;" d="m653 396l-235-235q-11-11-25-11t-25 11l-164 164q-11 11-11 25t11 25l57 57q10 11 25 11t25-11l82-82l153 153q11 11 25 11t26-11l56-56q11-11 11-26t-11-25z m79-46q0 83-41 152t-110 111t-152 41t-153-41t-110-111t-41-152t41-152t110-111t153-41t152 41t110 111t41 152z m125 0q0-117-57-215t-156-156t-215-58t-216 58t-155 156t-58 215t58 215t155 156t216 58t215-58t156-156t57-215z" horiz-adv-x="857.1" />
29
+ <glyph glyph-name="ok-squared" unicode="&#xe878;" d="m382 125l343 343q10 10 10 25t-10 25l-57 57q-11 10-25 10t-25-10l-261-261l-118 118q-10 11-25 11t-25-11l-57-57q-10-11-10-25t10-25l200-200q11-11 25-11t25 11z m475 493v-536q0-66-47-113t-114-48h-535q-67 0-114 48t-47 113v536q0 66 47 113t114 48h535q67 0 114-48t47-113z" horiz-adv-x="857.1" />
30
+ <glyph glyph-name="cancel" unicode="&#xe80a;" d="m724 112q0-22-15-38l-76-76q-16-15-38-15t-38 15l-164 165l-164-165q-16-15-38-15t-38 15l-76 76q-16 16-16 38t16 38l164 164l-164 164q-16 16-16 38t16 38l76 76q16 16 38 16t38-16l164-164l164 164q16 16 38 16t38-16l76-76q15-15 15-38t-15-38l-164-164l164-164q15-15 15-38z" horiz-adv-x="785.7" />
31
+ <glyph glyph-name="plus" unicode="&#xe86e;" d="m786 439v-107q0-22-16-38t-38-15h-232v-233q0-22-16-37t-38-16h-107q-22 0-38 16t-15 37v233h-232q-23 0-38 15t-16 38v107q0 23 16 38t38 16h232v232q0 22 15 38t38 16h107q23 0 38-16t16-38v-232h232q22 0 38-16t16-38z" horiz-adv-x="785.7" />
32
+ <glyph glyph-name="plus-circled" unicode="&#xe876;" d="m679 314v72q0 14-11 25t-25 10h-143v143q0 15-11 25t-25 11h-71q-15 0-25-11t-11-25v-143h-143q-14 0-25-10t-10-25v-72q0-14 10-25t25-11h143v-142q0-15 11-25t25-11h71q15 0 25 11t11 25v142h143q14 0 25 11t11 25z m178 36q0-117-57-215t-156-156t-215-58t-216 58t-155 156t-58 215t58 215t155 156t216 58t215-58t156-156t57-215z" horiz-adv-x="857.1" />
33
+ <glyph glyph-name="plus-squared" unicode="&#xe875;" d="m714 314v72q0 14-10 25t-25 10h-179v179q0 15-11 25t-25 11h-71q-15 0-25-11t-11-25v-179h-178q-15 0-26-10t-10-25v-72q0-14 10-25t26-10h178v-179q0-14 11-25t25-11h71q15 0 25 11t11 25v179h179q14 0 25 10t10 25z m143 304v-536q0-66-47-113t-114-48h-535q-67 0-114 48t-47 113v536q0 66 47 113t114 48h535q67 0 114-48t47-113z" horiz-adv-x="857.1" />
34
+ <glyph glyph-name="minus" unicode="&#xe86f;" d="m786 439v-107q0-22-16-38t-38-15h-678q-23 0-38 15t-16 38v107q0 23 16 38t38 16h678q22 0 38-16t16-38z" horiz-adv-x="785.7" />
35
+ <glyph glyph-name="minus-circled" unicode="&#xe870;" d="m679 314v72q0 14-11 25t-25 10h-429q-14 0-25-10t-10-25v-72q0-14 10-25t25-10h429q14 0 25 10t11 25z m178 36q0-117-57-215t-156-156t-215-58t-216 58t-155 156t-58 215t58 215t155 156t216 58t215-58t156-156t57-215z" horiz-adv-x="857.1" />
36
+ <glyph glyph-name="minus-squared" unicode="&#xe871;" d="m714 314v72q0 14-10 25t-25 10h-500q-15 0-26-10t-10-25v-72q0-14 10-25t26-10h500q14 0 25 10t10 25z m143 304v-536q0-66-47-113t-114-48h-535q-67 0-114 48t-47 113v536q0 66 47 113t114 48h535q67 0 114-48t47-113z" horiz-adv-x="857.1" />
37
+ <glyph glyph-name="minus-squared-alt" unicode="&#xe872;" d="m643 404v-36q0-8-5-13t-13-5h-464q-8 0-13 5t-5 13v36q0 7 5 12t13 5h464q8 0 13-5t5-12z m71-250v464q0 37-26 63t-63 26h-464q-37 0-63-26t-27-63v-464q0-37 27-64t63-26h464q37 0 63 26t26 64z m72 464v-464q0-67-47-114t-114-47h-464q-67 0-114 47t-47 114v464q0 66 47 113t114 48h464q66 0 114-48t47-113z" horiz-adv-x="785.7" />
38
+ <glyph glyph-name="info-circled" unicode="&#xe80f;" d="m571 82v89q0 8-5 13t-12 5h-54v286q0 8-5 13t-13 5h-178q-8 0-13-5t-5-13v-89q0-8 5-13t13-5h53v-179h-53q-8 0-13-5t-5-13v-89q0-8 5-13t13-5h250q7 0 12 5t5 13z m-71 500v89q0 8-5 13t-13 5h-107q-8 0-13-5t-5-13v-89q0-8 5-13t13-5h107q8 0 13 5t5 13z m357-232q0-117-57-215t-156-156t-215-58t-216 58t-155 156t-58 215t58 215t155 156t216 58t215-58t156-156t57-215z" horiz-adv-x="857.1" />
39
+ <glyph glyph-name="info" unicode="&#xe844;" d="m357 100v-71q0-15-10-25t-26-11h-285q-15 0-25 11t-11 25v71q0 15 11 25t25 11h35v214h-35q-15 0-25 11t-11 25v71q0 15 11 25t25 11h214q15 0 25-11t11-25v-321h35q15 0 26-11t10-25z m-71 643v-107q0-15-11-25t-25-11h-143q-14 0-25 11t-11 25v107q0 14 11 25t25 11h143q15 0 25-11t11-25z" horiz-adv-x="357.1" />
40
+ <glyph glyph-name="home" unicode="&#xe843;" d="m786 296v-267q0-15-11-26t-25-10h-214v214h-143v-214h-214q-15 0-25 10t-11 26v267q0 1 0 2t0 2l321 264l321-264q1-1 1-4z m124 39l-34-41q-5-5-12-6h-2q-7 0-12 3l-386 322l-386-322q-7-4-13-4q-7 2-12 7l-35 41q-4 5-3 13t6 12l401 334q18 15 42 15t43-15l136-114v109q0 8 5 13t13 5h107q8 0 13-5t5-13v-227l122-102q5-5 6-12t-4-13z" horiz-adv-x="928.6" />
41
+ <glyph glyph-name="link" unicode="&#xe80e;" d="m812 171q0 23-15 38l-116 116q-16 16-38 16q-24 0-40-18q1-1 10-10t12-12t9-11t7-14t2-15q0-23-16-38t-38-16q-8 0-15 2t-14 7t-11 9t-12 12t-10 10q-19-17-19-40q0-23 16-38l115-116q15-15 38-15q22 0 38 15l82 81q15 16 15 37z m-392 394q0 22-15 38l-115 115q-16 16-38 16q-22 0-38-15l-82-82q-16-15-16-37q0-22 16-38l116-116q15-15 38-15q23 0 40 17q-2 2-11 11t-12 12t-8 10t-7 14t-2 16q0 22 15 38t38 15q9 0 16-2t14-7t10-8t12-12t11-11q18 17 18 41z m500-394q0-67-48-113l-82-81q-46-47-113-47q-68 0-114 48l-115 115q-46 47-46 114q0 68 49 116l-49 49q-48-49-116-49q-67 0-114 47l-116 116q-47 47-47 114t47 113l82 82q47 46 114 46q67 0 114-47l114-116q47-46 47-113q0-69-49-117l49-49q48 49 116 49q67 0 114-47l116-116q47-47 47-114z" horiz-adv-x="928.6" />
42
+ <glyph glyph-name="unlink" unicode="&#xe83f;" d="m245 141l-143-143q-5-5-13-5q-6 0-13 5q-5 5-5 13t5 13l143 142q6 5 13 5t13-5q5-5 5-12t-5-13z m94-23v-179q0-8-5-13t-13-5t-12 5t-5 13v179q0 8 5 13t12 5t13-5t5-13z m-125 125q0-8-5-13t-13-5h-178q-8 0-13 5t-5 13t5 13t13 5h178q8 0 13-5t5-13z m706-72q0-67-48-113l-82-81q-46-47-113-47q-68 0-114 48l-186 187q-12 11-24 31l134 10l152-153q15-15 38-15t38 15l82 81q15 16 15 37q0 23-15 38l-153 154l10 133q20-12 31-23l188-188q47-48 47-114z m-345 404l-133-10l-152 153q-16 16-38 16q-22 0-38-15l-82-82q-16-15-16-37q0-22 16-38l153-153l-10-134q-20 12-32 24l-187 187q-47 48-47 114q0 67 47 113l82 82q47 46 114 46q67 0 114-47l186-187q12-12 23-32z m354-46q0-8-5-13t-13-5h-179q-8 0-13 5t-5 13t5 12t13 5h179q8 0 13-5t5-12z m-304 303v-178q0-8-5-13t-13-5t-13 5t-5 13v178q0 8 5 13t13 5t13-5t5-13z m227-84l-143-143q-6-5-13-5t-12 5q-5 6-5 13t5 13l142 142q6 5 13 5t13-5q5-5 5-12t-5-13z" horiz-adv-x="928.6" />
43
+ <glyph glyph-name="link-ext" unicode="&#xe840;" d="m786 332v-178q0-67-47-114t-114-47h-464q-67 0-114 47t-47 114v464q0 66 47 113t114 48h393q7 0 12-5t5-13v-36q0-8-5-13t-12-5h-393q-37 0-63-26t-27-63v-464q0-37 27-63t63-27h464q37 0 63 27t26 63v178q0 8 5 13t13 5h36q8 0 13-5t5-13z m214 482v-285q0-15-11-26t-25-10t-25 10l-98 99l-364-364q-5-6-13-6t-13 6l-63 63q-6 6-6 13t6 13l364 364l-99 98q-10 11-10 25t10 25t26 11h285q15 0 25-11t11-25z" horiz-adv-x="1000" />
44
+ <glyph glyph-name="lock" unicode="&#xe856;" d="m179 421h285v108q0 59-42 101t-101 41t-101-41t-41-101v-108z m464-53v-322q0-22-16-37t-38-16h-535q-23 0-38 16t-16 37v322q0 22 16 38t38 15h17v108q0 102 74 176t176 74t177-74t73-176v-108h18q23 0 38-15t16-38z" horiz-adv-x="642.9" />
45
+ <glyph glyph-name="lock-open" unicode="&#xe857;" d="m929 529v-143q0-15-11-25t-25-11h-36q-14 0-25 11t-11 25v143q0 59-41 101t-101 41t-101-41t-42-101v-108h53q23 0 38-15t16-38v-322q0-22-16-37t-38-16h-535q-23 0-38 16t-16 37v322q0 22 16 38t38 15h375v108q0 103 73 176t177 74t176-74t74-176z" horiz-adv-x="928.6" />
46
+ <glyph glyph-name="eye" unicode="&#xe841;" d="m929 314q-85 132-213 197q34-58 34-125q0-104-73-177t-177-73t-177 73t-73 177q0 67 34 125q-128-65-213-197q75-114 187-182t242-68t242 68t187 182z m-402 215q0 11-8 19t-19 7q-70 0-120-50t-50-119q0-12 8-19t19-8t19 8t8 19q0 48 34 82t82 34q11 0 19 8t8 19z m473-215q0-19-11-38q-78-129-210-206t-279-77t-279 77t-210 206q-11 19-11 38t11 39q78 128 210 205t279 78t279-78t210-205q11-20 11-39z" horiz-adv-x="1000" />
47
+ <glyph glyph-name="eye-off" unicode="&#xe842;" d="m310 105l43 79q-48 35-76 88t-27 114q0 67 34 125q-128-65-213-197q94-144 239-209z m217 424q0 11-8 19t-19 7q-70 0-120-50t-50-119q0-12 8-19t19-8t19 8t8 19q0 48 34 82t82 34q11 0 19 8t8 19z m202 106q0-4 0-5q-59-105-176-316t-176-316l-28-50q-5-9-15-9q-7 0-75 39q-9 6-9 16q0 7 25 49q-80 36-147 96t-117 137q-11 17-11 38t11 39q86 131 212 207t277 76q50 0 100-10l31 54q5 9 15 9q3 0 10-3t18-9t18-10t18-10t10-7q9-5 9-15z m21-249q0-78-44-142t-117-92l157 281q4-26 4-47z m250-72q0-19-11-38q-22-36-61-81q-84-96-194-149t-234-53l41 74q119 10 219 76t169 171q-65 100-158 164l35 63q53-36 102-86t81-102q11-19 11-39z" horiz-adv-x="1000" />
48
+ <glyph glyph-name="tag" unicode="&#xe85c;" d="m250 600q0 30-21 51t-50 20t-51-20t-21-51t21-50t51-21t50 21t21 50z m595-321q0-30-20-51l-274-274q-22-21-51-21q-30 0-50 21l-399 399q-21 21-36 57t-15 65v232q0 29 21 50t50 22h233q29 0 65-15t57-36l399-399q20-21 20-50z" horiz-adv-x="857.1" />
49
+ <glyph glyph-name="thumbs-up" unicode="&#xe887;" d="m143 100q0 15-11 25t-25 11t-25-11t-11-25t11-25t25-11t25 11t11 25z m643 321q0 29-22 50t-50 22h-196q0 32 27 89t26 89q0 55-17 81t-72 27q-14-15-21-48t-17-70t-33-61q-13-13-43-51q-2-3-13-17t-18-22t-19-24t-22-25t-22-19t-22-16t-20-5h-18v-357h18q7 0 18-1t18-4t21-6t20-7t20-7t16-5q118-41 191-41h67q107 0 107 93q0 15-2 31q16 9 26 30t10 41t-10 38q29 28 29 67q0 13-5 31t-14 26q18 1 30 26t12 45z m71 1q0-50-27-91q5-18 5-38q0-43-21-81q1-12 1-24q0-56-33-99q0-78-48-123t-126-45h-72q-54 0-106 13t-121 36q-65 23-77 23h-161q-29 0-50 21t-21 50v357q0 30 21 51t50 21h153q20 13 77 86q32 42 60 72q13 14 19 47t17 71t35 60q22 21 50 21q47 0 84-18t57-57t20-104q0-51-27-107h98q58 0 101-42t42-100z" horiz-adv-x="857.1" />
50
+ <glyph glyph-name="thumbs-up-alt" unicode="&#xe888;" d="m143 100q0 15-11 25t-25 11q-15 0-25-11t-11-25q0-15 11-25t25-11q15 0 25 11t11 25z m89 286v-357q0-15-10-25t-26-11h-160q-15 0-25 11t-11 25v357q0 14 11 25t25 10h160q15 0 26-10t10-25z m661 0q0-48-31-83q9-25 9-43q1-42-24-76q9-32 0-66q-9-31-31-52q5-63-27-101q-36-43-110-44h-72q-37 0-80 9t-68 16t-67 22q-69 24-88 25q-15 0-26 11t-10 25v357q0 14 10 25t24 11q13 1 42 33t57 67q38 49 56 67q10 10 17 27t10 27t8 34q4 22 7 34t11 29t18 28q11 11 26 11q25 0 46-6t33-15t22-22t14-26t7-27t2-26t1-21q0-21-6-43t-10-33t-16-31q-1-4-5-10t-6-13t-5-13h155q43 0 75-32t32-75z" horiz-adv-x="928.6" />
51
+ <glyph glyph-name="download" unicode="&#xe88a;" d="m714 100q0 15-10 25t-25 11t-26-11t-10-25t10-25t26-11t25 11t10 25z m143 0q0 15-10 25t-26 11t-25-11t-10-25t10-25t25-11t26 11t10 25z m72 125v-179q0-22-16-37t-38-16h-821q-23 0-38 16t-16 37v179q0 22 16 38t38 16h259l75-76q33-32 76-32t76 32l76 76h259q22 0 38-16t16-38z m-182 318q10-23-8-40l-250-250q-10-10-25-10t-25 10l-250 250q-17 17-8 40q10 21 33 21h143v250q0 15 11 25t25 11h143q14 0 25-11t10-25v-250h143q24 0 33-21z" horiz-adv-x="928.6" />
52
+ <glyph glyph-name="upload" unicode="&#xe889;" d="m714 29q0 14-10 25t-25 10t-26-10t-10-25t10-26t26-10t25 10t10 26z m143 0q0 14-10 25t-26 10t-25-10t-10-25t10-26t25-10t26 10t10 26z m72 125v-179q0-22-16-38t-38-16h-821q-23 0-38 16t-16 38v179q0 22 16 38t38 15h238q12-31 39-51t62-20h143q34 0 61 20t40 51h238q22 0 38-15t16-38z m-182 361q-9-22-33-22h-143v-250q0-15-10-25t-25-11h-143q-15 0-25 11t-11 25v250h-143q-23 0-33 22q-9 22 8 39l250 250q10 10 25 10t25-10l250-250q18-17 8-39z" horiz-adv-x="928.6" />
53
+ <glyph glyph-name="reply" unicode="&#xe8a6;" d="m1000 225q0-93-71-252q-2-4-6-13t-7-17t-8-12q-6-10-15-10q-9 0-13 6t-5 14q0 5 1 15t2 13q3 38 3 69q0 56-10 101t-27 77t-45 56t-59 39t-74 24t-86 12t-98 3h-125v-143q0-14-10-25t-26-11t-25 11l-285 286q-11 10-11 25t11 25l285 286q11 10 25 10t26-10t10-25v-143h125q398 0 488-225q30-75 30-186z" horiz-adv-x="1000" />
54
+ <glyph glyph-name="forward" unicode="&#xe874;" d="m1000 493q0-15-11-25l-285-286q-11-11-25-11t-26 11t-10 25v143h-125q-55 0-98-3t-86-12t-74-24t-59-39t-45-56t-27-77t-10-101q0-31 3-69q0-4 2-13t1-15q0-8-5-14t-13-6q-9 0-15 10q-4 5-8 12t-7 17t-6 13q-71 159-71 252q0 111 30 186q90 225 488 225h125v143q0 14 10 25t26 10t25-10l285-286q11-11 11-25z" horiz-adv-x="1000" />
55
+ <glyph glyph-name="export-1" unicode="&#xe873;" d="m786 298v-144q0-67-47-114t-114-47h-464q-67 0-114 47t-47 114v464q0 66 47 113t114 48h142q7 0 13-6t5-12q0-15-15-18q-43-15-74-34q-5-2-9-2h-62q-37 0-63-26t-27-63v-464q0-37 27-63t63-27h464q37 0 63 27t26 63v119q0 11 10 16q16 7 30 21q9 9 20 4q12-5 12-16z m132 277l-214-214q-10-11-25-11q-7 0-14 3q-22 9-22 33v107h-89q-181 0-245-73q-66-77-41-264q2-13-11-19q-5-1-7-1q-9 0-14 7q-6 8-12 17t-22 38t-28 56t-21 64t-10 68q0 27 2 50t8 51t15 49t27 45t38 42t52 34t70 27t89 17t110 6h89v107q0 24 22 33q7 3 14 3q14 0 25-11l214-214q11-11 11-25t-11-25z" horiz-adv-x="928.6" />
56
+ <glyph glyph-name="print" unicode="&#xe886;" d="m214-7h500v143h-500v-143z m0 357h500v214h-89q-22 0-38 16t-16 38v89h-357v-357z m643-36q0 15-10 25t-26 11t-25-11t-10-25t10-25t25-10t26 10t10 25z m72 0v-232q0-7-6-12t-12-6h-125v-89q0-22-16-38t-38-16h-536q-22 0-37 16t-16 38v89h-125q-7 0-13 6t-5 12v232q0 44 32 76t75 31h36v304q0 22 16 38t37 16h375q23 0 50-12t42-26l85-85q15-16 27-43t11-49v-143h35q45 0 76-31t32-76z" horiz-adv-x="928.6" />
57
+ <glyph glyph-name="gamepad" unicode="&#xe837;" d="m464 243v71q0 8-5 13t-13 5h-107v107q0 8-5 13t-13 5h-71q-8 0-13-5t-5-13v-107h-107q-8 0-13-5t-5-13v-71q0-8 5-13t13-5h107v-107q0-8 5-13t13-5h71q8 0 13 5t5 13v107h107q8 0 13 5t5 13z m322-36q0 30-21 51t-51 21t-50-21t-21-51t21-50t50-21t51 21t21 50z m143 143q0 30-21 51t-51 20t-50-20t-21-51t21-50t50-21t51 21t21 50z m142-71q0-119-83-202t-202-84q-107 0-189 71h-123q-81-71-188-71q-119 0-202 84t-84 202t84 202t202 83h500q118 0 202-83t83-202z" horiz-adv-x="1071.4" />
58
+ <glyph glyph-name="trash" unicode="&#xe801;" d="m286 439v-321q0-8-5-13t-13-5h-36q-8 0-13 5t-5 13v321q0 8 5 13t13 5h36q8 0 13-5t5-13z m143 0v-321q0-8-5-13t-13-5h-36q-8 0-13 5t-5 13v321q0 8 5 13t13 5h36q8 0 13-5t5-13z m142 0v-321q0-8-5-13t-12-5h-36q-8 0-13 5t-5 13v321q0 8 5 13t13 5h36q7 0 12-5t5-13z m72-404v529h-500v-529q0-12 4-22t8-15t6-5h464q2 0 6 5t8 15t4 22z m-375 601h250l-27 65q-4 5-9 6h-177q-6-1-10-6z m518-18v-36q0-8-5-13t-13-5h-54v-529q0-46-26-80t-63-34h-464q-37 0-63 33t-27 79v531h-53q-8 0-13 5t-5 13v36q0 8 5 13t13 5h172l39 93q9 21 31 35t44 15h178q22 0 44-15t30-35l39-93h173q8 0 13-5t5-13z" horiz-adv-x="785.7" />
59
+ <glyph glyph-name="doc-text" unicode="&#xe885;" d="m571 189v-35q0-8-5-13t-12-5h-393q-8 0-13 5t-5 13v35q0 8 5 13t13 5h393q7 0 12-5t5-13z m0 143v-36q0-7-5-12t-12-5h-393q-8 0-13 5t-5 12v36q0 8 5 13t13 5h393q7 0 12-5t5-13z m-500-339h572v428h-232q-23 0-38 16t-16 38v232h-286v-714z m358 500h209q-5 16-12 23l-175 174q-6 7-22 13v-210z m285-18v-500q0-22-15-38t-38-16h-607q-23 0-38 16t-16 38v750q0 22 16 38t38 16h357q22 0 49-12t42-26l174-175q16-15 27-42t11-49z" horiz-adv-x="714.3" />
60
+ <glyph glyph-name="doc-inv" unicode="&#xe884;" d="m714 421v-446q0-22-15-38t-38-16h-607q-23 0-38 16t-16 38v750q0 22 16 38t38 16h303v-304q0-22 16-38t38-16h303z m-1 72h-284v284q45-8 73-36l174-175q28-27 37-73z" horiz-adv-x="714.3" />
61
+ <glyph glyph-name="folder-1" unicode="&#xe83e;" d="m929 511v-393q0-51-37-88t-88-37h-679q-51 0-88 37t-37 88v536q0 51 37 88t88 37h179q51 0 88-37t37-88v-18h375q51 0 88-37t37-88z" horiz-adv-x="928.6" />
62
+ <glyph glyph-name="folder-open" unicode="&#xe883;" d="m1049 319q0-18-18-37l-187-221q-24-28-67-48t-81-20h-607q-19 0-33 7t-15 24q0 17 17 37l188 221q24 28 67 48t80 20h607q19 0 34-7t15-24z m-192 192v-90h-464q-53 0-110-26t-92-67l-188-221l-2-3q0 2-1 7t0 7v536q0 51 37 88t88 37h179q51 0 88-37t37-88v-18h303q51 0 88-37t37-88z" horiz-adv-x="1071.4" />
63
+ <glyph glyph-name="folder-open-empty" unicode="&#xe882;" d="m994 330q0 20-30 20h-607q-22 0-48-12t-39-29l-164-203q-11-13-11-22q0-20 30-20h607q22 0 48 13t40 29l164 203q10 12 10 21z m-637 91h429v90q0 22-16 38t-38 15h-321q-23 0-38 16t-16 38v36q0 22-15 38t-38 15h-179q-22 0-38-15t-16-38v-476l143 175q25 30 65 49t78 19z m708-91q0-34-25-66l-165-203q-24-30-65-49t-78-19h-607q-51 0-88 37t-37 88v536q0 51 37 88t88 37h179q51 0 88-37t37-88v-18h303q51 0 88-37t37-88v-90h107q30 0 56-13t37-40q8-17 8-38z" horiz-adv-x="1071.4" />
64
+ <glyph glyph-name="rss" unicode="&#xe880;" d="m214 100q0-45-31-76t-76-31t-76 31t-31 76t31 76t76 31t76-31t31-76z m286-69q1-15-9-26q-11-12-27-12h-75q-14 0-24 9t-11 23q-12 128-103 219t-219 103q-14 1-23 11t-9 24v75q0 16 12 26q9 10 24 10h3q89-7 170-45t145-101q63-63 101-145t45-171z m286-1q1-15-10-26q-10-11-26-11h-80q-14 0-25 10t-11 23q-6 120-56 228t-129 188t-188 129t-227 57q-14 0-24 11t-10 24v80q0 15 11 26q10 10 25 10h1q147-8 280-67t238-164q104-104 164-238t67-280z" horiz-adv-x="785.7" />
65
+ <glyph glyph-name="rss-squared" unicode="&#xe881;" d="m286 136q0 29-21 50t-51 21t-50-21t-21-50t21-51t50-21t51 21t21 51z m196-53q-8 130-99 221t-221 99q-8 1-14-5t-5-13v-71q0-8 5-13t12-5q86-6 147-68t67-147q1-7 6-12t12-5h72q7 0 13 6t5 13z m214 0q-3 86-31 166t-78 145t-115 114t-145 78t-166 31q-8 1-13-5q-5-5-5-13v-71q0-7 5-12t12-6q114-4 211-62t156-155t62-211q0-8 5-13t13-5h71q7 0 13 6q6 5 5 13z m161 535v-536q0-66-47-113t-114-48h-535q-67 0-114 48t-47 113v536q0 66 47 113t114 48h535q67 0 114-48t47-113z" horiz-adv-x="857.1" />
66
+ <glyph glyph-name="phone" unicode="&#xe87f;" d="m786 158q0-15-6-39t-12-38q-11-28-68-60q-52-28-103-28q-16 0-30 2t-32 7t-26 8t-31 11t-28 10q-54 20-97 47q-72 44-148 120t-120 148q-27 43-46 97q-2 5-10 28t-12 31t-8 26t-7 32t-2 29q0 52 29 104q31 56 59 68q14 6 38 12t39 6q8 0 12-2q10-3 30-43q6-10 16-30t20-35t17-30q2-2 10-14t12-20t4-16q0-11-16-28t-35-30t-34-30t-16-25q0-5 3-13t4-11t8-14t7-10q42-77 97-132t131-97q1 0 10-6t14-8t11-5t13-2q10 0 25 15t30 35t31 35t28 16q7 0 15-4t20-12t14-10q14-8 30-17t35-20t31-17q39-19 42-29q2-4 2-12z" horiz-adv-x="785.7" />
67
+ <glyph glyph-name="menu" unicode="&#xe830;" d="m857 100v-71q0-15-10-25t-26-11h-785q-15 0-25 11t-11 25v71q0 15 11 25t25 11h785q15 0 26-11t10-25z m0 286v-72q0-14-10-25t-26-10h-785q-15 0-25 10t-11 25v72q0 14 11 25t25 10h785q15 0 26-10t10-25z m0 285v-71q0-15-10-25t-26-11h-785q-15 0-25 11t-11 25v71q0 15 11 26t25 10h785q15 0 26-10t10-26z" horiz-adv-x="857.1" />
68
+ <glyph glyph-name="cog-alt" unicode="&#xe847;" d="m500 350q0 59-42 101t-101 42t-101-42t-42-101t42-101t101-42t101 42t42 101z m429-286q0 29-22 51t-50 21t-50-21t-21-51q0-29 21-50t50-21t51 21t21 50z m0 572q0 29-22 50t-50 21t-50-21t-21-50q0-30 21-51t50-21t51 21t21 51z m-215-235v-103q0-6-4-11t-9-6l-86-14q-6-19-18-42q19-27 50-64q4-6 4-11q0-7-4-11q-13-17-46-50t-44-33q-6 0-11 4l-64 50q-21-11-43-17q-6-60-13-87q-4-13-17-13h-104q-6 0-11 4t-5 10l-13 85q-19 6-42 18l-66-50q-4-4-11-4q-6 0-12 4q-80 75-80 90q0 5 4 10q5 8 23 30t26 34q-13 24-20 46l-85 13q-5 1-9 5t-4 11v103q0 6 4 11t9 6l86 14q7 19 18 42q-19 27-50 64q-4 6-4 11q0 7 4 11q12 17 46 50t44 33q6 0 12-4l64-50q19 10 43 18q6 60 13 86q3 13 16 13h104q6 0 11-4t6-10l13-85q19-6 41-17l66 49q5 4 11 4q7 0 12-4q81-75 81-90q0-5-4-10q-7-9-24-30t-25-34q13-27 19-46l85-12q5-2 9-6t4-11z m357-298v-78q0-9-83-17q-6-15-16-29q28-63 28-77q0-2-2-4q-68-40-69-40q-5 0-26 27t-29 37q-11-1-17-1t-17 1q-7-11-29-37t-25-27q-1 0-69 40q-3 2-3 4q0 14 29 77q-10 14-17 29q-83 8-83 17v78q0 9 83 18q7 16 17 29q-29 63-29 77q0 2 3 4q2 1 19 11t33 19t17 9q4 0 25-26t29-38q12 1 17 1t17-1q28 40 51 63l4 1q2 0 69-39q2-2 2-4q0-14-28-77q9-13 16-29q83-9 83-18z m0 572v-78q0-9-83-18q-6-15-16-29q28-63 28-77q0-2-2-4q-68-39-69-39q-5 0-26 26t-29 38q-11-1-17-1t-17 1q-7-12-29-38t-25-26q-1 0-69 39q-3 2-3 4q0 14 29 77q-10 14-17 29q-83 9-83 18v78q0 9 83 17q7 16 17 29q-29 63-29 77q0 2 3 4q2 1 19 11t33 19t17 9q4 0 25-26t29-38q12 2 17 2t17-2q28 40 51 63l4 1q2 0 69-39q2-2 2-4q0-14-28-77q9-13 16-29q83-8 83-17z" horiz-adv-x="1071.4" />
69
+ <glyph glyph-name="wrench" unicode="&#xe848;" d="m214 29q0 14-10 25t-25 10t-26-10t-10-25t10-26t26-10t25 10t10 26z m360 234l-381-381q-21-20-50-20q-29 0-51 20l-59 61q-21 20-21 50q0 29 21 51l380 380q22-55 64-97t97-64z m353 243q0-22-12-59q-27-75-92-122t-144-46q-104 0-177 73t-73 177t73 176t177 74q32 0 67-10t60-26q9-6 9-15t-9-16l-163-94v-125l108-60q2 2 44 27t75 45t40 20q8 0 13-5t4-14z" horiz-adv-x="928.6" />
70
+ <glyph glyph-name="basket-1" unicode="&#xe87c;" d="m357-7q0-30-21-51t-50-21t-51 21t-21 51t21 50t51 21t50-21t21-50z m500 0q0-30-21-51t-50-21t-51 21t-21 51t21 50t51 21t50-21t21-50z m72 607v-286q0-13-9-23t-23-12l-583-68q1-4 3-12t3-15t1-13q0-8-13-35h513q15 0 26-11t10-25t-10-25t-26-11h-571q-14 0-25 11t-11 25q0 8 6 22t17 33t11 21l-98 460h-114q-15 0-25 10t-11 25t11 26t25 10h143q9 0 16-3t11-9t7-14t4-15t3-16t3-14h670q14 0 25-11t11-25z" horiz-adv-x="928.6" />
71
+ <glyph glyph-name="calendar" unicode="&#xe87d;" d="m71-79h161v161h-161v-161z m197 0h178v161h-178v-161z m-197 197h161v178h-161v-178z m197 0h178v178h-178v-178z m-197 214h161v161h-161v-161z m411-411h179v161h-179v-161z m-214 411h178v161h-178v-161z m428-411h161v161h-161v-161z m-214 197h179v178h-179v-178z m-196 482v161q0 7-6 12t-12 6h-36q-7 0-12-6t-6-12v-161q0-7 6-13t12-5h36q7 0 12 5t6 13z m410-482h161v178h-161v-178z m-214 214h179v161h-179v-161z m214 0h161v161h-161v-161z m18 268v161q0 7-5 12t-13 6h-35q-8 0-13-6t-5-12v-161q0-7 5-13t13-5h35q8 0 13 5t5 13z m215 36v-715q0-29-22-50t-50-21h-786q-29 0-50 21t-21 50v715q0 29 21 50t50 21h72v54q0 36 26 63t63 26h36q37 0 63-26t26-63v-54h214v54q0 36 27 63t63 26h35q37 0 63-26t27-63v-54h71q29 0 50-21t22-50z" horiz-adv-x="928.6" />
72
+ <glyph glyph-name="calendar-empty" unicode="&#xe87e;" d="m71-79h786v572h-786v-572z m215 679v161q0 8-5 13t-13 5h-36q-8 0-13-5t-5-13v-161q0-8 5-13t13-5h36q8 0 13 5t5 13z m428 0v161q0 8-5 13t-13 5h-35q-8 0-13-5t-5-13v-161q0-8 5-13t13-5h35q8 0 13 5t5 13z m215 36v-715q0-29-22-50t-50-21h-786q-29 0-50 21t-21 50v715q0 29 21 50t50 21h72v54q0 36 26 63t63 26h36q37 0 63-26t26-63v-54h214v54q0 36 27 63t63 26h35q37 0 63-26t27-63v-54h71q29 0 50-21t22-50z" horiz-adv-x="928.6" />
73
+ <glyph glyph-name="lightbulb" unicode="&#xe88b;" d="m411 529q0-8-6-13t-12-5t-13 5t-5 13q0 25-30 39t-59 14q-8 0-13 5t-5 13t5 13t13 5q28 0 55-9t49-30t21-50z m89 0q0 40-19 74t-50 57t-69 35t-76 12t-76-12t-69-35t-50-57t-20-74q0-57 38-101q6-6 17-18t17-19q72-85 79-166h127q8 81 79 166q6 6 17 19t17 18q38 44 38 101z m71 0q0-87-57-150q-25-27-42-49t-33-53t-19-60q26-15 26-46q0-20-14-35q14-15 14-36q0-29-25-45q8-13 8-26q0-26-18-40t-43-14q-11-25-34-39t-48-15t-49 15t-33 39q-26 0-44 14t-17 40q0 13 7 26q-25 16-25 45q0 21 14 36q-14 15-14 35q0 31 26 46q-2 28-19 60t-33 53t-41 49q-58 63-58 150q0 55 25 103t65 79t92 49t104 19t104-19t91-49t66-79t24-103z" horiz-adv-x="571.4" />
74
+ <glyph glyph-name="resize-full-alt" unicode="&#xe845;" d="m716 548l-198-198l198-198l80 80q16 18 39 8q22-9 22-33v-250q0-14-10-25t-26-11h-250q-23 0-32 23q-10 21 7 38l81 81l-198 198l-198-198l80-81q17-17 8-38q-10-23-33-23h-250q-15 0-25 11t-11 25v250q0 24 22 33q22 10 39-8l80-80l198 198l-198 198l-80-80q-11-11-25-11q-7 0-14 3q-22 9-22 33v250q0 14 11 25t25 11h250q23 0 33-23q9-22-8-38l-80-81l198-198l198 198l-81 81q-17 16-7 38q9 23 32 23h250q15 0 26-11t10-25v-250q0-24-22-33q-7-3-14-3q-14 0-25 11z" horiz-adv-x="857.1" />
75
+ <glyph glyph-name="move" unicode="&#xe846;" d="m1000 350q0-14-11-25l-142-143q-11-11-26-11t-25 11t-10 25v72h-215v-215h72q14 0 25-10t11-25t-11-26l-143-142q-10-11-25-11t-25 11l-143 142q-11 11-11 26t11 25t25 10h72v215h-215v-72q0-14-10-25t-25-11t-26 11l-142 143q-11 11-11 25t11 25l142 143q11 11 26 11t25-11t10-25v-72h215v215h-72q-14 0-25 10t-11 25t11 26l143 142q11 11 25 11t25-11l143-142q11-11 11-26t-11-25t-25-10h-72v-215h215v72q0 14 10 25t25 11t26-11l142-143q11-10 11-25z" horiz-adv-x="1000" />
76
+ <glyph glyph-name="down-dir" unicode="&#xe838;" d="m571 457q0-14-10-25l-250-250q-11-11-25-11t-25 11l-250 250q-11 11-11 25t11 25t25 11h500q14 0 25-11t10-25z" horiz-adv-x="571.4" />
77
+ <glyph glyph-name="up-dir" unicode="&#xe839;" d="m571 171q0-14-10-25t-25-10h-500q-15 0-25 10t-11 25t11 26l250 250q10 10 25 10t25-10l250-250q10-11 10-26z" horiz-adv-x="571.4" />
78
+ <glyph glyph-name="left-dir" unicode="&#xe817;" d="m357 600v-500q0-14-10-25t-26-11t-25 11l-250 250q-10 11-10 25t10 25l250 250q11 11 25 11t26-11t10-25z" horiz-adv-x="357.1" />
79
+ <glyph glyph-name="right-dir" unicode="&#xe818;" d="m321 350q0-14-10-25l-250-250q-11-11-25-11t-25 11t-11 25v500q0 15 11 25t25 11t25-11l250-250q10-10 10-25z" horiz-adv-x="357.1" />
80
+ <glyph glyph-name="down-open" unicode="&#xe83b;" d="m899 457q0-29-21-50l-363-363q-21-22-51-22q-30 0-50 22l-363 363q-21 20-21 50q0 30 21 51l41 42q22 20 51 20q29 0 50-20l271-271l271 271q21 20 51 20q29 0 50-20l42-42q21-22 21-51z" horiz-adv-x="928.6" />
81
+ <glyph glyph-name="left-open" unicode="&#xe819;" d="m414-28l-364 364q-20 20-20 50t20 51l364 363q21 20 51 20t50-20l42-42q21-21 21-51t-21-50l-271-271l271-271q21-21 21-51t-21-50l-42-42q-21-20-50-20t-51 20z" horiz-adv-x="642.9" />
82
+ <glyph glyph-name="right-open" unicode="&#xe81a;" d="m613 386q0-29-20-51l-364-363q-21-21-50-21t-51 21l-42 42q-21 21-21 50q0 30 21 51l271 271l-271 270q-21 22-21 51q0 30 21 50l42 42q20 21 51 21t50-21l364-363q20-21 20-50z" horiz-adv-x="642.9" />
83
+ <glyph glyph-name="angle-left" unicode="&#xe820;" d="m350 546q0-7-6-12l-219-220l219-219q6-6 6-13t-6-13l-28-28q-5-5-12-5t-13 5l-260 260q-6 6-6 13t6 13l260 260q5 6 13 6t12-6l28-28q6-5 6-13z" horiz-adv-x="357.1" />
84
+ <glyph glyph-name="angle-right" unicode="&#xe81d;" d="m332 314q0-7-6-13l-260-260q-5-5-12-5t-13 5l-28 28q-6 6-6 13t6 13l219 219l-219 220q-6 5-6 12t6 13l28 28q5 6 13 6t12-6l260-260q6-5 6-13z" horiz-adv-x="357.1" />
85
+ <glyph glyph-name="angle-double-left" unicode="&#xe892;" d="m350 82q0-7-6-13l-28-28q-5-5-12-5t-13 5l-260 260q-6 6-6 13t6 13l260 260q5 6 13 6t12-6l28-28q6-5 6-13t-6-12l-219-220l219-219q6-6 6-13z m214 0q0-7-5-13l-28-28q-6-5-13-5t-13 5l-260 260q-6 6-6 13t6 13l260 260q6 6 13 6t13-6l28-28q5-5 5-13t-5-12l-220-220l220-219q5-6 5-13z" horiz-adv-x="571.4" />
86
+ <glyph glyph-name="angle-double-right" unicode="&#xe893;" d="m332 314q0-7-6-13l-260-260q-5-5-12-5t-13 5l-28 28q-6 6-6 13t6 13l219 219l-219 220q-6 5-6 12t6 13l28 28q5 6 13 6t12-6l260-260q6-5 6-13z m214 0q0-7-5-13l-260-260q-6-5-13-5t-13 5l-28 28q-5 6-5 13t5 13l219 219l-219 220q-5 5-5 12t5 13l28 28q6 6 13 6t13-6l260-260q5-5 5-13z" horiz-adv-x="571.4" />
87
+ <glyph glyph-name="left-big" unicode="&#xe81f;" d="m857 350v-71q0-30-18-51t-47-21h-393l164-164q21-20 21-50t-21-50l-42-43q-21-20-51-20q-29 0-50 20l-364 364q-20 21-20 50q0 29 20 51l364 363q21 21 50 21q29 0 51-21l42-42q21-21 21-50t-21-51l-164-164h393q29 0 47-20t18-51z" horiz-adv-x="857.1" />
88
+ <glyph glyph-name="right-big" unicode="&#xe81e;" d="m821 314q0-30-20-50l-363-364q-22-20-51-20q-29 0-50 20l-42 42q-22 21-22 51t22 51l163 163h-393q-29 0-47 21t-18 51v71q0 30 18 51t47 20h393l-163 164q-22 21-22 51t22 50l42 42q21 21 50 21q29 0 51-21l363-363q20-20 20-51z" horiz-adv-x="857.1" />
89
+ <glyph glyph-name="up-hand" unicode="&#xe835;" d="m714-43q0 15-10 25t-25 11t-26-11t-10-25t10-25t26-11t25 11t10 25z m72 426q0 106-93 106q-15 0-32-3q-9 17-29 27t-41 9t-39-10q-27 30-66 30q-14 0-31-6t-26-14v185q0 29-22 50t-50 22q-28 0-50-22t-21-50v-321q-11 0-27 8t-31 19t-38 18t-47 8q-37 0-55-25t-17-64q0-13 78-50q25-14 36-21q36-22 81-62q45-40 59-57q32-38 32-78v-18h357v18q0 40 18 93t36 108t18 100z m71 3q0-74-38-179q-33-92-33-125v-161q0-29-21-50t-51-21h-357q-29 0-50 21t-21 50v161q0 6-3 12t-8 13t-10 13t-12 13t-12 12t-12 10t-10 8q-41 36-72 56q-11 7-34 18t-40 21t-36 23t-27 30t-10 39q0 70 37 115t106 46q38 0 71-13v209q0 58 43 101t100 42q58 0 101-42t42-101v-94q35-2 66-21q12 2 24 2q57 0 100-34q77 1 122-47t45-127z" horiz-adv-x="857.1" />
90
+ <glyph glyph-name="ccw-1" unicode="&#xe891;" d="m857 350q0-87-34-166t-91-137t-137-92t-166-34q-96 0-183 41t-147 114q-4 6-4 13t5 11l76 77q6 5 14 5q9-1 13-7q41-53 100-82t126-29q58 0 110 23t92 61t61 91t22 111t-22 111t-61 91t-92 61t-110 23q-55 0-105-20t-90-57l77-77q17-16 8-38q-10-23-33-23h-250q-15 0-25 11t-11 25v250q0 24 22 33q22 10 39-8l72-72q60 57 137 88t159 31q87 0 166-34t137-92t91-137t34-166z" horiz-adv-x="857.1" />
91
+ <glyph glyph-name="shuffle-1" unicode="&#xe849;" d="m372 582q-34-52-77-153q-12 25-20 41t-23 35t-28 32t-36 19t-45 8h-125q-8 0-13 5t-5 13v107q0 8 5 13t13 5h125q139 0 229-125z m628-446q0-8-5-13l-179-179q-5-5-12-5q-8 0-13 6t-5 12v107q-18 0-48 0t-45-1t-41 1t-39 3t-36 6t-35 10t-32 16t-33 22t-31 30t-31 39q33 52 76 152q12-25 20-40t23-36t28-31t35-20t46-8h143v107q0 8 5 13t13 5q6 0 13-5l178-178q5-5 5-13z m0 500q0-8-5-13l-179-179q-5-5-12-5q-8 0-13 6t-5 12v107h-143q-27 0-49-8t-38-25t-29-35t-25-43q-18-34-43-95q-16-37-28-62t-30-59t-36-55t-41-47t-50-38t-60-23t-71-10h-125q-8 0-13 5t-5 13v107q0 8 5 13t13 5h125q27 0 48 9t39 25t28 34t26 43q17 35 43 96q16 36 28 62t30 58t36 56t41 46t50 38t59 24t72 9h143v107q0 8 5 13t13 5q6 0 13-5l178-178q5-5 5-13z" horiz-adv-x="1000" />
92
+ <glyph glyph-name="play" unicode="&#xe88c;" d="m772 333l-741-412q-13-7-22-2t-9 20v822q0 14 9 20t22-2l741-412q13-7 13-17t-13-17z" horiz-adv-x="785.7" />
93
+ <glyph glyph-name="play-circled" unicode="&#xe88e;" d="m429 779q116 0 215-58t156-156t57-215t-57-215t-156-156t-215-58t-216 58t-155 156t-58 215t58 215t155 156t216 58z m214-460q18 10 18 31t-18 31l-304 178q-17 11-35 1q-18-11-18-31v-358q0-20 18-31q9-4 17-4q10 0 18 5z" horiz-adv-x="857.1" />
94
+ <glyph glyph-name="stop" unicode="&#xe88f;" d="m857 743v-786q0-14-10-25t-26-11h-785q-15 0-25 11t-11 25v786q0 14 11 25t25 11h785q15 0 26-11t10-25z" horiz-adv-x="857.1" />
95
+ <glyph glyph-name="pause" unicode="&#xe88d;" d="m857 743v-786q0-14-10-25t-26-11h-285q-15 0-25 11t-11 25v786q0 14 11 25t25 11h285q15 0 26-11t10-25z m-500 0v-786q0-14-10-25t-26-11h-285q-15 0-25 11t-11 25v786q0 14 11 25t25 11h285q15 0 26-11t10-25z" horiz-adv-x="857.1" />
96
+ <glyph glyph-name="fast-fw" unicode="&#xe890;" d="m25-71q-10-11-18-8t-7 18v822q0 14 7 18t18-8l396-396q5-4 8-11v397q0 14 7 18t18-8l396-396q10-11 10-25t-10-25l-396-396q-11-11-18-8t-7 18v396q-3-5-8-10z" horiz-adv-x="928.6" />
97
+ <glyph glyph-name="desktop" unicode="&#xe85d;" d="m1000 296v465q0 7-5 12t-13 6h-893q-7 0-12-6t-6-12v-465q0-7 6-12t12-5h893q7 0 13 5t5 12z m71 465v-607q0-37-26-63t-63-27h-303q0-20 9-43t17-40t9-24q0-14-10-25t-25-11h-286q-15 0-25 11t-11 25q0 8 9 25t18 39t9 43h-304q-36 0-63 27t-26 63v607q0 37 26 63t63 26h893q37 0 63-26t26-63z" horiz-adv-x="1071.4" />
98
+ <glyph glyph-name="laptop" unicode="&#xe85e;" d="m232 136q-37 0-63 26t-26 63v393q0 37 26 63t63 26h607q37 0 63-26t27-63v-393q0-37-27-63t-63-26h-607z m-18 482v-393q0-7 6-13t12-5h607q8 0 13 5t5 13v393q0 7-5 12t-13 6h-607q-7 0-12-6t-6-12z m768-518h89v-54q0-22-26-37t-63-16h-893q-36 0-63 16t-26 37v54h982z m-402-54q9 0 9 9t-9 9h-89q-9 0-9-9t9-9h89z" horiz-adv-x="1071.4" />
99
+ <glyph glyph-name="tablet" unicode="&#xe85f;" d="m357 64q0 15-10 25t-26 11t-25-11t-10-25t10-25t25-10t26 10t10 25z m214 90v535q0 8-5 13t-12 5h-465q-7 0-12-5t-6-13v-535q0-8 6-13t12-5h465q7 0 12 5t5 13z m72 535v-607q0-37-26-63t-63-26h-465q-36 0-63 26t-26 63v607q0 37 26 63t63 27h465q36 0 63-27t26-63z" horiz-adv-x="642.9" />
100
+ <glyph glyph-name="mobile" unicode="&#xe860;" d="m259 64q0 19-13 32t-32 13t-31-13t-13-32t13-31t31-13t32 13t13 31z m116 90v392q0 8-5 13t-13 5h-286q-7 0-12-5t-5-13v-392q0-8 5-13t12-5h286q7 0 13 5t5 13z m-107 473q0 9-9 9h-89q-9 0-9-9t9-9h89q9 0 9 9z m161 9v-572q0-29-22-50t-50-21h-286q-29 0-50 21t-21 50v572q0 29 21 50t50 21h286q29 0 50-21t22-50z" horiz-adv-x="428.6" />
101
+ <glyph glyph-name="flight" unicode="&#xe894;" d="m768 761q24-29 7-83t-61-96l-90-90l90-388q3-11-7-18l-71-54q-4-3-11-3q-2 0-4 0q-8 2-12 9l-155 284l-145-145l30-108q3-10-5-18l-53-53q-5-5-13-5h-1q-9 1-14 7l-105 141l-141 105q-6 4-7 13q-1 7 5 14l54 54q5 5 12 5q4 0 5 0l108-30l145 145l-284 155q-8 5-9 14q-1 9 5 15l71 71q8 7 17 5l371-89l89 89q43 42 96 60t83-6z" horiz-adv-x="785.7" />
102
+ <glyph glyph-name="font" unicode="&#xe851;" d="m405 538l-95-251q40-1 85-1t67-1t29 0l16 1q-18 53-51 134q-30 74-51 118z m-393-617h-12l1 44q12 4 45 10q49 9 61 18q11 9 27 38l132 344l156 404h72l6-12l114-268q58-135 70-166q21-57 53-131q15-32 36-91q14-38 37-84q12-27 19-31q13-11 39-13q26-4 57-15q4-22 4-32q0-8-1-15q-45 0-107 5q-52 4-106 4q-44 0-75-1l-112-6l-32-1q0 25 2 43l73 16q32 7 38 13q7 7 7 15t-3 18l-26 63l-52 128l-251 1q-16-36-58-153q-13-36-13-47q0-17 10-24q14-12 57-18q2 0 8-1t16-3t23-3q1-16 1-32q0-10-2-16q-36 0-194 12l-27-5q-45-8-93-8z" horiz-adv-x="928.6" />
103
+ <glyph glyph-name="bold" unicode="&#xe852;" d="m310 1q42-18 78-18q73 0 120 23t68 63q22 39 22 101q0 64-23 101q-33 52-79 70q-45 18-138 18q-41 0-56-6v-80l-1-97l2-150q0-9 7-25z m-8 417q24-4 61-4q97 0 147 36t50 125q0 62-48 104q-47 42-142 42q-29 0-73-7q0-25 2-43q3-68 3-156l-1-55q0-24 1-43z m-302-497l1 53q25 5 38 7q43 6 69 17q9 15 11 28q5 37 5 109l-1 277q-2 143-5 225q0 49-6 61q0 2-6 7q-11 7-39 8q-17 1-64 8l-2 46l145 3l212 7l25 1q3 0 8 0t8 0q1 0 12 0t23 0h41q49 0 106-15q24-7 54-22q32-16 57-42q25-26 36-58t12-68q0-40-18-72t-53-58q-14-12-84-43q99-23 149-82q52-59 52-132q0-42-16-89q-12-35-40-66q-37-40-78-60q-41-20-113-33q-46-9-111-7l-110 3q-47 1-166-6q-19-2-152-7z" horiz-adv-x="785.7" />
104
+ <glyph glyph-name="italic" unicode="&#xe855;" d="m0-78l10 48q2 0 43 11q42 11 64 22q16 21 23 56l15 78l31 149l7 36q5 25 10 47t9 38t7 26t5 17t1 6l17 88l9 35l12 75l4 28v21q-23 13-80 16q-16 1-21 2l10 58l177-8q22-1 41-1q37 0 119 5q19 1 38 2t20 2q-1-11-3-22q-4-16-7-28q-31-11-61-17q-36-9-56-18q-7-17-14-49q-5-24-7-46q-25-111-37-170l-34-174l-21-88l-24-131l-7-25q-1-4 1-15q36-9 66-12q20-3 37-6q-1-16-4-32q-4-17-5-23q-10 0-13-1q-13-1-23-1q-5 0-16 2q-10 2-81 10l-110 1q-23 0-97-6q-42-4-55-6z" horiz-adv-x="571.4" />
105
+ <glyph glyph-name="text-height" unicode="&#xe84f;" d="m45 778l30-15q12-3 118-3h73l10 2l64 0l120 0h164l19-1q8-1 15 4t12 8l4 5l24 0q8 0 15 0v-58t1-74l0-55l0-33q0-18-2-28q-22-9-38-10q-14 24-31 71q-4 13-8 35t-7 36t-3 17q-7 8-15 10q-4 1-24 1t-58 0t-61-1q-19 0-38-3q-5-54-4-75l0-85v-186l2-200l-1-82q0-26 6-47q28-14 50-18q1 0 10-3t25-7t24-7q16-4 28-10q2-25 2-28q0-5-1-16q-8-1-19-1q-62 0-105 6q-40 4-132 4q-49 0-130-7q-27-3-39-3q-2 13-2 15l0 14v5q12 19 44 28q78 21 89 28q5 11 6 31q5 107 4 242l-3 238q-1 35 0 66t0 58t-1 31t-4 9q-3 3-7 3q-22 4-83 4q-24 0-56-8t-40-14q-8-5-13-18t-12-42t-13-47q-4-10-11-18t-12-7q-24 15-31 25v213z m928-714q19 0 24-10t-7-25l-70-90q-11-15-27-15t-27 15l-71 90q-11 15-6 25t23 10h45v572h-45q-18 0-23 10t6 25l71 90q11 15 27 15t27-15l70-90q12-15 7-25t-24-10h-44v-572h44z" horiz-adv-x="1000" />
106
+ <glyph glyph-name="text-width" unicode="&#xe850;" d="m45 778l30-15q12-3 118-3h73l10 2l64 0l249 0h178l19-1q8-1 15 4t12 8l4 5l23 0q9 0 16 0v-58t1-74l0-55l0-33q0-18-3-28q-21-9-38-10q-14 24-30 71q-4 13-8 35t-7 36t-3 17q-7 8-15 10q-4 1-33 1t-77 0t-72-1q-52 0-70-3q-6-54-5-75l1-85v29l1-201l0-82q-1-25 6-47q27-14 50-18q1 0 10-3t24-7t24-7q17-4 28-10q3-25 3-28q0-5-2-16q-8 0-19 0q-61 0-104 5q-40 5-133 5q-46 0-130-8q-25-2-39-2q-1 12-1 14l-1 15v5q12 18 44 27q78 21 89 28q5 12 7 31q3 77 3 242l-3 24q0 148-1 155q-1 7-3 9q-3 3-8 3q-21 4-82 4q-28 0-95-8t-73-14q-8-5-13-18t-12-42t-13-47q-4-10-11-18t-12-7q-24 15-31 25v213z m795-722q14-11 14-27t-14-28l-91-70q-14-11-24-6t-11 23v45h-571v-45q0-18-10-23t-25 6l-91 70q-14 11-14 28t14 27l91 70q14 11 25 6t10-23v-45h571v45q0 18 11 23t24-6z" horiz-adv-x="857.1" />
107
+ <glyph glyph-name="align-left" unicode="&#xe84c;" d="m1000 100v-71q0-15-11-25t-25-11h-928q-15 0-25 11t-11 25v71q0 15 11 25t25 11h928q15 0 25-11t11-25z m-214 214v-71q0-15-11-25t-25-11h-714q-15 0-25 11t-11 25v71q0 15 11 25t25 11h714q15 0 25-11t11-25z m143 215v-72q0-14-11-25t-25-11h-857q-15 0-25 11t-11 25v72q0 14 11 25t25 10h857q14 0 25-10t11-25z m-215 214v-72q0-14-10-25t-25-10h-643q-15 0-25 10t-11 25v72q0 14 11 25t25 11h643q14 0 25-11t10-25z" horiz-adv-x="1000" />
108
+ <glyph glyph-name="align-center" unicode="&#xe84d;" d="m1000 100v-71q0-15-11-25t-25-11h-928q-15 0-25 11t-11 25v71q0 15 11 25t25 11h928q15 0 25-11t11-25z m-214 214v-71q0-15-11-25t-25-11h-500q-14 0-25 11t-11 25v71q0 15 11 25t25 11h500q15 0 25-11t11-25z m143 215v-72q0-14-11-25t-25-11h-786q-14 0-25 11t-11 25v72q0 14 11 25t25 10h786q14 0 25-10t11-25z m-215 214v-72q0-14-10-25t-25-10h-358q-14 0-25 10t-10 25v72q0 14 10 25t25 11h358q14 0 25-11t10-25z" horiz-adv-x="1000" />
109
+ <glyph glyph-name="align-right" unicode="&#xe84e;" d="m1000 100v-71q0-15-11-25t-25-11h-928q-15 0-25 11t-11 25v71q0 15 11 25t25 11h928q15 0 25-11t11-25z m0 214v-71q0-15-11-25t-25-11h-714q-14 0-25 11t-11 25v71q0 15 11 25t25 11h714q15 0 25-11t11-25z m0 215v-72q0-14-11-25t-25-11h-857q-14 0-25 11t-11 25v72q0 14 11 25t25 10h857q15 0 25-10t11-25z m0 214v-72q0-14-11-25t-25-10h-643q-14 0-25 10t-10 25v72q0 14 10 25t25 11h643q15 0 25-11t11-25z" horiz-adv-x="1000" />
110
+ <glyph glyph-name="search" unicode="&#xe802;" d="m643 386q0 103-74 176t-176 74t-177-74t-73-176t73-177t177-73t176 73t74 177z m286-465q0-29-22-50t-50-21q-30 0-50 21l-191 191q-100-69-223-69q-80 0-153 31t-125 84t-84 125t-31 153t31 152t84 126t125 84t153 31t152-31t126-84t84-126t31-152q0-123-69-223l191-191q21-21 21-51z" horiz-adv-x="928.6" />
111
+ <glyph glyph-name="indent-left" unicode="&#xe866;" d="m214 546v-321q0-7-5-13t-13-5q-7 0-12 5l-161 161q-5 5-5 13t5 13l161 160q5 5 12 5q8 0 13-5t5-13z m786-428v-107q0-7-5-13t-13-5h-964q-7 0-13 5t-5 13v107q0 7 5 12t13 6h964q7 0 13-6t5-12z m0 214v-107q0-7-5-13t-13-5h-607q-7 0-13 5t-5 13v107q0 7 5 13t13 5h607q7 0 13-5t5-13z m0 214v-107q0-7-5-12t-13-6h-607q-7 0-13 6t-5 12v107q0 8 5 13t13 5h607q7 0 13-5t5-13z m0 215v-107q0-8-5-13t-13-5h-964q-7 0-13 5t-5 13v107q0 7 5 12t13 6h964q7 0 13-6t5-12z" horiz-adv-x="1000" />
112
+ <glyph glyph-name="indent-right" unicode="&#xe867;" d="m196 386q0-8-5-13l-160-161q-5-5-13-5q-7 0-13 5t-5 13v321q0 8 5 13t13 5q8 0 13-5l160-160q5-5 5-13z m804-268v-107q0-7-5-13t-13-5h-964q-7 0-13 5t-5 13v107q0 7 5 12t13 6h964q7 0 13-6t5-12z m0 214v-107q0-7-5-13t-13-5h-607q-7 0-13 5t-5 13v107q0 7 5 13t13 5h607q7 0 13-5t5-13z m0 214v-107q0-7-5-12t-13-6h-607q-7 0-13 6t-5 12v107q0 8 5 13t13 5h607q7 0 13-5t5-13z m0 215v-107q0-8-5-13t-13-5h-964q-7 0-13 5t-5 13v107q0 7 5 12t13 6h964q7 0 13-6t5-12z" horiz-adv-x="1000" />
113
+ <glyph glyph-name="ajust" unicode="&#xe84a;" d="m429 46v608q-83 0-153-41t-110-111t-41-152t41-152t110-111t153-41z m428 304q0-117-57-215t-156-156t-215-58t-216 58t-155 156t-58 215t58 215t155 156t216 58t215-58t156-156t57-215z" horiz-adv-x="857.1" />
114
+ <glyph glyph-name="tint" unicode="&#xe84b;" d="m286 207q0 20-11 39q-1 0-9 12t-14 21t-14 25t-12 28q-2 9-12 9t-11-9q-4-13-12-28t-14-25t-14-21t-9-12q-11-19-11-39q0-29 21-50t50-21t51 21t21 50z m285 72q0-119-83-202t-202-84t-202 84t-84 202q0 81 45 153q4 5 35 51t56 84t56 99t46 112q5 17 19 27t29 9t28-9t19-27q16-51 46-112t56-99t56-85t35-50q45-71 45-154z" horiz-adv-x="571.4" />
115
+ <glyph glyph-name="chart-bar" unicode="&#xe853;" d="m286 279v-215h-143v215h143z m214 285v-500h-143v500h143z m214-143v-357h-143v357h143z m215 215v-572h-143v572h143z m71-625v678q0 8-5 13t-13 5h-893q-7 0-12-5t-6-13v-678q0-8 6-13t12-5h893q7 0 13 5t5 13z m71 678v-678q0-37-26-63t-63-27h-893q-36 0-63 27t-26 63v678q0 37 26 63t63 27h893q37 0 63-27t26-63z" horiz-adv-x="1071.4" />
116
+ <glyph glyph-name="magic" unicode="&#xe807;" d="m664 526l164 163l-60 60l-164-164z m249 163q0-15-10-25l-717-718q-10-10-25-10t-25 10l-111 111q-10 10-10 25t10 25l718 718q10 10 25 10t25-10l110-111q10-10 10-25z m-753 106l54-16l-54-17l-17-55l-17 55l-55 17l55 16l17 55z m195-90l109-34l-109-33l-34-109l-33 109l-109 33l109 34l33 109z m519-267l55-17l-55-16l-17-55l-17 55l-54 16l54 17l17 55z m-357 357l54-16l-54-17l-17-55l-17 55l-54 17l54 16l17 55z" horiz-adv-x="928.6" />
117
+ <glyph glyph-name="sort" unicode="&#xe895;" d="m571 243q0-15-10-25l-250-250q-11-11-25-11t-25 11l-250 250q-11 10-11 25t11 25t25 11h500q14 0 25-11t10-25z m0 214q0-14-10-25t-25-11h-500q-15 0-25 11t-11 25t11 25l250 250q10 11 25 11t25-11l250-250q10-10 10-25z" horiz-adv-x="571.4" />
118
+ <glyph glyph-name="sort-alt-up" unicode="&#xe863;" d="m411 46q0-6-6-13l-178-178q-5-5-13-5q-6 0-13 5l-178 179q-8 9-4 19q4 11 17 11h107v768q0 8 5 13t13 5h107q8 0 13-5t5-13v-768h107q8 0 13-5t5-13z m589-71v-107q0-8-5-13t-13-5h-464q-8 0-13 5t-5 13v107q0 8 5 13t13 5h464q8 0 13-5t5-13z m-107 286v-107q0-8-5-13t-13-5h-357q-8 0-13 5t-5 13v107q0 8 5 13t13 5h357q8 0 13-5t5-13z m-107 285v-107q0-8-5-13t-13-5h-250q-8 0-13 5t-5 13v107q0 8 5 13t13 5h250q8 0 13-5t5-13z m-107 286v-107q0-8-5-13t-13-5h-143q-8 0-13 5t-5 13v107q0 8 5 13t13 5h143q8 0 13-5t5-13z" horiz-adv-x="1000" />
119
+ <glyph glyph-name="sort-alt-down" unicode="&#xe864;" d="m679-25v-107q0-8-5-13t-13-5h-143q-8 0-13 5t-5 13v107q0 8 5 13t13 5h143q8 0 13-5t5-13z m-268 71q0-6-6-13l-178-178q-5-5-13-5q-6 0-13 5l-178 179q-8 9-4 19q4 11 17 11h107v768q0 8 5 13t13 5h107q8 0 13-5t5-13v-768h107q8 0 13-5t5-13z m375 215v-107q0-8-5-13t-13-5h-250q-8 0-13 5t-5 13v107q0 8 5 13t13 5h250q8 0 13-5t5-13z m107 285v-107q0-8-5-13t-13-5h-357q-8 0-13 5t-5 13v107q0 8 5 13t13 5h357q8 0 13-5t5-13z m107 286v-107q0-8-5-13t-13-5h-464q-8 0-13 5t-5 13v107q0 8 5 13t13 5h464q8 0 13-5t5-13z" horiz-adv-x="1000" />
120
+ <glyph glyph-name="sort-name-up" unicode="&#xe854;" d="m665 622h98l-40 122l-6 26q-2 9-2 11h-2l-2-11q0 0-1-10t-5-16z m-254-576q0-6-6-13l-178-178q-5-5-13-5q-6 0-13 5l-178 179q-8 9-4 19q4 11 17 11h107v768q0 8 5 13t13 5h107q8 0 13-5t5-13v-768h107q8 0 13-5t5-13z m466-66v-130h-326v50l206 295q7 10 12 16l6 5v1q-1 0-4 0t-4 0q-6-2-16-2h-130v-64h-67v128h317v-50l-206-296q-4-4-12-14l-6-7v-1l8 1q5 2 16 2h139v66h67z m50 501v-60h-161v60h42l-26 80h-136l-26-80h42v-60h-160v60h39l128 369h90l129-369h39z" horiz-adv-x="928.6" />
121
+ <glyph glyph-name="sort-name-down" unicode="&#xe865;" d="m665 51h98l-40 122l-6 26q-2 9-2 11h-2l-2-11q0-1-1-10t-5-16z m-254-5q0-6-6-13l-178-178q-5-5-13-5q-6 0-13 5l-178 179q-8 9-4 19q4 11 17 11h107v768q0 8 5 13t13 5h107q8 0 13-5t5-13v-768h107q8 0 13-5t5-13z m516-137v-59h-161v59h42l-26 80h-136l-26-80h42v-59h-160v59h39l128 370h90l129-370h39z m-50 642v-130h-326v51l206 295q7 10 12 15l6 5v2q-1 0-4-1t-4 0q-6-2-16-2h-130v-64h-67v128h317v-50l-206-295q-4-5-12-15l-6-6v-1l8 1q5 1 16 1h139v66h67z" horiz-adv-x="928.6" />
122
+ <glyph glyph-name="coffee" unicode="&#xe896;" d="m929 493q0 45-32 76t-76 31h-35v-214h35q45 0 76 31t32 76z m-929-429h1000q0-59-42-101t-101-42h-714q-59 0-101 42t-42 101z m1036 429q0-89-63-152t-152-62h-35v-18q0-52-37-88t-88-37h-393q-51 0-88 37t-37 88v410q0 15 11 26t25 10h642q89 0 152-63t63-151z" horiz-adv-x="1071.4" />
123
+ <glyph glyph-name="food" unicode="&#xe897;" d="m357 814v-357q0-34-20-62t-51-39v-435q0-29-21-50t-51-21h-71q-29 0-50 21t-22 50v435q-31 11-51 39t-20 62v357q0 15 11 25t25 11t25-11t10-25v-232q0-14 11-25t25-11t25 11t11 25v232q0 15 10 25t26 11t25-11t10-25v-232q0-14 11-25t25-11t25 11t11 25v232q0 15 10 25t25 11t26-11t10-25z m429 0v-893q0-29-21-50t-51-21h-71q-29 0-50 21t-22 50v286h-125q-7 0-12 5t-5 13v446q0 74 52 127t126 52h143q15 0 25-11t11-25z" horiz-adv-x="785.7" />
124
+ <glyph glyph-name="medkit" unicode="&#xe898;" d="m714 225v107q0 8-5 13t-13 5h-125v125q0 8-5 13t-12 5h-108q-7 0-12-5t-5-13v-125h-125q-8 0-13-5t-5-13v-107q0-8 5-13t13-5h125v-125q0-8 5-13t12-5h108q7 0 12 5t5 13v125h125q8 0 13 5t5 13z m-357 411h286v71h-286v-71z m-214 0v-715h-18q-51 0-88 37t-37 88v465q0 51 37 88t88 37h18z m661 0v-715h-608v715h90v89q0 22 15 38t38 16h322q22 0 38-16t15-38v-89h90z m196-125v-465q0-51-37-88t-88-37h-18v715h18q51 0 88-37t37-88z" horiz-adv-x="1000" />
125
+ <glyph glyph-name="puzzle" unicode="&#xe899;" d="m929 237q0-45-25-75t-69-30q-23 0-43 10t-33 21t-32 21t-39 10q-62 0-62-69q0-22 9-65t8-64v-3q-12 0-18 0q-19-2-54-7t-65-7t-55-3q-34 0-57 15t-23 47q0 20 9 39t22 32t21 33t9 43q0 44-30 69t-75 25q-47 0-80-26t-33-71q0-24 9-46t18-36t19-30t8-28q0-25-25-50q-21-19-66-19q-53 0-136 13q-5 1-16 2t-15 3l-7 1q-1 0-2 0q-1 0-1 1v571q1 0 10-2t19-2t12-2q83-14 136-14q45 0 66 20q25 24 25 49q0 13-8 29t-19 29t-18 36t-9 46q0 46 33 72t81 25q44 0 74-25t30-69q0-23-9-43t-21-33t-22-31t-9-40q0-32 23-47t57-14q36 0 101 8t91 9v-1q-1-1-2-9t-3-19t-2-12q-13-84-13-137q0-45 19-65q25-26 50-26q12 0 28 8t30 19t36 19t46 8q46 0 71-33t26-80z" horiz-adv-x="928.6" />
126
+ <glyph glyph-name="apple" unicode="&#xe89a;" d="m777 172q-21-70-68-139q-72-110-144-110q-27 0-78 18q-48 18-84 18q-34 0-79-19q-46-19-74-19q-85 0-168 145q-82 146-82 281q0 127 63 208q63 81 159 81q40 0 98-17q58-17 77-17q25 0 80 19q57 19 97 19q66 0 119-36q29-20 58-56q-45-37-64-66q-36-52-36-115q0-70 38-125t88-70z m-209 655q0-34-17-76q-16-42-52-77q-30-30-60-41q-20-6-58-9q2 83 44 143q41 60 139 83q1-2 2-6t1-6q0-3 0-6t1-5z" horiz-adv-x="785.7" />
127
+ <glyph glyph-name="facebook" unicode="&#xe89b;" d="m285 540h144l-17-159h-127v-460h-190v460h-95v159h95v95q0 102 48 154t158 52h126v-158h-79q-22 0-35-4t-19-13t-7-19t-2-28v-79z" horiz-adv-x="428.6" />
128
+ <glyph glyph-name="gplus" unicode="&#xe89c;" d="m489 33q0 11-3 22t-5 20t-10 19t-11 17t-15 17t-16 14t-17 14t-18 13t-18 13t-17 12q-10 1-28 1q-30 0-59-4t-60-14t-55-26t-39-41t-15-60q0-38 20-68t52-47t67-25t71-9q33 0 63 7t56 22t42 41t15 62z m-67 481q0 33-9 71t-27 72t-46 59t-67 22q-52 0-80-38t-29-92q0-26 7-55t19-58t32-53t43-37t54-15q54 0 79 34t24 90z m-73 265h244l-76-45h-75q40-25 61-70t22-94q0-41-13-74t-31-51t-37-36t-31-34t-13-38q0-14 9-28t24-27t33-27t36-31t32-37t24-47t10-60q0-89-79-157q-84-73-234-73q-33 0-67 6t-68 18t-60 33t-43 49t-17 68q0 34 21 75q18 36 53 62t81 40t87 20t83 7q-35 47-35 83q0 7 1 14t3 10t4 12t4 12q-22-2-39-2q-83 0-143 54t-59 138q0 78 53 139t130 79q53 11 105 11z m580-143v-72h-143v-143h-72v143h-143v72h143v143h72v-143h143z" horiz-adv-x="928.6" />
129
+ <glyph glyph-name="tumblr" unicode="&#xe8a0;" d="m218 779h122v-217h203v-134h-203v-220q0-76 8-96q7-21 29-34q28-17 65-17q65 0 129 42v-135q-56-27-99-36q-43-11-96-11q-59 0-104 15q-44 14-77 42q-33 29-44 59q-13 30-13 90v301h-94v121q50 16 86 47q36 30 58 73q21 44 30 110z" horiz-adv-x="571.4" />
130
+ <glyph glyph-name="twitter-squared" unicode="&#xe8a2;" d="m714 510q-31-14-67-19q38 22 52 65q-37-21-75-29q-34 37-85 37q-49 0-83-34t-35-83q0-16 3-27q-72 4-135 37t-107 86q-16-28-16-59q0-64 51-98q-27 1-56 15v-1q0-42 28-75t68-40q-16-5-28-5q-7 0-22 2q12-35 42-58t67-23q-64-50-145-50q-15 0-28 1q82-52 180-52q62 0 117 20t93 53t68 76t42 91t13 94q0 10 0 15q35 25 58 61z m143 108v-536q0-66-47-113t-114-48h-535q-67 0-114 48t-47 113v536q0 66 47 113t114 48h535q67 0 114-48t47-113z" horiz-adv-x="857.1" />
131
+ <glyph glyph-name="twitter" unicode="&#xe8a1;" d="m904 622q-37-54-90-93q0-8 0-23q0-73-21-145t-64-139t-103-117t-144-82t-181-30q-151 0-276 81q19-3 43-3q126 0 224 77q-59 2-105 36t-64 89q19-2 34-2q24 0 48 6q-63 13-104 62t-41 115v2q38-21 82-23q-37 25-59 64t-22 86q0 49 25 91q68-83 164-133t208-55q-5 21-5 41q0 75 53 127t127 53q79 0 132-57q61 12 114 44q-20-64-79-100q52 6 104 28z" horiz-adv-x="928.6" />
132
+ <glyph glyph-name="vimeo-squared" unicode="&#xe89d;" d="m700 495q9 47-12 73q-29 36-104 25q-10-1-23-7t-32-17t-36-27t-33-39t-25-51q44 4 63-9t15-55q-3-29-29-80q-24-43-40-55q-24-18-48 8q-13 13-21 36t-11 40t-5 47t-5 40q-13 72-19 92q-7 20-20 38t-28 23q-32 8-71-14q-30-18-76-60t-69-56v-4q9-5 15-15t12-11q11-2 30 5t32 6t24-17q6-10 10-22t8-26t7-23q10-26 30-104q20-82 32-110q23-56 57-70q24-7 48-1t42 18q73 43 139 132q59 77 97 163t46 127z m157 123v-536q0-66-47-113t-114-48h-535q-67 0-114 48t-47 113v536q0 66 47 113t114 48h535q67 0 114-48t47-113z" horiz-adv-x="857.1" />
133
+ <glyph glyph-name="youtube" unicode="&#xe89f;" d="m542 156v-118q0-37-22-37q-13 0-25 12v168q12 12 25 12q22 0 22-37z m188-1v-25h-50v25q0 38 25 38t25-38z m-539 122h60v52h-174v-52h59v-318h55v318z m161-318h50v276h-50v-211q-17-23-32-23q-10 0-11 11q-1 2-1 20v203h-50v-218q0-28 5-41q7-21 32-21q27 0 57 34v-30z m240 83v110q0 41-5 55q-10 31-40 31q-28 0-52-30v121h-50v-370h50v27q25-31 52-31q30 0 40 31q5 15 5 56z m188 6v7h-51q0-29-1-34q-4-20-22-20q-26 0-26 38v49h100v57q0 44-15 65q-22 28-59 28q-38 0-60-28q-15-21-15-65v-96q0-44 16-65q22-29 60-29q40 0 60 30q10 15 12 30q1 5 1 33z m-339 509v117q0 39-24 39t-24-39v-117q0-39 24-39t24 39z m401-419q0-131-14-195q-8-33-33-56t-57-25q-102-12-309-12t-310 12q-32 3-57 25t-32 56q-15 62-15 195q0 131 15 195q7 33 32 56t57 26q103 11 310 11t309-11q33-4 57-26t33-56q14-62 14-195z m-557 712h57l-67-223v-151h-56v151q-8 42-34 119q-21 57-37 104h60l39-147z m207-186v-97q0-46-16-66q-21-29-59-29q-38 0-59 29q-15 21-15 66v97q0 45 15 65q21 29 59 29q38 0 59-29q16-20 16-65z m187 91v-279h-51v31q-30-35-58-35q-25 0-33 21q-4 13-4 42v220h51v-205q0-19 0-20q2-12 12-12q15 0 32 24v213h51z" horiz-adv-x="857.1" />
134
+ <glyph glyph-name="youtube-squared" unicode="&#xe89e;" d="m513 123v88q0 27-16 27q-10 0-19-9v-125q9-8 19-8q16 0 16 27z m103 68h36v19q0 28-18 28t-18-28v-19z m-319 148v-39h-45v-236h-41v236h-44v39h130z m112-70v-205h-37v23q-22-25-43-25q-18 0-23 15q-4 9-4 30v162h37v-151q0-13 1-14q0-8 8-8q11 0 24 17v156h37z m141-62v-81q0-29-4-41q-7-23-30-23q-19 0-38 22v-20h-37v275h37v-89q18 22 38 22q23 0 30-24q4-11 4-41z m140-72v-5q0-16-1-24q-2-12-9-22q-15-22-44-22q-29 0-46 21q-11 15-11 48v72q0 33 11 48q16 21 44 21t44-21q12-16 12-48v-43h-74v-36q0-28 18-28q14 0 17 14q0 1 1 4t0 9v12h38z m-252 460v-87q0-29-18-29t-18 29v87q0 29 18 29t18-29z m297-398q0 99-10 145q-6 25-24 41t-43 19q-75 9-229 9q-154 0-230-9q-24-2-42-19t-24-41q-11-48-11-145q0-98 11-145q5-24 24-41t42-19q76-9 230-9t229 9q24 2 43 19t23 41q11 47 11 145z m-421 363l50 166h-41l-29-109l-29 109h-44l13-39t13-38q20-58 26-89v-112h41v112z m161-45v73q0 32-11 48q-16 21-44 21q-28 0-43-21q-12-16-12-48v-73q0-32 12-48q15-22 43-22q28 0 44 22q11 15 11 48z m101-67h38v207h-38v-158q-12-18-23-18q-8 0-9 9q0 1 0 15v152h-38v-164q0-21 4-31q6-15 23-15q21 0 43 25v-22z m281 170v-536q0-66-47-113t-114-48h-535q-67 0-114 48t-47 113v536q0 66 47 113t114 48h535q67 0 114-48t47-113z" horiz-adv-x="857.1" />
135
+ <glyph glyph-name="picture" unicode="&#xe800;" d="m856 518l-100 0l-124 150l-214-150l-180 0q-52 0-90-39t-38-91l0-160l-108 296q-10 38 22 52l680 248q36 10 50-24z m106-90q16 0 27-12t11-28l0-472q0-16-11-28t-27-12l-724 0q-16 0-27 12t-11 28l0 472q0 16 11 28t27 12l724 0z m-56-452l0 162l-72 160l-166-60l-130-132l-138 170l-92-214l0-86l598 0z" horiz-adv-x="1000" />
136
+ <glyph glyph-name="check" unicode="&#xe810;" d="m249 0q-34 0-56 28l-180 236q-16 24-12 52t26 46t51 14t47-28l118-154l296 474q16 24 43 30t53-8q24-16 30-43t-8-53l-350-560q-20-32-56-32z" horiz-adv-x="667" />
137
+ <glyph glyph-name="back" unicode="&#xe8a5;" d="m750 540q40 0 70-29t30-71l0-290q0-40-30-70t-70-30l-690 0l0 140l650 0l0 210l-500 0l0-110l-210 180l210 180l0-110l540 0z" horiz-adv-x="850" />
138
+ <glyph glyph-name="thumbs-up-1" unicode="&#xe8a9;" d="m582 480q2-6 58-13t108-24t52-47q0-72-61-284t-107-212q-144 0-288 42t-144 88l0 342q0 14 15 34t46 45t53 41t62 43t46 31q50 34 104 100t85 104t41 26q48-76 29-137t-59-119t-40-60z m-432-4q14 0 0-14q-50-50-50-104l0-318q0-50 52-104q10-10-2-10q-26 0-55 8t-62 45t-33 99l0 242q0 62 33 100t63 47t54 9z" horiz-adv-x="800" />
139
+ <glyph glyph-name="thumbs-down" unicode="&#xe8aa;" d="m218 218q-2 6-57 13t-108 24t-53 47q0 72 62 285t106 213q144 0 288-43t144-89l0-342q0-10-8-24t-25-30t-32-29t-42-32t-41-29t-41-28l-33-22q-50-34-104-100t-85-104t-41-26q-48 76-29 137t59 119t40 60z m432 4q-12 0 2 14q48 50 48 104l0 318q0 50-52 104q-10 10 2 10q26 0 55-8t62-45t33-99l0-242q0-48-18-81t-45-48t-48-21t-39-6z" horiz-adv-x="800" />
140
+ <glyph glyph-name="download-1" unicode="&#xe8ab;" d="m968 198q18-10 27-32t3-40l-28-154q-4-20-22-33t-40-13l-816 0q-22 0-40 13t-22 33l-28 154q-10 48 32 72l158 108l98 0l-170-130l178 0q8 0 12-8l40-110l300 0l40 110q8 8 12 8l178 0l-170 130l98 0z m-208 322l-260-244l-260 244l166 0l0 256l190 0l0-256l164 0z" horiz-adv-x="1000" />
141
+ <glyph glyph-name="upload-1" unicode="&#xe8ac;" d="m500 776l260-244l-164 0l0-256l-190 0l0 256l-166 0z m468-578q18-10 27-32t3-40l-28-154q-4-20-22-33t-40-13l-816 0q-22 0-40 13t-22 33l-28 154q-10 48 32 72l158 108l98 0l-170-130l178 0q8 0 12-8l40-110l300 0l40 110q8 8 12 8l178 0l-170 130l98 0z" horiz-adv-x="1000" />
142
+ <glyph glyph-name="reply-1" unicode="&#xe8a8;" d="m900 10q-86 152-208 197t-330 45l0-218l-362 334l362 322l0-192q90 0 168-27t131-70t96-95t69-104t44-95t24-69z" horiz-adv-x="900" />
143
+ <glyph glyph-name="forward-1" unicode="&#xe8a7;" d="m540 252q-210 0-332-45t-208-197q4 20 13 53t50 117t96 148t156 117t225 53l0 192l360-322l-360-334l0 218z" horiz-adv-x="900" />
144
+ <glyph glyph-name="export" unicode="&#xe80b;" d="m750 60l0 56l100 82l0-188q0-20-15-35t-35-15l-750 0q-20 0-35 15t-15 35l0 550q0 22 14 36t36 14l288 0q-32-24-59-49t-39-39l-10-12l-130 0l0-450l650 0z m-82 348q-166 0-242-41t-160-181q0 8 1 22t9 56t22 79t44 83t70 79t107 56t149 23l0 156l332-250l-332-260l0 178z" horiz-adv-x="1000" />
145
+ <glyph glyph-name="folder" unicode="&#xe813;" d="m954 500q32 0 40-12t6-36l-42-452q-2-24-12-37t-42-13l-806 0q-52 0-56 50l-42 452q-2 24 6 36t40 12l908 0z m-34 110l10-40l-846 0l14 132q4 20 20 34t36 14l164 0q52 0 86-34l30-30q32-36 86-36l340 0q20 0 38-12t22-28z" horiz-adv-x="1001" />
146
+ <glyph glyph-name="rss-1" unicode="&#xe8c8;" d="m0 730q314 0 537-223t223-537l-118 0q0 266-188 453t-454 187l0 120z m0-238q218 0 371-153t153-369l-118 0q0 166-119 285t-287 119l0 118z m114-296q46 0 80-33t34-81q0-46-34-79t-80-33t-80 33t-34 79q0 48 34 81t80 33z" horiz-adv-x="760" />
147
+ <glyph glyph-name="cog" unicode="&#xe832;" d="m760 350q0-72 80-122q-12-40-34-82q-70 18-136-44q-54-58-34-136q-40-20-84-36q-46 82-132 82t-132-82q-44 16-84 36q20 80-34 136q-54 54-136 34q-14 26-34 82q82 52 82 132q0 72-82 124q20 56 34 82q74-18 136 44q54 56 34 136q42 22 84 34q46-80 132-80t132 80q42-12 84-34q-20-78 34-136q66-62 136-44q22-42 34-82q-80-50-80-124z m-340-182q76 0 129 53t53 129t-53 130t-129 54t-129-54t-53-130t53-129t129-53z" horiz-adv-x="840" />
148
+ <glyph glyph-name="tools" unicode="&#xe815;" d="m155 506q-8-8-11-22t-3-25t-2-11q-2-2-17-15t-19-17q-16-14-28 4l-70 76q-11 12 2 24q2 2 18 14t20 16q6 6 27 6t37 14q14 14 18 38t10 30q2 0 9 7t26 22t41 31q134 90 186 96q122 0 148-2q12 0-8-8q-120-52-152-76q-80-56-36-114q34-46 38-48q8-8-2-14q-2-2-38-35t-38-35q-14-8-18-4q-42 48-71 60t-67-12z m286-26l410-476q18-22-2-38l-48-42q-22-14-38 4l-414 472q-8 8 0 20l72 62q12 8 20-2z m554 202q16-104-16-166q-50-88-154-62q-56 12-100-32l-82-78l-68 78l68 70q24 24 31 53t6 65t5 58q12 56 140 112q12 6 18-3t2-15q-12-12-46-80q-14-10-12-35t40-53q58-40 96 22q6 12 26 41t22 33q4 10 13 9t11-17z m-858-684l254 248l76-86l-246-242q-20-20-38-4l-46 46q-22 18 0 38z" horiz-adv-x="1000" />
149
+ <glyph glyph-name="basket" unicode="&#xe812;" d="m150 0q0 40 30 70t70 30q42 0 71-30t29-70q0-42-29-71t-71-29q-40 0-70 29t-30 71z m500 0q0 40 30 70t70 30q42 0 71-30t29-70q0-42-29-71t-71-29q-40 0-70 29t-30 71z m-322 236q-36-10-34-23t44-13l562 0l0-76q0-20-20-20l-654 0q-20 0-20 20l0 76l-10 46l-98 454l-98 0l0 80q0 20 20 20l156 0q20 0 20-20l0-86l704 0l0-274q0-22-18-26z" horiz-adv-x="900" />
150
+ <glyph glyph-name="login" unicode="&#xe833;" d="m800 800q42 0 71-29t29-71l0-700q0-40-29-70t-71-30l-450 0q-40 0-69 30t-29 70l0 100l98 0l0-100l450 0l0 700l-450 0l0-150l-98 0l0 150q0 42 29 71t69 29l450 0z m-350-670l0 120l-450 0l0 150l450 0l0 120l200-194z" horiz-adv-x="900" />
151
+ <glyph glyph-name="logout" unicode="&#xe834;" d="m502 0l0 100l98 0l0-100q0-40-29-70t-71-30l-400 0q-40 0-70 30t-30 70l0 700q0 42 30 71t70 29l400 0q42 0 71-29t29-71l0-150l-98 0l0 150l-402 0l0-700l402 0z m398 326l-198-196l0 120l-450 0l0 150l450 0l0 120z" horiz-adv-x="900" />
152
+ <glyph glyph-name="resize-full" unicode="&#xe816;" d="m476 746l316 0l0-316l-100 124l-146-152l-100 100l152 146z m-230-444l100-100l-152-146l122-100l-316 0l0 316l100-122z" horiz-adv-x="792" />
153
+ <glyph glyph-name="popup" unicode="&#xe828;" d="m700 750q42 0 71-29t29-71l0-400q0-40-29-70t-71-30l-400 0q-40 0-70 30t-30 70l0 402q0 40 29 69t71 29l400 0z m0-500l0 400l-400 0l0-400l400 0z m-600 100l0-300l300 0l0-100l-300 0q-40 0-70 30t-30 70l0 300l100 0z" horiz-adv-x="800" />
154
+ <glyph glyph-name="arrow-combo" unicode="&#xe827;" d="m230 850l230-364l-460 0z m0-1000l-230 366l460 0z" horiz-adv-x="460" />
155
+ <glyph glyph-name="left-open-1" unicode="&#xe82a;" d="m242 626q14 16 39 16t41-16q38-36 0-80l-186-196l186-194q38-44 0-80q-16-16-40-16t-40 16l-226 236q-16 16-16 38q0 24 16 40q206 214 226 236z" horiz-adv-x="341" />
156
+ <glyph glyph-name="right-open-1" unicode="&#xe82b;" d="m98 626l226-236q16-16 16-40q0-22-16-38l-226-236q-16-16-40-16t-40 16q-36 36 0 80l186 194l-186 196q-36 44 0 80q16 16 41 16t39-16z" horiz-adv-x="340" />
157
+ <glyph glyph-name="left-open-mini" unicode="&#xe822;" d="m252 180q26-26 0-48q-26-26-48 0l-192 194q-24 24 0 50l192 194q22 26 48 0q26-22 0-48l-156-172z" horiz-adv-x="265" />
158
+ <glyph glyph-name="right-open-mini" unicode="&#xe823;" d="m13 180l158 170l-158 172q-26 26 0 48q26 26 48 0l192-194q24-26 0-50l-192-194q-22-26-48 0q-26 22 0 48z" horiz-adv-x="265" />
159
+ <glyph glyph-name="left-open-big" unicode="&#xe824;" d="m452-20q26-26 0-48q-26-26-48 0l-392 394q-24 24 0 50l392 394q22 26 48 0q26-22 0-48l-358-372z" horiz-adv-x="465" />
160
+ <glyph glyph-name="right-open-big" unicode="&#xe825;" d="m13-20l358 370l-358 372q-26 26 0 48q26 26 48 0l392-394q24-26 0-50l-392-394q-22-26-48 0q-26 22 0 48z" horiz-adv-x="465" />
161
+ <glyph glyph-name="left" unicode="&#xe836;" d="m378 20l-378 330l378 330l0-190l352 0l0-278l-352 0l0-192z" horiz-adv-x="730" />
162
+ <glyph glyph-name="right" unicode="&#xe826;" d="m350 680l380-330l-380-330l0 192l-350 0l0 278l350 0l0 190z" horiz-adv-x="730" />
163
+ <glyph glyph-name="ccw" unicode="&#xe808;" d="m532 736q170 0 289-120t119-290t-119-290t-289-120q-142 0-252 88l70 74q84-60 182-60q126 0 216 90t90 218t-90 218t-216 90q-124 0-214-87t-92-211l142 0l-184-204l-184 204l124 0q2 166 122 283t286 117z" horiz-adv-x="940" />
164
+ <glyph glyph-name="cw" unicode="&#xe8c9;" d="m408 760q168 0 287-116t123-282l122 0l-184-206l-184 206l144 0q-4 124-94 210t-214 86q-126 0-216-90t-90-218q0-126 90-216t216-90q104 0 182 60l70-76q-110-88-252-88q-168 0-288 120t-120 290t120 290t288 120z" horiz-adv-x="940" />
165
+ <glyph glyph-name="arrows-ccw" unicode="&#xe806;" d="m186 140l116 116l0-292l-276 16l88 86q-116 122-114 290t120 288q100 100 240 116l4-102q-100-16-172-88q-88-88-90-213t84-217z m332 598l276-16l-88-86q116-122 114-290t-120-288q-96-98-240-118l-2 104q98 16 170 88q88 88 90 213t-84 217l-114-116z" horiz-adv-x="820" />
166
+ <glyph glyph-name="level-down" unicode="&#xe8a3;" d="m100 200q-42 0-71 30t-29 70l0 350l140 0l0-310l364 0l0 150l240-220l-240-220l0 150l-404 0z" horiz-adv-x="744" />
167
+ <glyph glyph-name="level-up" unicode="&#xe8a4;" d="m200 350l0-90l-200 160l200 170l0-100l550 0q40 0 70-29t30-71l0-280l-140 0l0 240l-510 0z" horiz-adv-x="850" />
168
+ <glyph glyph-name="shuffle" unicode="&#xe814;" d="m754 516q-54 0-105-32t-80-66t-83-104q-48-62-75-94t-78-77t-107-66t-122-21l-104 0l0 140l104 0q54 0 106 32t81 66t83 104q62 82 101 126t116 88t163 44l36 0l0 120l210-180l-210-180l0 100l-36 0z m-484-88q-74 78-166 78l-104 0l0 140l104 0q140 0 254-108q-14-16-37-45t-27-33q-8-12-24-32z m520-242l0 100l210-180l-210-180l0 120l-36 0q-140 0-260 116q46 58 72 92q0 2 6 9t8 11q84-88 174-88l36 0z" horiz-adv-x="1000" />
169
+ <glyph glyph-name="palette" unicode="&#xe829;" d="m857 622q72-48 101-110t20-104t-35-48q-16-4-54 10t-80 10t-80-46q-30-46-21-75t34-65t23-50q-2-26-36-63t-126-74t-216-37q-186 0-291 101t-95 245q8 118 104 235t216 151q290 84 536-80z m-318-466q30 0 52 22t22 54t-22 53t-52 21q-32 0-54-21t-22-53t22-54t54-22z" horiz-adv-x="980" />
170
+ <glyph glyph-name="list-add" unicode="&#xe80c;" d="m350 400q22 0 36-15t14-35t-15-35t-35-15l-300 0q-20 0-35 15t-15 35t14 35t36 15l300 0z m0-200q22 0 36-15t14-35t-15-35t-35-15l-300 0q-20 0-35 15t-15 35t14 35t36 15l300 0z m620 200q30 0 30-50t-30-50l-170 0l0-170q0-30-50-30t-50 30l0 170l-164 0q-30 0-30 50t30 50l164 0l0 170q0 30 50 30t50-30l0-170l170 0z m-620 200q22 0 36-15t14-35t-15-35t-35-15l-300 0q-20 0-35 15t-15 35t14 35t36 15l300 0z" horiz-adv-x="1000" />
171
+ <glyph glyph-name="back-in-time" unicode="&#xe821;" d="m532 760q170 0 289-120t119-290t-119-290t-289-120q-138 0-252 88l70 76q82-60 182-60q126 0 216 90t90 216q0 128-90 218t-216 90q-124 0-213-86t-93-210l142 0l-184-206l-184 206l124 0q4 166 123 282t285 116z m-36-190l70 0l0-204l130-130l-50-50l-150 150l0 234z" horiz-adv-x="940" />
172
+ <glyph glyph-name="monitor" unicode="&#xe81b;" d="m900 790q42 0 71-30t29-70l0-550q0-42-29-77t-69-43l-218-44l86-38q50-28-20-28l-500 0q-98 0 32 52l36 14l-220 44q-40 8-69 43t-29 77l0 550q0 40 30 70t70 30l800 0z m0-646l0 556l-800 0l0-556l800 0z" horiz-adv-x="1000" />
173
+ <glyph glyph-name="paper-plane" unicode="&#xe8ad;" d="m894 720q14 4 22-3t4-19q-2-6-72-310t-74-316q-2-14-14-19t-24 1l-248 134l-30 16l22 26q388 420 394 426q4 4-1 9t-9 1l-550-402l-112 44l-190 76q-12 4-12 12t12 12q8 4 441 157t441 155z m-582-728l0 204l160-82q-130-116-142-128q-18-14-18 6z" horiz-adv-x="921" />
174
+ <glyph glyph-name="brush" unicode="&#xe8ae;" d="m118 170q38 34 85 29t87-45q42-40 48-87t-30-83q-86-84-228-102q-84-12-80 14q0 4 6 10q52 60 64 145t48 119z m840 646q26-26-148-248t-292-338q-38-38-124-104q-8-6-16 8q-18 34-48 64q-32 32-66 48q-16 6-8 16q64 84 104 122q118 116 344 287t254 145z" horiz-adv-x="962" />
175
+ <glyph glyph-name="droplet" unicode="&#xe81c;" d="m290 822q14-118 60-219t92-159t82-136t36-160q0-114-83-196t-197-82t-197 82t-83 196q0 82 36 160t82 136t92 159t60 219q2 8 11 8t9-8z m-42-392q2 4-2 14q-6 6-14 6t-12-6l-40-58q-32-46-48-70t-34-75t-18-101q0-24 17-41t41-17q58 0 58 68q0 94 42 246q2 6 5 17t5 17z" horiz-adv-x="560" />
176
+ <glyph glyph-name="clipboard" unicode="&#xe8b0;" d="m630 750q28 0 49-21t21-49l0-760q0-30-21-50t-49-20l-560 0q-28 0-49 20t-21 50l0 760q0 28 21 49t49 21l60-150l440 0z m-100-100l-360 0l-44 100l108 0l36 100l160 0l36-100l110 0z" horiz-adv-x="700" />
177
+ <glyph glyph-name="megaphone" unicode="&#xe8b1;" d="m792 500q58-138 67-258t-39-140q-28-12-61 3t-65 40t-99 41t-149 8q-28-4-42-19t-6-37q22-56 46-108q4-10 24-22t24-20q14-34-22-46q-50-22-102-40q-30-10-54 42q-32 76-58 132q-6 12-34 17t-46 31q-30-10-38-14q-34-12-74 12t-54 60q-17 32-5 79t43 61q126 52 213 108t124 103t59 92t25 78t15 59t36 36q48 20 130-70t142-228z m-28-300q8 4 10 38t-11 98t-41 128q-28 66-67 123t-67 84t-36 23t-10-42t10-105t40-133t68-119t68-76t36-19z" horiz-adv-x="860" />
178
+ <glyph glyph-name="key" unicode="&#xe8af;" d="m774 612q20-116-28-215t-150-117q-66-12-130-2l-118-194l-70-12l-104-166q-14-28-46-32l-76-14q-12-4-22 4t-12 22l-16 98q-8 30 12 56l258 386q-24 50-38 120q-18 106 53 187t185 101q106 20 195-45t107-177z m-126-76q30 44 21 97t-51 83q-42 32-92 22t-80-54q-8-12-12-23t-1-20t5-16t13-17t18-15t22-16t23-17q6-4 22-16t23-16t19-12t19-8t17 1t18 8t16 19z" horiz-adv-x="780" />
179
+ <glyph glyph-name="github" unicode="&#xe8b3;" d="m620 286q26 0 45-26t19-64t-19-64t-45-26q-28 0-47 26t-19 64t19 64t47 26z m226 234q74-80 74-194q0-74-17-133t-43-96t-64-65t-70-41t-73-20t-62-8t-45-1q-6 0-36-1t-50-1t-50 1t-36 1q-24 0-45 1t-62 8t-73 20t-70 41t-64 65t-43 96t-17 133q0 114 74 194q-8 4-1 80t33 140q92-10 228-104q46 12 126 12q84 0 126-12q62 42 119 68t83 30l26 6q26-64 33-140t-1-80z m-384-514q166 0 251 40t85 164q0 72-54 120q-28 26-65 32t-113 0t-104-6l-4 0q-32 0-83 4t-80 5t-63-7t-56-28q-52-46-52-120q0-124 84-164t250-40l4 0z m-160 280q26 0 45-26t19-64t-19-64t-45-26q-28 0-47 26t-19 64t19 64t47 26z" horiz-adv-x="920" />
180
+ <glyph glyph-name="github-circled" unicode="&#xe8b4;" d="m480 354q16 0 42 2t41 2t32-4t29-14q26-26 26-60q0-64-43-84t-127-20t-127 20t-43 84q0 34 26 60q12 10 29 14t32 4t41-2t42-2z m-80-128q14 0 23 14t9 32q0 46-32 46t-32-46q0-18 9-32t23-14z m160 0q14 0 24 14t10 32q0 20-10 33t-24 13q-32 0-32-46q0-18 9-32t23-14z m-80 604q200 0 340-140t140-340q0-198-140-339t-340-141q-198 0-339 141t-141 339q0 200 141 340t339 140z m44-676q188 0 188 184q0 56-38 98q4 4 1 41t-17 71q-44-6-114-52q-20 6-64 6q-40 0-64-6q-30 20-59 33t-41 17l-14 2q-14-34-17-71t1-41q-38-42-38-98q0-184 188-184l88 0z" horiz-adv-x="960" />
181
+ <glyph glyph-name="flickr" unicode="&#xe8b2;" d="m196 150q-80 0-138 59t-58 141q0 84 57 142t139 58t139-58t57-142q0-82-58-141t-138-59z m508 0q-80 0-138 59t-58 141q0 84 57 142t139 58t139-58t57-142q0-82-58-141t-138-59z" horiz-adv-x="900" />
182
+ <glyph glyph-name="flickr-circled" unicode="&#xe8b5;" d="m480 830q200 0 340-140t140-340q0-198-140-339t-340-141q-198 0-339 141t-141 339q0 200 141 340t339 140z m-128-580q40 0 70 30t30 70q0 42-30 72t-70 30t-70-30t-30-72q0-40 30-70t70-30z m256 0q42 0 71 30t29 70q0 42-29 72t-71 30q-40 0-69-30t-29-72q0-40 29-70t69-30z" horiz-adv-x="960" />
183
+ <glyph glyph-name="vimeo" unicode="&#xe8b6;" d="m896 558q-32-186-171-351t-245-237q-42-28-81-17t-66 38t-43 61q-16 32-78 239t-74 223q-16 12-38 5t-44-21l-20-14l-36 50q18 20 46 52t100 89t124 67q30 6 53-7t36-35t23-60t15-70t12-75t13-67q14-54 21-80t17-54t18-39t18-11q40 0 126 166q42 76 6 124t-112 2q22 126 140 188q104 54 182 8q80-46 58-174z" horiz-adv-x="901" />
184
+ <glyph glyph-name="vimeo-circled" unicode="&#xe8b7;" d="m480 830q200 0 340-140t140-340q0-198-140-339t-340-141q-198 0-339 141t-141 339q0 200 141 340t339 140z m220-386q14 82-48 94q-60 14-110-40q-28-28-34-66q38 24 56-1t-2-63q-44-84-64-84q-14 0-36 94q-4 14-8 40t-8 45t-12 39t-20 29t-30 5q-26-6-60-32t-56-50l-20-24l18-24q4 4 10 8t22 10t20-2q6-8 37-113t39-121q14-28 38-43t58 1q54 36 124 120t86 178z" horiz-adv-x="960" />
185
+ <glyph glyph-name="twitter-1" unicode="&#xe8b8;" d="m920 636q-36-54-94-98l0-24q0-130-60-250t-186-203t-290-83q-160 0-290 84q14-2 46-2q132 0 234 80q-62 2-110 38t-66 94q10-4 34-4q26 0 50 6q-66 14-108 66t-42 120l0 2q36-20 84-24q-84 58-84 158q0 48 26 94q154-188 390-196q-6 18-6 42q0 78 55 133t135 55q82 0 136-58q60 12 120 44q-20-66-82-104q56 8 108 30z" horiz-adv-x="920" />
186
+ <glyph glyph-name="twitter-circled" unicode="&#xe8b9;" d="m480 830q200 0 340-140t140-340q0-198-140-339t-340-141q-198 0-339 141t-141 339q0 200 141 340t339 140z m196-392q30 22 46 48q-32-12-54-14q30 18 42 52q-30-16-60-22q-28 28-70 28q-40 0-67-28t-27-66q0-2 1-10t1-12q-120 6-194 100q-14-24-14-48q0-50 44-78q-26 0-44 12l0-2q0-34 21-60t55-32q-16-4-24-4q-12 0-18 2q20-66 88-66q-50-40-118-40l-22 0q68-42 144-42q122 0 196 83t74 187l0 12z" horiz-adv-x="960" />
187
+ <glyph glyph-name="facebook-1" unicode="&#xe8ba;" d="m500 644l-142 0q-14 0-25-15t-11-37l0-102l178 0l0-148l-178 0l0-442l-170 0l0 442l-152 0l0 148l152 0l0 86q0 94 59 159t147 65l142 0l0-156z" horiz-adv-x="500" />
188
+ <glyph glyph-name="facebook-circled" unicode="&#xe8bb;" d="m480 830q200 0 340-140t140-340q0-198-140-339t-340-141t-340 141t-140 339q0 200 140 340t340 140z m114-330l0 78l-72 0q-44 0-74-33t-30-81l0-44l-76 0l0-74l76 0l0-222l86 0l0 222l90 0l0 74l-90 0l0 52q0 28 18 28l72 0z" horiz-adv-x="960" />
189
+ <glyph glyph-name="facebook-squared" unicode="&#xe8bc;" d="m752 770q44 0 76-31t32-75l0-646q0-44-32-76t-76-32l-162 0l0 310l114 0l0 134l-114 0l0 70q0 30 28 30l86 0l0 152l-96 0q-74 0-124-54t-50-132l0-66l-104 0l0-134l104 0l0-310l-326 0q-44 0-76 32t-32 76l0 646q0 44 32 75t76 31l644 0z" horiz-adv-x="860" />
190
+ <glyph glyph-name="gplus-1" unicode="&#xe8bd;" d="m48 572q0 58 25 102t56 65t69 34t56 15t26 2l230 0l0-4q0-22-78-36q-28 0-38-6q40-20 54-56t14-96q0-102-68-158q-38-38-38-54q0-18 50-64q104-90 104-178q0-140-116-194q-68-34-150-34l-4 0l-4 2q-2-2-4-2q-24 0-54 5t-75 21t-74 57t-29 103q0 60 32 101t83 57t88 22t71 6l2 0q-16 22-24 47t-8 39l2 14l-14 0q-64 0-110 30q-74 44-74 160z m370-452q-4 52-43 84t-103 32l-16 0q-64-2-114-46q-46-42-42-94t53-80t119-24q68 4 109 40t37 88z m-60 500q-30 108-122 108q-12 0-20-2q-40-12-58-62q-16-50-2-106q14-52 47-85t71-33q12 0 18 2q42 12 63 65t3 113z m388-174l150 0l0-94l-150 0l0-150l-94 0l0 150l-150 0l0 94l150 0l0 150l94 0l0-150z" horiz-adv-x="896" />
191
+ <glyph glyph-name="gplus-circled" unicode="&#xe8be;" d="m434 486q8-30-1-57t-31-33l-10 0q-42 0-60 60q-6 30 2 54q10 24 30 30q2 2 10 2q44 0 60-56z m46 344q200 0 340-140t140-340q0-198-140-339t-340-141q-198 0-339 141t-141 339q0 200 141 340t339 140z m-28-686q60 30 60 98q0 44-52 92q-26 22-26 32q0 12 20 26q34 34 34 80q0 58-36 78q2 2 10 3t10 1q40 4 40 16l0 4l-116 0q-12 0-33-4t-53-32t-32-76q0-56 38-80q22-16 56-16l6 0q-4-24 16-50l-2 0q-138 0-138-94q0-40 28-63t49-27t39-4l8 0q40 0 74 16z m254 208l0 48l-76 0l0 76l-48 0l0-76l-76 0l0-48l76 0l0-76l48 0l0 76l76 0z m-314-58q32 0 52-17t22-43t-19-44t-55-20q-34-4-60 11t-28 41q0 26 22 48q20 20 58 24l8 0z" horiz-adv-x="960" />
192
+ <glyph glyph-name="pinterest" unicode="&#xe8bf;" d="m320 190q-26-130-58-211t-96-129q-6 74-7 120t11 110t22 104t26 99t24 99q-24 52-19 116t48 106t99 20q40-16 44-59t-13-95t-32-103t-4-90t63-49q68-14 121 38t74 131t11 163t-54 128q-62 64-151 70t-163-33t-120-117t-32-170q4-22 22-52t21-47t-17-67q-146 34-140 230q4 138 105 234t233 112q164 18 290-57t144-219q26-176-66-317t-252-129q-22 2-42 9t-30 13t-31 21t-31 21z" horiz-adv-x="778" />
193
+ <glyph glyph-name="pinterest-circled" unicode="&#xe8c0;" d="m480 830q200 0 340-140t140-340q0-198-140-339t-340-141t-340 141t-140 339q0 200 140 340t340 140z m32-592q82-8 128 64t34 162q-10 72-74 110t-146 28q-66-8-117-56t-53-118q-4-100 70-116q10 24 9 33t-10 24t-11 27q-14 96 78 144t158-18q48-48 20-148t-98-86q-40 8-33 54t24 86t-21 60q-42 18-65-33t1-89q-4-20-21-83t-18-87t1-98q52 38 78 172q46-30 66-32z" horiz-adv-x="960" />
194
+ <glyph glyph-name="tumblr-1" unicode="&#xe8c1;" d="m560-58q-48-26-106-40q-48-12-102-12q-58 0-110 16q-54 20-82 46q-36 32-46 64q-14 30-14 96l0 322l-100 0l0 130q54 18 92 50t62 80q24 52 30 116l130 0l0-232l216 0l0-144l-216 0l0-236q0-84 8-102q10-24 32-36q28-20 68-20q68 0 138 46l0-144z" horiz-adv-x="560" />
195
+ <glyph glyph-name="tumblr-circled" unicode="&#xe8c2;" d="m480 830q200 0 340-140t140-340q0-198-140-339t-340-141q-198 0-339 141t-141 339q0 200 141 340t339 140z m130-686l0 74q-36-24-70-24q-16 0-36 10q-12 8-14 18q-6 12-6 52l0 118l110 0l0 74l-110 0l0 118l-64 0q-8-42-16-60q-10-22-32-40t-46-26l0-66l50 0l0-162q0-28 8-48q6-16 24-32q14-14 40-24q32-8 56-8q28 0 52 6q28 6 54 20z" horiz-adv-x="960" />
196
+ <glyph glyph-name="linkedin" unicode="&#xe8c3;" d="m204 698q0-40-29-68t-75-28q-44 0-72 28t-28 68q0 42 28 69t74 27t73-27t29-69z m-198-790l0 618l192 0l0-618l-192 0z m306 420q0 86-4 198l166 0l10-86l4 0q60 100 190 100q100 0 161-67t61-199l0-366l-192 0l0 342q0 134-98 134q-70 0-98-72q-6-12-6-48l0-356l-194 0l0 420z" horiz-adv-x="900" />
197
+ <glyph glyph-name="linkedin-circled" unicode="&#xe8c4;" d="m480 830q200 0 340-140t140-340q0-198-140-339t-340-141q-198 0-339 141t-141 339q0 200 141 340t339 140z m-118-678l0 312l-96 0l0-312l96 0z m-48 352q52 0 52 48t-52 48q-22 0-37-14t-15-34q0-48 52-48z m404-352l0 184q0 66-31 101t-81 35q-66 0-96-50l-2 0l-6 42l-84 0q2-28 2-100l0-212l98 0l0 180q0 18 4 24q12 38 50 38q48 0 48-68l0-174l98 0z" horiz-adv-x="960" />
198
+ <glyph glyph-name="dribbble" unicode="&#xe8c5;" d="m438 480q-30 54-66 109t-56 84t-24 33q-82-40-139-112t-77-162q182 0 362 48z m50-132q8 4 14 4q-10 28-32 68q-182-56-402-56l0-14q0-150 100-262q4 8 13 21t39 50t64 69t89 66t115 54z m-270-306q-2 0-4 2l-4 4z m148 690z m354-86q-114 98-260 98q-48 0-92-12q82-108 146-228q138 52 204 140z m-260-756q-190 0-325 135t-135 325t135 325t325 135t325-135t135-325t-135-325t-325-135z m68 396q-216-74-308-242l-2-2q110-84 242-84q78 0 154 32q-24 140-84 298z m16 158q12-24 26-56q2-2 5-9t5-11q66 8 129 4t101-10t42-8q0 138-88 246l-8-10q-8-10-26-27t-42-36t-62-42t-82-41z m60-138q52-148 76-280q140 92 168 262q-8 4-39 11t-88 12t-117-5z" horiz-adv-x="920" />
199
+ <glyph glyph-name="dribbble-circled" unicode="&#xe8c6;" d="m494 352q-44-14-82-44t-55-51t-25-35q-48 58-48 128l0 4q106 0 200 28l14-28z m114 148q-32-42-100-68q-26 48-70 110q14 4 42 4q72 0 128-46z m-246-304q40 80 152 120q34-92 40-146q-36-16-74-16q-68 0-118 42z m104 222q-92-24-176-24q18 92 104 134q32-40 72-110z m90-92q12 2 38 2q30 0 80-10q-16-82-82-128q-6 56-36 136z m-76 504q200 0 340-140t140-340q0-198-140-339t-340-141q-198 0-339 141t-141 339q0 200 141 340t339 140z m0-714q98 0 167 69t69 165q0 98-69 167t-167 69t-166-69t-68-167q0-96 68-165t166-69z m46 282q72 28 108 74q42-52 42-116q-48 8-90 8q-30 0-44-2q-2 2-2 4q0 4-2 4q-2 4-6 13t-6 15z" horiz-adv-x="960" />
200
+ <glyph glyph-name="picasa" unicode="&#xe8c7;" d="m250 760q10-12 158-144l-396-362q-12 48-12 96q0 130 67 240t183 170z m400 10l0-278l-328 296q64 22 138 22q98 0 190-40z m70-40q94-64 147-165t53-215q0-80-26-152l-174 0l0 532z m-686-550q12 12 66 60l102 92l0-362q-116 80-168 210z m238-250l0 198l590 0q-56-100-151-163t-209-75l-84 0q-84 10-146 40z" horiz-adv-x="920" />
201
+ <glyph glyph-name="ok-1" unicode="&#xe811;" d="m625 676q38-20 49-63t-9-80l-260-469q-30-53-91-53q-43 0-74 31l-209 207q-31 32-31 74t31 74t74 31t74-31l111-110l193 347q20 38 62 50t80-8z" horiz-adv-x="679" />
202
+ <glyph glyph-name="doc" unicode="&#xe809;" d="m818 595q16-16 16-36l0-521q0-65-46-111t-110-46l-522 0q-65 0-110 46t-46 111l0 625q0 65 46 110t110 46l417 0q22 0 37-15z m-110-36l-135 134l0-56q0-32 23-55t55-23l57 0z m-30-574q21 0 36 16t15 37l0 469l-78 0q-53 0-92 38t-38 92l0 78l-365 0q-21 0-37-15t-15-37l0-625q0-21 15-37t37-16l522 0z" horiz-adv-x="834" />
203
+ <glyph glyph-name="left-open-outline" unicode="&#xe82e;" d="m638 91q0-64-47-111t-110-46q-65 0-110 45l-371 372l371 371q44 44 111 44t111-44q45-45 45-111q0-65-45-110l-150-150l150-150q45-45 45-110z m-490 260l297-298q15-15 37-15t37 15t15 38q0 21-15 36l-224 224l224 223q15 15 15 37q0 22-15 37t-37 15t-37-15z" horiz-adv-x="638" />
204
+ <glyph glyph-name="left-open-2" unicode="&#xe82c;" d="m481 684q32-31 32-74t-32-74l-186-186l186-186q32-31 32-74t-32-74t-73-31t-74 31l-334 334l334 334q30 31 74 31t73-31z" horiz-adv-x="513" />
205
+ <glyph glyph-name="right-open-outline" unicode="&#xe82f;" d="m156-66q-63 0-110 46t-46 111t46 110l150 150l-150 150q-46 46-46 110q0 65 46 111q44 44 110 44t110-44l372-371l-372-372q-45-45-110-45z m0 729q-21 0-37-16t-15-36q0-20 16-37l223-223l-223-224q-16-16-16-36q0-22 16-38q15-15 36-15t37 15l297 298l-297 297q-15 15-37 15z" horiz-adv-x="638" />
206
+ <glyph glyph-name="right-open-2" unicode="&#xe82d;" d="m31 684q30 31 74 31t74-31l335-334l-335-334q-31-31-74-31t-74 31t-31 74t31 74l188 186l-188 186q-31 32-31 74t31 74z" horiz-adv-x="514" />
207
+ <glyph glyph-name="equalizer" unicode="&#xe83a;" d="m576 239l0-112l-55 0l0-167q0-23-17-40t-39-17t-39 17t-17 40l0 167l-56 0l0 112l56 0l0 503q0 24 17 39t38 16q24 0 41-16t16-39l0-503l55 0z m335 335l0-112l-55 0l0-502q0-23-16-40t-41-17q-23 0-39 17t-16 40l0 502l-56 0l0 112l56 0l0 168q0 24 16 39t39 16t41-16t16-39l0-168l55 0z m-670-112l0-111l-55 0l0-391q0-23-16-40t-40-17q-23 0-39 17t-17 40l0 391l-56 0l0 111l56 0l0 280q0 24 16 39t40 16t40-16t16-39l0-280l55 0z" horiz-adv-x="928" />
208
+ <glyph glyph-name="layers-alt" unicode="&#xe804;" d="m18 127l446-111l447 111l0-111l-447-113l-446 113l0 111z m0 224l446-112l447 112l0-112l-447-112l-446 112l0 112z m0 223l446-112l447 112l0-112l-447-111l-446 111l0 112z m0 223l446-112l447 112l0-112l-447-111l-446 111l0 112z" horiz-adv-x="928" />
209
+ <glyph glyph-name="pencil-1" unicode="&#xe831;" d="m795 731c50-46 44-118-4-165l-46-46s35 53-37 123c-64 64-124 37-124 37l49 48c43 45 120 45 162 3z m-89-250l-492-493l-210-51l-4 4l55 210l493 490c8 2 30 9 60 2l-523-522l-15-55l60-60l56 15l25 24l3 56l-40 40l479 479c7-7 7-7 15-15c71-70 38-124 38-124z" horiz-adv-x="830" />
210
+ <glyph glyph-name="align-justify" unicode="&#xe861;" d="m1000 100v-71q0-15-11-25t-25-11h-928q-15 0-25 11t-11 25v71q0 15 11 25t25 11h928q15 0 25-11t11-25z m0 214v-71q0-15-11-25t-25-11h-928q-15 0-25 11t-11 25v71q0 15 11 25t25 11h928q15 0 25-11t11-25z m0 215v-72q0-14-11-25t-25-11h-928q-15 0-25 11t-11 25v72q0 14 11 25t25 10h928q15 0 25-10t11-25z m0 214v-72q0-14-11-25t-25-10h-928q-15 0-25 10t-11 25v72q0 14 11 25t25 11h928q15 0 25-11t11-25z" horiz-adv-x="1000" />
211
+ </font>
212
+ </defs>
213
+ </svg>
css/font/egfont.ttf ADDED
Binary file
css/font/egfont.woff ADDED
Binary file
css/font/index.html ADDED
File without changes
css/index.html ADDED
File without changes
css/jui/index.html ADDED
File without changes
css/jui/new/images/ui-bg_flat_0_aaaaaa_40x100.png ADDED
Binary file
css/jui/new/images/ui-bg_flat_75_ffffff_40x100.png ADDED
Binary file
css/jui/new/images/ui-bg_glass_55_fbf9ee_1x400.png ADDED
Binary file
css/jui/new/images/ui-bg_glass_65_ffffff_1x400.png ADDED
Binary file
css/jui/new/images/ui-bg_glass_75_dadada_1x400.png ADDED
Binary file
css/jui/new/images/ui-bg_glass_75_e6e6e6_1x400.png ADDED
Binary file
css/jui/new/images/ui-bg_glass_95_fef1ec_1x400.png ADDED
Binary file
css/jui/new/images/ui-bg_highlight-soft_75_cccccc_1x100.png ADDED
Binary file
css/jui/new/images/ui-icons_222222_256x240.png ADDED
Binary file
css/jui/new/images/ui-icons_2e83ff_256x240.png ADDED
Binary file
css/jui/new/images/ui-icons_454545_256x240.png ADDED
Binary file
css/jui/new/images/ui-icons_888888_256x240.png ADDED
Binary file
css/jui/new/images/ui-icons_cd0a0a_256x240.png ADDED
Binary file
css/jui/new/index.html ADDED
File without changes
css/jui/new/jquery-ui-1.9.2.custom.css ADDED
@@ -0,0 +1,462 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*! jQuery UI - v1.9.2 - 2012-12-05
2
+ * http://jqueryui.com
3
+ * Includes: jquery.ui.core.css, jquery.ui.resizable.css, jquery.ui.selectable.css, jquery.ui.accordion.css, jquery.ui.autocomplete.css, jquery.ui.button.css, jquery.ui.datepicker.css, jquery.ui.dialog.css, jquery.ui.menu.css, jquery.ui.progressbar.css, jquery.ui.slider.css, jquery.ui.spinner.css, jquery.ui.tabs.css, jquery.ui.tooltip.css
4
+ * To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Verdana%2CArial%2Csans-serif&fwDefault=normal&fsDefault=1.1em&cornerRadius=4px&bgColorHeader=cccccc&bgTextureHeader=03_highlight_soft.png&bgImgOpacityHeader=75&borderColorHeader=aaaaaa&fcHeader=222222&iconColorHeader=222222&bgColorContent=ffffff&bgTextureContent=01_flat.png&bgImgOpacityContent=75&borderColorContent=aaaaaa&fcContent=222222&iconColorContent=222222&bgColorDefault=e6e6e6&bgTextureDefault=02_glass.png&bgImgOpacityDefault=75&borderColorDefault=d3d3d3&fcDefault=555555&iconColorDefault=888888&bgColorHover=dadada&bgTextureHover=02_glass.png&bgImgOpacityHover=75&borderColorHover=999999&fcHover=212121&iconColorHover=454545&bgColorActive=ffffff&bgTextureActive=02_glass.png&bgImgOpacityActive=65&borderColorActive=aaaaaa&fcActive=212121&iconColorActive=454545&bgColorHighlight=fbf9ee&bgTextureHighlight=02_glass.png&bgImgOpacityHighlight=55&borderColorHighlight=fcefa1&fcHighlight=363636&iconColorHighlight=2e83ff&bgColorError=fef1ec&bgTextureError=02_glass.png&bgImgOpacityError=95&borderColorError=cd0a0a&fcError=cd0a0a&iconColorError=cd0a0a&bgColorOverlay=aaaaaa&bgTextureOverlay=01_flat.png&bgImgOpacityOverlay=0&opacityOverlay=30&bgColorShadow=aaaaaa&bgTextureShadow=01_flat.png&bgImgOpacityShadow=0&opacityShadow=30&thicknessShadow=8px&offsetTopShadow=-8px&offsetLeftShadow=-8px&cornerRadiusShadow=8px
5
+ * Copyright (c) 2012 jQuery Foundation and other contributors Licensed MIT */
6
+
7
+ /* Layout helpers
8
+ ----------------------------------*/
9
+ .ui-helper-hidden { display: none; }
10
+ .ui-helper-hidden-accessible { border: 0; clip: rect(0 0 0 0); height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute; width: 1px; }
11
+ .ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; }
12
+ .ui-helper-clearfix:before, .ui-helper-clearfix:after { content: ""; display: table; }
13
+ .ui-helper-clearfix:after { clear: both; }
14
+ .ui-helper-clearfix { zoom: 1; }
15
+ .ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); }
16
+
17
+
18
+ /* Interaction Cues
19
+ ----------------------------------*/
20
+ .ui-state-disabled { cursor: default !important; }
21
+
22
+
23
+ /* Icons
24
+ ----------------------------------*/
25
+
26
+ /* states and images */
27
+ .ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; }
28
+
29
+
30
+ /* Misc visuals
31
+ ----------------------------------*/
32
+
33
+ /* Overlays */
34
+ .ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
35
+ .ui-resizable { position: relative;}
36
+ .ui-resizable-handle { position: absolute;font-size: 0.1px; display: block; }
37
+ .ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; }
38
+ .ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; left: 0; }
39
+ .ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px; left: 0; }
40
+ .ui-resizable-e { cursor: e-resize; width: 7px; right: -5px; top: 0; height: 100%; }
41
+ .ui-resizable-w { cursor: w-resize; width: 7px; left: -5px; top: 0; height: 100%; }
42
+ .ui-resizable-se { cursor: se-resize; width: 12px; height: 12px; right: 1px; bottom: 1px; }
43
+ .ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: -5px; bottom: -5px; }
44
+ .ui-resizable-nw { cursor: nw-resize; width: 9px; height: 9px; left: -5px; top: -5px; }
45
+ .ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: -5px; top: -5px;}.ui-selectable-helper { position: absolute; z-index: 100; border:1px dotted black; }
46
+ .ui-accordion .ui-accordion-header { display: block; cursor: pointer; position: relative; margin-top: 2px; padding: .5em .5em .5em .7em; zoom: 1; }
47
+ .ui-accordion .ui-accordion-icons { padding-left: 2.2em; }
48
+ .ui-accordion .ui-accordion-noicons { padding-left: .7em; }
49
+ .ui-accordion .ui-accordion-icons .ui-accordion-icons { padding-left: 2.2em; }
50
+ .ui-accordion .ui-accordion-header .ui-accordion-header-icon { position: absolute; left: .5em; top: 50%; margin-top: -8px; }
51
+ .ui-accordion .ui-accordion-content { padding: 1em 2.2em; border-top: 0; overflow: auto; zoom: 1; }
52
+ .ui-autocomplete {
53
+ position: absolute;
54
+ top: 0;
55
+ left: 0;
56
+ cursor: default;
57
+ }
58
+
59
+ /* workarounds */
60
+ * html .ui-autocomplete { width:1px; } /* without this, the menu expands to 100% in IE6 */
61
+ .ui-button { display: inline-block; position: relative; padding: 0; margin-right: .1em; cursor: pointer; text-align: center; zoom: 1; overflow: visible; } /* the overflow property removes extra width in IE */
62
+ .ui-button, .ui-button:link, .ui-button:visited, .ui-button:hover, .ui-button:active { text-decoration: none; }
63
+ .ui-button-icon-only { width: 2.2em; } /* to make room for the icon, a width needs to be set here */
64
+ button.ui-button-icon-only { width: 2.4em; } /* button elements seem to need a little more width */
65
+ .ui-button-icons-only { width: 3.4em; }
66
+ button.ui-button-icons-only { width: 3.7em; }
67
+
68
+ /*button text element */
69
+ .ui-button .ui-button-text { display: block; line-height: 1.4; }
70
+ .ui-button-text-only .ui-button-text { padding: .4em 1em; }
71
+ .ui-button-icon-only .ui-button-text, .ui-button-icons-only .ui-button-text { padding: .4em; text-indent: -9999999px; }
72
+ .ui-button-text-icon-primary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 1em .4em 2.1em; }
73
+ .ui-button-text-icon-secondary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 2.1em .4em 1em; }
74
+ .ui-button-text-icons .ui-button-text { padding-left: 2.1em; padding-right: 2.1em; }
75
+ /* no icon support for input elements, provide padding by default */
76
+ input.ui-button { padding: .4em 1em; }
77
+
78
+ /*button icon element(s) */
79
+ .ui-button-icon-only .ui-icon, .ui-button-text-icon-primary .ui-icon, .ui-button-text-icon-secondary .ui-icon, .ui-button-text-icons .ui-icon, .ui-button-icons-only .ui-icon { position: absolute; top: 50%; margin-top: -8px; }
80
+ .ui-button-icon-only .ui-icon { left: 50%; margin-left: -8px; }
81
+ .ui-button-text-icon-primary .ui-button-icon-primary, .ui-button-text-icons .ui-button-icon-primary, .ui-button-icons-only .ui-button-icon-primary { left: .5em; }
82
+ .ui-button-text-icon-secondary .ui-button-icon-secondary, .ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; }
83
+ .ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; }
84
+
85
+ /*button sets*/
86
+ .ui-buttonset { margin-right: 7px; }
87
+ .ui-buttonset .ui-button { margin-left: 0; margin-right: -.3em; }
88
+
89
+ /* workarounds */
90
+ button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra padding in Firefox */
91
+ .ui-datepicker { width: 17em; padding: .2em .2em 0; display: none; }
92
+ .ui-datepicker .ui-datepicker-header { position:relative; padding:.2em 0; }
93
+ .ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { position:absolute; top: 2px; width: 1.8em; height: 1.8em; }
94
+ .ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { top: 1px; }
95
+ .ui-datepicker .ui-datepicker-prev { left:2px; }
96
+ .ui-datepicker .ui-datepicker-next { right:2px; }
97
+ .ui-datepicker .ui-datepicker-prev-hover { left:1px; }
98
+ .ui-datepicker .ui-datepicker-next-hover { right:1px; }
99
+ .ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span { display: block; position: absolute; left: 50%; margin-left: -8px; top: 50%; margin-top: -8px; }
100
+ .ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; }
101
+ .ui-datepicker .ui-datepicker-title select { font-size:1em; margin:1px 0; }
102
+ .ui-datepicker select.ui-datepicker-month-year {width: 100%;}
103
+ .ui-datepicker select.ui-datepicker-month,
104
+ .ui-datepicker select.ui-datepicker-year { width: 49%;}
105
+ .ui-datepicker table {width: 100%; font-size: .9em; border-collapse: collapse; margin:0 0 .4em; }
106
+ .ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0; }
107
+ .ui-datepicker td { border: 0; padding: 1px; }
108
+ .ui-datepicker td span, .ui-datepicker td a { display: block; padding: .2em; text-align: right; text-decoration: none; }
109
+ .ui-datepicker .ui-datepicker-buttonpane { background-image: none; margin: .7em 0 0 0; padding:0 .2em; border-left: 0; border-right: 0; border-bottom: 0; }
110
+ .ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: pointer; padding: .2em .6em .3em .6em; width:auto; overflow:visible; }
111
+ .ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float:left; }
112
+
113
+ /* with multiple calendars */
114
+ .ui-datepicker.ui-datepicker-multi { width:auto; }
115
+ .ui-datepicker-multi .ui-datepicker-group { float:left; }
116
+ .ui-datepicker-multi .ui-datepicker-group table { width:95%; margin:0 auto .4em; }
117
+ .ui-datepicker-multi-2 .ui-datepicker-group { width:50%; }
118
+ .ui-datepicker-multi-3 .ui-datepicker-group { width:33.3%; }
119
+ .ui-datepicker-multi-4 .ui-datepicker-group { width:25%; }
120
+ .ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { border-left-width:0; }
121
+ .ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { border-left-width:0; }
122
+ .ui-datepicker-multi .ui-datepicker-buttonpane { clear:left; }
123
+ .ui-datepicker-row-break { clear:both; width:100%; font-size:0em; }
124
+
125
+ /* RTL support */
126
+ .ui-datepicker-rtl { direction: rtl; }
127
+ .ui-datepicker-rtl .ui-datepicker-prev { right: 2px; left: auto; }
128
+ .ui-datepicker-rtl .ui-datepicker-next { left: 2px; right: auto; }
129
+ .ui-datepicker-rtl .ui-datepicker-prev:hover { right: 1px; left: auto; }
130
+ .ui-datepicker-rtl .ui-datepicker-next:hover { left: 1px; right: auto; }
131
+ .ui-datepicker-rtl .ui-datepicker-buttonpane { clear:right; }
132
+ .ui-datepicker-rtl .ui-datepicker-buttonpane button { float: left; }
133
+ .ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current { float:right; }
134
+ .ui-datepicker-rtl .ui-datepicker-group { float:right; }
135
+ .ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header { border-right-width:0; border-left-width:1px; }
136
+ .ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { border-right-width:0; border-left-width:1px; }
137
+
138
+ /* IE6 IFRAME FIX (taken from datepicker 1.5.3 */
139
+ .ui-datepicker-cover {
140
+ position: absolute; /*must have*/
141
+ z-index: -1; /*must have*/
142
+ filter: mask(); /*must have*/
143
+ top: -4px; /*must have*/
144
+ left: -4px; /*must have*/
145
+ width: 200px; /*must have*/
146
+ height: 200px; /*must have*/
147
+ }.ui-dialog { position: absolute; top: 0; left: 0; padding: .2em; width: 300px; overflow: hidden; }
148
+ .ui-dialog .ui-dialog-titlebar { padding: .4em 1em; position: relative; }
149
+ .ui-dialog .ui-dialog-title { float: left; margin: .1em 16px .1em 0; }
150
+ .ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .3em; top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; }
151
+ .ui-dialog .ui-dialog-titlebar-close span { display: block; margin: 1px; }
152
+ .ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus { padding: 0; }
153
+ .ui-dialog .ui-dialog-content { position: relative; border: 0; padding: .5em 1em; background: none; overflow: auto; zoom: 1; }
154
+ .ui-dialog .ui-dialog-buttonpane { text-align: left; border-width: 1px 0 0 0; background-image: none; margin: .5em 0 0 0; padding: .3em 1em .5em .4em; }
155
+ .ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset { float: right; }
156
+ .ui-dialog .ui-dialog-buttonpane button { margin: .5em .4em .5em 0; cursor: pointer; }
157
+ .ui-dialog .ui-resizable-se { width: 14px; height: 14px; right: 3px; bottom: 3px; }
158
+ .ui-draggable .ui-dialog-titlebar { cursor: move; }
159
+ .ui-menu { list-style:none; padding: 2px; margin: 0; display:block; outline: none; }
160
+ .ui-menu .ui-menu { margin-top: -3px; position: absolute; }
161
+ .ui-menu .ui-menu-item { margin: 0; padding: 0; zoom: 1; width: 100%; }
162
+ .ui-menu .ui-menu-divider { margin: 5px -2px 5px -2px; height: 0; font-size: 0; line-height: 0; border-width: 1px 0 0 0; }
163
+ .ui-menu .ui-menu-item a { text-decoration: none; display: block; padding: 2px .4em; line-height: 1.5; zoom: 1; font-weight: normal; }
164
+ .ui-menu .ui-menu-item a.ui-state-focus,
165
+ .ui-menu .ui-menu-item a.ui-state-active { font-weight: normal; margin: -1px; }
166
+
167
+ .ui-menu .ui-state-disabled { font-weight: normal; margin: .4em 0 .2em; line-height: 1.5; }
168
+ .ui-menu .ui-state-disabled a { cursor: default; }
169
+
170
+ /* icon support */
171
+ .ui-menu-icons { position: relative; }
172
+ .ui-menu-icons .ui-menu-item a { position: relative; padding-left: 2em; }
173
+
174
+ /* left-aligned */
175
+ .ui-menu .ui-icon { position: absolute; top: .2em; left: .2em; }
176
+
177
+ /* right-aligned */
178
+ .ui-menu .ui-menu-icon { position: static; float: right; }
179
+ .ui-progressbar { height:2em; text-align: left; overflow: hidden; }
180
+ .ui-progressbar .ui-progressbar-value {margin: -1px; height:100%; }.ui-slider { position: relative; text-align: left; }
181
+ .ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 1.2em; height: 1.2em; cursor: default; }
182
+ .ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; background-position: 0 0; }
183
+
184
+ .ui-slider-horizontal { height: .8em; }
185
+ .ui-slider-horizontal .ui-slider-handle { top: -.3em; margin-left: -.6em; }
186
+ .ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; }
187
+ .ui-slider-horizontal .ui-slider-range-min { left: 0; }
188
+ .ui-slider-horizontal .ui-slider-range-max { right: 0; }
189
+
190
+ .ui-slider-vertical { width: .8em; height: 100px; }
191
+ .ui-slider-vertical .ui-slider-handle { left: -.3em; margin-left: 0; margin-bottom: -.6em; }
192
+ .ui-slider-vertical .ui-slider-range { left: 0; width: 100%; }
193
+ .ui-slider-vertical .ui-slider-range-min { bottom: 0; }
194
+ .ui-slider-vertical .ui-slider-range-max { top: 0; }.ui-spinner { position:relative; display: inline-block; overflow: hidden; padding: 0; vertical-align: middle; }
195
+ .ui-spinner-input { border: none; background: none; padding: 0; margin: .2em 0; vertical-align: middle; margin-left: .4em; margin-right: 22px; }
196
+ .ui-spinner-button { width: 16px; height: 50%; font-size: .5em; padding: 0; margin: 0; text-align: center; position: absolute; cursor: default; display: block; overflow: hidden; right: 0; }
197
+ .ui-spinner a.ui-spinner-button { border-top: none; border-bottom: none; border-right: none; } /* more specificity required here to overide default borders */
198
+ .ui-spinner .ui-icon { position: absolute; margin-top: -8px; top: 50%; left: 0; } /* vertical centre icon */
199
+ .ui-spinner-up { top: 0; }
200
+ .ui-spinner-down { bottom: 0; }
201
+
202
+ /* TR overrides */
203
+ .ui-spinner .ui-icon-triangle-1-s {
204
+ /* need to fix icons sprite */
205
+ background-position:-65px -16px;
206
+ }
207
+ .ui-tabs { position: relative; padding: .2em; zoom: 1; } /* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */
208
+ .ui-tabs .ui-tabs-nav { margin: 0; padding: .2em .2em 0; }
209
+ .ui-tabs .ui-tabs-nav li { list-style: none; float: left; position: relative; top: 0; margin: 1px .2em 0 0; border-bottom: 0; padding: 0; white-space: nowrap; }
210
+ .ui-tabs .ui-tabs-nav li a { float: left; padding: .5em 1em; text-decoration: none; }
211
+ .ui-tabs .ui-tabs-nav li.ui-tabs-active { margin-bottom: -1px; padding-bottom: 1px; }
212
+ .ui-tabs .ui-tabs-nav li.ui-tabs-active a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-tabs-loading a { cursor: text; }
213
+ .ui-tabs .ui-tabs-nav li a, .ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-active a { cursor: pointer; } /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */
214
+ .ui-tabs .ui-tabs-panel { display: block; border-width: 0; padding: 1em 1.4em; background: none; }
215
+ .ui-tooltip {
216
+ padding: 8px;
217
+ position: absolute;
218
+ z-index: 9999;
219
+ max-width: 300px;
220
+ -webkit-box-shadow: 0 0 5px #aaa;
221
+ box-shadow: 0 0 5px #aaa;
222
+ }
223
+ /* Fades and background-images don't work well together in IE6, drop the image */
224
+ * html .ui-tooltip {
225
+ background-image: none;
226
+ }
227
+ body .ui-tooltip { border-width: 2px; }
228
+
229
+ /* Component containers
230
+ ----------------------------------*/
231
+ .ui-widget { font-family: Verdana,Arial,sans-serif; font-size: 1.1em; }
232
+ .ui-widget .ui-widget { font-size: 1em; }
233
+ .ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Verdana,Arial,sans-serif; font-size: 1em; }
234
+ .ui-widget-content { border: 1px solid #aaaaaa; background: #ffffff url(images/ui-bg_flat_75_ffffff_40x100.png) 50% 50% repeat-x; color: #222222; }
235
+ .ui-widget-content a { color: #222222; }
236
+ .ui-widget-header { border: 1px solid #aaaaaa; background: #cccccc url(images/ui-bg_highlight-soft_75_cccccc_1x100.png) 50% 50% repeat-x; color: #222222; font-weight: bold; }
237
+ .ui-widget-header a { color: #222222; }
238
+
239
+ /* Interaction states
240
+ ----------------------------------*/
241
+ .ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #d3d3d3; background: #e6e6e6 url(images/ui-bg_glass_75_e6e6e6_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #555555; }
242
+ .ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #555555; text-decoration: none; }
243
+ .ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus { border: 1px solid #999999; background: #dadada url(images/ui-bg_glass_75_dadada_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #212121; }
244
+ .ui-state-hover a, .ui-state-hover a:hover, .ui-state-hover a:link, .ui-state-hover a:visited { color: #212121; text-decoration: none; }
245
+ .ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active { border: 1px solid #aaaaaa; background: #ffffff url(images/ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #212121; }
246
+ .ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #212121; text-decoration: none; }
247
+
248
+ /* Interaction Cues
249
+ ----------------------------------*/
250
+ .ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight {border: 1px solid #fcefa1; background: #fbf9ee url(images/ui-bg_glass_55_fbf9ee_1x400.png) 50% 50% repeat-x; color: #363636; }
251
+ .ui-state-highlight a, .ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a { color: #363636; }
252
+ .ui-state-error, .ui-widget-content .ui-state-error, .ui-widget-header .ui-state-error {border: 1px solid #cd0a0a; background: #fef1ec url(images/ui-bg_glass_95_fef1ec_1x400.png) 50% 50% repeat-x; color: #cd0a0a; }
253
+ .ui-state-error a, .ui-widget-content .ui-state-error a, .ui-widget-header .ui-state-error a { color: #cd0a0a; }
254
+ .ui-state-error-text, .ui-widget-content .ui-state-error-text, .ui-widget-header .ui-state-error-text { color: #cd0a0a; }
255
+ .ui-priority-primary, .ui-widget-content .ui-priority-primary, .ui-widget-header .ui-priority-primary { font-weight: bold; }
256
+ .ui-priority-secondary, .ui-widget-content .ui-priority-secondary, .ui-widget-header .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; }
257
+ .ui-state-disabled, .ui-widget-content .ui-state-disabled, .ui-widget-header .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; }
258
+ .ui-state-disabled .ui-icon { filter:Alpha(Opacity=35); } /* For IE8 - See #6059 */
259
+
260
+ /* Icons
261
+ ----------------------------------*/
262
+
263
+ /* states and images */
264
+ .ui-icon { width: 16px; height: 16px; background-image: url(images/ui-icons_222222_256x240.png); }
265
+ .ui-widget-content .ui-icon {background-image: url(images/ui-icons_222222_256x240.png); }
266
+ .ui-widget-header .ui-icon {background-image: url(images/ui-icons_222222_256x240.png); }
267
+ .ui-state-default .ui-icon { background-image: url(images/ui-icons_888888_256x240.png); }
268
+ .ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(images/ui-icons_454545_256x240.png); }
269
+ .ui-state-active .ui-icon {background-image: url(images/ui-icons_454545_256x240.png); }
270
+ .ui-state-highlight .ui-icon {background-image: url(images/ui-icons_2e83ff_256x240.png); }
271
+ .ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: url(images/ui-icons_cd0a0a_256x240.png); }
272
+
273
+ /* positioning */
274
+ .ui-icon-carat-1-n { background-position: 0 0; }
275
+ .ui-icon-carat-1-ne { background-position: -16px 0; }
276
+ .ui-icon-carat-1-e { background-position: -32px 0; }
277
+ .ui-icon-carat-1-se { background-position: -48px 0; }
278
+ .ui-icon-carat-1-s { background-position: -64px 0; }
279
+ .ui-icon-carat-1-sw { background-position: -80px 0; }
280
+ .ui-icon-carat-1-w { background-position: -96px 0; }
281
+ .ui-icon-carat-1-nw { background-position: -112px 0; }
282
+ .ui-icon-carat-2-n-s { background-position: -128px 0; }
283
+ .ui-icon-carat-2-e-w { background-position: -144px 0; }
284
+ .ui-icon-triangle-1-n { background-position: 0 -16px; }
285
+ .ui-icon-triangle-1-ne { background-position: -16px -16px; }
286
+ .ui-icon-triangle-1-e { background-position: -32px -16px; }
287
+ .ui-icon-triangle-1-se { background-position: -48px -16px; }
288
+ .ui-icon-triangle-1-s { background-position: -64px -16px; }
289
+ .ui-icon-triangle-1-sw { background-position: -80px -16px; }
290
+ .ui-icon-triangle-1-w { background-position: -96px -16px; }
291
+ .ui-icon-triangle-1-nw { background-position: -112px -16px; }
292
+ .ui-icon-triangle-2-n-s { background-position: -128px -16px; }
293
+ .ui-icon-triangle-2-e-w { background-position: -144px -16px; }
294
+ .ui-icon-arrow-1-n { background-position: 0 -32px; }
295
+ .ui-icon-arrow-1-ne { background-position: -16px -32px; }
296
+ .ui-icon-arrow-1-e { background-position: -32px -32px; }
297
+ .ui-icon-arrow-1-se { background-position: -48px -32px; }
298
+ .ui-icon-arrow-1-s { background-position: -64px -32px; }
299
+ .ui-icon-arrow-1-sw { background-position: -80px -32px; }
300
+ .ui-icon-arrow-1-w { background-position: -96px -32px; }
301
+ .ui-icon-arrow-1-nw { background-position: -112px -32px; }
302
+ .ui-icon-arrow-2-n-s { background-position: -128px -32px; }
303
+ .ui-icon-arrow-2-ne-sw { background-position: -144px -32px; }
304
+ .ui-icon-arrow-2-e-w { background-position: -160px -32px; }
305
+ .ui-icon-arrow-2-se-nw { background-position: -176px -32px; }
306
+ .ui-icon-arrowstop-1-n { background-position: -192px -32px; }
307
+ .ui-icon-arrowstop-1-e { background-position: -208px -32px; }
308
+ .ui-icon-arrowstop-1-s { background-position: -224px -32px; }
309
+ .ui-icon-arrowstop-1-w { background-position: -240px -32px; }
310
+ .ui-icon-arrowthick-1-n { background-position: 0 -48px; }
311
+ .ui-icon-arrowthick-1-ne { background-position: -16px -48px; }
312
+ .ui-icon-arrowthick-1-e { background-position: -32px -48px; }
313
+ .ui-icon-arrowthick-1-se { background-position: -48px -48px; }
314
+ .ui-icon-arrowthick-1-s { background-position: -64px -48px; }
315
+ .ui-icon-arrowthick-1-sw { background-position: -80px -48px; }
316
+ .ui-icon-arrowthick-1-w { background-position: -96px -48px; }
317
+ .ui-icon-arrowthick-1-nw { background-position: -112px -48px; }
318
+ .ui-icon-arrowthick-2-n-s { background-position: -128px -48px; }
319
+ .ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; }
320
+ .ui-icon-arrowthick-2-e-w { background-position: -160px -48px; }
321
+ .ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; }
322
+ .ui-icon-arrowthickstop-1-n { background-position: -192px -48px; }
323
+ .ui-icon-arrowthickstop-1-e { background-position: -208px -48px; }
324
+ .ui-icon-arrowthickstop-1-s { background-position: -224px -48px; }
325
+ .ui-icon-arrowthickstop-1-w { background-position: -240px -48px; }
326
+ .ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; }
327
+ .ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; }
328
+ .ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; }
329
+ .ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; }
330
+ .ui-icon-arrowreturn-1-w { background-position: -64px -64px; }
331
+ .ui-icon-arrowreturn-1-n { background-position: -80px -64px; }
332
+ .ui-icon-arrowreturn-1-e { background-position: -96px -64px; }
333
+ .ui-icon-arrowreturn-1-s { background-position: -112px -64px; }
334
+ .ui-icon-arrowrefresh-1-w { background-position: -128px -64px; }
335
+ .ui-icon-arrowrefresh-1-n { background-position: -144px -64px; }
336
+ .ui-icon-arrowrefresh-1-e { background-position: -160px -64px; }
337
+ .ui-icon-arrowrefresh-1-s { background-position: -176px -64px; }
338
+ .ui-icon-arrow-4 { background-position: 0 -80px; }
339
+ .ui-icon-arrow-4-diag { background-position: -16px -80px; }
340
+ .ui-icon-extlink { background-position: -32px -80px; }
341
+ .ui-icon-newwin { background-position: -48px -80px; }
342
+ .ui-icon-refresh { background-position: -64px -80px; }
343
+ .ui-icon-shuffle { background-position: -80px -80px; }
344
+ .ui-icon-transfer-e-w { background-position: -96px -80px; }
345
+ .ui-icon-transferthick-e-w { background-position: -112px -80px; }
346
+ .ui-icon-folder-collapsed { background-position: 0 -96px; }
347
+ .ui-icon-folder-open { background-position: -16px -96px; }
348
+ .ui-icon-document { background-position: -32px -96px; }
349
+ .ui-icon-document-b { background-position: -48px -96px; }
350
+ .ui-icon-note { background-position: -64px -96px; }
351
+ .ui-icon-mail-closed { background-position: -80px -96px; }
352
+ .ui-icon-mail-open { background-position: -96px -96px; }
353
+ .ui-icon-suitcase { background-position: -112px -96px; }
354
+ .ui-icon-comment { background-position: -128px -96px; }
355
+ .ui-icon-person { background-position: -144px -96px; }
356
+ .ui-icon-print { background-position: -160px -96px; }
357
+ .ui-icon-trash { background-position: -176px -96px; }
358
+ .ui-icon-locked { background-position: -192px -96px; }
359
+ .ui-icon-unlocked { background-position: -208px -96px; }
360
+ .ui-icon-bookmark { background-position: -224px -96px; }
361
+ .ui-icon-tag { background-position: -240px -96px; }
362
+ .ui-icon-home { background-position: 0 -112px; }
363
+ .ui-icon-flag { background-position: -16px -112px; }
364
+ .ui-icon-calendar { background-position: -32px -112px; }
365
+ .ui-icon-cart { background-position: -48px -112px; }
366
+ .ui-icon-pencil { background-position: -64px -112px; }
367
+ .ui-icon-clock { background-position: -80px -112px; }
368
+ .ui-icon-disk { background-position: -96px -112px; }
369
+ .ui-icon-calculator { background-position: -112px -112px; }
370
+ .ui-icon-zoomin { background-position: -128px -112px; }
371
+ .ui-icon-zoomout { background-position: -144px -112px; }
372
+ .ui-icon-search { background-position: -160px -112px; }
373
+ .ui-icon-wrench { background-position: -176px -112px; }
374
+ .ui-icon-gear { background-position: -192px -112px; }
375
+ .ui-icon-heart { background-position: -208px -112px; }
376
+ .ui-icon-star { background-position: -224px -112px; }
377
+ .ui-icon-link { background-position: -240px -112px; }
378
+ .ui-icon-cancel { background-position: 0 -128px; }
379
+ .ui-icon-plus { background-position: -16px -128px; }
380
+ .ui-icon-plusthick { background-position: -32px -128px; }
381
+ .ui-icon-minus { background-position: -48px -128px; }
382
+ .ui-icon-minusthick { background-position: -64px -128px; }
383
+ .ui-icon-close { background-position: -80px -128px; }
384
+ .ui-icon-closethick { background-position: -96px -128px; }
385
+ .ui-icon-key { background-position: -112px -128px; }
386
+ .ui-icon-lightbulb { background-position: -128px -128px; }
387
+ .ui-icon-scissors { background-position: -144px -128px; }
388
+ .ui-icon-clipboard { background-position: -160px -128px; }
389
+ .ui-icon-copy { background-position: -176px -128px; }
390
+ .ui-icon-contact { background-position: -192px -128px; }
391
+ .ui-icon-image { background-position: -208px -128px; }
392
+ .ui-icon-video { background-position: -224px -128px; }
393
+ .ui-icon-script { background-position: -240px -128px; }
394
+ .ui-icon-alert { background-position: 0 -144px; }
395
+ .ui-icon-info { background-position: -16px -144px; }
396
+ .ui-icon-notice { background-position: -32px -144px; }
397
+ .ui-icon-help { background-position: -48px -144px; }
398
+ .ui-icon-check { background-position: -64px -144px; }
399
+ .ui-icon-bullet { background-position: -80px -144px; }
400
+ .ui-icon-radio-on { background-position: -96px -144px; }
401
+ .ui-icon-radio-off { background-position: -112px -144px; }
402
+ .ui-icon-pin-w { background-position: -128px -144px; }
403
+ .ui-icon-pin-s { background-position: -144px -144px; }
404
+ .ui-icon-play { background-position: 0 -160px; }
405
+ .ui-icon-pause { background-position: -16px -160px; }
406
+ .ui-icon-seek-next { background-position: -32px -160px; }
407
+ .ui-icon-seek-prev { background-position: -48px -160px; }
408
+ .ui-icon-seek-end { background-position: -64px -160px; }
409
+ .ui-icon-seek-start { background-position: -80px -160px; }
410
+ /* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */
411
+ .ui-icon-seek-first { background-position: -80px -160px; }
412
+ .ui-icon-stop { background-position: -96px -160px; }
413
+ .ui-icon-eject { background-position: -112px -160px; }
414
+ .ui-icon-volume-off { background-position: -128px -160px; }
415
+ .ui-icon-volume-on { background-position: -144px -160px; }
416
+ .ui-icon-power { background-position: 0 -176px; }
417
+ .ui-icon-signal-diag { background-position: -16px -176px; }
418
+ .ui-icon-signal { background-position: -32px -176px; }
419
+ .ui-icon-battery-0 { background-position: -48px -176px; }
420
+ .ui-icon-battery-1 { background-position: -64px -176px; }
421
+ .ui-icon-battery-2 { background-position: -80px -176px; }
422
+ .ui-icon-battery-3 { background-position: -96px -176px; }
423
+ .ui-icon-circle-plus { background-position: 0 -192px; }
424
+ .ui-icon-circle-minus { background-position: -16px -192px; }
425
+ .ui-icon-circle-close { background-position: -32px -192px; }
426
+ .ui-icon-circle-triangle-e { background-position: -48px -192px; }
427
+ .ui-icon-circle-triangle-s { background-position: -64px -192px; }
428
+ .ui-icon-circle-triangle-w { background-position: -80px -192px; }
429
+ .ui-icon-circle-triangle-n { background-position: -96px -192px; }
430
+ .ui-icon-circle-arrow-e { background-position: -112px -192px; }
431
+ .ui-icon-circle-arrow-s { background-position: -128px -192px; }
432
+ .ui-icon-circle-arrow-w { background-position: -144px -192px; }
433
+ .ui-icon-circle-arrow-n { background-position: -160px -192px; }
434
+ .ui-icon-circle-zoomin { background-position: -176px -192px; }
435
+ .ui-icon-circle-zoomout { background-position: -192px -192px; }
436
+ .ui-icon-circle-check { background-position: -208px -192px; }
437
+ .ui-icon-circlesmall-plus { background-position: 0 -208px; }
438
+ .ui-icon-circlesmall-minus { background-position: -16px -208px; }
439
+ .ui-icon-circlesmall-close { background-position: -32px -208px; }
440
+ .ui-icon-squaresmall-plus { background-position: -48px -208px; }
441
+ .ui-icon-squaresmall-minus { background-position: -64px -208px; }
442
+ .ui-icon-squaresmall-close { background-position: -80px -208px; }
443
+ .ui-icon-grip-dotted-vertical { background-position: 0 -224px; }
444
+ .ui-icon-grip-dotted-horizontal { background-position: -16px -224px; }
445
+ .ui-icon-grip-solid-vertical { background-position: -32px -224px; }
446
+ .ui-icon-grip-solid-horizontal { background-position: -48px -224px; }
447
+ .ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; }
448
+ .ui-icon-grip-diagonal-se { background-position: -80px -224px; }
449
+
450
+
451
+ /* Misc visuals
452
+ ----------------------------------*/
453
+
454
+ /* Corner radius */
455
+ .ui-corner-all, .ui-corner-top, .ui-corner-left, .ui-corner-tl { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; -khtml-border-top-left-radius: 4px; border-top-left-radius: 4px; }
456
+ .ui-corner-all, .ui-corner-top, .ui-corner-right, .ui-corner-tr { -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; -khtml-border-top-right-radius: 4px; border-top-right-radius: 4px; }
457
+ .ui-corner-all, .ui-corner-bottom, .ui-corner-left, .ui-corner-bl { -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; -khtml-border-bottom-left-radius: 4px; border-bottom-left-radius: 4px; }
458
+ .ui-corner-all, .ui-corner-bottom, .ui-corner-right, .ui-corner-br { -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; -khtml-border-bottom-right-radius: 4px; border-bottom-right-radius: 4px; }
459
+
460
+ /* Overlays */
461
+ .ui-widget-overlay { background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .3;filter:Alpha(Opacity=30); }
462
+ .ui-widget-shadow { margin: -8px 0 0 -8px; padding: 8px; background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .3;filter:Alpha(Opacity=30); -moz-border-radius: 8px; -khtml-border-radius: 8px; -webkit-border-radius: 8px; border-radius: 8px; }
css/jui/new/jquery-ui-1.9.2.custom.min.css ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ /*! jQuery UI - v1.9.2 - 2012-12-05
2
+ * http://jqueryui.com
3
+ * Includes: jquery.ui.core.css, jquery.ui.resizable.css, jquery.ui.selectable.css, jquery.ui.accordion.css, jquery.ui.autocomplete.css, jquery.ui.button.css, jquery.ui.datepicker.css, jquery.ui.dialog.css, jquery.ui.menu.css, jquery.ui.progressbar.css, jquery.ui.slider.css, jquery.ui.spinner.css, jquery.ui.tabs.css, jquery.ui.tooltip.css
4
+ * To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Verdana%2CArial%2Csans-serif&fwDefault=normal&fsDefault=1.1em&cornerRadius=4px&bgColorHeader=cccccc&bgTextureHeader=03_highlight_soft.png&bgImgOpacityHeader=75&borderColorHeader=aaaaaa&fcHeader=222222&iconColorHeader=222222&bgColorContent=ffffff&bgTextureContent=01_flat.png&bgImgOpacityContent=75&borderColorContent=aaaaaa&fcContent=222222&iconColorContent=222222&bgColorDefault=e6e6e6&bgTextureDefault=02_glass.png&bgImgOpacityDefault=75&borderColorDefault=d3d3d3&fcDefault=555555&iconColorDefault=888888&bgColorHover=dadada&bgTextureHover=02_glass.png&bgImgOpacityHover=75&borderColorHover=999999&fcHover=212121&iconColorHover=454545&bgColorActive=ffffff&bgTextureActive=02_glass.png&bgImgOpacityActive=65&borderColorActive=aaaaaa&fcActive=212121&iconColorActive=454545&bgColorHighlight=fbf9ee&bgTextureHighlight=02_glass.png&bgImgOpacityHighlight=55&borderColorHighlight=fcefa1&fcHighlight=363636&iconColorHighlight=2e83ff&bgColorError=fef1ec&bgTextureError=02_glass.png&bgImgOpacityError=95&borderColorError=cd0a0a&fcError=cd0a0a&iconColorError=cd0a0a&bgColorOverlay=aaaaaa&bgTextureOverlay=01_flat.png&bgImgOpacityOverlay=0&opacityOverlay=30&bgColorShadow=aaaaaa&bgTextureShadow=01_flat.png&bgImgOpacityShadow=0&opacityShadow=30&thicknessShadow=8px&offsetTopShadow=-8px&offsetLeftShadow=-8px&cornerRadiusShadow=8px
5
+ * Copyright (c) 2012 jQuery Foundation and other contributors Licensed MIT */.ui-helper-hidden{display:none}.ui-helper-hidden-accessible{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.ui-helper-reset{margin:0;padding:0;border:0;outline:0;line-height:1.3;text-decoration:none;font-size:100%;list-style:none}.ui-helper-clearfix:before,.ui-helper-clearfix:after{content:"";display:table}.ui-helper-clearfix:after{clear:both}.ui-helper-clearfix{zoom:1}.ui-helper-zfix{width:100%;height:100%;top:0;left:0;position:absolute;opacity:0;filter:Alpha(Opacity=0)}.ui-state-disabled{cursor:default!important}.ui-icon{display:block;text-indent:-99999px;overflow:hidden;background-repeat:no-repeat}.ui-widget-overlay{position:absolute;top:0;left:0;width:100%;height:100%}.ui-resizable{position:relative}.ui-resizable-handle{position:absolute;font-size:0.1px;display:block}.ui-resizable-disabled .ui-resizable-handle,.ui-resizable-autohide .ui-resizable-handle{display:none}.ui-resizable-n{cursor:n-resize;height:7px;width:100%;top:-5px;left:0}.ui-resizable-s{cursor:s-resize;height:7px;width:100%;bottom:-5px;left:0}.ui-resizable-e{cursor:e-resize;width:7px;right:-5px;top:0;height:100%}.ui-resizable-w{cursor:w-resize;width:7px;left:-5px;top:0;height:100%}.ui-resizable-se{cursor:se-resize;width:12px;height:12px;right:1px;bottom:1px}.ui-resizable-sw{cursor:sw-resize;width:9px;height:9px;left:-5px;bottom:-5px}.ui-resizable-nw{cursor:nw-resize;width:9px;height:9px;left:-5px;top:-5px}.ui-resizable-ne{cursor:ne-resize;width:9px;height:9px;right:-5px;top:-5px}.ui-selectable-helper{position:absolute;z-index:100;border:1px dotted black}.ui-accordion .ui-accordion-header{display:block;cursor:pointer;position:relative;margin-top:2px;padding:.5em .5em .5em .7em;zoom:1}.ui-accordion .ui-accordion-icons{padding-left:2.2em}.ui-accordion .ui-accordion-noicons{padding-left:.7em}.ui-accordion .ui-accordion-icons .ui-accordion-icons{padding-left:2.2em}.ui-accordion .ui-accordion-header .ui-accordion-header-icon{position:absolute;left:.5em;top:50%;margin-top:-8px}.ui-accordion .ui-accordion-content{padding:1em 2.2em;border-top:0;overflow:auto;zoom:1}.ui-autocomplete{position:absolute;top:0;left:0;cursor:default}* html .ui-autocomplete{width:1px}.ui-button{display:inline-block;position:relative;padding:0;margin-right:.1em;cursor:pointer;text-align:center;zoom:1;overflow:visible}.ui-button,.ui-button:link,.ui-button:visited,.ui-button:hover,.ui-button:active{text-decoration:none}.ui-button-icon-only{width:2.2em}button.ui-button-icon-only{width:2.4em}.ui-button-icons-only{width:3.4em}button.ui-button-icons-only{width:3.7em}.ui-button .ui-button-text{display:block;line-height:1.4}.ui-button-text-only .ui-button-text{padding:.4em 1em}.ui-button-icon-only .ui-button-text,.ui-button-icons-only .ui-button-text{padding:.4em;text-indent:-9999999px}.ui-button-text-icon-primary .ui-button-text,.ui-button-text-icons .ui-button-text{padding:.4em 1em .4em 2.1em}.ui-button-text-icon-secondary .ui-button-text,.ui-button-text-icons .ui-button-text{padding:.4em 2.1em .4em 1em}.ui-button-text-icons .ui-button-text{padding-left:2.1em;padding-right:2.1em}input.ui-button{padding:.4em 1em}.ui-button-icon-only .ui-icon,.ui-button-text-icon-primary .ui-icon,.ui-button-text-icon-secondary .ui-icon,.ui-button-text-icons .ui-icon,.ui-button-icons-only .ui-icon{position:absolute;top:50%;margin-top:-8px}.ui-button-icon-only .ui-icon{left:50%;margin-left:-8px}.ui-button-text-icon-primary .ui-button-icon-primary,.ui-button-text-icons .ui-button-icon-primary,.ui-button-icons-only .ui-button-icon-primary{left:.5em}.ui-button-text-icon-secondary .ui-button-icon-secondary,.ui-button-text-icons .ui-button-icon-secondary,.ui-button-icons-only .ui-button-icon-secondary{right:.5em}.ui-button-text-icons .ui-button-icon-secondary,.ui-button-icons-only .ui-button-icon-secondary{right:.5em}.ui-buttonset{margin-right:7px}.ui-buttonset .ui-button{margin-left:0;margin-right:-.3em}button.ui-button::-moz-focus-inner{border:0;padding:0}.ui-datepicker{width:17em;padding:.2em .2em 0;display:none}.ui-datepicker .ui-datepicker-header{position:relative;padding:.2em 0}.ui-datepicker .ui-datepicker-prev,.ui-datepicker .ui-datepicker-next{position:absolute;top:2px;width:1.8em;height:1.8em}.ui-datepicker .ui-datepicker-prev-hover,.ui-datepicker .ui-datepicker-next-hover{top:1px}.ui-datepicker .ui-datepicker-prev{left:2px}.ui-datepicker .ui-datepicker-next{right:2px}.ui-datepicker .ui-datepicker-prev-hover{left:1px}.ui-datepicker .ui-datepicker-next-hover{right:1px}.ui-datepicker .ui-datepicker-prev span,.ui-datepicker .ui-datepicker-next span{display:block;position:absolute;left:50%;margin-left:-8px;top:50%;margin-top:-8px}.ui-datepicker .ui-datepicker-title{margin:0 2.3em;line-height:1.8em;text-align:center}.ui-datepicker .ui-datepicker-title select{font-size:1em;margin:1px 0}.ui-datepicker select.ui-datepicker-month-year{width:100%}.ui-datepicker select.ui-datepicker-month,.ui-datepicker select.ui-datepicker-year{width:49%}.ui-datepicker table{width:100%;font-size:.9em;border-collapse:collapse;margin:0 0 .4em}.ui-datepicker th{padding:.7em .3em;text-align:center;font-weight:bold;border:0}.ui-datepicker td{border:0;padding:1px}.ui-datepicker td span,.ui-datepicker td a{display:block;padding:.2em;text-align:right;text-decoration:none}.ui-datepicker .ui-datepicker-buttonpane{background-image:none;margin:.7em 0 0 0;padding:0 .2em;border-left:0;border-right:0;border-bottom:0}.ui-datepicker .ui-datepicker-buttonpane button{float:right;margin:.5em .2em .4em;cursor:pointer;padding:.2em .6em .3em .6em;width:auto;overflow:visible}.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current{float:left}.ui-datepicker.ui-datepicker-multi{width:auto}.ui-datepicker-multi .ui-datepicker-group{float:left}.ui-datepicker-multi .ui-datepicker-group table{width:95%;margin:0 auto .4em}.ui-datepicker-multi-2 .ui-datepicker-group{width:50%}.ui-datepicker-multi-3 .ui-datepicker-group{width:33.3%}.ui-datepicker-multi-4 .ui-datepicker-group{width:25%}.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header{border-left-width:0}.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header{border-left-width:0}.ui-datepicker-multi .ui-datepicker-buttonpane{clear:left}.ui-datepicker-row-break{clear:both;width:100%;font-size:0em}.ui-datepicker-rtl{direction:rtl}.ui-datepicker-rtl .ui-datepicker-prev{right:2px;left:auto}.ui-datepicker-rtl .ui-datepicker-next{left:2px;right:auto}.ui-datepicker-rtl .ui-datepicker-prev:hover{right:1px;left:auto}.ui-datepicker-rtl .ui-datepicker-next:hover{left:1px;right:auto}.ui-datepicker-rtl .ui-datepicker-buttonpane{clear:right}.ui-datepicker-rtl .ui-datepicker-buttonpane button{float:left}.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current{float:right}.ui-datepicker-rtl .ui-datepicker-group{float:right}.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header{border-right-width:0;border-left-width:1px}.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header{border-right-width:0;border-left-width:1px}.ui-datepicker-cover{position:absolute;z-index:-1;filter:mask();top:-4px;left:-4px;width:200px;height:200px}.ui-dialog{position:absolute;top:0;left:0;padding:.2em;width:300px;overflow:hidden}.ui-dialog .ui-dialog-titlebar{padding:.4em 1em;position:relative}.ui-dialog .ui-dialog-title{float:left;margin:.1em 16px .1em 0}.ui-dialog .ui-dialog-titlebar-close{position:absolute;right:.3em;top:50%;width:19px;margin:-10px 0 0 0;padding:1px;height:18px}.ui-dialog .ui-dialog-titlebar-close span{display:block;margin:1px}.ui-dialog .ui-dialog-titlebar-close:hover,.ui-dialog .ui-dialog-titlebar-close:focus{padding:0}.ui-dialog .ui-dialog-content{position:relative;border:0;padding:.5em 1em;background:none;overflow:auto;zoom:1}.ui-dialog .ui-dialog-buttonpane{text-align:left;border-width:1px 0 0 0;background-image:none;margin:.5em 0 0 0;padding:.3em 1em .5em .4em}.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset{float:right}.ui-dialog .ui-dialog-buttonpane button{margin:.5em .4em .5em 0;cursor:pointer}.ui-dialog .ui-resizable-se{width:14px;height:14px;right:3px;bottom:3px}.ui-draggable .ui-dialog-titlebar{cursor:move}.ui-menu{list-style:none;padding:2px;margin:0;display:block;outline:none}.ui-menu .ui-menu{margin-top:-3px;position:absolute}.ui-menu .ui-menu-item{margin:0;padding:0;zoom:1;width:100%}.ui-menu .ui-menu-divider{margin:5px -2px 5px -2px;height:0;font-size:0;line-height:0;border-width:1px 0 0 0}.ui-menu .ui-menu-item a{text-decoration:none;display:block;padding:2px .4em;line-height:1.5;zoom:1;font-weight:normal}.ui-menu .ui-menu-item a.ui-state-focus,.ui-menu .ui-menu-item a.ui-state-active{font-weight:normal;margin:-1px}.ui-menu .ui-state-disabled{font-weight:normal;margin:.4em 0 .2em;line-height:1.5}.ui-menu .ui-state-disabled a{cursor:default}.ui-menu-icons{position:relative}.ui-menu-icons .ui-menu-item a{position:relative;padding-left:2em}.ui-menu .ui-icon{position:absolute;top:.2em;left:.2em}.ui-menu .ui-menu-icon{position:static;float:right}.ui-progressbar{height:2em;text-align:left;overflow:hidden}.ui-progressbar .ui-progressbar-value{margin:-1px;height:100%}.ui-slider{position:relative;text-align:left}.ui-slider .ui-slider-handle{position:absolute;z-index:2;width:1.2em;height:1.2em;cursor:default}.ui-slider .ui-slider-range{position:absolute;z-index:1;font-size:.7em;display:block;border:0;background-position:0 0}.ui-slider-horizontal{height:.8em}.ui-slider-horizontal .ui-slider-handle{top:-.3em;margin-left:-.6em}.ui-slider-horizontal .ui-slider-range{top:0;height:100%}.ui-slider-horizontal .ui-slider-range-min{left:0}.ui-slider-horizontal .ui-slider-range-max{right:0}.ui-slider-vertical{width:.8em;height:100px}.ui-slider-vertical .ui-slider-handle{left:-.3em;margin-left:0;margin-bottom:-.6em}.ui-slider-vertical .ui-slider-range{left:0;width:100%}.ui-slider-vertical .ui-slider-range-min{bottom:0}.ui-slider-vertical .ui-slider-range-max{top:0}.ui-spinner{position:relative;display:inline-block;overflow:hidden;padding:0;vertical-align:middle}.ui-spinner-input{border:none;background:none;padding:0;margin:.2em 0;vertical-align:middle;margin-left:.4em;margin-right:22px}.ui-spinner-button{width:16px;height:50%;font-size:.5em;padding:0;margin:0;text-align:center;position:absolute;cursor:default;display:block;overflow:hidden;right:0}.ui-spinner a.ui-spinner-button{border-top:none;border-bottom:none;border-right:none}.ui-spinner .ui-icon{position:absolute;margin-top:-8px;top:50%;left:0}.ui-spinner-up{top:0}.ui-spinner-down{bottom:0}.ui-spinner .ui-icon-triangle-1-s{background-position:-65px -16px}.ui-tabs{position:relative;padding:.2em;zoom:1}.ui-tabs .ui-tabs-nav{margin:0;padding:.2em .2em 0}.ui-tabs .ui-tabs-nav li{list-style:none;float:left;position:relative;top:0;margin:1px .2em 0 0;border-bottom:0;padding:0;white-space:nowrap}.ui-tabs .ui-tabs-nav li a{float:left;padding:.5em 1em;text-decoration:none}.ui-tabs .ui-tabs-nav li.ui-tabs-active{margin-bottom:-1px;padding-bottom:1px}.ui-tabs .ui-tabs-nav li.ui-tabs-active a,.ui-tabs .ui-tabs-nav li.ui-state-disabled a,.ui-tabs .ui-tabs-nav li.ui-tabs-loading a{cursor:text}.ui-tabs .ui-tabs-nav li a,.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-active a{cursor:pointer}.ui-tabs .ui-tabs-panel{display:block;border-width:0;padding:1em 1.4em;background:none}.ui-tooltip{padding:8px;position:absolute;z-index:9999;max-width:300px;-webkit-box-shadow:0 0 5px #aaa;box-shadow:0 0 5px #aaa}* html .ui-tooltip{background-image:none}body .ui-tooltip{border-width:2px}.ui-widget{font-family:Verdana,Arial,sans-serif;font-size:1.1em}.ui-widget .ui-widget{font-size:1em}.ui-widget input,.ui-widget select,.ui-widget textarea,.ui-widget button{font-family:Verdana,Arial,sans-serif;font-size:1em}.ui-widget-content{border:1px solid #aaa;background:#fff url(images/ui-bg_flat_75_ffffff_40x100.png) 50% 50% repeat-x;color:#222}.ui-widget-content a{color:#222}.ui-widget-header{border:1px solid #aaa;background:#ccc url(images/ui-bg_highlight-soft_75_cccccc_1x100.png) 50% 50% repeat-x;color:#222;font-weight:bold}.ui-widget-header a{color:#222}.ui-state-default,.ui-widget-content .ui-state-default,.ui-widget-header .ui-state-default{border:1px solid #d3d3d3;background:#e6e6e6 url(images/ui-bg_glass_75_e6e6e6_1x400.png) 50% 50% repeat-x;font-weight:normal;color:#555}.ui-state-default a,.ui-state-default a:link,.ui-state-default a:visited{color:#555;text-decoration:none}.ui-state-hover,.ui-widget-content .ui-state-hover,.ui-widget-header .ui-state-hover,.ui-state-focus,.ui-widget-content .ui-state-focus,.ui-widget-header .ui-state-focus{border:1px solid #999;background:#dadada url(images/ui-bg_glass_75_dadada_1x400.png) 50% 50% repeat-x;font-weight:normal;color:#212121}.ui-state-hover a,.ui-state-hover a:hover,.ui-state-hover a:link,.ui-state-hover a:visited{color:#212121;text-decoration:none}.ui-state-active,.ui-widget-content .ui-state-active,.ui-widget-header .ui-state-active{border:1px solid #aaa;background:#fff url(images/ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x;font-weight:normal;color:#212121}.ui-state-active a,.ui-state-active a:link,.ui-state-active a:visited{color:#212121;text-decoration:none}.ui-state-highlight,.ui-widget-content .ui-state-highlight,.ui-widget-header .ui-state-highlight{border:1px solid #fcefa1;background:#fbf9ee url(images/ui-bg_glass_55_fbf9ee_1x400.png) 50% 50% repeat-x;color:#363636}.ui-state-highlight a,.ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a{color:#363636}.ui-state-error,.ui-widget-content .ui-state-error,.ui-widget-header .ui-state-error{border:1px solid #cd0a0a;background:#fef1ec url(images/ui-bg_glass_95_fef1ec_1x400.png) 50% 50% repeat-x;color:#cd0a0a}.ui-state-error a,.ui-widget-content .ui-state-error a,.ui-widget-header .ui-state-error a{color:#cd0a0a}.ui-state-error-text,.ui-widget-content .ui-state-error-text,.ui-widget-header .ui-state-error-text{color:#cd0a0a}.ui-priority-primary,.ui-widget-content .ui-priority-primary,.ui-widget-header .ui-priority-primary{font-weight:bold}.ui-priority-secondary,.ui-widget-content .ui-priority-secondary,.ui-widget-header .ui-priority-secondary{opacity:.7;filter:Alpha(Opacity=70);font-weight:normal}.ui-state-disabled,.ui-widget-content .ui-state-disabled,.ui-widget-header .ui-state-disabled{opacity:.35;filter:Alpha(Opacity=35);background-image:none}.ui-state-disabled .ui-icon{filter:Alpha(Opacity=35)}.ui-icon{width:16px;height:16px;background-image:url(images/ui-icons_222222_256x240.png)}.ui-widget-content .ui-icon{background-image:url(images/ui-icons_222222_256x240.png)}.ui-widget-header .ui-icon{background-image:url(images/ui-icons_222222_256x240.png)}.ui-state-default .ui-icon{background-image:url(images/ui-icons_888888_256x240.png)}.ui-state-hover .ui-icon,.ui-state-focus .ui-icon{background-image:url(images/ui-icons_454545_256x240.png)}.ui-state-active .ui-icon{background-image:url(images/ui-icons_454545_256x240.png)}.ui-state-highlight .ui-icon{background-image:url(images/ui-icons_2e83ff_256x240.png)}.ui-state-error .ui-icon,.ui-state-error-text .ui-icon{background-image:url(images/ui-icons_cd0a0a_256x240.png)}.ui-icon-carat-1-n{background-position:0 0}.ui-icon-carat-1-ne{background-position:-16px 0}.ui-icon-carat-1-e{background-position:-32px 0}.ui-icon-carat-1-se{background-position:-48px 0}.ui-icon-carat-1-s{background-position:-64px 0}.ui-icon-carat-1-sw{background-position:-80px 0}.ui-icon-carat-1-w{background-position:-96px 0}.ui-icon-carat-1-nw{background-position:-112px 0}.ui-icon-carat-2-n-s{background-position:-128px 0}.ui-icon-carat-2-e-w{background-position:-144px 0}.ui-icon-triangle-1-n{background-position:0 -16px}.ui-icon-triangle-1-ne{background-position:-16px -16px}.ui-icon-triangle-1-e{background-position:-32px -16px}.ui-icon-triangle-1-se{background-position:-48px -16px}.ui-icon-triangle-1-s{background-position:-64px -16px}.ui-icon-triangle-1-sw{background-position:-80px -16px}.ui-icon-triangle-1-w{background-position:-96px -16px}.ui-icon-triangle-1-nw{background-position:-112px -16px}.ui-icon-triangle-2-n-s{background-position:-128px -16px}.ui-icon-triangle-2-e-w{background-position:-144px -16px}.ui-icon-arrow-1-n{background-position:0 -32px}.ui-icon-arrow-1-ne{background-position:-16px -32px}.ui-icon-arrow-1-e{background-position:-32px -32px}.ui-icon-arrow-1-se{background-position:-48px -32px}.ui-icon-arrow-1-s{background-position:-64px -32px}.ui-icon-arrow-1-sw{background-position:-80px -32px}.ui-icon-arrow-1-w{background-position:-96px -32px}.ui-icon-arrow-1-nw{background-position:-112px -32px}.ui-icon-arrow-2-n-s{background-position:-128px -32px}.ui-icon-arrow-2-ne-sw{background-position:-144px -32px}.ui-icon-arrow-2-e-w{background-position:-160px -32px}.ui-icon-arrow-2-se-nw{background-position:-176px -32px}.ui-icon-arrowstop-1-n{background-position:-192px -32px}.ui-icon-arrowstop-1-e{background-position:-208px -32px}.ui-icon-arrowstop-1-s{background-position:-224px -32px}.ui-icon-arrowstop-1-w{background-position:-240px -32px}.ui-icon-arrowthick-1-n{background-position:0 -48px}.ui-icon-arrowthick-1-ne{background-position:-16px -48px}.ui-icon-arrowthick-1-e{background-position:-32px -48px}.ui-icon-arrowthick-1-se{background-position:-48px -48px}.ui-icon-arrowthick-1-s{background-position:-64px -48px}.ui-icon-arrowthick-1-sw{background-position:-80px -48px}.ui-icon-arrowthick-1-w{background-position:-96px -48px}.ui-icon-arrowthick-1-nw{background-position:-112px -48px}.ui-icon-arrowthick-2-n-s{background-position:-128px -48px}.ui-icon-arrowthick-2-ne-sw{background-position:-144px -48px}.ui-icon-arrowthick-2-e-w{background-position:-160px -48px}.ui-icon-arrowthick-2-se-nw{background-position:-176px -48px}.ui-icon-arrowthickstop-1-n{background-position:-192px -48px}.ui-icon-arrowthickstop-1-e{background-position:-208px -48px}.ui-icon-arrowthickstop-1-s{background-position:-224px -48px}.ui-icon-arrowthickstop-1-w{background-position:-240px -48px}.ui-icon-arrowreturnthick-1-w{background-position:0 -64px}.ui-icon-arrowreturnthick-1-n{background-position:-16px -64px}.ui-icon-arrowreturnthick-1-e{background-position:-32px -64px}.ui-icon-arrowreturnthick-1-s{background-position:-48px -64px}.ui-icon-arrowreturn-1-w{background-position:-64px -64px}.ui-icon-arrowreturn-1-n{background-position:-80px -64px}.ui-icon-arrowreturn-1-e{background-position:-96px -64px}.ui-icon-arrowreturn-1-s{background-position:-112px -64px}.ui-icon-arrowrefresh-1-w{background-position:-128px -64px}.ui-icon-arrowrefresh-1-n{background-position:-144px -64px}.ui-icon-arrowrefresh-1-e{background-position:-160px -64px}.ui-icon-arrowrefresh-1-s{background-position:-176px -64px}.ui-icon-arrow-4{background-position:0 -80px}.ui-icon-arrow-4-diag{background-position:-16px -80px}.ui-icon-extlink{background-position:-32px -80px}.ui-icon-newwin{background-position:-48px -80px}.ui-icon-refresh{background-position:-64px -80px}.ui-icon-shuffle{background-position:-80px -80px}.ui-icon-transfer-e-w{background-position:-96px -80px}.ui-icon-transferthick-e-w{background-position:-112px -80px}.ui-icon-folder-collapsed{background-position:0 -96px}.ui-icon-folder-open{background-position:-16px -96px}.ui-icon-document{background-position:-32px -96px}.ui-icon-document-b{background-position:-48px -96px}.ui-icon-note{background-position:-64px -96px}.ui-icon-mail-closed{background-position:-80px -96px}.ui-icon-mail-open{background-position:-96px -96px}.ui-icon-suitcase{background-position:-112px -96px}.ui-icon-comment{background-position:-128px -96px}.ui-icon-person{background-position:-144px -96px}.ui-icon-print{background-position:-160px -96px}.ui-icon-trash{background-position:-176px -96px}.ui-icon-locked{background-position:-192px -96px}.ui-icon-unlocked{background-position:-208px -96px}.ui-icon-bookmark{background-position:-224px -96px}.ui-icon-tag{background-position:-240px -96px}.ui-icon-home{background-position:0 -112px}.ui-icon-flag{background-position:-16px -112px}.ui-icon-calendar{background-position:-32px -112px}.ui-icon-cart{background-position:-48px -112px}.ui-icon-pencil{background-position:-64px -112px}.ui-icon-clock{background-position:-80px -112px}.ui-icon-disk{background-position:-96px -112px}.ui-icon-calculator{background-position:-112px -112px}.ui-icon-zoomin{background-position:-128px -112px}.ui-icon-zoomout{background-position:-144px -112px}.ui-icon-search{background-position:-160px -112px}.ui-icon-wrench{background-position:-176px -112px}.ui-icon-gear{background-position:-192px -112px}.ui-icon-heart{background-position:-208px -112px}.ui-icon-star{background-position:-224px -112px}.ui-icon-link{background-position:-240px -112px}.ui-icon-cancel{background-position:0 -128px}.ui-icon-plus{background-position:-16px -128px}.ui-icon-plusthick{background-position:-32px -128px}.ui-icon-minus{background-position:-48px -128px}.ui-icon-minusthick{background-position:-64px -128px}.ui-icon-close{background-position:-80px -128px}.ui-icon-closethick{background-position:-96px -128px}.ui-icon-key{background-position:-112px -128px}.ui-icon-lightbulb{background-position:-128px -128px}.ui-icon-scissors{background-position:-144px -128px}.ui-icon-clipboard{background-position:-160px -128px}.ui-icon-copy{background-position:-176px -128px}.ui-icon-contact{background-position:-192px -128px}.ui-icon-image{background-position:-208px -128px}.ui-icon-video{background-position:-224px -128px}.ui-icon-script{background-position:-240px -128px}.ui-icon-alert{background-position:0 -144px}.ui-icon-info{background-position:-16px -144px}.ui-icon-notice{background-position:-32px -144px}.ui-icon-help{background-position:-48px -144px}.ui-icon-check{background-position:-64px -144px}.ui-icon-bullet{background-position:-80px -144px}.ui-icon-radio-on{background-position:-96px -144px}.ui-icon-radio-off{background-position:-112px -144px}.ui-icon-pin-w{background-position:-128px -144px}.ui-icon-pin-s{background-position:-144px -144px}.ui-icon-play{background-position:0 -160px}.ui-icon-pause{background-position:-16px -160px}.ui-icon-seek-next{background-position:-32px -160px}.ui-icon-seek-prev{background-position:-48px -160px}.ui-icon-seek-end{background-position:-64px -160px}.ui-icon-seek-start{background-position:-80px -160px}.ui-icon-seek-first{background-position:-80px -160px}.ui-icon-stop{background-position:-96px -160px}.ui-icon-eject{background-position:-112px -160px}.ui-icon-volume-off{background-position:-128px -160px}.ui-icon-volume-on{background-position:-144px -160px}.ui-icon-power{background-position:0 -176px}.ui-icon-signal-diag{background-position:-16px -176px}.ui-icon-signal{background-position:-32px -176px}.ui-icon-battery-0{background-position:-48px -176px}.ui-icon-battery-1{background-position:-64px -176px}.ui-icon-battery-2{background-position:-80px -176px}.ui-icon-battery-3{background-position:-96px -176px}.ui-icon-circle-plus{background-position:0 -192px}.ui-icon-circle-minus{background-position:-16px -192px}.ui-icon-circle-close{background-position:-32px -192px}.ui-icon-circle-triangle-e{background-position:-48px -192px}.ui-icon-circle-triangle-s{background-position:-64px -192px}.ui-icon-circle-triangle-w{background-position:-80px -192px}.ui-icon-circle-triangle-n{background-position:-96px -192px}.ui-icon-circle-arrow-e{background-position:-112px -192px}.ui-icon-circle-arrow-s{background-position:-128px -192px}.ui-icon-circle-arrow-w{background-position:-144px -192px}.ui-icon-circle-arrow-n{background-position:-160px -192px}.ui-icon-circle-zoomin{background-position:-176px -192px}.ui-icon-circle-zoomout{background-position:-192px -192px}.ui-icon-circle-check{background-position:-208px -192px}.ui-icon-circlesmall-plus{background-position:0 -208px}.ui-icon-circlesmall-minus{background-position:-16px -208px}.ui-icon-circlesmall-close{background-position:-32px -208px}.ui-icon-squaresmall-plus{background-position:-48px -208px}.ui-icon-squaresmall-minus{background-position:-64px -208px}.ui-icon-squaresmall-close{background-position:-80px -208px}.ui-icon-grip-dotted-vertical{background-position:0 -224px}.ui-icon-grip-dotted-horizontal{background-position:-16px -224px}.ui-icon-grip-solid-vertical{background-position:-32px -224px}.ui-icon-grip-solid-horizontal{background-position:-48px -224px}.ui-icon-gripsmall-diagonal-se{background-position:-64px -224px}.ui-icon-grip-diagonal-se{background-position:-80px -224px}.ui-corner-all,.ui-corner-top,.ui-corner-left,.ui-corner-tl{-moz-border-radius-topleft:4px;-webkit-border-top-left-radius:4px;-khtml-border-top-left-radius:4px;border-top-left-radius:4px}.ui-corner-all,.ui-corner-top,.ui-corner-right,.ui-corner-tr{-moz-border-radius-topright:4px;-webkit-border-top-right-radius:4px;-khtml-border-top-right-radius:4px;border-top-right-radius:4px}.ui-corner-all,.ui-corner-bottom,.ui-corner-left,.ui-corner-bl{-moz-border-radius-bottomleft:4px;-webkit-border-bottom-left-radius:4px;-khtml-border-bottom-left-radius:4px;border-bottom-left-radius:4px}.ui-corner-all,.ui-corner-bottom,.ui-corner-right,.ui-corner-br{-moz-border-radius-bottomright:4px;-webkit-border-bottom-right-radius:4px;-khtml-border-bottom-right-radius:4px;border-bottom-right-radius:4px}.ui-widget-overlay{background:#aaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x;opacity:.3;filter:Alpha(Opacity=30)}.ui-widget-shadow{margin:-8px 0 0 -8px;padding:8px;background:#aaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x;opacity:.3;filter:Alpha(Opacity=30);-moz-border-radius:8px;-khtml-border-radius:8px;-webkit-border-radius:8px;border-radius:8px}
css/jui/new/jquery-ui.structure.min.css ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ /*! jQuery UI - v1.11.1 - 2014-08-31
2
+ * http://jqueryui.com
3
+ * Copyright 2014 jQuery Foundation and other contributors; Licensed MIT */
4
+
5
+ .ui-helper-hidden{display:none}.ui-helper-hidden-accessible{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.ui-helper-reset{margin:0;padding:0;border:0;outline:0;line-height:1.3;text-decoration:none;font-size:100%;list-style:none}.ui-helper-clearfix:before,.ui-helper-clearfix:after{content:"";display:table;border-collapse:collapse}.ui-helper-clearfix:after{clear:both}.ui-helper-clearfix{min-height:0}.ui-helper-zfix{width:100%;height:100%;top:0;left:0;position:absolute;opacity:0;filter:Alpha(Opacity=0)}.ui-front{z-index:100}.ui-state-disabled{cursor:default!important}.ui-icon{display:block;text-indent:-99999px;overflow:hidden;background-repeat:no-repeat}.ui-widget-overlay{position:fixed;top:0;left:0;width:100%;height:100%}.ui-draggable-handle{-ms-touch-action:none;touch-action:none}.ui-resizable{position:relative}.ui-resizable-handle{position:absolute;font-size:0.1px;display:block;-ms-touch-action:none;touch-action:none}.ui-resizable-disabled .ui-resizable-handle,.ui-resizable-autohide .ui-resizable-handle{display:none}.ui-resizable-n{cursor:n-resize;height:7px;width:100%;top:-5px;left:0}.ui-resizable-s{cursor:s-resize;height:7px;width:100%;bottom:-5px;left:0}.ui-resizable-e{cursor:e-resize;width:7px;right:-5px;top:0;height:100%}.ui-resizable-w{cursor:w-resize;width:7px;left:-5px;top:0;height:100%}.ui-resizable-se{cursor:se-resize;width:12px;height:12px;right:1px;bottom:1px}.ui-resizable-sw{cursor:sw-resize;width:9px;height:9px;left:-5px;bottom:-5px}.ui-resizable-nw{cursor:nw-resize;width:9px;height:9px;left:-5px;top:-5px}.ui-resizable-ne{cursor:ne-resize;width:9px;height:9px;right:-5px;top:-5px}.ui-selectable{-ms-touch-action:none;touch-action:none}.ui-selectable-helper{position:absolute;z-index:100;border:1px dotted black}.ui-sortable-handle{-ms-touch-action:none;touch-action:none}.ui-accordion .ui-accordion-header{display:block;cursor:pointer;position:relative;margin:2px 0 0 0;padding:.5em .5em .5em .7em;min-height:0;font-size:100%}.ui-accordion .ui-accordion-icons{padding-left:2.2em}.ui-accordion .ui-accordion-icons .ui-accordion-icons{padding-left:2.2em}.ui-accordion .ui-accordion-header .ui-accordion-header-icon{position:absolute;left:.5em;top:50%;margin-top:-8px}.ui-accordion .ui-accordion-content{padding:1em 2.2em;border-top:0;overflow:auto}.ui-autocomplete{position:absolute;top:0;left:0;cursor:default}.ui-button{display:inline-block;position:relative;padding:0;line-height:normal;margin-right:.1em;cursor:pointer;vertical-align:middle;text-align:center;overflow:visible}.ui-button,.ui-button:link,.ui-button:visited,.ui-button:hover,.ui-button:active{text-decoration:none}.ui-button-icon-only{width:2.2em}button.ui-button-icon-only{width:2.4em}.ui-button-icons-only{width:3.4em}button.ui-button-icons-only{width:3.7em}.ui-button .ui-button-text{display:block;line-height:normal}.ui-button-text-only .ui-button-text{padding:.4em 1em}.ui-button-icon-only .ui-button-text,.ui-button-icons-only .ui-button-text{padding:.4em;text-indent:-9999999px}.ui-button-text-icon-primary .ui-button-text,.ui-button-text-icons .ui-button-text{padding:.4em 1em .4em 2.1em}.ui-button-text-icon-secondary .ui-button-text,.ui-button-text-icons .ui-button-text{padding:.4em 2.1em .4em 1em}.ui-button-text-icons .ui-button-text{padding-left:2.1em;padding-right:2.1em}input.ui-button{padding:.4em 1em}.ui-button-icon-only .ui-icon,.ui-button-text-icon-primary .ui-icon,.ui-button-text-icon-secondary .ui-icon,.ui-button-text-icons .ui-icon,.ui-button-icons-only .ui-icon{position:absolute;top:50%;margin-top:-8px}.ui-button-icon-only .ui-icon{left:50%;margin-left:-8px}.ui-button-text-icon-primary .ui-button-icon-primary,.ui-button-text-icons .ui-button-icon-primary,.ui-button-icons-only .ui-button-icon-primary{left:.5em}.ui-button-text-icon-secondary .ui-button-icon-secondary,.ui-button-text-icons .ui-button-icon-secondary,.ui-button-icons-only .ui-button-icon-secondary{right:.5em}.ui-buttonset{margin-right:7px}.ui-buttonset .ui-button{margin-left:0;margin-right:-.3em}input.ui-button::-moz-focus-inner,button.ui-button::-moz-focus-inner{border:0;padding:0}.ui-datepicker{width:17em;padding:.2em .2em 0;display:none}.ui-datepicker .ui-datepicker-header{position:relative;padding:.2em 0}.ui-datepicker .ui-datepicker-prev,.ui-datepicker .ui-datepicker-next{position:absolute;top:2px;width:1.8em;height:1.8em}.ui-datepicker .ui-datepicker-prev-hover,.ui-datepicker .ui-datepicker-next-hover{top:1px}.ui-datepicker .ui-datepicker-prev{left:2px}.ui-datepicker .ui-datepicker-next{right:2px}.ui-datepicker .ui-datepicker-prev-hover{left:1px}.ui-datepicker .ui-datepicker-next-hover{right:1px}.ui-datepicker .ui-datepicker-prev span,.ui-datepicker .ui-datepicker-next span{display:block;position:absolute;left:50%;margin-left:-8px;top:50%;margin-top:-8px}.ui-datepicker .ui-datepicker-title{margin:0 2.3em;line-height:1.8em;text-align:center}.ui-datepicker .ui-datepicker-title select{font-size:1em;margin:1px 0}.ui-datepicker select.ui-datepicker-month,.ui-datepicker select.ui-datepicker-year{width:45%}.ui-datepicker table{width:100%;font-size:.9em;border-collapse:collapse;margin:0 0 .4em}.ui-datepicker th{padding:.7em .3em;text-align:center;font-weight:bold;border:0}.ui-datepicker td{border:0;padding:1px}.ui-datepicker td span,.ui-datepicker td a{display:block;padding:.2em;text-align:right;text-decoration:none}.ui-datepicker .ui-datepicker-buttonpane{background-image:none;margin:.7em 0 0 0;padding:0 .2em;border-left:0;border-right:0;border-bottom:0}.ui-datepicker .ui-datepicker-buttonpane button{float:right;margin:.5em .2em .4em;cursor:pointer;padding:.2em .6em .3em .6em;width:auto;overflow:visible}.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current{float:left}.ui-datepicker.ui-datepicker-multi{width:auto}.ui-datepicker-multi .ui-datepicker-group{float:left}.ui-datepicker-multi .ui-datepicker-group table{width:95%;margin:0 auto .4em}.ui-datepicker-multi-2 .ui-datepicker-group{width:50%}.ui-datepicker-multi-3 .ui-datepicker-group{width:33.3%}.ui-datepicker-multi-4 .ui-datepicker-group{width:25%}.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header,.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header{border-left-width:0}.ui-datepicker-multi .ui-datepicker-buttonpane{clear:left}.ui-datepicker-row-break{clear:both;width:100%;font-size:0}.ui-datepicker-rtl{direction:rtl}.ui-datepicker-rtl .ui-datepicker-prev{right:2px;left:auto}.ui-datepicker-rtl .ui-datepicker-next{left:2px;right:auto}.ui-datepicker-rtl .ui-datepicker-prev:hover{right:1px;left:auto}.ui-datepicker-rtl .ui-datepicker-next:hover{left:1px;right:auto}.ui-datepicker-rtl .ui-datepicker-buttonpane{clear:right}.ui-datepicker-rtl .ui-datepicker-buttonpane button{float:left}.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current,.ui-datepicker-rtl .ui-datepicker-group{float:right}.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header,.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header{border-right-width:0;border-left-width:1px}.ui-dialog{overflow:hidden;position:absolute;top:0;left:0;padding:.2em;outline:0}.ui-dialog .ui-dialog-titlebar{padding:.4em 1em;position:relative}.ui-dialog .ui-dialog-title{float:left;margin:.1em 0;white-space:nowrap;width:90%;overflow:hidden;text-overflow:ellipsis}.ui-dialog .ui-dialog-titlebar-close{position:absolute;right:.3em;top:50%;width:20px;margin:-10px 0 0 0;padding:1px;height:20px}.ui-dialog .ui-dialog-content{position:relative;border:0;padding:.5em 1em;background:none;overflow:auto}.ui-dialog .ui-dialog-buttonpane{text-align:left;border-width:1px 0 0 0;background-image:none;margin-top:.5em;padding:.3em 1em .5em .4em}.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset{float:right}.ui-dialog .ui-dialog-buttonpane button{margin:.5em .4em .5em 0;cursor:pointer}.ui-dialog .ui-resizable-se{width:12px;height:12px;right:-5px;bottom:-5px;background-position:16px 16px}.ui-draggable .ui-dialog-titlebar{cursor:move}.ui-menu{list-style:none;padding:0;margin:0;display:block;outline:none}.ui-menu .ui-menu{position:absolute}.ui-menu .ui-menu-item{position:relative;margin:0;padding:3px 1em 3px .4em;cursor:pointer;min-height:0;list-style-image:url("data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7")}.ui-menu .ui-menu-divider{margin:5px 0;height:0;font-size:0;line-height:0;border-width:1px 0 0 0}.ui-menu .ui-state-focus,.ui-menu .ui-state-active{margin:-1px}.ui-menu-icons{position:relative}.ui-menu-icons .ui-menu-item{padding-left:2em}.ui-menu .ui-icon{position:absolute;top:0;bottom:0;left:.2em;margin:auto 0}.ui-menu .ui-menu-icon{left:auto;right:0}.ui-progressbar{height:2em;text-align:left;overflow:hidden}.ui-progressbar .ui-progressbar-value{margin:-1px;height:100%}.ui-progressbar .ui-progressbar-overlay{background:url("data:image/gif;base64,R0lGODlhKAAoAIABAAAAAP///yH/C05FVFNDQVBFMi4wAwEAAAAh+QQJAQABACwAAAAAKAAoAAACkYwNqXrdC52DS06a7MFZI+4FHBCKoDeWKXqymPqGqxvJrXZbMx7Ttc+w9XgU2FB3lOyQRWET2IFGiU9m1frDVpxZZc6bfHwv4c1YXP6k1Vdy292Fb6UkuvFtXpvWSzA+HycXJHUXiGYIiMg2R6W459gnWGfHNdjIqDWVqemH2ekpObkpOlppWUqZiqr6edqqWQAAIfkECQEAAQAsAAAAACgAKAAAApSMgZnGfaqcg1E2uuzDmmHUBR8Qil95hiPKqWn3aqtLsS18y7G1SzNeowWBENtQd+T1JktP05nzPTdJZlR6vUxNWWjV+vUWhWNkWFwxl9VpZRedYcflIOLafaa28XdsH/ynlcc1uPVDZxQIR0K25+cICCmoqCe5mGhZOfeYSUh5yJcJyrkZWWpaR8doJ2o4NYq62lAAACH5BAkBAAEALAAAAAAoACgAAAKVDI4Yy22ZnINRNqosw0Bv7i1gyHUkFj7oSaWlu3ovC8GxNso5fluz3qLVhBVeT/Lz7ZTHyxL5dDalQWPVOsQWtRnuwXaFTj9jVVh8pma9JjZ4zYSj5ZOyma7uuolffh+IR5aW97cHuBUXKGKXlKjn+DiHWMcYJah4N0lYCMlJOXipGRr5qdgoSTrqWSq6WFl2ypoaUAAAIfkECQEAAQAsAAAAACgAKAAAApaEb6HLgd/iO7FNWtcFWe+ufODGjRfoiJ2akShbueb0wtI50zm02pbvwfWEMWBQ1zKGlLIhskiEPm9R6vRXxV4ZzWT2yHOGpWMyorblKlNp8HmHEb/lCXjcW7bmtXP8Xt229OVWR1fod2eWqNfHuMjXCPkIGNileOiImVmCOEmoSfn3yXlJWmoHGhqp6ilYuWYpmTqKUgAAIfkECQEAAQAsAAAAACgAKAAAApiEH6kb58biQ3FNWtMFWW3eNVcojuFGfqnZqSebuS06w5V80/X02pKe8zFwP6EFWOT1lDFk8rGERh1TTNOocQ61Hm4Xm2VexUHpzjymViHrFbiELsefVrn6XKfnt2Q9G/+Xdie499XHd2g4h7ioOGhXGJboGAnXSBnoBwKYyfioubZJ2Hn0RuRZaflZOil56Zp6iioKSXpUAAAh+QQJAQABACwAAAAAKAAoAAACkoQRqRvnxuI7kU1a1UU5bd5tnSeOZXhmn5lWK3qNTWvRdQxP8qvaC+/yaYQzXO7BMvaUEmJRd3TsiMAgswmNYrSgZdYrTX6tSHGZO73ezuAw2uxuQ+BbeZfMxsexY35+/Qe4J1inV0g4x3WHuMhIl2jXOKT2Q+VU5fgoSUI52VfZyfkJGkha6jmY+aaYdirq+lQAACH5BAkBAAEALAAAAAAoACgAAAKWBIKpYe0L3YNKToqswUlvznigd4wiR4KhZrKt9Upqip61i9E3vMvxRdHlbEFiEXfk9YARYxOZZD6VQ2pUunBmtRXo1Lf8hMVVcNl8JafV38aM2/Fu5V16Bn63r6xt97j09+MXSFi4BniGFae3hzbH9+hYBzkpuUh5aZmHuanZOZgIuvbGiNeomCnaxxap2upaCZsq+1kAACH5BAkBAAEALAAAAAAoACgAAAKXjI8By5zf4kOxTVrXNVlv1X0d8IGZGKLnNpYtm8Lr9cqVeuOSvfOW79D9aDHizNhDJidFZhNydEahOaDH6nomtJjp1tutKoNWkvA6JqfRVLHU/QUfau9l2x7G54d1fl995xcIGAdXqMfBNadoYrhH+Mg2KBlpVpbluCiXmMnZ2Sh4GBqJ+ckIOqqJ6LmKSllZmsoq6wpQAAAh+QQJAQABACwAAAAAKAAoAAAClYx/oLvoxuJDkU1a1YUZbJ59nSd2ZXhWqbRa2/gF8Gu2DY3iqs7yrq+xBYEkYvFSM8aSSObE+ZgRl1BHFZNr7pRCavZ5BW2142hY3AN/zWtsmf12p9XxxFl2lpLn1rseztfXZjdIWIf2s5dItwjYKBgo9yg5pHgzJXTEeGlZuenpyPmpGQoKOWkYmSpaSnqKileI2FAAACH5BAkBAAEALAAAAAAoACgAAAKVjB+gu+jG4kORTVrVhRlsnn2dJ3ZleFaptFrb+CXmO9OozeL5VfP99HvAWhpiUdcwkpBH3825AwYdU8xTqlLGhtCosArKMpvfa1mMRae9VvWZfeB2XfPkeLmm18lUcBj+p5dnN8jXZ3YIGEhYuOUn45aoCDkp16hl5IjYJvjWKcnoGQpqyPlpOhr3aElaqrq56Bq7VAAAOw==");height:100%;filter:alpha(opacity=25);opacity:0.25}.ui-progressbar-indeterminate .ui-progressbar-value{background-image:none}.ui-selectmenu-menu{padding:0;margin:0;position:absolute;top:0;left:0;display:none}.ui-selectmenu-menu .ui-menu{overflow:auto;overflow-x:hidden;padding-bottom:1px}.ui-selectmenu-menu .ui-menu .ui-selectmenu-optgroup{font-size:1em;font-weight:bold;line-height:1.5;padding:2px 0.4em;margin:0.5em 0 0 0;height:auto;border:0}.ui-selectmenu-open{display:block}.ui-selectmenu-button{display:inline-block;overflow:hidden;position:relative;text-decoration:none;cursor:pointer}.ui-selectmenu-button span.ui-icon{right:0.5em;left:auto;margin-top:-8px;position:absolute;top:50%}.ui-selectmenu-button span.ui-selectmenu-text{text-align:left;padding:0.4em 2.1em 0.4em 1em;display:block;line-height:1.4;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ui-slider{position:relative;text-align:left}.ui-slider .ui-slider-handle{position:absolute;z-index:2;width:1.2em;height:1.2em;cursor:default;-ms-touch-action:none;touch-action:none}.ui-slider .ui-slider-range{position:absolute;z-index:1;font-size:.7em;display:block;border:0;background-position:0 0}.ui-slider.ui-state-disabled .ui-slider-handle,.ui-slider.ui-state-disabled .ui-slider-range{filter:inherit}.ui-slider-horizontal{height:.8em}.ui-slider-horizontal .ui-slider-handle{top:-.3em;margin-left:-.6em}.ui-slider-horizontal .ui-slider-range{top:0;height:100%}.ui-slider-horizontal .ui-slider-range-min{left:0}.ui-slider-horizontal .ui-slider-range-max{right:0}.ui-slider-vertical{width:.8em;height:100px}.ui-slider-vertical .ui-slider-handle{left:-.3em;margin-left:0;margin-bottom:-.6em}.ui-slider-vertical .ui-slider-range{left:0;width:100%}.ui-slider-vertical .ui-slider-range-min{bottom:0}.ui-slider-vertical .ui-slider-range-max{top:0}.ui-spinner{position:relative;display:inline-block;overflow:hidden;padding:0;vertical-align:middle}.ui-spinner-input{border:none;background:none;color:inherit;padding:0;margin:.2em 0;vertical-align:middle;margin-left:.4em;margin-right:22px}.ui-spinner-button{width:16px;height:50%;font-size:.5em;padding:0;margin:0;text-align:center;position:absolute;cursor:default;display:block;overflow:hidden;right:0}.ui-spinner a.ui-spinner-button{border-top:none;border-bottom:none;border-right:none}.ui-spinner .ui-icon{position:absolute;margin-top:-8px;top:50%;left:0}.ui-spinner-up{top:0}.ui-spinner-down{bottom:0}.ui-spinner .ui-icon-triangle-1-s{background-position:-65px -16px}.ui-tabs{position:relative;padding:.2em}.ui-tabs .ui-tabs-nav{margin:0;padding:.2em .2em 0}.ui-tabs .ui-tabs-nav li{list-style:none;float:left;position:relative;top:0;margin:1px .2em 0 0;border-bottom-width:0;padding:0;white-space:nowrap}.ui-tabs .ui-tabs-nav .ui-tabs-anchor{float:left;padding:.5em 1em;text-decoration:none}.ui-tabs .ui-tabs-nav li.ui-tabs-active{margin-bottom:-1px;padding-bottom:1px}.ui-tabs .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor,.ui-tabs .ui-tabs-nav li.ui-state-disabled .ui-tabs-anchor,.ui-tabs .ui-tabs-nav li.ui-tabs-loading .ui-tabs-anchor{cursor:text}.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor{cursor:pointer}.ui-tabs .ui-tabs-panel{display:block;border-width:0;padding:1em 1.4em;background:none}.ui-tooltip{padding:8px;position:absolute;z-index:9999;max-width:300px;-webkit-box-shadow:0 0 5px #aaa;box-shadow:0 0 5px #aaa}body .ui-tooltip{border-width:2px}
css/jui/new/jquery-ui.theme.min.css ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ /*! jQuery UI - v1.11.1 - 2014-09-01
2
+ * http://jqueryui.com
3
+ * Copyright 2014 jQuery Foundation and other contributors; Licensed MIT */
4
+
5
+ .ui-widget{font-family:Verdana,Arial,sans-serif;font-size:1.1em}.ui-widget .ui-widget{font-size:1em}.ui-widget input,.ui-widget select,.ui-widget textarea,.ui-widget button{font-family:Verdana,Arial,sans-serif;font-size:1em}.ui-widget-content{border:1px solid #aaa;background:#fff url("images/ui-bg_flat_75_ffffff_40x100.png") 50% 50% repeat-x;color:#222}.ui-widget-content a{color:#222}.ui-widget-header{border:1px solid #aaa;background:#ccc url("images/ui-bg_highlight-soft_75_cccccc_1x100.png") 50% 50% repeat-x;color:#222;font-weight:bold}.ui-widget-header a{color:#222}.ui-state-default,.ui-widget-content .ui-state-default,.ui-widget-header .ui-state-default{border:1px solid #d3d3d3;background:#e6e6e6 url("images/ui-bg_glass_75_e6e6e6_1x400.png") 50% 50% repeat-x;font-weight:normal;color:#555}.ui-state-default a,.ui-state-default a:link,.ui-state-default a:visited{color:#555;text-decoration:none}.ui-state-hover,.ui-widget-content .ui-state-hover,.ui-widget-header .ui-state-hover,.ui-state-focus,.ui-widget-content .ui-state-focus,.ui-widget-header .ui-state-focus{border:1px solid #999;background:#dadada url("images/ui-bg_glass_75_dadada_1x400.png") 50% 50% repeat-x;font-weight:normal;color:#212121}.ui-state-hover a,.ui-state-hover a:hover,.ui-state-hover a:link,.ui-state-hover a:visited,.ui-state-focus a,.ui-state-focus a:hover,.ui-state-focus a:link,.ui-state-focus a:visited{color:#212121;text-decoration:none}.ui-state-active,.ui-widget-content .ui-state-active,.ui-widget-header .ui-state-active{border:1px solid #aaa;background:#fff url("images/ui-bg_glass_65_ffffff_1x400.png") 50% 50% repeat-x;font-weight:normal;color:#212121}.ui-state-active a,.ui-state-active a:link,.ui-state-active a:visited{color:#212121;text-decoration:none}.ui-state-highlight,.ui-widget-content .ui-state-highlight,.ui-widget-header .ui-state-highlight{border:1px solid #fcefa1;background:#fbf9ee url("images/ui-bg_glass_55_fbf9ee_1x400.png") 50% 50% repeat-x;color:#363636}.ui-state-highlight a,.ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a{color:#363636}.ui-state-error,.ui-widget-content .ui-state-error,.ui-widget-header .ui-state-error{border:1px solid #cd0a0a;background:#fef1ec url("images/ui-bg_glass_95_fef1ec_1x400.png") 50% 50% repeat-x;color:#cd0a0a}.ui-state-error a,.ui-widget-content .ui-state-error a,.ui-widget-header .ui-state-error a{color:#cd0a0a}.ui-state-error-text,.ui-widget-content .ui-state-error-text,.ui-widget-header .ui-state-error-text{color:#cd0a0a}.ui-priority-primary,.ui-widget-content .ui-priority-primary,.ui-widget-header .ui-priority-primary{font-weight:bold}.ui-priority-secondary,.ui-widget-content .ui-priority-secondary,.ui-widget-header .ui-priority-secondary{opacity:.7;filter:Alpha(Opacity=70);font-weight:normal}.ui-state-disabled,.ui-widget-content .ui-state-disabled,.ui-widget-header .ui-state-disabled{opacity:.35;filter:Alpha(Opacity=35);background-image:none}.ui-state-disabled .ui-icon{filter:Alpha(Opacity=35)}.ui-icon{width:16px;height:16px}.ui-icon,.ui-widget-content .ui-icon{background-image:url("images/ui-icons_222222_256x240.png")}.ui-widget-header .ui-icon{background-image:url("images/ui-icons_222222_256x240.png")}.ui-state-default .ui-icon{background-image:url("images/ui-icons_888888_256x240.png")}.ui-state-hover .ui-icon,.ui-state-focus .ui-icon{background-image:url("images/ui-icons_454545_256x240.png")}.ui-state-active .ui-icon{background-image:url("images/ui-icons_454545_256x240.png")}.ui-state-highlight .ui-icon{background-image:url("images/ui-icons_2e83ff_256x240.png")}.ui-state-error .ui-icon,.ui-state-error-text .ui-icon{background-image:url("images/ui-icons_cd0a0a_256x240.png")}.ui-icon-blank{background-position:16px 16px}.ui-icon-carat-1-n{background-position:0 0}.ui-icon-carat-1-ne{background-position:-16px 0}.ui-icon-carat-1-e{background-position:-32px 0}.ui-icon-carat-1-se{background-position:-48px 0}.ui-icon-carat-1-s{background-position:-64px 0}.ui-icon-carat-1-sw{background-position:-80px 0}.ui-icon-carat-1-w{background-position:-96px 0}.ui-icon-carat-1-nw{background-position:-112px 0}.ui-icon-carat-2-n-s{background-position:-128px 0}.ui-icon-carat-2-e-w{background-position:-144px 0}.ui-icon-triangle-1-n{background-position:0 -16px}.ui-icon-triangle-1-ne{background-position:-16px -16px}.ui-icon-triangle-1-e{background-position:-32px -16px}.ui-icon-triangle-1-se{background-position:-48px -16px}.ui-icon-triangle-1-s{background-position:-64px -16px}.ui-icon-triangle-1-sw{background-position:-80px -16px}.ui-icon-triangle-1-w{background-position:-96px -16px}.ui-icon-triangle-1-nw{background-position:-112px -16px}.ui-icon-triangle-2-n-s{background-position:-128px -16px}.ui-icon-triangle-2-e-w{background-position:-144px -16px}.ui-icon-arrow-1-n{background-position:0 -32px}.ui-icon-arrow-1-ne{background-position:-16px -32px}.ui-icon-arrow-1-e{background-position:-32px -32px}.ui-icon-arrow-1-se{background-position:-48px -32px}.ui-icon-arrow-1-s{background-position:-64px -32px}.ui-icon-arrow-1-sw{background-position:-80px -32px}.ui-icon-arrow-1-w{background-position:-96px -32px}.ui-icon-arrow-1-nw{background-position:-112px -32px}.ui-icon-arrow-2-n-s{background-position:-128px -32px}.ui-icon-arrow-2-ne-sw{background-position:-144px -32px}.ui-icon-arrow-2-e-w{background-position:-160px -32px}.ui-icon-arrow-2-se-nw{background-position:-176px -32px}.ui-icon-arrowstop-1-n{background-position:-192px -32px}.ui-icon-arrowstop-1-e{background-position:-208px -32px}.ui-icon-arrowstop-1-s{background-position:-224px -32px}.ui-icon-arrowstop-1-w{background-position:-240px -32px}.ui-icon-arrowthick-1-n{background-position:0 -48px}.ui-icon-arrowthick-1-ne{background-position:-16px -48px}.ui-icon-arrowthick-1-e{background-position:-32px -48px}.ui-icon-arrowthick-1-se{background-position:-48px -48px}.ui-icon-arrowthick-1-s{background-position:-64px -48px}.ui-icon-arrowthick-1-sw{background-position:-80px -48px}.ui-icon-arrowthick-1-w{background-position:-96px -48px}.ui-icon-arrowthick-1-nw{background-position:-112px -48px}.ui-icon-arrowthick-2-n-s{background-position:-128px -48px}.ui-icon-arrowthick-2-ne-sw{background-position:-144px -48px}.ui-icon-arrowthick-2-e-w{background-position:-160px -48px}.ui-icon-arrowthick-2-se-nw{background-position:-176px -48px}.ui-icon-arrowthickstop-1-n{background-position:-192px -48px}.ui-icon-arrowthickstop-1-e{background-position:-208px -48px}.ui-icon-arrowthickstop-1-s{background-position:-224px -48px}.ui-icon-arrowthickstop-1-w{background-position:-240px -48px}.ui-icon-arrowreturnthick-1-w{background-position:0 -64px}.ui-icon-arrowreturnthick-1-n{background-position:-16px -64px}.ui-icon-arrowreturnthick-1-e{background-position:-32px -64px}.ui-icon-arrowreturnthick-1-s{background-position:-48px -64px}.ui-icon-arrowreturn-1-w{background-position:-64px -64px}.ui-icon-arrowreturn-1-n{background-position:-80px -64px}.ui-icon-arrowreturn-1-e{background-position:-96px -64px}.ui-icon-arrowreturn-1-s{background-position:-112px -64px}.ui-icon-arrowrefresh-1-w{background-position:-128px -64px}.ui-icon-arrowrefresh-1-n{background-position:-144px -64px}.ui-icon-arrowrefresh-1-e{background-position:-160px -64px}.ui-icon-arrowrefresh-1-s{background-position:-176px -64px}.ui-icon-arrow-4{background-position:0 -80px}.ui-icon-arrow-4-diag{background-position:-16px -80px}.ui-icon-extlink{background-position:-32px -80px}.ui-icon-newwin{background-position:-48px -80px}.ui-icon-refresh{background-position:-64px -80px}.ui-icon-shuffle{background-position:-80px -80px}.ui-icon-transfer-e-w{background-position:-96px -80px}.ui-icon-transferthick-e-w{background-position:-112px -80px}.ui-icon-folder-collapsed{background-position:0 -96px}.ui-icon-folder-open{background-position:-16px -96px}.ui-icon-document{background-position:-32px -96px}.ui-icon-document-b{background-position:-48px -96px}.ui-icon-note{background-position:-64px -96px}.ui-icon-mail-closed{background-position:-80px -96px}.ui-icon-mail-open{background-position:-96px -96px}.ui-icon-suitcase{background-position:-112px -96px}.ui-icon-comment{background-position:-128px -96px}.ui-icon-person{background-position:-144px -96px}.ui-icon-print{background-position:-160px -96px}.ui-icon-trash{background-position:-176px -96px}.ui-icon-locked{background-position:-192px -96px}.ui-icon-unlocked{background-position:-208px -96px}.ui-icon-bookmark{background-position:-224px -96px}.ui-icon-tag{background-position:-240px -96px}.ui-icon-home{background-position:0 -112px}.ui-icon-flag{background-position:-16px -112px}.ui-icon-calendar{background-position:-32px -112px}.ui-icon-cart{background-position:-48px -112px}.ui-icon-pencil{background-position:-64px -112px}.ui-icon-clock{background-position:-80px -112px}.ui-icon-disk{background-position:-96px -112px}.ui-icon-calculator{background-position:-112px -112px}.ui-icon-zoomin{background-position:-128px -112px}.ui-icon-zoomout{background-position:-144px -112px}.ui-icon-search{background-position:-160px -112px}.ui-icon-wrench{background-position:-176px -112px}.ui-icon-gear{background-position:-192px -112px}.ui-icon-heart{background-position:-208px -112px}.ui-icon-star{background-position:-224px -112px}.ui-icon-link{background-position:-240px -112px}.ui-icon-cancel{background-position:0 -128px}.ui-icon-plus{background-position:-16px -128px}.ui-icon-plusthick{background-position:-32px -128px}.ui-icon-minus{background-position:-48px -128px}.ui-icon-minusthick{background-position:-64px -128px}.ui-icon-close{background-position:-80px -128px}.ui-icon-closethick{background-position:-96px -128px}.ui-icon-key{background-position:-112px -128px}.ui-icon-lightbulb{background-position:-128px -128px}.ui-icon-scissors{background-position:-144px -128px}.ui-icon-clipboard{background-position:-160px -128px}.ui-icon-copy{background-position:-176px -128px}.ui-icon-contact{background-position:-192px -128px}.ui-icon-image{background-position:-208px -128px}.ui-icon-video{background-position:-224px -128px}.ui-icon-script{background-position:-240px -128px}.ui-icon-alert{background-position:0 -144px}.ui-icon-info{background-position:-16px -144px}.ui-icon-notice{background-position:-32px -144px}.ui-icon-help{background-position:-48px -144px}.ui-icon-check{background-position:-64px -144px}.ui-icon-bullet{background-position:-80px -144px}.ui-icon-radio-on{background-position:-96px -144px}.ui-icon-radio-off{background-position:-112px -144px}.ui-icon-pin-w{background-position:-128px -144px}.ui-icon-pin-s{background-position:-144px -144px}.ui-icon-play{background-position:0 -160px}.ui-icon-pause{background-position:-16px -160px}.ui-icon-seek-next{background-position:-32px -160px}.ui-icon-seek-prev{background-position:-48px -160px}.ui-icon-seek-end{background-position:-64px -160px}.ui-icon-seek-start{background-position:-80px -160px}.ui-icon-seek-first{background-position:-80px -160px}.ui-icon-stop{background-position:-96px -160px}.ui-icon-eject{background-position:-112px -160px}.ui-icon-volume-off{background-position:-128px -160px}.ui-icon-volume-on{background-position:-144px -160px}.ui-icon-power{background-position:0 -176px}.ui-icon-signal-diag{background-position:-16px -176px}.ui-icon-signal{background-position:-32px -176px}.ui-icon-battery-0{background-position:-48px -176px}.ui-icon-battery-1{background-position:-64px -176px}.ui-icon-battery-2{background-position:-80px -176px}.ui-icon-battery-3{background-position:-96px -176px}.ui-icon-circle-plus{background-position:0 -192px}.ui-icon-circle-minus{background-position:-16px -192px}.ui-icon-circle-close{background-position:-32px -192px}.ui-icon-circle-triangle-e{background-position:-48px -192px}.ui-icon-circle-triangle-s{background-position:-64px -192px}.ui-icon-circle-triangle-w{background-position:-80px -192px}.ui-icon-circle-triangle-n{background-position:-96px -192px}.ui-icon-circle-arrow-e{background-position:-112px -192px}.ui-icon-circle-arrow-s{background-position:-128px -192px}.ui-icon-circle-arrow-w{background-position:-144px -192px}.ui-icon-circle-arrow-n{background-position:-160px -192px}.ui-icon-circle-zoomin{background-position:-176px -192px}.ui-icon-circle-zoomout{background-position:-192px -192px}.ui-icon-circle-check{background-position:-208px -192px}.ui-icon-circlesmall-plus{background-position:0 -208px}.ui-icon-circlesmall-minus{background-position:-16px -208px}.ui-icon-circlesmall-close{background-position:-32px -208px}.ui-icon-squaresmall-plus{background-position:-48px -208px}.ui-icon-squaresmall-minus{background-position:-64px -208px}.ui-icon-squaresmall-close{background-position:-80px -208px}.ui-icon-grip-dotted-vertical{background-position:0 -224px}.ui-icon-grip-dotted-horizontal{background-position:-16px -224px}.ui-icon-grip-solid-vertical{background-position:-32px -224px}.ui-icon-grip-solid-horizontal{background-position:-48px -224px}.ui-icon-gripsmall-diagonal-se{background-position:-64px -224px}.ui-icon-grip-diagonal-se{background-position:-80px -224px}.ui-corner-all,.ui-corner-top,.ui-corner-left,.ui-corner-tl{border-top-left-radius:4px}.ui-corner-all,.ui-corner-top,.ui-corner-right,.ui-corner-tr{border-top-right-radius:4px}.ui-corner-all,.ui-corner-bottom,.ui-corner-left,.ui-corner-bl{border-bottom-left-radius:4px}.ui-corner-all,.ui-corner-bottom,.ui-corner-right,.ui-corner-br{border-bottom-right-radius:4px}.ui-widget-overlay{background:#aaa url("images/ui-bg_flat_0_aaaaaa_40x100.png") 50% 50% repeat-x;opacity:.3;filter:Alpha(Opacity=30)}.ui-widget-shadow{margin:-8px 0 0 -8px;padding:8px;background:#aaa url("images/ui-bg_flat_0_aaaaaa_40x100.png") 50% 50% repeat-x;opacity:.3;filter:Alpha(Opacity=30);border-radius:8px}
css/media_dialog.css ADDED
@@ -0,0 +1,238 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ @CHARSET "ISO-8859-1";
2
+
3
+ /* protection */
4
+ .dialog-video input[type='radio']{
5
+ /* protection */
6
+ appearance:radio;
7
+ -moz-appearance:radio;
8
+ -webkit-appearance:radio;
9
+ border:none;
10
+ background:none;
11
+ outline:none;
12
+ }
13
+
14
+
15
+ .ui-dialog-content,
16
+ .ui-dialog-buttonpane{
17
+ cursor:default;
18
+ }
19
+
20
+ .dialog-video{
21
+ cursor:default;
22
+ overflow:visible !important;
23
+ }
24
+
25
+ .dialog-video .video-dialog-loader{
26
+ margin-top:30px;
27
+ height:30px;
28
+
29
+ }
30
+
31
+ .dialog-video .video-type-chooser label{
32
+ display:inline;
33
+ padding-right:5px;
34
+ cursor:pointer;
35
+ margin-bottom:30px;
36
+ }
37
+
38
+ .dialog-video .video-type-chooser input{
39
+ padding:0px;
40
+ margin:0px;
41
+ cursor:pointer;
42
+ margin-right:17px;
43
+ display:inline;
44
+ }
45
+
46
+ .dialog-video input:before{
47
+ content:none !important;
48
+ width:auto !important;
49
+ height:auto !important;
50
+ margin:0px !important;
51
+ padding:0px !important;
52
+ }
53
+
54
+
55
+
56
+ .dialog-video .video_left{
57
+ float:left;
58
+ width:420px;
59
+ }
60
+
61
+ .dialog-video .video_right{
62
+ float:right;
63
+ width:380px;
64
+ }
65
+
66
+ .dialog-video .video_props_left{
67
+ position: relative;
68
+ }
69
+
70
+ .dialog-video input[type='text'],
71
+ .dialog-video textarea{
72
+ padding:5px;
73
+ }
74
+
75
+
76
+ .dialog-video .input_search{
77
+ width:160px;
78
+ padding:5px;
79
+ float:left;
80
+ margin-top:3px;
81
+ }
82
+
83
+ .dialog-video .input-url{
84
+ width: 250px;
85
+ }
86
+
87
+ .dialog-video .input-url-long{
88
+ width: 408px;
89
+ }
90
+
91
+ .dialog-video .input-title{
92
+ width: 350px;
93
+ }
94
+
95
+ .dialog-video .input-description{
96
+ width:350px;
97
+ height:60px;
98
+ }
99
+
100
+ .dialog-video .dv_loader_search{
101
+ margin-left:10px;
102
+ margin-top:8px;
103
+ float:left;
104
+ }
105
+
106
+
107
+ .dialog-video .button-search{
108
+ float:left;
109
+ margin-left:10px;
110
+ }
111
+
112
+ .dialog-video .video_example{
113
+ font-style:italic;
114
+ font-size:11px;
115
+ display:block;
116
+ margin-top:5px;
117
+ cursor:text;
118
+ }
119
+
120
+
121
+ .dialog-video .video_right {
122
+ padding-right: 10px;
123
+ border-right: 1px solid #f1f1f1;
124
+ }
125
+
126
+ .dialog-video .dv-preview-image{
127
+ width:360px;
128
+ height:200px;
129
+ border:1px solid #f1f1f1;
130
+ margin-top:20px;
131
+ background-size: cover;
132
+ background-repeat:no-repeat;
133
+ background-position:center center;
134
+ }
135
+
136
+ .dialog-video .dv-thumb-image{
137
+ position:absolute;
138
+ width:120px;
139
+ height:92px;
140
+ border:1px solid #E5E5E5;
141
+ right:0px;
142
+ top:31px;
143
+ background-size: cover;
144
+ background-repeat:no-repeat;
145
+ background-position:center center;
146
+ }
147
+
148
+ .dialog-video hr {
149
+ border-top: 1px solid #E5E5E5;
150
+ border-bottom: 1px solid #Fff;
151
+ height: 0px;
152
+ background: none;
153
+ border-left: none;
154
+ border-right: 0px;
155
+ }
156
+
157
+ .dialog-video .video-input-small{
158
+ width:50px;
159
+ }
160
+
161
+ .dialog-video .choose-video-type {
162
+ margin:20px 0px 15px;
163
+ font-size: 16px;
164
+ font-weight: 600;
165
+ }
166
+
167
+ .dialog-video .video-title{
168
+ margin:10px 0px 6px;
169
+ font-size: 12px;
170
+ font-weight: 600;
171
+ }
172
+
173
+ .dialog-video .dv_link_change{
174
+ color: #025a8d;
175
+ text-decoration: none;
176
+ }
177
+
178
+ .dialog-video .dv_link_change:hover{
179
+ text-decoration: underline;
180
+ }
181
+
182
+ #dv_link_change_image{
183
+ margin-left:80px;
184
+ }
185
+
186
+ #dv_link_change_thumb{
187
+ margin-left:91px;
188
+ }
189
+
190
+ #dv_link_example_mp4{
191
+ margin-left:233px;
192
+ }
193
+
194
+ #dv_link_example_webm{
195
+ margin-left:219px;
196
+ }
197
+
198
+ #dv_link_example_ogv{
199
+ margin-left:231px;
200
+ }
201
+
202
+
203
+ #video_block_html5 { width:100%;}
204
+
205
+
206
+ #video_block_html5 .video_title2{
207
+ margin-bottom:2px;
208
+ }
209
+
210
+
211
+ #video_block_html5 ul li input{
212
+ width:100%;
213
+ }
214
+
215
+ .dialog-video .checkbox_video_dialog{
216
+ margin-left:5px;
217
+ margin-top:2px;
218
+ }
219
+
220
+
221
+ .dialog-video .dv_error_message{
222
+ color:red;
223
+ font-size:16px;
224
+ }
225
+
226
+ #dv_error_message_bottom{
227
+ position:absolute;
228
+ top:446px;
229
+ left:22px;
230
+ color:red;
231
+ }
232
+
233
+ #dv_button_video_add{
234
+ position:absolute;
235
+ top:406px;
236
+ left:170px;
237
+ }
238
+
css/tipsy.css ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .tipsy { padding: 5px; font-size: 12px; position: absolute; z-index: 100000; }
2
+ .tipsy-inner { padding: 5px 8px 4px 8px; background-color: black; color: white; max-width: 200px; text-align: left; }
3
+ .tipsy-inner { border-radius: 3px; -moz-border-radius:3px; -webkit-border-radius:3px; }
4
+ .tipsy-arrow { position: absolute; background: url('../images/tipsy.gif') no-repeat top left; width: 9px; height: 5px; }
5
+ .tipsy-n .tipsy-arrow { top: 0; left: 50%; margin-left: -4px; }
6
+ .tipsy-nw .tipsy-arrow { top: 0; left: 10px; }
7
+ .tipsy-ne .tipsy-arrow { top: 0; right: 10px; }
8
+ .tipsy-s .tipsy-arrow { bottom: 0; left: 50%; margin-left: -4px; background-position: bottom left; }
9
+ .tipsy-sw .tipsy-arrow { bottom: 0; left: 10px; background-position: bottom left; }
10
+ .tipsy-se .tipsy-arrow { bottom: 0; right: 10px; background-position: bottom left; }
11
+ .tipsy-e .tipsy-arrow { top: 50%; margin-top: -4px; right: 0; width: 5px; height: 9px; background-position: top right; }
12
+ .tipsy-w .tipsy-arrow { top: 50%; margin-top: -4px; left: 0; width: 5px; height: 9px; }
css/unitegallery_manager.css ADDED
@@ -0,0 +1,435 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ @CHARSET "ISO-8859-1";
2
+
3
+ #---------------GENERAL--------------------- {}
4
+
5
+
6
+ .ug-manager-outer {
7
+ position: relative;
8
+ }
9
+
10
+ .manager_wrapper {
11
+ min-width: 520px;
12
+ position: relative;
13
+ margin: 0px;
14
+ margin-right:0px;
15
+ border:1px solid lightgray;
16
+ }
17
+
18
+ .manager_wrapper.ug-nocats {
19
+ min-width: 200px;
20
+ }
21
+
22
+ .manager_wrapper .layout_table {
23
+ width: 100%;
24
+ table-collapse: collapse;
25
+ }
26
+
27
+ .manager_wrapper .layout_table td {
28
+ background-color: white;
29
+ }
30
+
31
+ .content_wrapper .manager_shadow_overlay {
32
+ position: absolute;
33
+ background: black;
34
+ width: 100%;
35
+ height: 100%;
36
+ top: 0px;
37
+ left: 0px;
38
+ opacity: 0.05;
39
+ filter: alpha(opacity=5);
40
+ }
41
+
42
+ .manager_wrapper .manager_title {
43
+ font-size: 16px;
44
+ line-height: 30px;
45
+ padding-left: 10px;
46
+ padding-top: 5px;
47
+ padding-bottom:5px;
48
+ }
49
+
50
+ .manager_wrapper .manager_buttons {
51
+ padding-left:20px;
52
+ padding-right:10px;
53
+ padding-top:10px;
54
+ height:43px;
55
+ background-color:#eee;
56
+ border-bottom:1px solid lightgray;
57
+ border-top:1px solid lightgray;
58
+ }
59
+
60
+ .categories_wrapper .manager_buttons{
61
+ border-right:1px solid lightgray;
62
+ }
63
+
64
+ .manager_wrapper .manager_buttons a {
65
+ margin-right: 5px;
66
+ }
67
+
68
+ .manager_wrapper hr {
69
+ display:none;
70
+ }
71
+
72
+ .settings_tabs {
73
+ background-color: #eee;
74
+ border-top: 1px solid lightgray;
75
+ border-right: 1px solid lightgray;
76
+ }
77
+
78
+ .items_wrapper .manager_buttons .ug-button-item.button-disabled {
79
+ display: none;
80
+ }
81
+
82
+ .manager_wrapper .categories_wrapper {
83
+ background-color: #fff;
84
+ border-left: 1px solid lightgray;
85
+ }
86
+
87
+ .manager_wrapper .items_wrapper {
88
+ background-color: #fff;
89
+ position: relative;
90
+ overflow: hidden;
91
+ border-right: 1px solid lightgray;
92
+ }
93
+
94
+ .categories_wrapper .cats_section {
95
+ height: 450px;
96
+ background-color: #F8F8F8;
97
+ overflow-y: auto;
98
+ }
99
+
100
+ .categories_wrapper .cat_list_wrapper {
101
+ position: relative;
102
+ padding-top: 10px;
103
+ padding-left: 10px;
104
+ padding-bottom: 10px;
105
+ }
106
+
107
+ .categories_wrapper .list_cats {
108
+ margin: 0px;
109
+ padding: 0px;
110
+ }
111
+
112
+ .categories_wrapper .list_cats li {
113
+ margin: 0px;
114
+ padding: 5px;
115
+ margin-top: 10px;
116
+ width: 162px;
117
+ display: block;
118
+ border: 1px solid #BFBFBF;
119
+ border-radius: 3px;
120
+ background-color: #F0F0F0;
121
+ width: 178px;
122
+ height: 20px;
123
+ color: #333333;
124
+ text-align: left;
125
+ font-weight: bold;
126
+ box-shadow: 1px 2px 2px rgba(0,0,0,0.1);
127
+ box-sizing: content-box;
128
+ }
129
+ .list_cats li.item-hover {
130
+ background-color:#D9E6F9;
131
+ }
132
+ .list_cats li span {
133
+ display: block;
134
+ padding-left: 6px;
135
+ padding-top: 2px;
136
+ white-space: nowrap;
137
+ overflow: hidden;
138
+ }
139
+
140
+ .list_cats li.selected-item {
141
+ background-color:#BCD2F4;
142
+ border-color:#96B9EE;
143
+ }
144
+
145
+ .status_line {
146
+ clear: both;
147
+ width: 100%;
148
+ height: 48px;
149
+ border-top: 1px solid lightgray;
150
+ background-color: #eee;
151
+ border-top: none;
152
+ }
153
+
154
+ .status_line .status_text {
155
+ display: block;
156
+ padding-top: 14px;
157
+ }
158
+
159
+ .status_line .status_text_wrapper {
160
+
161
+ height: 30px;
162
+ float: left;
163
+ }
164
+ .status_line .status_operations {
165
+ float: left;
166
+ width: 400px;
167
+ padding-top: 3px;
168
+ }
169
+ .status_line .status_num_selected {
170
+ float: left;
171
+ line-height: 41px;
172
+ }
173
+ .item_operations_wrapper {
174
+ float: left;
175
+ margin-left: 15px;
176
+ margin-top: 4px;
177
+ }
178
+ .item_operations_wrapper select {
179
+ width: auto;
180
+ display: inline;
181
+ }
182
+ .item_operations_wrapper select {
183
+ margin: 0px;
184
+ margin-right: 3px;
185
+ }
186
+ .status_loader_wrapper {
187
+ margin-left: 10px;
188
+ width: 16px;
189
+ height: 16px;
190
+ float: left;
191
+ margin-top: 15px;
192
+ }
193
+ .status_loader {
194
+ width: 16px;
195
+ height: 16px;
196
+ background-image: url('../images/loader-status.gif');
197
+ }
198
+ .dialog_edit_category_inner {
199
+ padding-top: 20px;
200
+ padding-bottom: 20px;
201
+ }
202
+
203
+ .shadow_bar {
204
+ position: absolute;
205
+ top: 1px;
206
+ left: 1px;
207
+ width: 100%;
208
+ height: 100%;
209
+ z-index: 10002;
210
+ background-color: #ffffff;
211
+ opacity: 0;
212
+ filter: alpha(opacity=0);
213
+ }
214
+ .select_bar {
215
+ border: 1px solid black;
216
+ position: absolute;
217
+ z-index: 10003;
218
+ }
219
+
220
+ .um-sortby-wrapper{
221
+ float:right;
222
+ margin-right:10px;
223
+ }
224
+
225
+ .um-sortby-wrapper span{
226
+ font-size:14px;
227
+ font-weight:normal;
228
+ }
229
+
230
+ .um-sortby-wrapper select{
231
+ padding:2px;
232
+ margin:0px;
233
+ font-weight:normal;
234
+ }
235
+
236
+
237
+
238
+ #---------------ITEMS-LIST---------------------- {}
239
+
240
+ #dialog_edit_item .dialog_edit_item_content {
241
+ margin-top: 10px;
242
+ margin-bottom: 10px;
243
+ min-height: 360px;
244
+ }
245
+ #dialog_edit_item #dialog_edit_item_loader {
246
+ margin-top: 10px;
247
+ margin-bottom: 10px;
248
+ width: 200px;
249
+ height: 30px;
250
+ position: absolute;
251
+ top: 20px;
252
+ left: 10px;
253
+ }
254
+ .items_outer {
255
+ margin: 0px;
256
+ padding: 0px;
257
+ overflow-y: auto;
258
+ overflow-x: none;
259
+ background-color: #ffffff;
260
+ }
261
+ .items_list_wrapper {
262
+ margin: 0px;
263
+ xbackground-color: green;
264
+ position: relative;
265
+ overflow: hidden;
266
+ }
267
+ .items_list_wrapper .items_loader {
268
+ padding-top: 20px;
269
+ padding-left: 10px;
270
+ font-size: 18px;
271
+ padding-bottom: 10px;
272
+ }
273
+ .items_list_wrapper .icon_drag {
274
+ width: 24px;
275
+ height: 24px;
276
+ background-image: url('../images/icon_drag.png');
277
+ z-index: 1000;
278
+ position: absolute;
279
+ }
280
+ .items_list_wrapper .icon_notdrag {
281
+ width: 22px;
282
+ height: 22px;
283
+ background-image: url('../images/icon_notdrag.png');
284
+ z-index: 1000;
285
+ position: absolute;
286
+ }
287
+ .items_wrapper .drag_indicator {
288
+ width: 120px;
289
+ height: 30px;
290
+ border: 1px solid #B4B0B0;
291
+ background-color: rgba(255,255,255,0.85);
292
+ position: absolute;
293
+ z-index: 1001;
294
+ text-align: center;
295
+ line-height: 30px;
296
+ overflow: hidden;
297
+ font-size: 16px;
298
+ color: #484646;
299
+ box-shadow: 1px 2px 2px rgba(0,0,0,0.1);
300
+ }
301
+ .items_list_wrapper .no_items_text {
302
+ font-size: 18px;
303
+ margin-top: 20px;
304
+ margin-left: 10px;
305
+ }
306
+
307
+ .ug-list-items {
308
+ padding: 0px;
309
+ margin: 0px;
310
+ }
311
+
312
+
313
+ #---------------ITEMS-LIST-INLINE---------------------- {}
314
+
315
+ .ug-list-items li{
316
+ width:130px;
317
+ height:100px;
318
+ border:1px solid #BFBFBF;
319
+ background-color:#F0F0F0;
320
+ position:absolute;
321
+ box-shadow:1px 2px 2px rgba(0,0,0,0.1);
322
+ border-radius:3px;
323
+ overflow:hidden;
324
+ box-sizing: content-box;
325
+ }
326
+
327
+ .ug-list-items li.item-hover{
328
+ background-color:#D9E6F9;
329
+ }
330
+
331
+ .ug-list-items li.item-selected{
332
+ xbackground-color:#BCD2F4;
333
+ background-color:#E2F34B;
334
+ border-color:#96B9EE;
335
+ xcursor:default;
336
+ }
337
+
338
+ .ug-list-items li .ug-item-title{
339
+ text-align:center;
340
+ overflow:hidden;
341
+ font-weight:bold;
342
+ padding-top:2px;
343
+ padding-bottom:2px;
344
+ white-space: nowrap;
345
+ margin-left:4px;
346
+ margin-right:4px;
347
+ height:14px;
348
+ font-family:Arial,'Helvetica','sans-serif';
349
+ line-height:none;
350
+ color:#000000;
351
+ box-sizing: content-box;
352
+ }
353
+
354
+ .ug-list-items li.item-selected .ug-item-title{
355
+ background-color:#F6FBC7;
356
+ }
357
+
358
+ .ug-list-items li .ug-item-image{
359
+ overflow:hidden;
360
+ background-color:#E7E7E7;
361
+ margin:0px auto;
362
+ height:69px;
363
+ margin-top:4px;
364
+ width:122px;
365
+ background-size:cover;
366
+ background-position:center center;
367
+ }
368
+
369
+
370
+ .ug-list-items li .ug-item-icon{
371
+ position:absolute;
372
+ bottom:-2px;
373
+ right:-2px;
374
+ width:32px;
375
+ height:32px;
376
+ }
377
+
378
+ #---------------ITEMS-LIST-ICONS---------------------- {}
379
+
380
+ .ug-item-icon{
381
+ background-repeat: no-repeat;
382
+ }
383
+
384
+ .ug-list-items li.item_type_youtube .ug-item-icon {
385
+ background-image: url('../images/icon_youtube_32.png');
386
+ }
387
+
388
+ .ug-list-items li.item_type_vimeo .ug-item-icon {
389
+ background-image: url('../images/icon_vimeo_32.png');
390
+ }
391
+
392
+ .ug-list-items li.item_type_wistia .ug-item-icon {
393
+ background-image: url('../images/icon_wistia_32.png');
394
+ }
395
+
396
+ .ug-list-items li.item_type_html5video .ug-item-icon {
397
+ background-image: url('../images/icon_html5video_32.png');
398
+ bottom: -3px;
399
+ right: -3px;
400
+ }
401
+
402
+ #---------------FILTERS---------------------- {}
403
+
404
+
405
+ .ug-items-filters {}
406
+
407
+ .ug-items-filters .ug-filters-set-title {
408
+ float: left;
409
+ font-size: 14px;
410
+ font-weight: bold;
411
+ padding-top:18px;
412
+ padding-left:20px;
413
+ }
414
+
415
+ .ug-items-filters .ug-filters-set {
416
+ padding-left: 10px;
417
+ float: left;
418
+ }
419
+
420
+ .ug-items-filters .ug-filters-set a {
421
+ text-decoration: none;
422
+ color: #aaa;
423
+ padding: 15px 20px;
424
+ display:inline-block;
425
+ border-top:3px solid transparent;
426
+ }
427
+
428
+ .ug-items-filters .ug-filters-set a:first-child {
429
+ margin-left: 0px;
430
+ }
431
+
432
+ .ug-items-filters .ug-filters-set a.ug-active {
433
+ color:#333;
434
+ border-top:3px solid #0087FF;
435
+ }
css/unitegallery_styles.css ADDED
@@ -0,0 +1,120 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ /* ====================================== */
3
+ /* debug
4
+ /* ====================================== */
5
+
6
+
7
+ #debug_line{
8
+ position:absolute;
9
+ width:700px;
10
+ height:30px;
11
+ border:1px solid green;
12
+ top:60px;
13
+ left:170px;
14
+ padding:5px;
15
+ }
16
+
17
+ #debug_side{
18
+ position:absolute;
19
+ width:300px;
20
+ height:400px;
21
+ border:1px solid red;
22
+ padding:5px;
23
+ top:60px;
24
+ left:800px;
25
+ padding:5px;
26
+ overflow:scroll;
27
+ z-index:1000;
28
+ }
29
+
30
+ /* ====================================== */
31
+ /* Galleries View
32
+ /* ====================================== */
33
+
34
+ #---------------Galleries_View---------------------{}
35
+
36
+ .dialog_new_gallery .inside{
37
+ margin-bottom:20px;
38
+ margin-top:20px;
39
+ }
40
+
41
+ ul.list_galleries li{
42
+ margin:0px;
43
+ padding:0px;
44
+ }
45
+
46
+ ul.list_galleries li{
47
+ float:left;
48
+ margin-top:10px;
49
+ margin-left:15px;
50
+ }
51
+
52
+ ul.list_galleries li a{
53
+ margin-bottom:2px;
54
+ }
55
+
56
+ ul.list_galleries li a:hover{
57
+ background-color:#D3EAFB;
58
+ }
59
+
60
+ .galleries-view-box{
61
+ margin-top:40px;
62
+ border:1px solid #e5e5e5;
63
+ padding:15px;
64
+ padding-left:28px;
65
+ position:relative;
66
+ overflow:hidden;
67
+ background:#fff;
68
+ box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
69
+ line-height:1.6em;
70
+ }
71
+
72
+ .galleries-view-box .view-box-title{
73
+ font-size:16px;
74
+ font-weight:bold;
75
+ padding-bottom: 10px;
76
+ }
77
+
78
+ .galleries-view-box p{
79
+ margin-top:10px;
80
+ font-size:14px;
81
+ }
82
+
83
+ #---------------End_Galleries_View---------------------{}
84
+
85
+ /* ====================================== */
86
+ /* End Galleries View
87
+ /* ====================================== */
88
+
89
+ #---------------Gallery_View---------------------{}
90
+
91
+ /* ====================================== */
92
+ /* Gallery View
93
+ /* ====================================== */
94
+
95
+ .update_button_wrapper{
96
+ float:left;
97
+ margin-right:10px;
98
+ width:110px;
99
+ xborder:1px solid black;
100
+ }
101
+
102
+ .update_button_wrapper div{
103
+ margin-top:5px;
104
+ }
105
+
106
+ .settings_limit_message{
107
+ float:left;
108
+ padding-top:2px;
109
+ padding-left:70px;
110
+ padding-right:5px;
111
+ line-height: 1.6em;
112
+ }
113
+
114
+ .ug-settings-advanced .CodeMirror-scroll{
115
+ height: 200px;
116
+ }
117
+
118
+
119
+
120
+
galleries/index.html ADDED
File without changes
galleries/order.xml ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <apps>
3
+ <item>ugcore_default</item>
4
+ <item>ugcore_compact</item>
5
+ <item>ugcore_grid</item>
6
+ <item>ugcore_slider</item>
7
+ <item>ugcore_video</item>
8
+ <item>ugcore_tilescolumns</item>
9
+ <item>ugcore_tilesjustified</item>
10
+ <item>ugcore_tilesnested</item>
11
+ <item>ugcore_tilesgrid</item>
12
+ <item>ugcore_carousel</item>
13
+ </apps>
galleries/ugcore_carousel/client_output.php ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+
4
+ defined('UNITEGALLERY_INC') or die('Restricted access');
5
+
6
+ /**
7
+ * passed $arrOptions to this file
8
+ */
9
+
10
+ $output = new UGCarouselOutput();
11
+
12
+ $uniteGalleryOutput = $output->putGallery(GlobalsUGGallery::$galleryID, $arrOptions);
13
+
14
+ ?>
galleries/ugcore_carousel/config.xml ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+
3
+ <config>
4
+
5
+ <general>
6
+ <name>ug-carousel</name>
7
+ <title>Carousel</title>
8
+ <istiles>true</istiles>
9
+ <published>true</published>
10
+ </general>
11
+
12
+ </config>
galleries/ugcore_carousel/inc_php/index.html ADDED
File without changes
galleries/ugcore_carousel/inc_php/output.class.php ADDED
@@ -0,0 +1,85 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+
4
+ defined('UNITEGALLERY_INC') or die('Restricted access');
5
+
6
+
7
+ class UGCarouselOutput extends UGMainOutput{
8
+
9
+
10
+ /**
11
+ *
12
+ * construct the output object
13
+ */
14
+ public function __construct(){
15
+
16
+ $this->theme = UGMainOutput::THEME_CAROUSEL;
17
+ $this->isTilesType = true;
18
+
19
+ parent::__construct();
20
+ }
21
+
22
+
23
+ /**
24
+ *
25
+ * put theme related scripts
26
+ */
27
+ protected function putScripts($putSkins = true){
28
+
29
+ parent::putScripts();
30
+
31
+ if($this->putJsToBody == false)
32
+ HelperGalleryUG::addScriptAbsoluteUrl($this->urlPlugin."themes/carousel/ug-theme-carousel.js", "unitegallery_carousel_theme");
33
+
34
+ }
35
+
36
+
37
+ /**
38
+ * put javascript includes to the body before the gallery div
39
+ */
40
+ protected function putJsIncludesToBody(){
41
+ $output = parent::putJsIncludesToBody();
42
+
43
+ $src = $this->urlPlugin."themes/carousel/ug-theme-carousel.js";
44
+
45
+ $output .= "<script type='text/javascript' src='{$src}'></script>";
46
+ return($output);
47
+
48
+ }
49
+
50
+
51
+ /**
52
+ * get theme options override
53
+ */
54
+ protected function getArrJsOptions(){
55
+
56
+ $arr = parent::getArrJsOptions();
57
+
58
+ $arr[] = $this->buildJsParam("theme_gallery_padding", self::VALIDATE_NUMERIC, self::TYPE_NUMBER);
59
+ $arr[] = $this->buildJsParam("theme_carousel_align");
60
+ $arr[] = $this->buildJsParam("theme_carousel_offset", self::VALIDATE_NUMERIC, self::TYPE_NUMBER);
61
+ $arr[] = $this->buildJsParam("carousel_padding", self::VALIDATE_NUMERIC, self::TYPE_NUMBER);
62
+ $arr[] = $this->buildJsParam("carousel_space_between_tiles", self::VALIDATE_NUMERIC, self::TYPE_NUMBER);
63
+ $arr[] = $this->buildJsParam("carousel_scroll_duration", self::VALIDATE_NUMERIC, self::TYPE_NUMBER);
64
+ $arr[] = $this->buildJsParam("carousel_scroll_easing");
65
+ $arr[] = $this->buildJsParam("carousel_autoplay", null, self::TYPE_BOOLEAN);
66
+ $arr[] = $this->buildJsParam("carousel_autoplay_timeout", self::VALIDATE_NUMERIC, self::TYPE_NUMBER);
67
+ $arr[] = $this->buildJsParam("carousel_autoplay_direction");
68
+ $arr[] = $this->buildJsParam("carousel_autoplay_pause_onhover", null, self::TYPE_BOOLEAN);
69
+ $arr[] = $this->buildJsParam("theme_enable_navigation", null, self::TYPE_BOOLEAN);
70
+ $arr[] = $this->buildJsParam("theme_navigation_enable_play", null, self::TYPE_BOOLEAN);
71
+ $arr[] = $this->buildJsParam("theme_navigation_align");
72
+ $arr[] = $this->buildJsParam("theme_navigation_offset_hor", self::VALIDATE_NUMERIC, self::TYPE_NUMBER);
73
+ $arr[] = $this->buildJsParam("theme_navigation_position");
74
+ $arr[] = $this->buildJsParam("theme_navigation_margin", self::VALIDATE_NUMERIC, self::TYPE_NUMBER);
75
+ $arr[] = $this->buildJsParam("theme_space_between_arrows", self::VALIDATE_NUMERIC, self::TYPE_NUMBER);
76
+ $arr[] = $this->buildJsParam("carousel_navigation_numtiles", self::VALIDATE_NUMERIC, self::TYPE_NUMBER);
77
+
78
+
79
+ return($arr);
80
+ }
81
+
82
+
83
+ }
84
+
85
+ ?>
galleries/ugcore_carousel/includes.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ defined('UNITEGALLERY_INC') or die('Restricted access');
4
+
5
+
6
+ require_once GlobalsUG::$pathHelpersClasses."include_classes.php";
7
+
8
+ require_once $pathGallery."inc_php/output.class.php";
9
+ ?>
galleries/ugcore_carousel/index.html ADDED
File without changes
galleries/ugcore_carousel/release_log.txt ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version 1.0
2
+
3
+ first release
galleries/ugcore_carousel/settings/gallery_options.php ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ defined('UNITEGALLERY_INC') or die('Restricted access');
3
+
4
+
5
+ $settings = new UniteGallerySettingsUG();
6
+ $settings->loadXMLFile(GlobalsUGGallery::$pathSettings."gallery_options.xml");
7
+
8
+ if(method_exists("UniteProviderFunctionsUG", "addTilesSizeSettings"))
9
+ $settings = UniteProviderFunctionsUG::addTilesSizeSettings($settings);
10
+
11
+ if(method_exists("UniteProviderFunctionsUG", "addBigImageSizeSettings"))
12
+ $settings = UniteProviderFunctionsUG::addBigImageSizeSettings($settings, true);
13
+
14
+ ?>
galleries/ugcore_carousel/settings/gallery_options.xml ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+
3
+ <fields>
4
+
5
+ <fieldset name="general_options" label="General Options" icon="eg-icon-cog-alt">
6
+
7
+ <field name="tile_width"
8
+ type="text"
9
+ default="160"
10
+ label="Tile Width"
11
+ unit="px"
12
+ description="Tile width, fixed width of the tile"></field>
13
+
14
+ <field name="tile_height"
15
+ type="text"
16
+ default="160"
17
+ label="Tile Height"
18
+ unit="px"
19
+ description="Tile height. fixed height of the tile"></field>
20
+
21
+ <field type="hr"></field>
22
+
23
+ <field name="theme_gallery_padding"
24
+ type="text"
25
+ default="0"
26
+ label="Gallery Padding Sides"
27
+ unit="px"
28
+ description="The padding from the sides of the gallery"></field>
29
+
30
+ <field name="theme_carousel_align"
31
+ type="list"
32
+ default="center"
33
+ label="Carousel Align"
34
+ description="Align the carousel element in space">
35
+ </field>
36
+
37
+ <field name="theme_carousel_offset"
38
+ type="text"
39
+ default="0"
40
+ label="Carrousel Offset"
41
+ unit="px"
42
+ description="Carousel offset according the align"></field>
43
+
44
+ <field type="hr"></field>
45
+
46
+ <field name="gallery_shuffle"
47
+ type="boolean"
48
+ default="false"
49
+ label="Shuffle Items At Start"
50
+ description="Shuffle (randomize) items at gallery start">
51
+ </field>
52
+
53
+ </fieldset>
54
+ </fields>
galleries/ugcore_carousel/settings/gallery_settings.php ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ defined('UNITEGALLERY_INC') or die('Restricted access');
4
+
5
+ require GlobalsUG::$pathHelpersSettings."main_tiles.php";
6
+
7
+ $settingsParams = new UniteGallerySettingsUG();
8
+ $settingsParams->loadXMLFile(GlobalsUGGallery::$pathSettings."gallery_settings.xml");
9
+
10
+ //set defaults
11
+ $arrDefaults = array(
12
+ "tile_width" => "160",
13
+ "tile_height" => "160",
14
+ "tile_enable_border" => "true",
15
+ "tile_enable_outline" => "true"
16
+ );
17
+
18
+ $arrSettingsToHide = array(
19
+ //"slider_textpanel_align"
20
+ );
21
+
22
+ //update settings
23
+ $settingsParams->updateSelectToEasing("carousel_scroll_easing");
24
+ $settingsParams->updateSelectToAlignHor("theme_carousel_align");
25
+ $settingsParams->updateSelectToAlignHor("theme_navigation_align");
26
+
27
+ $settingsParams->hideSettings($arrSettingsToHide);
28
+
29
+ $settingsParams->setStoredValues($arrDefaults);
30
+
31
+ // get merged settings with values
32
+ $valuesMain = $settingsMain->getArrValues();
33
+ $valuesParams = $settingsParams->getArrValues();
34
+ $valuesMerged = array_merge($valuesMain, $valuesParams);
35
+
36
+ $valuesMerged["gallery_theme"] = "carousel";
37
+
38
+ ?>
galleries/ugcore_carousel/settings/gallery_settings.xml ADDED
@@ -0,0 +1,151 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+
3
+ <fields>
4
+
5
+ <fieldset name="gallery_options" loadfrom="current" />
6
+
7
+ <fieldset name="carousel_options" label="Carousel Options" icon="eg-icon-cog-alt">
8
+
9
+ <field name="carousel_padding"
10
+ type="text"
11
+ default="8"
12
+ label="Carousel Padding"
13
+ unit="px"
14
+ description="Padding from each side of the carousel to avoid tile cut in case of shadow or outline"></field>
15
+
16
+ <field name="carousel_space_between_tiles"
17
+ type="text"
18
+ default="20"
19
+ label="Space Between Tiles"
20
+ unit="px"
21
+ description="space between tiles"></field>
22
+
23
+ <field type="hr"></field>
24
+
25
+ <field name="carousel_scroll_duration"
26
+ type="text"
27
+ default="500"
28
+ label="Carousel Scroll Duration"
29
+ unit="ms"
30
+ description="The scroll duration. in milliseconds"></field>
31
+
32
+ <field name="carousel_scroll_easing"
33
+ type="list"
34
+ default="easeOutCubic"
35
+ label="Carousel Scroll Easing"
36
+ description="The easing of the carousel scrool motion">
37
+ </field>
38
+
39
+ <field type="hr"></field>
40
+
41
+ <field name="carousel_autoplay"
42
+ type="boolean"
43
+ default="true"
44
+ label="Carousel Autoplay At Start"
45
+ description="Autoplay the carousel at start"></field>
46
+
47
+ <field name="carousel_autoplay_timeout"
48
+ type="text"
49
+ default="3000"
50
+ label="Carousel Autoplay Timeout"
51
+ unit="ms"
52
+ description="The timeout till next scroll"></field>
53
+
54
+ <field name="carousel_autoplay_direction"
55
+ type="radio"
56
+ default="right"
57
+ label="Carousel Autoplay Direction"
58
+ description="The direction that the carousel scrolls on autoplay">
59
+ <option value="left" text="Left"></option>
60
+ <option value="right" text="Right"></option>
61
+ </field>
62
+
63
+ <field name="carousel_autoplay_pause_onhover"
64
+ type="boolean"
65
+ default="true"
66
+ label="Pause Autoplay On Mouseover"
67
+ description="Pause carousel autoplay on mouseover"></field>
68
+
69
+
70
+ </fieldset>
71
+
72
+ <fieldset name="carousel_navigation" label="Carousel Navigation" icon="eg-icon-cog-alt">
73
+
74
+ <field name="theme_enable_navigation"
75
+ type="boolean"
76
+ default="true"
77
+ label="&lt;b&gt;Enable Navigation&lt;/b&gt;"
78
+ description="enable carousel navigation"> </field>
79
+
80
+ <field type="bulk_control_start"
81
+ parent="theme_enable_navigation"
82
+ ctype="enable"
83
+ value="true" />
84
+
85
+ <field name="theme_navigation_enable_play"
86
+ type="boolean"
87
+ default="true"
88
+ label="&amp;nbsp; Enable Play Button"
89
+ description="enable carousel play button between the arrows"></field>
90
+
91
+ <field name="theme_navigation_align"
92
+ type="list"
93
+ default="center"
94
+ label="&amp;nbsp; Navigation Align"
95
+ description="the align of the navigation relating to the tiles">
96
+ </field>
97
+
98
+ <field name="theme_navigation_offset_hor"
99
+ type="text"
100
+ default="0"
101
+ label="&amp;nbsp; Navigation Position Offset"
102
+ unit="px"
103
+ description="The position offset relating to the align. Can be negative"></field>
104
+
105
+ <field name="theme_navigation_position"
106
+ type="list"
107
+ default="bottom"
108
+ label="&amp;nbsp; Navigation Vertical Position"
109
+ description="the vertical position of the navigation reative to the carousel">
110
+ <option value="top" text="Top"></option>
111
+ <option value="bottom" text="Bottom"></option>
112
+ </field>
113
+
114
+ <field name="theme_navigation_margin"
115
+ type="text"
116
+ default="20"
117
+ label="&amp;nbsp; Navigation Margin"
118
+ unit="px"
119
+ description="Vertical space between the carousel and the navigation"></field>
120
+
121
+ <field name="theme_space_between_arrows"
122
+ type="text"
123
+ default="5"
124
+ label="&amp;nbsp; Space Between Arrows"
125
+ unit="px"
126
+ description="space between navigation arrows"></field>
127
+
128
+ <field name="carousel_navigation_numtiles"
129
+ type="text"
130
+ default="3"
131
+ label="&amp;nbsp; Number Of Tiles To Scroll"
132
+ unit="tiles"
133
+ description="The number of tiles the carousel scrolls on navigation arrow press"></field>
134
+
135
+ <field type="bulk_control_end"/>
136
+
137
+
138
+ </fieldset>
139
+
140
+ <fieldset name="position" loadfrom="helper"></fieldset>
141
+
142
+ <fieldset name="tiles_design" loadfrom="helper"></fieldset>
143
+
144
+ <fieldset name="tiles_textpanel" loadfrom="helper"></fieldset>
145
+
146
+ <fieldset name="lightbox" loadfrom="helper"></fieldset>
147
+
148
+ <fieldset name="troubleshooting" loadfrom="helper"></fieldset>
149
+
150
+ </fields>
151
+
galleries/ugcore_carousel/settings/index.html ADDED
File without changes
galleries/ugcore_carousel/views/index.html ADDED
File without changes
galleries/ugcore_carousel/views/preview.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+
4
+ defined('UNITEGALLERY_INC') or die('Restricted access');
5
+
6
+
7
+ $output = new UGCarouselOutput();
8
+ echo $output->putGallery(GlobalsUGGallery::$galleryID);
9
+
10
+ ?>
galleries/ugcore_compact/ajax_actions.php ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ defined('UNITEGALLERY_INC') or die('Restricted access');
3
+
4
+ /**
5
+ * gets $action, $data , and working framework, so globals and helper works
6
+ * response from helperUG
7
+ */
8
+
9
+ switch($action){
10
+ case "update_thumbpanel_defaults":
11
+ UGCompactThemeHelper::updateThumbPanelDefaults($data);
12
+
13
+ $urlRedirect = HelperGalleryUG::getUrlViewCurrentGallery();
14
+ HelperUG::ajaxResponseSuccessRedirect("Position settings updated successfully", $urlRedirect);
15
+ break;
16
+ default:
17
+ HelperUG::ajaxResponseError("wrong ajax action (Compact Theme): <b>$action</b> ");
18
+ break;
19
+ }
20
+
21
+ ?>
galleries/ugcore_compact/client_output.php ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ defined('UNITEGALLERY_INC') or die('Restricted access');
3
+
4
+ /**
5
+ * passed $arrOptions to this file
6
+ */
7
+
8
+ $output = new UGCompactThemeOutput();
9
+
10
+ $uniteGalleryOutput = $output->putGallery(GlobalsUGGallery::$galleryID, $arrOptions);
11
+ ?>
galleries/ugcore_compact/config.xml ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+
3
+ <config>
4
+
5
+ <general>
6
+ <name>ug-compact</name>
7
+ <title>Compact Theme</title>
8
+ <published>true</published>
9
+ </general>
10
+
11
+ </config>
galleries/ugcore_compact/inc_php/helper.class.php ADDED
@@ -0,0 +1,169 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ defined('UNITEGALLERY_INC') or die('Restricted access');
4
+
5
+ class UGCompactThemeHelper{
6
+
7
+ /**
8
+ * update thumb panel defaults of some gallery settings
9
+ * should be inited gallery inside the framework
10
+ */
11
+ public static function updateThumbPanelDefaults($data){
12
+
13
+ UniteFunctionsUG::validateNotEmpty(GlobalsUGGallery::$gallery, "The gallery shouold be inited");
14
+
15
+ //$valuesParams["theme_panel_position"] = $position;
16
+
17
+ //include settings
18
+ $panelPos = UniteFunctionsUG::getVal($data, "position");
19
+ require HelperGalleryUG::getFilepathSettings("gallery_settings");
20
+ $posRelatedFields = self::getPositionRelatedSettings();
21
+ $valuesParams = UniteFunctionsUG::filterArrFields($valuesParams, $posRelatedFields);
22
+ $valuesParams["theme_panel_position"] = $panelPos;
23
+
24
+ GlobalsUGGallery::$gallery->updateParams($valuesParams);
25
+ }
26
+
27
+
28
+ /**
29
+ * get array of position related settings
30
+ */
31
+ private static function getPositionRelatedSettings(){
32
+
33
+ $arrSettings = array(
34
+ "slider_enable_text_panel",
35
+ "slider_zoompanel_align_hor",
36
+ "slider_zoompanel_align_vert",
37
+ "slider_zoompanel_offset_hor",
38
+ "slider_zoompanel_offset_vert",
39
+ "slider_progress_indicator_align_hor",
40
+ "slider_progress_indicator_align_vert",
41
+ "slider_progress_indicator_offset_hor",
42
+ "slider_progress_indicator_offset_vert",
43
+ "slider_play_button_align_hor",
44
+ "slider_play_button_align_vert",
45
+ "slider_play_button_offset_hor",
46
+ "slider_play_button_offset_ver",
47
+ "slider_fullscreen_button_align_hor",
48
+ "slider_fullscreen_button_align_vert",
49
+ "slider_fullscreen_button_offset_hor",
50
+ "slider_fullscreen_button_offset_vert"
51
+ );
52
+
53
+ return($arrSettings);
54
+ }
55
+
56
+
57
+ /**
58
+ * get defauot setting for left position
59
+ */
60
+ public static function getDefautsLeft(){
61
+
62
+ $arrDefaults = array(
63
+ "slider_enable_text_panel"=>"true",
64
+ "slider_zoompanel_align_hor"=>"right",
65
+ "slider_fullscreen_button_align_hor"=>"right",
66
+ "slider_zoompanel_offset_vert"=>"9",
67
+ "slider_zoompanel_offset_hor"=>"11",
68
+ "slider_play_button_align_hor"=>"right",
69
+ "slider_play_button_offset_hor"=>"88",
70
+ "slider_play_button_offset_vert"=>"8",
71
+ "slider_fullscreen_button_offset_hor"=>"52",
72
+ "slider_fullscreen_button_offset_vert"=>"9",
73
+ "slider_progress_indicator_align_hor"=>"right",
74
+ "slider_progress_indicator_offset_vert"=>"36",
75
+ "slider_progress_indicator_offset_hor"=>"63"
76
+ );
77
+
78
+ return($arrDefaults);
79
+ }
80
+
81
+ /**
82
+ * get defauot setting for right position
83
+ */
84
+ public static function getDefaultsRight(){
85
+
86
+ $arrDefaults = array(
87
+ "slider_enable_text_panel"=>"true",
88
+ "slider_zoompanel_offset_vert"=>"9",
89
+ "slider_zoompanel_offset_hor"=>"11",
90
+ "slider_play_button_offset_hor"=>"88",
91
+ "slider_play_button_offset_vert"=>"8",
92
+ "slider_fullscreen_button_offset_hor"=>"52",
93
+ "slider_fullscreen_button_offset_vert"=>"9",
94
+ "slider_progress_indicator_align_hor"=>"left",
95
+ "slider_progress_indicator_offset_vert"=>"36",
96
+ "slider_progress_indicator_offset_hor"=>"63"
97
+ );
98
+
99
+ return($arrDefaults);
100
+ }
101
+
102
+
103
+ /**
104
+ * get default setting for bottom position
105
+ */
106
+ public static function getDefaultsBottom(){
107
+
108
+ $arrDefaults = array(
109
+ "slider_zoompanel_align_hor"=>"right",
110
+ "slider_zoompanel_offset_vert"=>"10",
111
+ "slider_progress_indicator_align_hor"=>"left",
112
+ "slider_progress_indicator_offset_vert"=>"36",
113
+ "slider_progress_indicator_offset_hor"=>"16"
114
+ );
115
+
116
+ return($arrDefaults);
117
+ }
118
+
119
+
120
+ /**
121
+ * get default setting for top position
122
+ */
123
+ public static function getDefaultsTop(){
124
+
125
+ $arrDefaults = array(
126
+ "slider_zoompanel_align_vert"=>"bottom",
127
+ "slider_zoompanel_offset_vert"=>"10",
128
+ "slider_play_button_align_hor"=>"right",
129
+ "slider_play_button_align_vert"=>"bottom",
130
+ "slider_fullscreen_button_align_vert"=>"bottom",
131
+ "slider_fullscreen_button_align_hor"=>"right",
132
+ "slider_progress_indicator_align_vert"=>"bottom",
133
+ "slider_progress_indicator_offset_vert"=>"40"
134
+ );
135
+
136
+ return($arrDefaults);
137
+ }
138
+
139
+ /**
140
+ * get settings defaults by thumbs panel position
141
+ */
142
+ public static function getDefautlsByPosition($pos){
143
+
144
+ $pos = strtolower($pos);
145
+ if($pos == "")
146
+ $pos = "bottom";
147
+
148
+ switch($pos){
149
+ case "top":
150
+ return self::getDefaultsTop();
151
+ break;
152
+ case "bottom":
153
+ return self::getDefaultsBottom();
154
+ break;
155
+ case "left":
156
+ return self::getDefautsLeft();
157
+ break;
158
+ case "right":
159
+ return self::getDefaultsRight();
160
+ break;
161
+ default:
162
+ UniteFunctionsUG::throwError("Wrong position: {$pos}");
163
+ break;
164
+ }
165
+ }
166
+
167
+
168
+ }
169
+ ?>
galleries/ugcore_compact/inc_php/index.html ADDED
File without changes
galleries/ugcore_compact/inc_php/output.class.php ADDED
@@ -0,0 +1,88 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+
4
+ defined('UNITEGALLERY_INC') or die('Restricted access');
5
+
6
+
7
+ class UGCompactThemeOutput extends UGMainOutput{
8
+
9
+
10
+ /**
11
+ *
12
+ * construct the output object
13
+ */
14
+ public function __construct(){
15
+ $this->theme = UGMainOutput::THEME_COMPACT;
16
+ parent::__construct();
17
+ }
18
+
19
+
20
+ /**
21
+ *
22
+ * put theme related scripts
23
+ */
24
+ protected function putScripts($putSkins = true){
25
+
26
+ parent::putScripts();
27
+
28
+ if($this->putJsToBody == false)
29
+ HelperGalleryUG::addScriptAbsoluteUrl($this->urlPlugin."themes/compact/ug-theme-compact.js", "unitegallery_compact_theme");
30
+
31
+ }
32
+
33
+
34
+ /**
35
+ * put javascript includes to the body before the gallery div
36
+ */
37
+ protected function putJsIncludesToBody(){
38
+ $output = parent::putJsIncludesToBody();
39
+
40
+ $src = $this->urlPlugin."themes/compact/ug-theme-compact.js";
41
+
42
+ $output .= "<script type='text/javascript' src='{$src}'></script>";
43
+ return($output);
44
+ }
45
+
46
+
47
+ /**
48
+ * get default settings override.
49
+ * get them every time, take the position into the calculation
50
+ */
51
+ protected function getDefautSettingsValues(){
52
+
53
+ $panelPos = $this->getParam("theme_panel_position");
54
+
55
+ require HelperGalleryUG::getFilepathSettings("gallery_settings");
56
+
57
+ return($valuesMerged);
58
+ }
59
+
60
+
61
+ /**
62
+ * get theme options override
63
+ */
64
+ protected function getArrJsOptions(){
65
+
66
+ $arr = parent::getArrJsOptions();
67
+
68
+ $arr[] = $this->buildJsParam("theme_hide_panel_under_width", self::VALIDATE_NUMERIC, self::TYPE_NUMBER);
69
+ $arr[] = $this->buildJsParam("theme_panel_position");
70
+
71
+
72
+ return($arr);
73
+ }
74
+
75
+ /**
76
+ * get must fields array
77
+ */
78
+ protected function getArrMustFields(){
79
+
80
+ $arrMustFields = parent::getArrMustFields();
81
+ $arrMustFields[] = "theme_panel_position";
82
+
83
+ return($arrMustFields);
84
+ }
85
+
86
+ }
87
+
88
+ ?>
galleries/ugcore_compact/includes.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+
4
+ defined('UNITEGALLERY_INC') or die('Restricted access');
5
+
6
+
7
+ require_once GlobalsUG::$pathHelpersClasses."include_classes.php";
8
+
9
+ require_once $pathGallery."inc_php/helper.class.php";
10
+ require_once $pathGallery."inc_php/output.class.php";
11
+
12
+ ?>
galleries/ugcore_compact/index.html ADDED
File without changes
galleries/ugcore_compact/js/compact_admin.js ADDED
@@ -0,0 +1,95 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ function UGCompactThemeAdmin(){
3
+
4
+ var g_galleryAdmin = new UGAdmin();
5
+ if(!g_ugAdmin)
6
+ g_ugAdmin = new UniteAdminUG();
7
+
8
+
9
+ /**
10
+ * on select position select change. change the button text
11
+ */
12
+ function onSelectPositionChange(event){
13
+ var objSelect = jQuery(this);
14
+ var objButton = jQuery("#theme_button_set_defaults");
15
+
16
+ var pos = objSelect.val();
17
+ var template = g_ugtext["changedefauts_template"];
18
+
19
+ if(!g_ugAdmin)
20
+ g_ugAdmin = new UniteAdminUG();
21
+
22
+ pos = g_ugAdmin.capitalizeFirstLetter(pos);
23
+
24
+ var newText = template.replace("[pos]",pos);
25
+ objButton.val(newText);
26
+ }
27
+
28
+
29
+ /**
30
+ * call ajax to set defaut settings, then refresh the page
31
+ */
32
+ function onChangeDefaults(){
33
+
34
+ var confirmText = g_ugtext["changedefauts_confirm"];
35
+
36
+ if(confirm(confirmText) == false)
37
+ return(false);
38
+
39
+ var thumbpos = jQuery("#theme_panel_position").val();
40
+
41
+ //if new gallery view - just refresh the page with the thumbpos url argument
42
+ if(g_galleryID == ""){
43
+ var urlView = g_galleryAdmin.getUrlCurrentView("thumbpos=" + thumbpos);
44
+ urlView += "#confirmchange";
45
+ window.location = urlView;
46
+ return(false);
47
+ }
48
+ else{
49
+ var data = {"position":thumbpos};
50
+ jQuery("#theme_button_set_defaults").hide();
51
+ jQuery("#theme_button_set_defaults_loader").show();
52
+ g_galleryAdmin.ajaxRequestGallery("update_thumbpanel_defaults", data);
53
+ }
54
+
55
+ };
56
+
57
+
58
+ /**
59
+ * check the hash command and show the success message accordingly
60
+ */
61
+ function handleHashCommands(){
62
+
63
+ if(location.hash == "#confirmchange"){
64
+
65
+ var successText = g_ugtext["changedefauts_success"];
66
+
67
+ g_ugAdmin.showSuccessMessage(successText);
68
+
69
+ location.hash = "";
70
+ }
71
+
72
+ }
73
+
74
+
75
+ /**
76
+ * init function
77
+ */
78
+ this.init = function(){
79
+ jQuery("#theme_panel_position").change(onSelectPositionChange);
80
+ jQuery("#theme_button_set_defaults").click(onChangeDefaults);
81
+
82
+ handleHashCommands();
83
+
84
+ };
85
+
86
+ }
87
+
88
+ jQuery(document).ready(function(){
89
+
90
+ compactAdmin = new UGCompactThemeAdmin();
91
+ compactAdmin.init();
92
+
93
+
94
+ });
95
+
galleries/ugcore_compact/js/index.html ADDED
File without changes
galleries/ugcore_compact/release_log.txt ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version 1.0
2
+
3
+ first release
galleries/ugcore_compact/scripts.php ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+
4
+ defined('UNITEGALLERY_INC') or die('Restricted access');
5
+
6
+ HelperGalleryUG::addScript("js/compact_admin.js", "compact_admin");
7
+ ?>
galleries/ugcore_compact/settings/gallery_settings.php ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+
4
+ defined('UNITEGALLERY_INC') or die('Restricted access');
5
+
6
+
7
+ require GlobalsUG::$pathHelpersSettings."main.php";
8
+
9
+ $settingsParams = new UniteGallerySettingsUG();
10
+ $settingsParams->loadXMLFile(GlobalsUGGallery::$pathSettings."gallery_settings.xml");
11
+
12
+ $settingsParams->updateSettingProperty("thumb_fixed_size", "hidden", false);
13
+
14
+
15
+ //set defaults
16
+ $arrDefaults = array(
17
+ "slider_controls_always_on" => "true",
18
+ "slider_enable_text_panel" => "false",
19
+ "strippanel_enable_buttons" => "false"
20
+ );
21
+
22
+
23
+ //set defaults by position
24
+ if(!isset($panelPos))
25
+ $panelPos = UniteFunctionsUG::getGetVar("thumbpos","bottom");
26
+
27
+
28
+ $arrPosDefaults = UGCompactThemeHelper::getDefautlsByPosition($panelPos);
29
+ $arrDefaults = array_merge($arrDefaults, $arrPosDefaults);
30
+
31
+
32
+ $arrSettingsToHide = array(
33
+ );
34
+
35
+ //$settingsParams->hideSettings($arrSettingsToHide);
36
+ $settingsParams->setStoredValues($arrDefaults);
37
+
38
+ // get merged settings with values
39
+ $valuesMain = $settingsMain->getArrValues();
40
+ $valuesParams = $settingsParams->getArrValues();
41
+ $valuesMerged = array_merge($valuesMain, $valuesParams);
42
+ $valuesMerged["gallery_theme"] = "compact";
43
+
44
+
45
+ ?>
galleries/ugcore_compact/settings/gallery_settings.xml ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+
3
+ <fields>
4
+
5
+ <fieldset name="theme_options" label="Theme Options" icon="eg-icon-cog-alt">
6
+
7
+ <field name="theme_panel_position"
8
+ type="list"
9
+ default="bottom"
10
+ label="Thumbs Panel Position"
11
+ description="The position of the thumbs panel">
12
+ <option value="bottom" text="Bottom"></option>
13
+ <option value="top" text="Top"></option>
14
+ <option value="left" text="Left"></option>
15
+ <option value="right" text="Right"></option>
16
+ </field>
17
+
18
+ <field name="theme_button_set_defaults"
19
+ type="button"
20
+ default="Set Defaults"
21
+ label="Set Thumbs Panel Defaults"
22
+ description="Set the position defalut settings"
23
+ addtext="&lt;span class='loader_text' id='theme_button_set_defaults_loader' style='display:none'&gt;updating...&lt;/span&gt;">
24
+ </field>
25
+
26
+ <field name="theme_hide_panel_under_width"
27
+ type="text"
28
+ default="480"
29
+ label="Hide Panel Under Width"
30
+ unit="px"
31
+ description="hide panel under certain browser width, if 0, don't hide">
32
+ </field>
33
+
34
+
35
+ </fieldset>
36
+
37
+ <fieldset name="general" loadfrom="helper"></fieldset>
38
+ <fieldset name="position" loadfrom="helper"></fieldset>
39
+
40
+ <fieldset name="strip_panel" loadfrom="helper"></fieldset>
41
+
42
+ <fieldset name="thumbnail" loadfrom="helper"></fieldset>
43
+
44
+ <fieldset name="slider_main" loadfrom="helper"></fieldset>
45
+
46
+ <fieldset name="slider_textpanel" loadfrom="helper"></fieldset>
47
+
48
+ <!--
49
+ <fieldset name="grid_panel" loadfrom="helper"></fieldset>
50
+ -->
51
+
52
+ <fieldset name="troubleshooting" loadfrom="helper"></fieldset>
53
+
54
+ </fields>
55
+
galleries/ugcore_compact/settings/index.html ADDED
File without changes
galleries/ugcore_compact/views/index.html ADDED
File without changes
galleries/ugcore_compact/views/preview.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+
4
+ defined('UNITEGALLERY_INC') or die('Restricted access');
5
+
6
+
7
+ $output = new UGCompactThemeOutput();
8
+ echo $output->putGallery(GlobalsUGGallery::$galleryID);
9
+
10
+ ?>
galleries/ugcore_compact/views/settings_before_draw.php ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+
4
+ defined('UNITEGALLERY_INC') or die('Restricted access');
5
+
6
+ //set panel position from get
7
+ if(empty($galleryID)){
8
+ $getPanelPos = UniteFunctionsUG::getGetVar("thumbpos","bottom");
9
+ $settingsParams->updateSettingValue("theme_panel_position", $getPanelPos);
10
+ }
11
+
12
+ HelperGalleryUG::addJsText("changedefauts_confirm", __("Do you sure to set the theme panel position defaults?", UNITEGALLERY_TEXTDOMAIN));
13
+ HelperGalleryUG::addJsText("changedefauts_success", __("The default settings has been succssfully changed.", UNITEGALLERY_TEXTDOMAIN));
14
+ HelperGalleryUG::addJsText("changedefauts_template", __("Set [pos] Defaults.", UNITEGALLERY_TEXTDOMAIN));
15
+
16
+ $panelPosition = $settingsParams->getSettingValue("theme_panel_position", "bottom");
17
+
18
+ $posName = ucfirst($panelPosition);
19
+ $settingsParams->updateSettingValue("theme_button_set_defaults", "Set {$posName} Defaults");
20
+
21
+
22
+ ?>
galleries/ugcore_default/client_output.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+
4
+ defined('UNITEGALLERY_INC') or die('Restricted access');
5
+ /**
6
+ * passed $arrOptions to this file
7
+ */
8
+
9
+ $output = new UGDefaultThemeOutput();
10
+
11
+ $uniteGalleryOutput = $output->putGallery(GlobalsUGGallery::$galleryID, $arrOptions);
12
+ ?>
galleries/ugcore_default/config.xml ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+
3
+ <config>
4
+
5
+ <general>
6
+ <name>ug-default</name>
7
+ <title>Default Theme</title>
8
+ <published>true</published>
9
+ </general>
10
+
11
+ </config>
galleries/ugcore_default/inc_php/index.html ADDED
File without changes
galleries/ugcore_default/inc_php/output.class.php ADDED
@@ -0,0 +1,69 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+
4
+ defined('UNITEGALLERY_INC') or die('Restricted access');
5
+
6
+
7
+ class UGDefaultThemeOutput extends UGMainOutput{
8
+
9
+
10
+ /**
11
+ *
12
+ * construct the output object
13
+ */
14
+ public function __construct(){
15
+
16
+ $this->theme = UGMainOutput::THEME_DEFAULT;
17
+
18
+ parent::__construct();
19
+ }
20
+
21
+
22
+ /**
23
+ *
24
+ * put theme related scripts
25
+ */
26
+ protected function putScripts($putSkins = true){
27
+
28
+ parent::putScripts();
29
+
30
+ if($this->putJsToBody == false)
31
+ HelperGalleryUG::addScriptAbsoluteUrl($this->urlPlugin."themes/default/ug-theme-default.js", "unitegallery_default_theme");
32
+
33
+ HelperGalleryUG::addStyleAbsoluteUrl($this->urlPlugin."themes/default/ug-theme-default.css","ug-theme-default");
34
+
35
+ }
36
+
37
+
38
+ /**
39
+ * put javascript includes to the body before the gallery div
40
+ */
41
+ protected function putJsIncludesToBody(){
42
+ $output = parent::putJsIncludesToBody();
43
+ $src = $this->urlPlugin."themes/default/ug-theme-default.js";
44
+
45
+ $output .= "<script type='text/javascript' src='{$src}'></script>";
46
+ return($output);
47
+ }
48
+
49
+
50
+ /**
51
+ * get theme options override
52
+ */
53
+ protected function getArrJsOptions(){
54
+
55
+ $arr = parent::getArrJsOptions();
56
+
57
+ $arr[] = $this->buildJsParam("theme_enable_fullscreen_button", null, self::TYPE_BOOLEAN);
58
+ $arr[] = $this->buildJsParam("theme_enable_play_button", null, self::TYPE_BOOLEAN);
59
+ $arr[] = $this->buildJsParam("theme_enable_hidepanel_button", null, self::TYPE_BOOLEAN);
60
+ $arr[] = $this->buildJsParam("theme_enable_text_panel", null, self::TYPE_BOOLEAN);
61
+ $arr[] = $this->buildJsParam("theme_hide_panel_under_width", self::VALIDATE_NUMERIC, self::TYPE_NUMBER);
62
+
63
+ return($arr);
64
+ }
65
+
66
+
67
+ }
68
+
69
+ ?>
galleries/ugcore_default/includes.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ defined('UNITEGALLERY_INC') or die('Restricted access');
4
+
5
+
6
+ require_once GlobalsUG::$pathHelpersClasses."include_classes.php";
7
+
8
+ require_once $pathGallery."inc_php/output.class.php";
9
+ ?>
galleries/ugcore_default/index.html ADDED
File without changes
galleries/ugcore_default/release_log.txt ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version 1.0
2
+
3
+ first release
galleries/ugcore_default/settings/gallery_settings.php ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ defined('UNITEGALLERY_INC') or die('Restricted access');
4
+
5
+
6
+ require GlobalsUG::$pathHelpersSettings."main.php";
7
+
8
+ $settingsParams = new UniteGallerySettingsUG();
9
+ $settingsParams->loadXMLFile(GlobalsUGGallery::$pathSettings."gallery_settings.xml");
10
+
11
+ //show fixed thumb size setting
12
+ $settingsParams->updateSettingProperty("thumb_fixed_size", "hidden", false);
13
+ $settingsParams->addControl("thumb_fixed_size", "thumb_width", "disable", "false");
14
+
15
+
16
+ //set defaults
17
+ $arrDefaults = array(
18
+ "slider_controls_always_on" => "true", //zoompanel
19
+ "slider_zoompanel_offset_vert" => "12",
20
+
21
+ "slider_textpanel_align" => "top", //text panel
22
+ "slider_textpanel_padding_top" => "0",
23
+ "slider_textpanel_enable_title" => "false",
24
+ "slider_textpanel_enable_description" => "true",
25
+
26
+ "strippanel_background_color" => "#232323", //strip panel
27
+ "strippanel_padding_top" => "10",
28
+
29
+ "slider_enable_text_panel" => "true", //must options
30
+ "slider_enable_play_button" => "false",
31
+ "slider_enable_fullscreen_button" => "false"
32
+ );
33
+
34
+ $arrSettingsToHide = array(
35
+ "slider_enable_text_panel",
36
+ "slider_enable_play_button",
37
+ "slider_enable_fullscreen_button",
38
+ "hr_buttons1",
39
+ "hr_buttons2",
40
+ "slider_textpanel_height",
41
+ "slider_textpanel_margin",
42
+ "slider_textpanel_always_on",
43
+ "hr_textpanel1",
44
+ "slider_textpanel_align"
45
+ );
46
+
47
+ $settingsParams->hideSettings($arrSettingsToHide);
48
+
49
+ $settingsParams->setStoredValues($arrDefaults);
50
+
51
+ // get merged settings with values
52
+ $valuesMain = $settingsMain->getArrValues();
53
+ $valuesParams = $settingsParams->getArrValues();
54
+ $valuesMerged = array_merge($valuesMain, $valuesParams);
55
+
56
+ $valuesMerged["gallery_theme"] = "default";
57
+
58
+ ?>
galleries/ugcore_default/settings/gallery_settings.xml ADDED
@@ -0,0 +1,66 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+
3
+ <fields>
4
+
5
+ <fieldset name="theme_options" label="Theme Options" icon="eg-icon-cog-alt">
6
+
7
+ <field name="theme_enable_fullscreen_button"
8
+ type="boolean"
9
+ default="true"
10
+ label="Show Fullscreen Button"
11
+ description="show, hide the theme fullscreen button. The position in the theme is constant">
12
+ </field>
13
+
14
+ <field name="theme_enable_play_button"
15
+ type="boolean"
16
+ default="true"
17
+ label="Show Play Button"
18
+ description="show, hide the theme play button. The position in the theme is constant">
19
+ </field>
20
+
21
+ <field name="theme_enable_hidepanel_button"
22
+ type="boolean"
23
+ default="true"
24
+ label="Show 'Hide Panel' Button"
25
+ description="show, hide the hidepanel button">
26
+ </field>
27
+
28
+ <field name="theme_enable_text_panel"
29
+ type="boolean"
30
+ default="true"
31
+ label="Show Text Panel"
32
+ description="enable the panel text panel">
33
+ </field>
34
+
35
+ <field type="hr"></field>
36
+
37
+ <field name="theme_hide_panel_under_width"
38
+ type="text"
39
+ default="480"
40
+ label="Hide Panel Under Width"
41
+ unit="px"
42
+ description="hide panel under certain browser width, if 0, don't hide">
43
+ </field>
44
+
45
+ </fieldset>
46
+
47
+ <fieldset name="general" loadfrom="helper"></fieldset>
48
+
49
+ <fieldset name="position" loadfrom="helper"></fieldset>
50
+
51
+ <fieldset name="strip_panel" loadfrom="helper"></fieldset>
52
+
53
+ <fieldset name="thumbnail" loadfrom="helper"></fieldset>
54
+
55
+ <fieldset name="slider_main" loadfrom="helper"></fieldset>
56
+
57
+ <fieldset name="slider_textpanel" loadfrom="helper"></fieldset>
58
+
59
+ <!--
60
+ <fieldset name="grid_panel" loadfrom="helper"></fieldset>
61
+ -->
62
+
63
+ <fieldset name="troubleshooting" loadfrom="helper"></fieldset>
64
+
65
+ </fields>
66
+
galleries/ugcore_default/settings/index.html ADDED
File without changes
galleries/ugcore_default/views/index.html ADDED
File without changes
galleries/ugcore_default/views/preview.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+
4
+ defined('UNITEGALLERY_INC') or die('Restricted access');
5
+
6
+
7
+ $output = new UGDefaultThemeOutput();
8
+ echo $output->putGallery(GlobalsUGGallery::$galleryID);
9
+
10
+ ?>
galleries/ugcore_grid/ajax_actions.php ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+
4
+ defined('UNITEGALLERY_INC') or die('Restricted access');
5
+
6
+ /**
7
+ * gets $action, $data , and working framework, so globals and helper works
8
+ * response from helperUG
9
+ */
10
+
11
+ switch($action){
12
+ case "update_thumbpanel_defaults":
13
+ UGGridThemeHelper::updateThumbPanelDefaults($data);
14
+
15
+ $urlRedirect = HelperGalleryUG::getUrlViewCurrentGallery();
16
+ HelperUG::ajaxResponseSuccessRedirect("Position settings updated successfully", $urlRedirect);
17
+ break;
18
+ default:
19
+ HelperUG::ajaxResponseError("wrong ajax action (Compact Theme): <b>$action</b> ");
20
+ break;
21
+ }
22
+
23
+ ?>
galleries/ugcore_grid/client_output.php ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+
4
+ defined('UNITEGALLERY_INC') or die('Restricted access');
5
+
6
+ /**
7
+ * passed $arrOptions to this file
8
+ */
9
+
10
+ $output = new UGGridThemeOutput();
11
+
12
+ $uniteGalleryOutput = $output->putGallery(GlobalsUGGallery::$galleryID, $arrOptions);
13
+ ?>
galleries/ugcore_grid/config.xml ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+
3
+ <config>
4
+
5
+ <general>
6
+ <name>ug-grid</name>
7
+ <title>Grid Theme</title>
8
+ <published>true</published>
9
+ </general>
10
+
11
+ </config>
galleries/ugcore_grid/inc_php/helper.class.php ADDED
@@ -0,0 +1,163 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+
4
+ defined('UNITEGALLERY_INC') or die('Restricted access');
5
+
6
+ class UGGridThemeHelper{
7
+
8
+ /**
9
+ * update thumb panel defaults of some gallery settings
10
+ * should be inited gallery inside the framework
11
+ */
12
+ public static function updateThumbPanelDefaults($data){
13
+
14
+ UniteFunctionsUG::validateNotEmpty(GlobalsUGGallery::$gallery, "The gallery shouold be inited");
15
+
16
+ //$valuesParams["theme_panel_position"] = $position;
17
+
18
+ //include settings
19
+ $panelPos = UniteFunctionsUG::getVal($data, "position");
20
+ require HelperGalleryUG::getFilepathSettings("gallery_settings");
21
+ $posRelatedFields = self::getPositionRelatedSettings();
22
+ $valuesParams = UniteFunctionsUG::filterArrFields($valuesParams, $posRelatedFields);
23
+ $valuesParams["theme_panel_position"] = $panelPos;
24
+
25
+ GlobalsUGGallery::$gallery->updateParams($valuesParams);
26
+ }
27
+
28
+
29
+ /**
30
+ * get array of position related settings
31
+ */
32
+ private static function getPositionRelatedSettings(){
33
+
34
+ $arrSettings = array(
35
+ "slider_enable_text_panel",
36
+ "slider_zoompanel_align_hor",
37
+ "slider_zoompanel_align_vert",
38
+ "slider_zoompanel_offset_hor",
39
+ "slider_zoompanel_offset_vert",
40
+ "slider_progress_indicator_align_hor",
41
+ "slider_progress_indicator_align_vert",
42
+ "slider_progress_indicator_offset_hor",
43
+ "slider_progress_indicator_offset_vert",
44
+ "slider_play_button_align_hor",
45
+ "slider_play_button_align_vert",
46
+ "slider_play_button_offset_hor",
47
+ "slider_play_button_offset_ver",
48
+ "slider_fullscreen_button_align_hor",
49
+ "slider_fullscreen_button_align_vert",
50
+ "slider_fullscreen_button_offset_hor",
51
+ "slider_fullscreen_button_offset_vert",
52
+ "gridpanel_padding_border_top",
53
+ "gridpanel_padding_border_bottom"
54
+ );
55
+
56
+ return($arrSettings);
57
+ }
58
+
59
+
60
+ /**
61
+ * get defauot setting for left position, take the right setting for base
62
+ */
63
+ public static function getDefautsLeft(){
64
+
65
+ $arrDefaults = self::getDefaultsRight();
66
+
67
+ $arrDefaults["slider_zoompanel_align_hor"] = "right";
68
+ $arrDefaults["slider_fullscreen_button_align_hor"] = "right";
69
+ $arrDefaults["slider_play_button_align_hor"] = "right";
70
+
71
+ return($arrDefaults);
72
+ }
73
+
74
+ /**
75
+ * get defauot setting for right position
76
+ */
77
+ public static function getDefaultsRight(){
78
+
79
+ $arrDefaults = array(
80
+ "slider_zoompanel_offset_vert"=>"9",
81
+ "slider_zoompanel_offset_hor"=>"11",
82
+ "slider_play_button_offset_hor"=>"88",
83
+ "slider_play_button_offset_vert"=>"8",
84
+ "slider_fullscreen_button_offset_hor"=>"52",
85
+ "slider_fullscreen_button_offset_vert"=>"9"
86
+ );
87
+
88
+ return($arrDefaults);
89
+ }
90
+
91
+
92
+ /**
93
+ * get default setting for top position
94
+ */
95
+ public static function getDefaultsTop(){
96
+
97
+ $arrDefaults = array(
98
+ "slider_enable_text_panel"=>"false",
99
+ "slider_zoompanel_align_vert"=>"bottom",
100
+ "slider_zoompanel_offset_vert"=>"10",
101
+ "slider_play_button_align_hor"=>"right",
102
+ "slider_play_button_align_vert"=>"bottom",
103
+ "slider_fullscreen_button_align_vert"=>"bottom",
104
+ "slider_fullscreen_button_align_hor"=>"right",
105
+ "slider_progress_indicator_align_vert"=>"bottom",
106
+ "slider_progress_indicator_offset_vert"=>"40",
107
+ "gridpanel_padding_border_top"=>"4",
108
+ "gridpanel_padding_border_bottom"=>"10"
109
+ );
110
+
111
+ return($arrDefaults);
112
+ }
113
+
114
+
115
+ /**
116
+ * get default setting for top position
117
+ */
118
+ public static function getDefaultsBottom(){
119
+
120
+ $arrDefaults = array(
121
+ "slider_enable_text_panel"=>"false",
122
+ "slider_zoompanel_align_hor"=>"right",
123
+ "slider_zoompanel_offset_vert"=>"10",
124
+ "slider_progress_indicator_align_hor"=>"left",
125
+ "slider_progress_indicator_offset_vert"=>"36",
126
+ "slider_progress_indicator_offset_hor"=>"16"
127
+ );
128
+
129
+ return($arrDefaults);
130
+ }
131
+
132
+
133
+ /**
134
+ * get settings defaults by thumbs panel position
135
+ */
136
+ public static function getDefautlsByPosition($pos){
137
+
138
+ $pos = strtolower($pos);
139
+ if($pos == "")
140
+ $pos = "right";
141
+
142
+ switch($pos){
143
+ case "left":
144
+ return self::getDefautsLeft();
145
+ break;
146
+ case "right":
147
+ return self::getDefaultsRight();
148
+ break;
149
+ case "top":
150
+ return self::getDefaultsTop();
151
+ break;
152
+ case "bottom":
153
+ return self::getDefaultsBottom();
154
+ break;
155
+ default:
156
+ UniteFunctionsUG::throwError("Wrong position: {$pos}");
157
+ break;
158
+ }
159
+ }
160
+
161
+
162
+ }
163
+ ?>
galleries/ugcore_grid/inc_php/index.html ADDED
File without changes
galleries/ugcore_grid/inc_php/output.class.php ADDED
@@ -0,0 +1,88 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+
4
+ defined('UNITEGALLERY_INC') or die('Restricted access');
5
+
6
+
7
+ class UGGridThemeOutput extends UGMainOutput{
8
+
9
+ /**
10
+ *
11
+ * construct the output object
12
+ */
13
+ public function __construct(){
14
+
15
+ $this->theme = UGMainOutput::THEME_GRID;
16
+ parent::__construct();
17
+ }
18
+
19
+
20
+ /**
21
+ *
22
+ * put theme related scripts
23
+ */
24
+ protected function putScripts($putSkins = true){
25
+
26
+ parent::putScripts();
27
+
28
+ if($this->putJsToBody == false)
29
+ HelperGalleryUG::addScriptAbsoluteUrl($this->urlPlugin."themes/grid/ug-theme-grid.js", "unitegallery_grid_theme");
30
+
31
+ }
32
+
33
+
34
+ /**
35
+ * put javascript includes to the body before the gallery div
36
+ */
37
+ protected function putJsIncludesToBody(){
38
+ $output = parent::putJsIncludesToBody();
39
+
40
+ $src = $this->urlPlugin."themes/grid/ug-theme-grid.js";
41
+
42
+ $output .= "<script type='text/javascript' src='{$src}'></script>";
43
+ return($output);
44
+
45
+ }
46
+
47
+
48
+ /**
49
+ * get default settings override.
50
+ * get them every time, take the position into the calculation
51
+ */
52
+ protected function getDefautSettingsValues(){
53
+
54
+ $panelPos = $this->getParam("theme_panel_position");
55
+
56
+ require HelperGalleryUG::getFilepathSettings("gallery_settings");
57
+
58
+ return($valuesMerged);
59
+ }
60
+
61
+ /**
62
+ * get theme options override
63
+ */
64
+ protected function getArrJsOptions(){
65
+
66
+ $arr = parent::getArrJsOptions();
67
+
68
+ $arr[] = $this->buildJsParam("theme_hide_panel_under_width", self::VALIDATE_NUMERIC, self::TYPE_NUMBER);
69
+ $arr[] = $this->buildJsParam("theme_panel_position");
70
+
71
+ return($arr);
72
+ }
73
+
74
+
75
+ /**
76
+ * get must fields array
77
+ */
78
+ protected function getArrMustFields(){
79
+
80
+ $arrMustFields = parent::getArrMustFields();
81
+ $arrMustFields[] = "theme_panel_position";
82
+
83
+ return($arrMustFields);
84
+ }
85
+
86
+ }
87
+
88
+ ?>
galleries/ugcore_grid/includes.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+
4
+ defined('UNITEGALLERY_INC') or die('Restricted access');
5
+
6
+
7
+ require_once GlobalsUG::$pathHelpersClasses."include_classes.php";
8
+
9
+ require_once $pathGallery."inc_php/helper.class.php";
10
+ require_once $pathGallery."inc_php/output.class.php";
11
+
12
+ ?>
galleries/ugcore_grid/index.html ADDED
File without changes
galleries/ugcore_grid/js/grid_admin.js ADDED
@@ -0,0 +1,95 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ function UGGridThemeAdmin(){
3
+
4
+ var g_galleryAdmin = new UGAdmin();
5
+ if(!g_ugAdmin)
6
+ g_ugAdmin = new UniteAdminUG();
7
+
8
+
9
+ /**
10
+ * on select position select change. change the button text
11
+ */
12
+ function onSelectPositionChange(event){
13
+ var objSelect = jQuery(this);
14
+ var objButton = jQuery("#theme_button_set_defaults");
15
+
16
+ var pos = objSelect.val();
17
+ var template = g_ugtext["changedefauts_template"];
18
+
19
+ if(!g_ugAdmin)
20
+ g_ugAdmin = new UniteAdminUG();
21
+
22
+ pos = g_ugAdmin.capitalizeFirstLetter(pos);
23
+
24
+ var newText = template.replace("[pos]",pos);
25
+ objButton.val(newText);
26
+ }
27
+
28
+
29
+ /**
30
+ * call ajax to set defaut settings, then refresh the page
31
+ */
32
+ function onChangeDefaults(){
33
+
34
+ var confirmText = g_ugtext["changedefauts_confirm"];
35
+
36
+ if(confirm(confirmText) == false)
37
+ return(false);
38
+
39
+ var thumbpos = jQuery("#theme_panel_position").val();
40
+
41
+ //if new gallery view - just refresh the page with the thumbpos url argument
42
+ if(g_galleryID == ""){
43
+ var urlView = g_galleryAdmin.getUrlCurrentView("thumbpos=" + thumbpos);
44
+ urlView += "#confirmchange";
45
+ window.location = urlView;
46
+ return(false);
47
+ }
48
+ else{
49
+ var data = {"position":thumbpos};
50
+ jQuery("#theme_button_set_defaults").hide();
51
+ jQuery("#theme_button_set_defaults_loader").show();
52
+ g_galleryAdmin.ajaxRequestGallery("update_thumbpanel_defaults", data);
53
+ }
54
+
55
+ };
56
+
57
+
58
+ /**
59
+ * check the hash command and show the success message accordingly
60
+ */
61
+ function handleHashCommands(){
62
+
63
+ if(location.hash == "#confirmchange"){
64
+
65
+ var successText = g_ugtext["changedefauts_success"];
66
+
67
+ g_ugAdmin.showSuccessMessage(successText);
68
+
69
+ location.hash = "";
70
+ }
71
+
72
+ }
73
+
74
+
75
+ /**
76
+ * init function
77
+ */
78
+ this.init = function(){
79
+ jQuery("#theme_panel_position").change(onSelectPositionChange);
80
+ jQuery("#theme_button_set_defaults").click(onChangeDefaults);
81
+
82
+ handleHashCommands();
83
+
84
+ };
85
+
86
+ }
87
+
88
+ jQuery(document).ready(function(){
89
+
90
+ compactAdmin = new UGGridThemeAdmin();
91
+ compactAdmin.init();
92
+
93
+
94
+ });
95
+
galleries/ugcore_grid/js/index.html ADDED
File without changes
galleries/ugcore_grid/release_log.txt ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version 1.0
2
+
3
+ first release
galleries/ugcore_grid/scripts.php ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+
4
+ defined('UNITEGALLERY_INC') or die('Restricted access');
5
+
6
+ HelperGalleryUG::addScript("js/grid_admin.js", "grid_admin");
7
+ ?>
galleries/ugcore_grid/settings/gallery_settings.php ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+
4
+ defined('UNITEGALLERY_INC') or die('Restricted access');
5
+
6
+
7
+ require GlobalsUG::$pathHelpersSettings."main.php";
8
+
9
+ $settingsParams = new UniteGallerySettingsUG();
10
+ $settingsParams->loadXMLFile(GlobalsUGGallery::$pathSettings."gallery_settings.xml");
11
+
12
+ //set defaults
13
+ $arrDefaults = array(
14
+ "slider_controls_always_on" => "true",
15
+ );
16
+
17
+ //set defaults by position
18
+ if(!isset($panelPos))
19
+ $panelPos = UniteFunctionsUG::getGetVar("thumbpos","right");
20
+
21
+ $arrPosDefaults = UGGridThemeHelper::getDefautlsByPosition($panelPos);
22
+ $arrDefaults = array_merge($arrDefaults, $arrPosDefaults);
23
+
24
+ $arrSettingsToHide = array(
25
+ );
26
+
27
+ //$settingsParams->hideSettings($arrSettingsToHide);
28
+ $settingsParams->setStoredValues($arrDefaults);
29
+
30
+ // get merged settings with values
31
+ $valuesMain = $settingsMain->getArrValues();
32
+ $valuesParams = $settingsParams->getArrValues();
33
+ $valuesMerged = array_merge($valuesMain, $valuesParams);
34
+
35
+ $valuesMerged["gallery_theme"] = "grid";
36
+
37
+ ?>
galleries/ugcore_grid/settings/gallery_settings.xml ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+
3
+ <fields>
4
+
5
+ <fieldset name="theme_options" label="Theme Options" icon="eg-icon-cog-alt">
6
+
7
+ <field name="theme_panel_position"
8
+ type="list"
9
+ default="right"
10
+ label="Thumbs Panel Position"
11
+ description="The position of the thumbs panel">
12
+ <option value="right" text="Right"></option>
13
+ <option value="left" text="Left"></option>
14
+ <option value="bottom" text="Bottom"></option>
15
+ <option value="top" text="Top"></option>
16
+ </field>
17
+
18
+ <field type="control"
19
+ parent="theme_panel_position"
20
+ ctype="show"
21
+ child="gridpanel_arrows_align_hor, gridpanel_arrows_padding_hor"
22
+ value="bottom,top" />
23
+
24
+ <field type="control"
25
+ parent="theme_panel_position"
26
+ ctype="show"
27
+ child="gridpanel_space_between_arrows, gridpanel_vertical_scroll"
28
+ value="left,right" />
29
+
30
+ <field name="theme_button_set_defaults"
31
+ type="button"
32
+ default="Set Defaults"
33
+ label="Set Thumbs Panel Defaults"
34
+ description="Set the position defalut settings"
35
+ addtext="&lt;span class='loader_text' id='theme_button_set_defaults_loader' style='display:none'&gt;updating...&lt;/span&gt;">
36
+ </field>
37
+
38
+ <field name="theme_hide_panel_under_width"
39
+ type="text"
40
+ default="480"
41
+ label="Hide Panel Under Width"
42
+ unit="px"
43
+ description="hide panel under certain browser width, if 0, don't hide">
44
+ </field>
45
+
46
+ </fieldset>
47
+
48
+ <fieldset name="general" loadfrom="helper"></fieldset>
49
+
50
+ <fieldset name="position" loadfrom="helper"></fieldset>
51
+
52
+ <fieldset name="grid_panel" loadfrom="helper"></fieldset>
53
+
54
+ <fieldset name="thumbnail" loadfrom="helper"></fieldset>
55
+
56
+ <fieldset name="slider_main" loadfrom="helper"></fieldset>
57
+
58
+ <fieldset name="slider_textpanel" loadfrom="helper"></fieldset>
59
+
60
+ <fieldset name="troubleshooting" loadfrom="helper"></fieldset>
61
+
62
+ </fields>
galleries/ugcore_grid/settings/index.html ADDED
File without changes
galleries/ugcore_grid/views/index.html ADDED
File without changes
galleries/ugcore_grid/views/preview.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+
4
+ defined('UNITEGALLERY_INC') or die('Restricted access');
5
+
6
+
7
+ $output = new UGGridThemeOutput();
8
+ echo $output->putGallery(GlobalsUGGallery::$galleryID);
9
+
10
+ ?>
galleries/ugcore_grid/views/settings_before_draw.php ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+
4
+ defined('UNITEGALLERY_INC') or die('Restricted access');
5
+
6
+
7
+ //set panel position from get
8
+ if(empty($galleryID)){
9
+ $getPanelPos = UniteFunctionsUG::getGetVar("thumbpos","bottom");
10
+ $settingsParams->updateSettingValue("theme_panel_position", $getPanelPos);
11
+ }
12
+
13
+ HelperGalleryUG::addJsText("changedefauts_confirm", __("Do you sure to set the theme panel position defaults?", UNITEGALLERY_TEXTDOMAIN));
14
+ HelperGalleryUG::addJsText("changedefauts_success", __("The default settings has been succssfully changed.", UNITEGALLERY_TEXTDOMAIN));
15
+ HelperGalleryUG::addJsText("changedefauts_template", __("Set [pos] Defaults.", UNITEGALLERY_TEXTDOMAIN));
16
+
17
+ $panelPosition = $settingsParams->getSettingValue("theme_panel_position", "bottom");
18
+
19
+ $posName = ucfirst($panelPosition);
20
+ $settingsParams->updateSettingValue("theme_button_set_defaults", "Set {$posName} Defaults");
21
+
22
+
23
+ ?>
galleries/ugcore_slider/client_output.php ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+
4
+ defined('UNITEGALLERY_INC') or die('Restricted access');
5
+
6
+ /**
7
+ * passed $arrOptions to this file
8
+ */
9
+
10
+ $output = new UGSliderThemeOutput();
11
+
12
+ $uniteGalleryOutput = $output->putGallery(GlobalsUGGallery::$galleryID, $arrOptions);
13
+ ?>
galleries/ugcore_slider/config.xml ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+
3
+ <config>
4
+
5
+ <general>
6
+ <name>ug-slider</name>
7
+ <title>Slider</title>
8
+ <published>true</published>
9
+ </general>
10
+
11
+ </config>
galleries/ugcore_slider/inc_php/index.html ADDED
File without changes
galleries/ugcore_slider/inc_php/output.class.php ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+
4
+ defined('UNITEGALLERY_INC') or die('Restricted access');
5
+
6
+
7
+ class UGSliderThemeOutput extends UGMainOutput{
8
+
9
+
10
+ /**
11
+ *
12
+ * construct the output object
13
+ */
14
+ public function __construct(){
15
+
16
+ $this->theme = UGMainOutput::THEME_SLIDER;
17
+
18
+ parent::__construct();
19
+ }
20
+
21
+
22
+ /**
23
+ *
24
+ * put theme related scripts
25
+ */
26
+ protected function putScripts($putSkins = true){
27
+
28
+ parent::putScripts();
29
+
30
+ if($this->putJsToBody == false)
31
+ HelperGalleryUG::addScriptAbsoluteUrl($this->urlPlugin."themes/slider/ug-theme-slider.js", "unitegallery_slider_theme");
32
+
33
+ }
34
+
35
+
36
+ /**
37
+ * put javascript includes to the body before the gallery div
38
+ */
39
+ protected function putJsIncludesToBody(){
40
+ $output = parent::putJsIncludesToBody();
41
+
42
+ $src = $this->urlPlugin."themes/slider/ug-theme-slider.js";
43
+
44
+ $output .= "<script type='text/javascript' src='{$src}'></script>";
45
+ return($output);
46
+ }
47
+
48
+
49
+
50
+ }
51
+
52
+ ?>
galleries/ugcore_slider/includes.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+
4
+ defined('UNITEGALLERY_INC') or die('Restricted access');
5
+
6
+
7
+ require_once GlobalsUG::$pathHelpersClasses."include_classes.php";
8
+
9
+ require_once $pathGallery."inc_php/output.class.php";
10
+ ?>
galleries/ugcore_slider/index.html ADDED
File without changes
galleries/ugcore_slider/release_log.txt ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version 1.0
2
+
3
+ first release
galleries/ugcore_slider/settings/gallery_settings.php ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+
4
+ defined('UNITEGALLERY_INC') or die('Restricted access');
5
+
6
+
7
+ require GlobalsUG::$pathHelpersSettings."main.php";
8
+
9
+ $settingsParams = new UniteGallerySettingsUG();
10
+ $settingsParams->loadXMLFile(GlobalsUGGallery::$pathSettings."gallery_settings.xml");
11
+
12
+ //set defaults
13
+ $arrDefaults = array(
14
+ "gallery_autoplay" => "true",
15
+ "slider_scale_mode" => "fill",
16
+ "slider_controls_always_on" => "true",
17
+ "slider_enable_text_panel" => "false",
18
+ "slider_controls_appear_ontap" => "true",
19
+ "slider_enable_bullets" => "true",
20
+ "slider_enable_arrows" => "true",
21
+ "slider_enable_play_button" => "false",
22
+ "slider_enable_fullscreen_button" => "false",
23
+ "slider_enable_zoom_panel" => "false"
24
+ );
25
+
26
+ $arrSettingsToHide = array(
27
+ );
28
+
29
+ //$settingsParams->hideSettings($arrSettingsToHide);
30
+
31
+ $settingsParams->setStoredValues($arrDefaults);
32
+
33
+ // get merged settings with values
34
+ $valuesMain = $settingsMain->getArrValues();
35
+ $valuesParams = $settingsParams->getArrValues();
36
+ $valuesMerged = array_merge($valuesMain, $valuesParams);
37
+
38
+ $valuesMerged["gallery_theme"] = "slider";
39
+
40
+ ?>
galleries/ugcore_slider/settings/gallery_settings.xml ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+
3
+ <fields>
4
+
5
+ <fieldset name="general" loadfrom="helper"></fieldset>
6
+
7
+ <fieldset name="position" loadfrom="helper"></fieldset>
8
+
9
+ <fieldset name="slider_main" loadfrom="helper"></fieldset>
10
+
11
+ <fieldset name="slider_textpanel" loadfrom="helper"></fieldset>
12
+
13
+ <fieldset name="troubleshooting" loadfrom="helper"></fieldset>
14
+
15
+ </fields>
16
+
galleries/ugcore_slider/settings/index.html ADDED
File without changes
galleries/ugcore_slider/views/index.html ADDED
File without changes
galleries/ugcore_slider/views/preview.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+
4
+ defined('UNITEGALLERY_INC') or die('Restricted access');
5
+
6
+
7
+ $output = new UGSliderThemeOutput();
8
+ echo $output->putGallery(GlobalsUGGallery::$galleryID);
9
+
10
+ ?>
galleries/ugcore_tilescolumns/client_output.php ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+
4
+ defined('UNITEGALLERY_INC') or die('Restricted access');
5
+
6
+ /**
7
+ * passed $arrOptions to this file
8
+ */
9
+
10
+ $output = new UGTilesColumnsOutput();
11
+
12
+ $uniteGalleryOutput = $output->putGallery(GlobalsUGGallery::$galleryID, $arrOptions);
13
+ ?>
galleries/ugcore_tilescolumns/config.xml ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+
3
+ <config>
4
+
5
+ <general>
6
+ <name>ug-tilescolumns</name>
7
+ <title>Tiles - Columns</title>
8
+ <istiles>true</istiles>
9
+ <published>true</published>
10
+ </general>
11
+
12
+ </config>
galleries/ugcore_tilescolumns/inc_php/index.html ADDED
File without changes
galleries/ugcore_tilescolumns/inc_php/output.class.php ADDED
@@ -0,0 +1,106 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+
4
+ defined('UNITEGALLERY_INC') or die('Restricted access');
5
+
6
+
7
+ class UGTilesColumnsOutput extends UGMainOutput{
8
+
9
+
10
+ /**
11
+ *
12
+ * construct the output object
13
+ */
14
+ public function __construct(){
15
+
16
+ $this->theme = UGMainOutput::THEME_TILES;
17
+ $this->isTilesType = true;
18
+
19
+ parent::__construct();
20
+ }
21
+
22
+
23
+ /**
24
+ * modify options
25
+ */
26
+ protected function modifyOptions(){
27
+ parent::modifyOptions();
28
+
29
+ //set tiles_align if position is not center
30
+ $position = $this->getParam("position");
31
+ if($position == "left" || $position == "right")
32
+ $this->arrParams["tiles_align"] = $position;
33
+
34
+ //treat open at start
35
+ $openAtStart = $this->getParam("theme_open_lightbox_at_start", self::FORCE_BOOLEAN);
36
+
37
+ if($openAtStart == true){
38
+ $openAt = $this->getParam("theme_auto_open", self::FORCE_NUMERIC);
39
+ $this->arrParams["theme_auto_open"] = $this->getParam("theme_auto_open", self::FORCE_NUMERIC);
40
+ }else
41
+ unset($this->arrParams["theme_auto_open"]);
42
+
43
+ }
44
+
45
+
46
+ /**
47
+ *
48
+ * put theme related scripts
49
+ */
50
+ protected function putScripts($putSkins = true){
51
+
52
+ parent::putScripts();
53
+
54
+ if($this->putJsToBody == false)
55
+ HelperGalleryUG::addScriptAbsoluteUrl($this->urlPlugin."themes/tiles/ug-theme-tiles.js", "unitegallery_tiles_theme");
56
+
57
+ }
58
+
59
+
60
+ /**
61
+ * put javascript includes to the body before the gallery div
62
+ */
63
+ protected function putJsIncludesToBody(){
64
+ $output = parent::putJsIncludesToBody();
65
+
66
+ $src = $this->urlPlugin."themes/tiles/ug-theme-tiles.js";
67
+
68
+ $output .= "<script type='text/javascript' src='{$src}'></script>";
69
+ return($output);
70
+ }
71
+
72
+
73
+ /**
74
+ * get theme options override
75
+ */
76
+ protected function getArrJsOptions(){
77
+
78
+ $arr = parent::getArrJsOptions();
79
+
80
+ $arr[] = $this->buildJsParam("theme_gallery_padding", self::VALIDATE_NUMERIC, self::TYPE_NUMBER);
81
+ $arr[] = $this->buildJsParam("tiles_include_padding", null, self::TYPE_BOOLEAN);
82
+ $arr[] = $this->buildJsParam("tiles_col_width", self::VALIDATE_NUMERIC, self::TYPE_NUMBER);
83
+ $arr[] = $this->buildJsParam("tiles_space_between_cols", self::VALIDATE_NUMERIC, self::TYPE_NUMBER);
84
+ $arr[] = $this->buildJsParam("tiles_set_initial_height", null, self::TYPE_BOOLEAN);
85
+ $arr[] = $this->buildJsParam("tiles_space_between_cols_mobile", self::VALIDATE_NUMERIC, self::TYPE_NUMBER);
86
+ $arr[] = $this->buildJsParam("tiles_exact_width", null, self::TYPE_BOOLEAN);
87
+ $arr[] = $this->buildJsParam("tiles_min_columns", self::VALIDATE_NUMERIC, self::TYPE_NUMBER);
88
+ $arr[] = $this->buildJsParam("tiles_max_columns", self::VALIDATE_NUMERIC, self::TYPE_NUMBER);
89
+
90
+ $arr[] = $this->buildJsParam("theme_enable_preloader", null, self::TYPE_BOOLEAN);
91
+ $arr[] = $this->buildJsParam("theme_preloading_height", self::VALIDATE_NUMERIC, self::TYPE_NUMBER);
92
+ $arr[] = $this->buildJsParam("theme_preloader_vertpos", self::VALIDATE_NUMERIC, self::TYPE_NUMBER);
93
+ $arr[] = $this->buildJsParam("tiles_enable_transition", null, self::TYPE_BOOLEAN);
94
+ $arr[] = $this->buildJsParam("theme_appearance_order");
95
+
96
+ $arr[] = $this->buildJsParam("tiles_align"); //param not in settings
97
+
98
+ $arr[] = $this->buildJsParam("theme_auto_open", self::VALIDATE_NUMERIC, self::TYPE_NUMBER);
99
+
100
+ return($arr);
101
+ }
102
+
103
+
104
+ }
105
+
106
+ ?>
galleries/ugcore_tilescolumns/includes.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ defined('UNITEGALLERY_INC') or die('Restricted access');
4
+
5
+
6
+ require_once GlobalsUG::$pathHelpersClasses."include_classes.php";
7
+
8
+ require_once $pathGallery."inc_php/output.class.php";
9
+ ?>
galleries/ugcore_tilescolumns/index.html ADDED
File without changes
galleries/ugcore_tilescolumns/release_log.txt ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version 1.0
2
+
3
+ first release
galleries/ugcore_tilescolumns/settings/gallery_options.php ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ defined('UNITEGALLERY_INC') or die('Restricted access');
3
+
4
+
5
+ $settings = new UniteGallerySettingsUG();
6
+ $settings->loadXMLFile(GlobalsUGGallery::$pathSettings."gallery_options.xml");
7
+
8
+ if(method_exists("UniteProviderFunctionsUG", "addTilesSizeSettings"))
9
+ $settings = UniteProviderFunctionsUG::addTilesSizeSettings($settings);
10
+
11
+ if(method_exists("UniteProviderFunctionsUG", "addBigImageSizeSettings"))
12
+ $settings = UniteProviderFunctionsUG::addBigImageSizeSettings($settings, true);
13
+
14
+
15
+ ?>
galleries/ugcore_tilescolumns/settings/gallery_options.xml ADDED
@@ -0,0 +1,146 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+
3
+ <fields>
4
+ <fieldset name="gallery_options" label="Gallery Options" icon="eg-icon-cog-alt">
5
+
6
+ <field name="tiles_include_padding"
7
+ type="boolean"
8
+ default="true"
9
+ label="Set Initial Padding Sides"
10
+ description="To set initial sides padding equal to space between thumbs.">
11
+ </field>
12
+
13
+ <field name="theme_gallery_padding"
14
+ type="text"
15
+ default="0"
16
+ label="Padding Sides Addition"
17
+ unit="px"
18
+ description="The padding from the sides of the gallery, in addition to initial padding if exists."></field>
19
+
20
+ <field name="tiles_set_initial_height"
21
+ type="boolean"
22
+ default="true"
23
+ label="Set Initial Height"
24
+ description="Set gallery initial estimated height before tiles are placed(in case that scrollbar don't exists, to avoid jumps)"></field>
25
+
26
+ <field type="hr"></field>
27
+
28
+ <field name="tiles_col_width"
29
+ type="text"
30
+ default="250"
31
+ label="Tiles Column Width"
32
+ unit="px"
33
+ description="Column width of the tiles gallery. In case of dynamic tiles width this width will be the base width, and the angorytm will count the optimal column width for every gallery size"></field>
34
+
35
+ <field name="tiles_space_between_cols"
36
+ type="text"
37
+ default="3"
38
+ label="Space Between Columns"
39
+ unit="px"
40
+ description="Space between columns. Horizontal and vertical space"></field>
41
+
42
+ <field name="tiles_space_between_cols_mobile"
43
+ type="text"
44
+ default="3"
45
+ label="Space Between Columns Mobile Size"
46
+ unit="px"
47
+ description="Space between columns. Horizontal and vertical space on mobile gallery size (under 480px))">
48
+ </field>
49
+
50
+ <field name="tiles_exact_width"
51
+ type="boolean"
52
+ default="false"
53
+ label="Exact Tiles Width"
54
+ description="The tiles width can be dynamic or exact. In case of dynamic, they will be justified to gallery width.">
55
+ </field>
56
+
57
+ <field name="tiles_min_columns"
58
+ type="text"
59
+ default="2"
60
+ label="Minimum number of columns"
61
+ unit="cols"
62
+ description="The minimum number of columns.">
63
+ </field>
64
+
65
+ <field name="tiles_max_columns"
66
+ type="text"
67
+ default="0"
68
+ label="Maximum Number of Columns"
69
+ unit="cols"
70
+ description="Maximum number of columns. 0 for unlimited.">
71
+ </field>
72
+
73
+ <field type="hr"></field>
74
+
75
+ <field name="theme_enable_preloader"
76
+ type="boolean"
77
+ default="true"
78
+ label="&lt;b&gt;Show Gallery Preloader&lt;/b&gt;"
79
+ description="show gallery preloader, to show before first tile place"></field>
80
+
81
+ <field type="bulk_control_start"
82
+ parent="theme_enable_preloader"
83
+ ctype="show"
84
+ value="true" />
85
+
86
+ <field name="theme_preloading_height"
87
+ type="text"
88
+ default="200"
89
+ label="&amp;nbsp; Preloading Area Height"
90
+ unit="px"
91
+ description="The height of the preloading area"></field>
92
+
93
+ <field name="theme_preloader_vertpos"
94
+ type="text"
95
+ default="100"
96
+ label="&amp;nbsp; Preloader Circle Y Pos"
97
+ unit="px"
98
+ description="The y position of the preloading circle"></field>
99
+
100
+ <field type="bulk_control_end"/>
101
+
102
+ <field type="hr"></field>
103
+
104
+ <field name="tiles_enable_transition"
105
+ type="boolean"
106
+ default="true"
107
+ label="Enable Transition"
108
+ description="Enable transition on width resize"></field>
109
+
110
+ <field name="theme_appearance_order"
111
+ type="list"
112
+ default="normal"
113
+ label="Appearance Order"
114
+ description="The appearance order of the tiles. &lt;br&gt;&lt;br&gt; Optimal - optimal and fastest layout. The order will be closed to original, though not the same. &lt;br&gt;&lt;br&gt; Shuffle - the tiles will be shuffled once in start. &lt;br&gt; &lt;br&gt; Keep Order - the order will be kept, but the layout will be not optimal at the bottom">
115
+ <option value="normal" text="Optimal"></option>
116
+ <option value="shuffle" text="Shuffle"></option>
117
+ <option value="keep" text="Keep Order"></option>
118
+ </field>
119
+
120
+ <field type="hr"></field>
121
+
122
+ <field name="theme_open_lightbox_at_start"
123
+ type="boolean"
124
+ default="false"
125
+ label="&lt;b&gt;Open Lightbox At Start&lt;/b&gt;"
126
+ description="Open lightbox at page init">
127
+ </field>
128
+
129
+ <field name="theme_auto_open"
130
+ type="text"
131
+ default="0"
132
+ label="&amp;nbsp; Open Lightbox At Tile"
133
+ unit="tile number"
134
+ description="Enter the tile index that the lightbox will be open at start">
135
+ </field>
136
+
137
+ <field type="control"
138
+ parent="theme_open_lightbox_at_start"
139
+ ctype="show"
140
+ child="theme_auto_open"
141
+ value="true"
142
+ />
143
+
144
+ </fieldset>
145
+
146
+ </fields>
galleries/ugcore_tilescolumns/settings/gallery_settings.php ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ defined('UNITEGALLERY_INC') or die('Restricted access');
4
+
5
+ require GlobalsUG::$pathHelpersSettings."main_tiles.php";
6
+
7
+ $settingsParams = new UniteGallerySettingsUG();
8
+ $settingsParams->loadXMLFile(GlobalsUGGallery::$pathSettings."gallery_settings.xml");
9
+
10
+
11
+ //$settingsParams->updateSettingItems($name, $items);
12
+
13
+
14
+ //set defaults
15
+ $arrDefaults = array(
16
+ //"slider_enable_fullscreen_button" => "false"
17
+ );
18
+
19
+ $arrSettingsToHide = array(
20
+ //"slider_textpanel_align"
21
+ );
22
+
23
+ $settingsParams->hideSettings($arrSettingsToHide);
24
+
25
+ $settingsParams->setStoredValues($arrDefaults);
26
+
27
+ // get merged settings with values
28
+ $valuesMain = $settingsMain->getArrValues();
29
+ $valuesParams = $settingsParams->getArrValues();
30
+ $valuesMerged = array_merge($valuesMain, $valuesParams);
31
+
32
+ $valuesMerged["gallery_theme"] = "tiles";
33
+
34
+ ?>
galleries/ugcore_tilescolumns/settings/gallery_settings.xml ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+
3
+ <fields>
4
+
5
+ <fieldset name="gallery_options" loadfrom="current"></fieldset>
6
+ <fieldset name="loadmore" loadfrom="helper"></fieldset>
7
+
8
+ <fieldset name="position_tiles" loadfrom="helper"></fieldset>
9
+
10
+ <fieldset name="tiles_design" loadfrom="helper"></fieldset>
11
+
12
+ <fieldset name="tiles_textpanel" loadfrom="helper"></fieldset>
13
+
14
+ <fieldset name="lightbox" loadfrom="helper"></fieldset>
15
+
16
+ <fieldset name="troubleshooting" loadfrom="helper"></fieldset>
17
+
18
+ </fields>
19
+
galleries/ugcore_tilescolumns/settings/index.html ADDED
File without changes
galleries/ugcore_tilescolumns/views/index.html ADDED
File without changes
galleries/ugcore_tilescolumns/views/preview.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+
4
+ defined('UNITEGALLERY_INC') or die('Restricted access');
5
+
6
+
7
+ $output = new UGTilesColumnsOutput();
8
+ echo $output->putGallery(GlobalsUGGallery::$galleryID);
9
+
10
+ ?>
galleries/ugcore_tilesgrid/client_output.php ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+
4
+ defined('UNITEGALLERY_INC') or die('Restricted access');
5
+
6
+ /**
7
+ * passed $arrOptions to this file
8
+ */
9
+
10
+ $output = new UGTilesGridOutput();
11
+
12
+ $uniteGalleryOutput = $output->putGallery(GlobalsUGGallery::$galleryID, $arrOptions);
13
+ ?>
galleries/ugcore_tilesgrid/config.xml ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+
3
+ <config>
4
+
5
+ <general>
6
+ <name>ug-tilesgrid</name>
7
+ <title>Tiles Grid</title>
8
+ <istiles>true</istiles>
9
+ <published>true</published>
10
+ </general>
11
+
12
+ </config>
galleries/ugcore_tilesgrid/inc_php/index.html ADDED
File without changes
galleries/ugcore_tilesgrid/inc_php/output.class.php ADDED
@@ -0,0 +1,108 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+
4
+ defined('UNITEGALLERY_INC') or die('Restricted access');
5
+
6
+
7
+ class UGTilesGridOutput extends UGMainOutput{
8
+
9
+
10
+ /**
11
+ *
12
+ * construct the output object
13
+ */
14
+ public function __construct(){
15
+
16
+ $this->theme = UGMainOutput::THEME_TILESGRID;
17
+ $this->isTilesType = true;
18
+
19
+ parent::__construct();
20
+ }
21
+
22
+
23
+ /**
24
+ * modify optoins
25
+ */
26
+ protected function modifyOptions(){
27
+ parent::modifyOptions();
28
+
29
+ $enableNavigation = $this->getParam("custom_enable_navigation", self::FORCE_BOOLEAN);
30
+
31
+ if($enableNavigation === false)
32
+ $this->arrParams["grid_num_rows"] = 9999;
33
+
34
+ //treat open at start
35
+ $openAtStart = $this->getParam("theme_open_lightbox_at_start", self::FORCE_BOOLEAN);
36
+
37
+ if($openAtStart == true){
38
+ $openAt = $this->getParam("theme_auto_open", self::FORCE_NUMERIC);
39
+ $this->arrParams["theme_auto_open"] = $this->getParam("theme_auto_open", self::FORCE_NUMERIC);
40
+ }else
41
+ unset($this->arrParams["theme_auto_open"]);
42
+
43
+ //grid align
44
+ $position = $this->getParam("position");
45
+ if($position != "center")
46
+ $this->arrParams["theme_grid_align"] = $position;
47
+ }
48
+
49
+
50
+ /**
51
+ *
52
+ * put theme related scripts
53
+ */
54
+ protected function putScripts($putSkins = true){
55
+
56
+ parent::putScripts();
57
+
58
+ if($this->putJsToBody == false)
59
+ HelperGalleryUG::addScriptAbsoluteUrl($this->urlPlugin."themes/tilesgrid/ug-theme-tilesgrid.js", "unitegallery_tilesgrid_theme");
60
+
61
+ }
62
+
63
+
64
+ /**
65
+ * put javascript includes to the body before the gallery div
66
+ */
67
+ protected function putJsIncludesToBody(){
68
+ $output = parent::putJsIncludesToBody();
69
+
70
+ $src = $this->urlPlugin."themes/tilesgrid/ug-theme-tilesgrid.js";
71
+
72
+ $output .= "<script type='text/javascript' src='{$src}'></script>";
73
+ return($output);
74
+
75
+ }
76
+
77
+
78
+ /**
79
+ * get theme options override
80
+ */
81
+ protected function getArrJsOptions(){
82
+
83
+ $arr = parent::getArrJsOptions();
84
+
85
+ $arr[] = $this->buildJsParam("theme_gallery_padding", self::VALIDATE_NUMERIC, self::TYPE_NUMBER);
86
+ $arr[] = $this->buildJsParam("grid_padding", self::VALIDATE_NUMERIC, self::TYPE_NUMBER);
87
+ $arr[] = $this->buildJsParam("grid_num_rows", self::VALIDATE_NUMERIC, self::TYPE_NUMBER);
88
+
89
+ $arr[] = $this->buildJsParam("grid_space_between_mobile", self::VALIDATE_NUMERIC, self::TYPE_NUMBER);
90
+ $arr[] = $this->buildJsParam("grid_min_cols", self::VALIDATE_NUMERIC, self::TYPE_NUMBER);
91
+
92
+ $arr[] = $this->buildJsParam("theme_navigation_type");
93
+ $arr[] = $this->buildJsParam("theme_arrows_margin_top", self::VALIDATE_NUMERIC, self::TYPE_NUMBER);
94
+ $arr[] = $this->buildJsParam("theme_space_between_arrows", self::VALIDATE_NUMERIC, self::TYPE_NUMBER);
95
+ $arr[] = $this->buildJsParam("theme_bullets_color");
96
+ $arr[] = $this->buildJsParam("bullets_space_between", self::VALIDATE_NUMERIC, self::TYPE_NUMBER);
97
+ $arr[] = $this->buildJsParam("theme_bullets_margin_top", self::VALIDATE_NUMERIC, self::TYPE_NUMBER);
98
+
99
+ $arr[] = $this->buildJsParam("theme_auto_open", self::VALIDATE_NUMERIC, self::TYPE_NUMBER);
100
+ $arr[] = $this->buildJsParam("theme_grid_align");
101
+
102
+ return($arr);
103
+ }
104
+
105
+
106
+ }
107
+
108
+ ?>
galleries/ugcore_tilesgrid/includes.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ defined('UNITEGALLERY_INC') or die('Restricted access');
4
+
5
+
6
+ require_once GlobalsUG::$pathHelpersClasses."include_classes.php";
7
+
8
+ require_once $pathGallery."inc_php/output.class.php";
9
+ ?>
galleries/ugcore_tilesgrid/index.html ADDED
File without changes
galleries/ugcore_tilesgrid/release_log.txt ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version 1.0
2
+
3
+ first release
galleries/ugcore_tilesgrid/settings/gallery_options.php ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ defined('UNITEGALLERY_INC') or die('Restricted access');
3
+
4
+
5
+ $settings = new UniteGallerySettingsUG();
6
+ $settings->loadXMLFile(GlobalsUGGallery::$pathSettings."gallery_options.xml");
7
+
8
+ if(method_exists("UniteProviderFunctionsUG", "addTilesSizeSettings"))
9
+ $settings = UniteProviderFunctionsUG::addTilesSizeSettings($settings);
10
+
11
+ if(method_exists("UniteProviderFunctionsUG", "addBigImageSizeSettings"))
12
+ $settings = UniteProviderFunctionsUG::addBigImageSizeSettings($settings, true);
13
+
14
+
15
+ ?>
galleries/ugcore_tilesgrid/settings/gallery_options.xml ADDED
@@ -0,0 +1,99 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+
3
+ <fields>
4
+ <fieldset name="gallery_options" label="Gallery Options" icon="eg-icon-cog-alt">
5
+
6
+ <field name="tile_width"
7
+ type="text"
8
+ default="180"
9
+ label="Tile Width"
10
+ unit="px"
11
+ description="Tile width, fixed width of the tile"></field>
12
+
13
+ <field name="tile_height"
14
+ type="text"
15
+ default="150"
16
+ label="Tile Height"
17
+ unit="px"
18
+ description="Tile height. fixed height of the tile"></field>
19
+
20
+ <field type="hr"></field>
21
+
22
+ <field name="theme_gallery_padding"
23
+ type="text"
24
+ default="0"
25
+ label="Gallery Padding Sides"
26
+ unit="px"
27
+ description="The padding from the sides of the gallery"></field>
28
+
29
+ <field name="grid_padding"
30
+ type="text"
31
+ default="10"
32
+ label="Grid Padding"
33
+ unit="px"
34
+ description="The padding of the grid. Needed for the shadow or the outline not to be cut off."></field>
35
+
36
+ <field name="grid_space_between_cols"
37
+ type="text"
38
+ default="20"
39
+ label="Space Between Columns"
40
+ unit="px"
41
+ description="The space between grid columns"></field>
42
+
43
+ <field name="grid_space_between_rows"
44
+ type="text"
45
+ default="20"
46
+ label="Space Between Rows"
47
+ unit="px"
48
+ description="The space between grid rows"></field>
49
+
50
+ <field name="grid_space_between_mobile"
51
+ type="text"
52
+ default="15"
53
+ label="Space Between - Mobile"
54
+ unit="px"
55
+ description="The space between rows and columns in mobile mode, when the screen is small"></field>
56
+
57
+ <field name="grid_min_cols"
58
+ type="text"
59
+ default="2"
60
+ label="Minimum Number Of Columns"
61
+ unit="cols"
62
+ description="The minimum number of columns. For better view on mobile"></field>
63
+
64
+ <field type="hr"></field>
65
+
66
+ <field name="gallery_shuffle"
67
+ type="boolean"
68
+ default="false"
69
+ label="Shuffle Items At Start"
70
+ description="Shuffle (randomize) items at gallery start">
71
+ </field>
72
+
73
+ <field type="hr"></field>
74
+
75
+ <field name="theme_open_lightbox_at_start"
76
+ type="boolean"
77
+ default="false"
78
+ label="&lt;b&gt;Open Lightbox At Start&lt;/b&gt;"
79
+ description="Open lightbox at page init">
80
+ </field>
81
+
82
+ <field name="theme_auto_open"
83
+ type="text"
84
+ default="0"
85
+ label="&amp;nbsp; Open Lightbox At Tile"
86
+ unit="tile number"
87
+ description="Enter the tile index that the lightbox will be open at start">
88
+ </field>
89
+
90
+ <field type="control"
91
+ parent="theme_open_lightbox_at_start"
92
+ ctype="show"
93
+ child="theme_auto_open"
94
+ value="true"
95
+ />
96
+
97
+ </fieldset>
98
+
99
+ </fields>
galleries/ugcore_tilesgrid/settings/gallery_settings.php ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ defined('UNITEGALLERY_INC') or die('Restricted access');
4
+
5
+ require GlobalsUG::$pathHelpersSettings."main_tiles.php";
6
+
7
+ $settingsParams = new UniteGallerySettingsUG();
8
+ $settingsParams->loadXMLFile(GlobalsUGGallery::$pathSettings."gallery_settings.xml");
9
+
10
+ //set defaults
11
+ $arrDefaults = array(
12
+ "tile_width" => "180",
13
+ "tile_height" => "150",
14
+ "grid_num_rows" => "3",
15
+ "grid_padding" => "10",
16
+ "tile_enable_border" => "true",
17
+ "tile_enable_shadow" => "true",
18
+ "tile_border_radius" => "2",
19
+ "grid_space_between_cols" => "20",
20
+ "grid_space_between_rows" => "20",
21
+ "bullets_space_between" => "12",
22
+ );
23
+
24
+ $arrSettingsToHide = array(
25
+ //"slider_textpanel_align"
26
+ );
27
+
28
+ $settingsParams->hideSettings($arrSettingsToHide);
29
+
30
+ $settingsParams->setStoredValues($arrDefaults);
31
+
32
+ // get merged settings with values
33
+ $valuesMain = $settingsMain->getArrValues();
34
+ $valuesParams = $settingsParams->getArrValues();
35
+ $valuesMerged = array_merge($valuesMain, $valuesParams);
36
+
37
+ $valuesMerged["gallery_theme"] = "tilesgrid";
38
+
39
+ ?>
galleries/ugcore_tilesgrid/settings/gallery_settings.xml ADDED
@@ -0,0 +1,108 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+
3
+ <fields>
4
+
5
+ <fieldset name="gallery_options" loadfrom="current" />
6
+
7
+ <fieldset name="grid_navigation" label="Grid Navigation" icon="eg-icon-cog-alt">
8
+
9
+ <field name="custom_enable_navigation"
10
+ type="boolean"
11
+ default="true"
12
+ label="&lt;b&gt;Enable Navigation&lt;/b&gt;"
13
+ description="Enable navigation. If enabled, the navigation will be appeared after the grid exceeds the given rows"></field>
14
+
15
+ <field name="grid_num_rows"
16
+ type="text"
17
+ default="3"
18
+ label="&amp;nbsp; Number Of Rows"
19
+ unit="px"
20
+ description="Num of the rows of the grid. If more rows required by number of tiles and the gallery given width, add more panes and grid navigation"></field>
21
+
22
+ <field type="hr"></field>
23
+
24
+
25
+ <field name="theme_navigation_type"
26
+ type="list"
27
+ default="bullets"
28
+ label="&lt;b&gt;Navigation Type&lt;/b&gt;"
29
+ description="Navigation type. Arrows or bullets">
30
+ <option value="bullets" text="Bullets"></option>
31
+ <option value="arrows" text="Arrows"></option>
32
+ </field>
33
+
34
+ <field type="bulk_control_start"
35
+ parent="theme_navigation_type"
36
+ ctype="show"
37
+ value="arrows" />
38
+
39
+ <field name="theme_arrows_margin_top"
40
+ type="text"
41
+ default="20"
42
+ label="&amp;nbsp; Arrows Margin Top"
43
+ unit="px"
44
+ description="The margin top of the arrows, vertical sapce between the arrows and the grid"></field>
45
+
46
+ <field name="theme_space_between_arrows"
47
+ type="text"
48
+ default="5"
49
+ label="&amp;nbsp; Space Between Arrows"
50
+ unit="px"
51
+ description="The space between arrows"></field>
52
+
53
+ <field type="bulk_control_end"/>
54
+
55
+ <field type="bulk_control_start"
56
+ parent="theme_navigation_type"
57
+ ctype="show"
58
+ value="bullets" />
59
+
60
+ <field name="theme_bullets_color"
61
+ type="list"
62
+ default="gray"
63
+ label="&amp;nbsp; Bullets Color"
64
+ description="Choose the color set of the bullets. Each set loads different images.">
65
+ <option value="gray" text="Gray"></option>
66
+ <option value="blue" text="Blue"></option>
67
+ <option value="brown" text="Brown"></option>
68
+ <option value="green" text="Green"></option>
69
+ <option value="red" text="Red"></option>
70
+ </field>
71
+
72
+ <field name="bullets_space_between"
73
+ type="text"
74
+ default="12"
75
+ label="&amp;nbsp; Space Between Bullets"
76
+ unit="px"
77
+ description="Space between bullets"></field>
78
+
79
+ <field name="theme_bullets_margin_top"
80
+ type="text"
81
+ default="40"
82
+ label="&amp;nbsp; Bullets Margin Top"
83
+ unit="px"
84
+ description="The margin top of the bullets. vertical sapce between the arrows and the grid"></field>
85
+
86
+ <field type="bulk_control_end"/>
87
+
88
+ <field type="control"
89
+ parent="custom_enable_navigation"
90
+ ctype="enable"
91
+ child="grid_num_rows, theme_navigation_type, theme_arrows_margin_top, theme_space_between_arrows, theme_bullets_color, bullets_space_between, theme_bullets_margin_top"
92
+ value="true"
93
+ />
94
+
95
+ </fieldset>
96
+
97
+ <fieldset name="position" loadfrom="helper"></fieldset>
98
+
99
+ <fieldset name="tiles_design" loadfrom="helper"></fieldset>
100
+
101
+ <fieldset name="tiles_textpanel" loadfrom="helper"></fieldset>
102
+
103
+ <fieldset name="lightbox" loadfrom="helper"></fieldset>
104
+
105
+ <fieldset name="troubleshooting" loadfrom="helper"></fieldset>
106
+
107
+ </fields>
108
+
galleries/ugcore_tilesgrid/settings/index.html ADDED
File without changes
galleries/ugcore_tilesgrid/views/index.html ADDED
File without changes
galleries/ugcore_tilesgrid/views/preview.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+
4
+ defined('UNITEGALLERY_INC') or die('Restricted access');
5
+
6
+
7
+ $output = new UGTilesGridOutput();
8
+ echo $output->putGallery(GlobalsUGGallery::$galleryID);
9
+
10
+ ?>
galleries/ugcore_tilesjustified/client_output.php ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+
4
+ defined('UNITEGALLERY_INC') or die('Restricted access');
5
+
6
+ /**
7
+ * passed $arrOptions to this file
8
+ */
9
+
10
+ $output = new UGTilesJustifiedOutput();
11
+
12
+ $uniteGalleryOutput = $output->putGallery(GlobalsUGGallery::$galleryID, $arrOptions);
13
+ ?>
galleries/ugcore_tilesjustified/config.xml ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+
3
+ <config>
4
+
5
+ <general>
6
+ <name>ug-tilesjustified</name>
7
+ <title>Tiles - Justified</title>
8
+ <istiles>true</istiles>
9
+ <published>true</published>
10
+ </general>
11
+
12
+ </config>
galleries/ugcore_tilesjustified/inc_php/index.html ADDED
File without changes
galleries/ugcore_tilesjustified/inc_php/output.class.php ADDED
@@ -0,0 +1,100 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+
4
+ defined('UNITEGALLERY_INC') or die('Restricted access');
5
+
6
+
7
+ class UGTilesJustifiedOutput extends UGMainOutput{
8
+
9
+
10
+ /**
11
+ *
12
+ * construct the output object
13
+ */
14
+ public function __construct(){
15
+
16
+ $this->theme = UGMainOutput::THEME_TILES;
17
+ $this->isTilesType = true;
18
+
19
+ parent::__construct();
20
+ }
21
+
22
+
23
+ /**
24
+ *
25
+ * add justified function
26
+ */
27
+ protected function modifyOptions(){
28
+
29
+ parent::modifyOptions();
30
+ $this->arrParams["tiles_type"] = "justified";
31
+
32
+ //treat open at start
33
+ $openAtStart = $this->getParam("theme_open_lightbox_at_start", self::FORCE_BOOLEAN);
34
+
35
+ if($openAtStart == true){
36
+ $openAt = $this->getParam("theme_auto_open", self::FORCE_NUMERIC);
37
+ $this->arrParams["theme_auto_open"] = $this->getParam("theme_auto_open", self::FORCE_NUMERIC);
38
+ }else
39
+ unset($this->arrParams["theme_auto_open"]);
40
+
41
+ }
42
+
43
+
44
+
45
+ /**
46
+ *
47
+ * put theme related scripts
48
+ */
49
+ protected function putScripts($putSkins = true){
50
+
51
+ parent::putScripts();
52
+
53
+ if($this->putJsToBody == false)
54
+ HelperGalleryUG::addScriptAbsoluteUrl($this->urlPlugin."themes/tiles/ug-theme-tiles.js", "unitegallery_tiles_theme");
55
+
56
+ }
57
+
58
+
59
+ /**
60
+ * put javascript includes to the body before the gallery div
61
+ */
62
+ protected function putJsIncludesToBody(){
63
+ $output = parent::putJsIncludesToBody();
64
+
65
+ $src = $this->urlPlugin."themes/tiles/ug-theme-tiles.js";
66
+
67
+ $output .= "<script type='text/javascript' src='{$src}'></script>";
68
+ return($output);
69
+
70
+ }
71
+
72
+
73
+ /**
74
+ * get theme options override
75
+ */
76
+ protected function getArrJsOptions(){
77
+
78
+ $arr = parent::getArrJsOptions();
79
+
80
+ $arr[] = $this->buildJsParam("tiles_type");
81
+ $arr[] = $this->buildJsParam("theme_gallery_padding", self::VALIDATE_NUMERIC, self::TYPE_NUMBER);
82
+
83
+ $arr[] = $this->buildJsParam("tiles_justified_space_between", self::VALIDATE_NUMERIC, self::TYPE_NUMBER);
84
+ $arr[] = $this->buildJsParam("tiles_justified_row_height", self::VALIDATE_NUMERIC, self::TYPE_NUMBER);
85
+
86
+ $arr[] = $this->buildJsParam("theme_enable_preloader", null, self::TYPE_BOOLEAN);
87
+ $arr[] = $this->buildJsParam("theme_preloading_height", self::VALIDATE_NUMERIC, self::TYPE_NUMBER);
88
+ $arr[] = $this->buildJsParam("theme_preloader_vertpos", self::VALIDATE_NUMERIC, self::TYPE_NUMBER);
89
+
90
+ $arr[] = $this->buildJsParam("tiles_enable_transition", null, self::TYPE_BOOLEAN);
91
+
92
+ $arr[] = $this->buildJsParam("theme_auto_open", self::VALIDATE_NUMERIC, self::TYPE_NUMBER);
93
+
94
+ return($arr);
95
+ }
96
+
97
+
98
+ }
99
+
100
+ ?>
galleries/ugcore_tilesjustified/includes.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ defined('UNITEGALLERY_INC') or die('Restricted access');
4
+
5
+
6
+ require_once GlobalsUG::$pathHelpersClasses."include_classes.php";
7
+
8
+ require_once $pathGallery."inc_php/output.class.php";
9
+ ?>
galleries/ugcore_tilesjustified/index.html ADDED
File without changes
galleries/ugcore_tilesjustified/release_log.txt ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version 1.0
2
+
3
+ first release
galleries/ugcore_tilesjustified/settings/gallery_options.php ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ defined('UNITEGALLERY_INC') or die('Restricted access');
3
+
4
+
5
+ $settings = new UniteGallerySettingsUG();
6
+ $settings->loadXMLFile(GlobalsUGGallery::$pathSettings."gallery_options.xml");
7
+
8
+ if(method_exists("UniteProviderFunctionsUG", "addTilesSizeSettings"))
9
+ $settings = UniteProviderFunctionsUG::addTilesSizeSettings($settings);
10
+
11
+ if(method_exists("UniteProviderFunctionsUG", "addBigImageSizeSettings"))
12
+ $settings = UniteProviderFunctionsUG::addBigImageSizeSettings($settings, true);
13
+
14
+ ?>
galleries/ugcore_tilesjustified/settings/gallery_options.xml ADDED
@@ -0,0 +1,97 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+
3
+ <fields>
4
+
5
+ <fieldset name="gallery_options" label="Gallery Options" icon="eg-icon-cog-alt">
6
+
7
+ <field name="theme_gallery_padding"
8
+ type="text"
9
+ default="0"
10
+ label="Gallery Padding Sides"
11
+ unit="px"
12
+ description="The padding from the sides of the gallery"></field>
13
+
14
+ <field name="tiles_justified_space_between"
15
+ type="text"
16
+ default="3"
17
+ label="Space Between Tiles"
18
+ unit="px"
19
+ description="Space between tiles. Horizontal and vertical space"></field>
20
+
21
+ <field name="tiles_justified_row_height"
22
+ type="text"
23
+ default="150"
24
+ label="Initial Row Height"
25
+ unit="px"
26
+ description="The row height from wich the algorythm will count the final height."></field>
27
+
28
+ <field type="hr"></field>
29
+
30
+ <field name="theme_enable_preloader"
31
+ type="boolean"
32
+ default="true"
33
+ label="&lt;b&gt;Show Gallery Preloader&lt;/b&gt;"
34
+ description="show gallery preloader, to show before first tile place"></field>
35
+
36
+ <field type="bulk_control_start"
37
+ parent="theme_enable_preloader"
38
+ ctype="show"
39
+ value="true" />
40
+
41
+ <field name="theme_preloading_height"
42
+ type="text"
43
+ default="200"
44
+ label="&amp;nbsp; Preloading Area Height"
45
+ unit="px"
46
+ description="The height of the preloading area"></field>
47
+
48
+ <field name="theme_preloader_vertpos"
49
+ type="text"
50
+ default="100"
51
+ label="&amp;nbsp; Preloader Circle Y Pos"
52
+ unit="px"
53
+ description="The y position of the preloading circle"></field>
54
+
55
+ <field type="bulk_control_end"/>
56
+
57
+ <field type="hr"></field>
58
+
59
+ <field name="tiles_enable_transition"
60
+ type="boolean"
61
+ default="true"
62
+ label="Enable Transition"
63
+ description="Enable transition on width resize"></field>
64
+
65
+ <field name="gallery_shuffle"
66
+ type="boolean"
67
+ default="false"
68
+ label="Shuffle Items At Start"
69
+ description="Shuffle (randomize) items at gallery start">
70
+ </field>
71
+
72
+ <field type="hr"></field>
73
+
74
+ <field name="theme_open_lightbox_at_start"
75
+ type="boolean"
76
+ default="false"
77
+ label="&lt;b&gt;Open Lightbox At Start&lt;/b&gt;"
78
+ description="Open lightbox at page init">
79
+ </field>
80
+
81
+ <field name="theme_auto_open"
82
+ type="text"
83
+ default="0"
84
+ label="&amp;nbsp; Open Lightbox At Tile"
85
+ unit="tile number"
86
+ description="Enter the tile index that the lightbox will be open at start">
87
+ </field>
88
+
89
+ <field type="control"
90
+ parent="theme_open_lightbox_at_start"
91
+ ctype="show"
92
+ child="theme_auto_open"
93
+ value="true"
94
+ />
95
+
96
+ </fieldset>
97
+ </fields>
galleries/ugcore_tilesjustified/settings/gallery_settings.php ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ defined('UNITEGALLERY_INC') or die('Restricted access');
4
+
5
+ require GlobalsUG::$pathHelpersSettings."main_tiles.php";
6
+
7
+ $settingsParams = new UniteGallerySettingsUG();
8
+ $settingsParams->loadXMLFile(GlobalsUGGallery::$pathSettings."gallery_settings.xml");
9
+
10
+ //set defaults
11
+ $arrDefaults = array(
12
+ //"slider_enable_fullscreen_button" => "false"
13
+ );
14
+
15
+ $arrSettingsToHide = array(
16
+ //"slider_textpanel_align"
17
+ );
18
+
19
+ $settingsParams->hideSettings($arrSettingsToHide);
20
+
21
+ $settingsParams->helper_updateTextPanelPosition();
22
+
23
+ $settingsParams->setStoredValues($arrDefaults);
24
+
25
+ // get merged settings with values
26
+ $valuesMain = $settingsMain->getArrValues();
27
+ $valuesParams = $settingsParams->getArrValues();
28
+ $valuesMerged = array_merge($valuesMain, $valuesParams);
29
+
30
+ $valuesMerged["gallery_theme"] = "tiles";
31
+
32
+ ?>
galleries/ugcore_tilesjustified/settings/gallery_settings.xml ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+
3
+ <fields>
4
+
5
+ <fieldset name="gallery_options" loadfrom="current"></fieldset>
6
+
7
+ <fieldset name="position" loadfrom="helper"></fieldset>
8
+
9
+ <fieldset name="tiles_design" loadfrom="helper"></fieldset>
10
+
11
+ <fieldset name="tiles_textpanel" loadfrom="helper"></fieldset>
12
+
13
+ <fieldset name="lightbox" loadfrom="helper"></fieldset>
14
+
15
+ <fieldset name="troubleshooting" loadfrom="helper"></fieldset>
16
+
17
+ </fields>
18
+
galleries/ugcore_tilesjustified/settings/index.html ADDED
File without changes
galleries/ugcore_tilesjustified/views/index.html ADDED
File without changes
galleries/ugcore_tilesjustified/views/preview.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+
4
+ defined('UNITEGALLERY_INC') or die('Restricted access');
5
+
6
+
7
+ $output = new UGTilesJustifiedOutput();
8
+ echo $output->putGallery(GlobalsUGGallery::$galleryID);
9
+
10
+ ?>
galleries/ugcore_tilesnested/client_output.php ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+
4
+ defined('UNITEGALLERY_INC') or die('Restricted access');
5
+
6
+ /**
7
+ * passed $arrOptions to this file
8
+ */
9
+
10
+ $output = new UGTilesNestedOutput();
11
+
12
+ $uniteGalleryOutput = $output->putGallery(GlobalsUGGallery::$galleryID, $arrOptions);
13
+ ?>
galleries/ugcore_tilesnested/config.xml ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+
3
+ <config>
4
+
5
+ <general>
6
+ <name>ug-tilesnested</name>
7
+ <title>Tiles - Nested</title>
8
+ <istiles>true</istiles>
9
+ <published>true</published>
10
+ </general>
11
+
12
+ </config>
galleries/ugcore_tilesnested/inc_php/index.html ADDED
File without changes
galleries/ugcore_tilesnested/inc_php/output.class.php ADDED
@@ -0,0 +1,110 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+
4
+ defined('UNITEGALLERY_INC') or die('Restricted access');
5
+
6
+
7
+ class UGTilesNestedOutput extends UGMainOutput{
8
+
9
+
10
+ /**
11
+ *
12
+ * construct the output object
13
+ */
14
+ public function __construct(){
15
+
16
+ $this->theme = UGMainOutput::THEME_TILES;
17
+ $this->isTilesType = true;
18
+
19
+ parent::__construct();
20
+ }
21
+
22
+
23
+ /**
24
+ *
25
+ * add justified function
26
+ */
27
+ protected function modifyOptions(){
28
+
29
+ parent::modifyOptions();
30
+ $this->arrParams["tiles_type"] = "nested";
31
+
32
+ //set tiles_align if position is not center
33
+ $position = $this->getParam("position");
34
+ if($position == "left" || $position == "right")
35
+ $this->arrParams["tiles_align"] = $position;
36
+
37
+ //treat open at start
38
+ $openAtStart = $this->getParam("theme_open_lightbox_at_start", self::FORCE_BOOLEAN);
39
+
40
+ if($openAtStart == true){
41
+ $openAt = $this->getParam("theme_auto_open", self::FORCE_NUMERIC);
42
+ $this->arrParams["theme_auto_open"] = $this->getParam("theme_auto_open", self::FORCE_NUMERIC);
43
+ }else
44
+ unset($this->arrParams["theme_auto_open"]);
45
+
46
+ }
47
+
48
+
49
+
50
+ /**
51
+ *
52
+ * put theme related scripts
53
+ */
54
+ protected function putScripts($putSkins = true){
55
+
56
+ parent::putScripts();
57
+
58
+ if($this->putJsToBody == false)
59
+ HelperGalleryUG::addScriptAbsoluteUrl($this->urlPlugin."themes/tiles/ug-theme-tiles.js", "unitegallery_tiles_theme");
60
+
61
+ }
62
+
63
+
64
+ /**
65
+ * put javascript includes to the body before the gallery div
66
+ */
67
+ protected function putJsIncludesToBody(){
68
+ $output = parent::putJsIncludesToBody();
69
+
70
+ $src = $this->urlPlugin."themes/tiles/ug-theme-tiles.js";
71
+
72
+ $output .= "<script type='text/javascript' src='{$src}'></script>";
73
+ return($output);
74
+
75
+ }
76
+
77
+
78
+ /**
79
+ * get theme options override
80
+ */
81
+ protected function getArrJsOptions(){
82
+
83
+ $arr = parent::getArrJsOptions();
84
+
85
+ $arr[] = $this->buildJsParam("tiles_type");
86
+ $arr[] = $this->buildJsParam("theme_gallery_padding", self::VALIDATE_NUMERIC, self::TYPE_NUMBER);
87
+
88
+ $arr[] = $this->buildJsParam("tiles_nested_optimal_tile_width", self::VALIDATE_NUMERIC, self::TYPE_NUMBER);
89
+ $arr[] = $this->buildJsParam("tiles_min_columns", self::VALIDATE_NUMERIC, self::TYPE_NUMBER);
90
+
91
+ $arr[] = $this->buildJsParam("tiles_space_between_cols", self::VALIDATE_NUMERIC, self::TYPE_NUMBER);
92
+ $arr[] = $this->buildJsParam("tiles_space_between_cols_mobile", self::VALIDATE_NUMERIC, self::TYPE_NUMBER);
93
+
94
+ $arr[] = $this->buildJsParam("theme_enable_preloader", null, self::TYPE_BOOLEAN);
95
+ $arr[] = $this->buildJsParam("theme_preloading_height", self::VALIDATE_NUMERIC, self::TYPE_NUMBER);
96
+ $arr[] = $this->buildJsParam("theme_preloader_vertpos", self::VALIDATE_NUMERIC, self::TYPE_NUMBER);
97
+
98
+ $arr[] = $this->buildJsParam("tiles_enable_transition", null, self::TYPE_BOOLEAN);
99
+
100
+ $arr[] = $this->buildJsParam("tiles_align"); //param not in settings
101
+
102
+ $arr[] = $this->buildJsParam("theme_auto_open", self::VALIDATE_NUMERIC, self::TYPE_NUMBER);
103
+
104
+ return($arr);
105
+ }
106
+
107
+
108
+ }
109
+
110
+ ?>
galleries/ugcore_tilesnested/includes.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ defined('UNITEGALLERY_INC') or die('Restricted access');
4
+
5
+
6
+ require_once GlobalsUG::$pathHelpersClasses."include_classes.php";
7
+
8
+ require_once $pathGallery."inc_php/output.class.php";
9
+ ?>
galleries/ugcore_tilesnested/index.html ADDED
File without changes
galleries/ugcore_tilesnested/release_log.txt ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version 1.0
2
+
3
+ first release
galleries/ugcore_tilesnested/settings/gallery_options.php ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ defined('UNITEGALLERY_INC') or die('Restricted access');
3
+
4
+
5
+ $settings = new UniteGallerySettingsUG();
6
+ $settings->loadXMLFile(GlobalsUGGallery::$pathSettings."gallery_options.xml");
7
+
8
+ if(method_exists("UniteProviderFunctionsUG", "addTilesSizeSettings"))
9
+ $settings = UniteProviderFunctionsUG::addTilesSizeSettings($settings);
10
+
11
+ if(method_exists("UniteProviderFunctionsUG", "addBigImageSizeSettings"))
12
+ $settings = UniteProviderFunctionsUG::addBigImageSizeSettings($settings, true);
13
+
14
+
15
+ ?>
galleries/ugcore_tilesnested/settings/gallery_options.xml ADDED
@@ -0,0 +1,114 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+
3
+ <fields>
4
+
5
+ <fieldset name="gallery_options" label="Gallery Options" icon="eg-icon-cog-alt">
6
+
7
+ <field name="theme_gallery_padding"
8
+ type="text"
9
+ default="0"
10
+ label="Gallery Padding Sides Addition"
11
+ unit="px"
12
+ description="Add some padding from the sides of the gallery. Note that initially the nested type has some padding because of it's algorthitm."></field>
13
+
14
+ <field name="tiles_nested_optimal_tile_width"
15
+ type="text"
16
+ default="250"
17
+ label="Optimal Tile Width"
18
+ unit="px"
19
+ description="Choose the optimal tile width that you prefer. The tile sizes will be set accordingly">
20
+ </field>
21
+
22
+ <field name="tiles_space_between_cols"
23
+ type="text"
24
+ default="3"
25
+ label="Space Between Columns"
26
+ unit="px"
27
+ description="Space between columns. Horizontal and vertical space"></field>
28
+
29
+ <field name="tiles_space_between_cols_mobile"
30
+ type="text"
31
+ default="3"
32
+ label="Space Between Columns Mobile Size"
33
+ unit="px"
34
+ description="Space between columns. Horizontal and vertical space on mobile gallery size (under 480px))">
35
+ </field>
36
+
37
+ <field name="tiles_min_columns"
38
+ type="text"
39
+ default="2"
40
+ label="Number Of Columns On Mobile Mode"
41
+ unit="cols"
42
+ description="The number of columns on mobile mode. Can be 1 or 2">
43
+ </field>
44
+
45
+ <field type="hr"></field>
46
+
47
+ <field name="theme_enable_preloader"
48
+ type="boolean"
49
+ default="true"
50
+ label="&lt;b&gt;Show Gallery Preloader&lt;/b&gt;"
51
+ description="show gallery preloader, to show before first tile place"></field>
52
+
53
+ <field type="bulk_control_start"
54
+ parent="theme_enable_preloader"
55
+ ctype="show"
56
+ value="true" />
57
+
58
+ <field name="theme_preloading_height"
59
+ type="text"
60
+ default="200"
61
+ label="&amp;nbsp; Preloading Area Height"
62
+ unit="px"
63
+ description="The height of the preloading area"></field>
64
+
65
+ <field name="theme_preloader_vertpos"
66
+ type="text"
67
+ default="100"
68
+ label="&amp;nbsp; Preloader Circle Y Pos"
69
+ unit="px"
70
+ description="The y position of the preloading circle"></field>
71
+
72
+ <field type="bulk_control_end"/>
73
+
74
+ <field type="hr"></field>
75
+
76
+ <field name="tiles_enable_transition"
77
+ type="boolean"
78
+ default="true"
79
+ label="Enable Transition"
80
+ description="Enable transition on width resize"></field>
81
+
82
+ <field name="gallery_shuffle"
83
+ type="boolean"
84
+ default="false"
85
+ label="Shuffle Items At Start"
86
+ description="Shuffle (randomize) items at gallery start">
87
+ </field>
88
+
89
+ <field type="hr"></field>
90
+
91
+ <field name="theme_open_lightbox_at_start"
92
+ type="boolean"
93
+ default="false"
94
+ label="&lt;b&gt;Open Lightbox At Start&lt;/b&gt;"
95
+ description="Open lightbox at page init">
96
+ </field>
97
+
98
+ <field name="theme_auto_open"
99
+ type="text"
100
+ default="0"
101
+ label="&amp;nbsp; Open Lightbox At Tile"
102
+ unit="tile number"
103
+ description="Enter the tile index that the lightbox will be open at start">
104
+ </field>
105
+
106
+ <field type="control"
107
+ parent="theme_open_lightbox_at_start"
108
+ ctype="show"
109
+ child="theme_auto_open"
110
+ value="true"
111
+ />
112
+
113
+ </fieldset>
114
+ </fields>
galleries/ugcore_tilesnested/settings/gallery_settings.php ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ defined('UNITEGALLERY_INC') or die('Restricted access');
4
+
5
+ require GlobalsUG::$pathHelpersSettings."main_tiles.php";
6
+
7
+ $settingsParams = new UniteGallerySettingsUG();
8
+ $settingsParams->loadXMLFile(GlobalsUGGallery::$pathSettings."gallery_settings.xml");
9
+
10
+ //set defaults
11
+ $arrDefaults = array(
12
+ //"slider_enable_fullscreen_button" => "false"
13
+ );
14
+
15
+ $arrSettingsToHide = array(
16
+ //"slider_textpanel_align"
17
+ );
18
+
19
+ $settingsParams->hideSettings($arrSettingsToHide);
20
+
21
+ $settingsParams->helper_updateTextPanelPosition();
22
+
23
+ $settingsParams->setStoredValues($arrDefaults);
24
+
25
+ // get merged settings with values
26
+ $valuesMain = $settingsMain->getArrValues();
27
+ $valuesParams = $settingsParams->getArrValues();
28
+ $valuesMerged = array_merge($valuesMain, $valuesParams);
29
+
30
+ $valuesMerged["gallery_theme"] = "tiles";
31
+
32
+ ?>
galleries/ugcore_tilesnested/settings/gallery_settings.xml ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+
3
+ <fields>
4
+
5
+ <fieldset name="gallery_options" loadfrom="current"></fieldset>
6
+
7
+ <fieldset name="position" loadfrom="helper"></fieldset>
8
+
9
+ <fieldset name="tiles_design" loadfrom="helper"></fieldset>
10
+
11
+ <fieldset name="tiles_textpanel" loadfrom="helper"></fieldset>
12
+
13
+ <fieldset name="lightbox" loadfrom="helper"></fieldset>
14
+
15
+ <fieldset name="troubleshooting" loadfrom="helper"></fieldset>
16
+
17
+ </fields>
18
+
galleries/ugcore_tilesnested/settings/index.html ADDED
File without changes
galleries/ugcore_tilesnested/views/index.html ADDED
File without changes
galleries/ugcore_tilesnested/views/preview.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+
4
+ defined('UNITEGALLERY_INC') or die('Restricted access');
5
+
6
+
7
+ $output = new UGTilesNestedOutput();
8
+ echo $output->putGallery(GlobalsUGGallery::$galleryID);
9
+
10
+ ?>
galleries/ugcore_video/ajax_actions.php ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+
4
+ defined('UNITEGALLERY_INC') or die('Restricted access');
5
+
6
+ /**
7
+ * gets $action, $data , and working framework, so globals and helper works
8
+ * response from helperUG
9
+ */
10
+
11
+ switch($action){
12
+ case "get_skin_css":
13
+ $skin = UniteFunctionsUG::getVal($data, "skin");
14
+ $filepath = GlobalsUG::$path_media_ug."themes/video/skin-{$skin}.css";
15
+ $filepath_modified = GlobalsUG::$path_media_ug."themes/video/skin-{$skin}-modified.css";
16
+
17
+ UniteFunctionsUG::validateFilepath($filepath);
18
+
19
+ //if exists modified version - get the modified
20
+ if(file_exists($filepath_modified))
21
+ $filepath = $filepath_modified;
22
+
23
+ $content = file_get_contents($filepath);
24
+ $data = array();
25
+ $data["content"] = $content;
26
+
27
+ $relativePath = HelperUG::pathToRelative($filepath);
28
+
29
+ $data["filepath"] = $relativePath;
30
+ HelperUG::ajaxResponseData($data);
31
+ break;
32
+ case "update_skin_css":
33
+ $skin = UniteFunctionsUG::getVal($data, "skin");
34
+ $filepath_modified = GlobalsUG::$path_media_ug."themes/video/skin-{$skin}-modified.css";
35
+
36
+ $content = UniteFunctionsUG::getVal($data, "css");
37
+
38
+ UniteFunctionsUG::writeFile($content, $filepath_modified);
39
+
40
+ HelperUG::ajaxResponseSuccess("Content Updated");
41
+ break;
42
+ case "get_original_skin_css":
43
+ $skin = UniteFunctionsUG::getVal($data, "skin");
44
+ $filepath = GlobalsUG::$path_media_ug."themes/video/skin-{$skin}.css";
45
+ $filepath_modified = GlobalsUG::$path_media_ug."themes/video/skin-{$skin}-modified.css";
46
+
47
+ if(file_exists($filepath_modified) == false)
48
+ HelperUG::ajaxResponseSuccess("The file is original");
49
+
50
+ $content = file_get_contents($filepath);
51
+ $data = array();
52
+ $data["content"] = $content;
53
+
54
+ HelperUG::ajaxResponseData($data);
55
+ break;
56
+ default:
57
+ HelperUG::ajaxResponseError("wrong ajax action (Video Theme): <b>$action</b> ");
58
+ break;
59
+ }
60
+
61
+ ?>
galleries/ugcore_video/client_output.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+
4
+ defined('UNITEGALLERY_INC') or die('Restricted access');
5
+ /**
6
+ * passed $arrOptions to this file
7
+ */
8
+
9
+ $output = new UGVideoThemeOutput();
10
+
11
+ $uniteGalleryOutput = $output->putGallery(GlobalsUGGallery::$galleryID, $arrOptions);
12
+ ?>
galleries/ugcore_video/config.xml ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+
3
+ <config>
4
+
5
+ <general>
6
+ <name>ug-video</name>
7
+ <title>Video Gallery</title>
8
+ <published>true</published>
9
+ <items_type>video</items_type>
10
+ </general>
11
+
12
+ </config>
galleries/ugcore_video/inc_php/index.html ADDED
File without changes
galleries/ugcore_video/inc_php/output.class.php ADDED
@@ -0,0 +1,104 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+
4
+ defined('UNITEGALLERY_INC') or die('Restricted access');
5
+
6
+
7
+ class UGVideoThemeOutput extends UGMainOutput{
8
+
9
+
10
+ /**
11
+ *
12
+ * construct the output object
13
+ */
14
+ public function __construct(){
15
+
16
+ $this->theme = UGMainOutput::THEME_VIDEO;
17
+
18
+ parent::__construct();
19
+ }
20
+
21
+
22
+ /**
23
+ *
24
+ * put theme related scripts
25
+ */
26
+ protected function putScripts($putSkins = true){
27
+
28
+ parent::putScripts(false); //don't put skins
29
+
30
+ if($this->putJsToBody == false)
31
+ HelperGalleryUG::addScriptAbsoluteUrl($this->urlPlugin."themes/video/ug-theme-video.js", "unitegallery_video_theme");
32
+
33
+ $skin = $this->getParam("theme_skin");
34
+ $urlSkin = $this->urlPlugin."themes/video/skin-{$skin}.css";
35
+
36
+ //if exists modified version, take the modified
37
+ $filepath_modified = GlobalsUG::$path_media_ug."themes/video/skin-{$skin}-modified.css";
38
+ if(file_exists($filepath_modified))
39
+ $urlSkin = $this->urlPlugin."themes/video/skin-{$skin}-modified.css";
40
+
41
+ HelperGalleryUG::addStyleAbsoluteUrl($urlSkin, "ug-theme-video-{$skin}");
42
+ }
43
+
44
+
45
+ /**
46
+ * put javascript includes to the body before the gallery div
47
+ */
48
+ protected function putJsIncludesToBody(){
49
+ $output = parent::putJsIncludesToBody();
50
+
51
+ $src = $this->urlPlugin."themes/video/ug-theme-video.js";
52
+
53
+ $output .= "<script type='text/javascript' src='{$src}'></script>";
54
+ return($output);
55
+
56
+ }
57
+
58
+
59
+ /**
60
+ * get theme options override
61
+ */
62
+ protected function getArrJsOptions(){
63
+
64
+ $arr = parent::getArrJsOptions();
65
+
66
+ $arr[] = $this->buildJsParam("theme_skin");
67
+ $arr[] = $this->buildJsParam("theme_autoplay", null, self::TYPE_BOOLEAN);
68
+ $arr[] = $this->buildJsParam("theme_next_video_onend", null, self::TYPE_BOOLEAN);
69
+
70
+ return($arr);
71
+ }
72
+
73
+
74
+ /**
75
+ * filter items that are image types
76
+ */
77
+ private function filterImageItems($arrItems){
78
+
79
+ $arrItemsNew = array();
80
+
81
+ foreach($arrItems as $item){
82
+ $type = $item->getType();
83
+ if($type != "image")
84
+ $arrItemsNew[] = $item;
85
+ }
86
+
87
+ return($arrItemsNew);
88
+ }
89
+
90
+
91
+ /**
92
+ * put gallery items
93
+ */
94
+ protected function putItems($arrItems){
95
+
96
+ $arrItems = $this->filterImageItems($arrItems);
97
+
98
+ return parent::putItems($arrItems);
99
+ }
100
+
101
+
102
+ }
103
+
104
+ ?>
galleries/ugcore_video/includes.php ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+
4
+ defined('UNITEGALLERY_INC') or die('Restricted access');
5
+
6
+
7
+ require_once GlobalsUG::$pathHelpersClasses."include_classes.php";
8
+
9
+ require_once $pathGallery."inc_php/output.class.php";
10
+
11
+ ?>
galleries/ugcore_video/index.html ADDED
File without changes
galleries/ugcore_video/js/video_admin.js ADDED
@@ -0,0 +1,134 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ (function( $ ){
2
+
3
+ var g_galleryAdmin = new UGAdmin();
4
+ var g_codemirrorCss = null;
5
+
6
+
7
+ /**
8
+ * set the editor to the text area
9
+ */
10
+ function setCodeMirrorEditor(){
11
+
12
+ g_codemirrorCss = CodeMirror.fromTextArea(document.getElementById("des_area_editor"), {
13
+ mode: {name: "css"},
14
+ lineNumbers: true
15
+ });
16
+
17
+ }
18
+
19
+
20
+ /**
21
+ * open edit css dialog
22
+ */
23
+ function ugOpenEditCssDialog(){
24
+
25
+ var buttonOpts = {};
26
+
27
+ //update button
28
+ buttonOpts[g_ugtext.update] = function(){
29
+
30
+ var data = {};
31
+ var skin = jQuery("#dialog_edit_css").data("skin");
32
+ data.skin = skin;
33
+
34
+ if (g_codemirrorCss != null)
35
+ data.css = g_codemirrorCss.getValue();
36
+ else
37
+ data.css = jQuery("#des_area_editor").val();
38
+
39
+ jQuery("#des_loader_operation").show().html(g_ugtext.updating);
40
+
41
+ g_ugAdmin.setErrorMessageID("des_error_message");
42
+ g_galleryAdmin.ajaxRequestGallery("update_skin_css", data, function(response){
43
+ jQuery("#des_loader_operation").hide();
44
+ jQuery("#dialog_edit_css").dialog("close");
45
+
46
+ });
47
+
48
+ };
49
+
50
+ //restore button
51
+ buttonOpts[g_ugtext.restore] = function(){
52
+
53
+ var data = {};
54
+ var skin = jQuery("#dialog_edit_css").data("skin");
55
+ data.skin = skin;
56
+
57
+ jQuery("#des_loader_operation").show().html(g_ugtext.restoring);
58
+
59
+ g_ugAdmin.setErrorMessageID("des_error_message");
60
+ g_galleryAdmin.ajaxRequestGallery("get_original_skin_css", data, function(response){
61
+
62
+ jQuery("#des_loader_operation").hide();
63
+
64
+ if(!response.content)
65
+ alert(response.message);
66
+ else
67
+ g_codemirrorCss.setValue(response.content);
68
+
69
+ });
70
+
71
+
72
+ };
73
+
74
+
75
+ buttonOpts[g_ugtext.cancel] = function(){
76
+ jQuery("#dialog_edit_css").dialog("close");
77
+ };
78
+
79
+
80
+ jQuery("#dialog_edit_css").dialog({
81
+ buttons:buttonOpts,
82
+ minWidth:900,
83
+ modal:true,
84
+ open:function(){
85
+ var skin = jQuery("#theme_skin").val();
86
+
87
+ jQuery("#dialog_edit_css").data("skin",skin);
88
+
89
+ var data = {
90
+ skin: skin
91
+ };
92
+
93
+ if (g_codemirrorCss != null)
94
+ g_codemirrorCss.setValue("");
95
+ else
96
+ jQuery("#des_area_editor").val("").hide();
97
+
98
+
99
+ jQuery("#des_editing_file_text").hide();
100
+ jQuery("#des_loader").show();
101
+
102
+ g_ugAdmin.setErrorMessageID("des_error_message");
103
+ g_galleryAdmin.ajaxRequestGallery("get_skin_css", data, function(response){
104
+
105
+ jQuery("#des_loader").hide();
106
+
107
+ var content = response.content;
108
+ var filepath = response.filepath;
109
+
110
+ jQuery("#des_editing_file_text").show();
111
+ jQuery("#des_filepath").html(filepath);
112
+
113
+ if (g_codemirrorCss != null)
114
+ g_codemirrorCss.setValue(content);
115
+ else{
116
+
117
+ jQuery("#des_area_editor").show().val(content);
118
+ setTimeout(setCodeMirrorEditor, 500);
119
+ }
120
+
121
+ });
122
+
123
+ }
124
+ });
125
+
126
+ }
127
+
128
+ jQuery(document).ready(function(){
129
+
130
+ jQuery("#button_edit_css").click(ugOpenEditCssDialog);
131
+
132
+ });
133
+
134
+ })( jQuery );
galleries/ugcore_video/release_log.txt ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version 1.0
2
+
3
+ first release
galleries/ugcore_video/scripts.php ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+
4
+ defined('UNITEGALLERY_INC') or die('Restricted access');
5
+
6
+ HelperGalleryUG::addScript("js/video_admin.js", "video_admin");
7
+
8
+ //add codemirror scripts
9
+ HelperGalleryUG::addScriptAbsoluteUrl(GlobalsUG::$urlPlugin."js/codemirror/codemirror.js", "codemirror_js");
10
+ HelperGalleryUG::addScriptAbsoluteUrl(GlobalsUG::$urlPlugin."js/codemirror/css.js", "codemirror_cssjs");
11
+ HelperGalleryUG::addStyleAbsoluteUrl(GlobalsUG::$urlPlugin."js/codemirror/codemirror.css", "codemirror_css");
12
+
13
+ ?>
galleries/ugcore_video/settings/gallery_settings.php ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+
4
+ defined('UNITEGALLERY_INC') or die('Restricted access');
5
+
6
+
7
+ require GlobalsUG::$pathHelpersSettings."main.php";
8
+
9
+ $settingsParams = new UniteGallerySettingsUG();
10
+ $settingsParams->loadXMLFile(GlobalsUGGallery::$pathSettings."gallery_settings.xml");
11
+
12
+ // get merged settings with values
13
+ $valuesMain = $settingsMain->getArrValues();
14
+ $valuesParams = $settingsParams->getArrValues();
15
+ $valuesMerged = array_merge($valuesMain, $valuesParams);
16
+
17
+ $valuesMerged["gallery_theme"] = "video";
18
+
19
+ ?>
galleries/ugcore_video/settings/gallery_settings.xml ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+
3
+ <fields>
4
+
5
+ <fieldset name="theme_options" label="Theme Options" icon="eg-icon-cog-alt">
6
+
7
+ <field name="theme_skin"
8
+ type="list"
9
+ default="right-thumb"
10
+ label="Choose Scroller Skin"
11
+ description="Choose the video gallery skin. Each one represented by css file">
12
+ <option value="right-thumb" text="With Icon"></option>
13
+ <option value="right-no-thumb" text="Title + Description"></option>
14
+ <option value="right-title-only" text="Title Only"></option>
15
+ </field>
16
+
17
+ <field name="button_edit_css"
18
+ type="button"
19
+ default="Edit Skin Css"
20
+ label="&amp;nbsp;"
21
+ description="">
22
+ </field>
23
+
24
+ <field name="theme_autoplay"
25
+ type="boolean"
26
+ default="false"
27
+ label="Autoplay Always"
28
+ description="Always autoplay video at start and at select">
29
+ </field>
30
+
31
+ <field name="theme_next_video_onend"
32
+ type="boolean"
33
+ default="false"
34
+ label="Next Video On End"
35
+ description="Change to next video on end">
36
+ </field>
37
+
38
+
39
+ </fieldset>
40
+
41
+ <fieldset name="position" loadfrom="helper"></fieldset>
42
+
43
+ <fieldset name="troubleshooting" loadfrom="helper"></fieldset>
44
+
45
+ </fields>
46
+
galleries/ugcore_video/settings/index.html ADDED
File without changes
galleries/ugcore_video/views/index.html ADDED
File without changes
galleries/ugcore_video/views/preview.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+
4
+ defined('UNITEGALLERY_INC') or die('Restricted access');
5
+
6
+
7
+ $output = new UGVideoThemeOutput();
8
+ echo $output->putGallery(GlobalsUGGallery::$galleryID);
9
+
10
+ ?>
galleries/ugcore_video/views/settings_before_draw.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ <style type="text/css">
3
+ #dialog_edit_css .CodeMirror-scroll{
4
+ height:400px !important;
5
+ }
6
+ </style>
7
+
8
+ <div id="dialog_edit_css" title="<?php _e("Edit Skin Css", UNITEGALLERY_TEXTDOMAIN)?>" style="display:none;position:relative;">
9
+
10
+ <div class="vert_sap20"></div>
11
+
12
+ <div id="des_error_message" class="unite_error_message" style="display:none"></div>
13
+
14
+ <div id="des_loader_operation" class="loader_text" style="position:absolute;top:39px;left:789px;display:none;"></div>
15
+
16
+ <div id="des_loader" class="loader_text">Loading content...</div>
17
+
18
+ <div id="des_editing_file_text"><?php _e("Editing File", UNITEGALLERY_TEXTDOMAIN)?>: <i> <span id="des_filepath"> </span></i> </div>
19
+
20
+ <div class="vert_sap20"></div>
21
+
22
+ <textarea id="des_area_editor" style="width:100%;height:400px;"></textarea>
23
+
24
+ </div>
helpers/classes/include_classes.php ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+
4
+ defined('UNITEGALLERY_INC') or die('Restricted access');
5
+
6
+ require_once GlobalsUG::$pathHelpersClasses."settings_ug.class.php";
7
+ require_once GlobalsUG::$pathHelpersClasses."output_ug.class.php";
8
+ ?>
helpers/classes/index.html ADDED
File without changes
helpers/classes/output_ug.class.php ADDED
@@ -0,0 +1,1617 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ defined('UNITEGALLERY_INC') or die('Restricted access');
4
+
5
+
6
+ class UGMainOutput extends UniteOutputBaseUG{
7
+
8
+ protected static $serial = 0;
9
+
10
+ private $gallery;
11
+ protected $urlPlugin;
12
+ private $galleryHtmlID;
13
+ private $galleryID;
14
+ protected $theme;
15
+ private $putNoConflictMode = false;
16
+ protected $putJsToBody = false;
17
+ protected $isTilesType = false;
18
+ protected $arrJsParamsAssoc = array();
19
+ protected $arrLoadMoreCache = null;
20
+ protected $arrItems;
21
+
22
+
23
+ const THEME_DEFAULT = "default";
24
+ const THEME_COMPACT = "compact";
25
+ const THEME_SLIDER = "slider";
26
+ const THEME_GRID = "grid";
27
+ const THEME_VIDEO = "video";
28
+ const THEME_TILES = "tiles";
29
+ const THEME_TILESGRID = "tilesgrid";
30
+ const THEME_CAROUSEL = "carousel";
31
+
32
+
33
+ /**
34
+ *
35
+ * construct the output object
36
+ */
37
+ public function __construct(){
38
+
39
+ $this->init();
40
+ }
41
+
42
+
43
+ /**
44
+ *
45
+ * init the gallery
46
+ */
47
+ private function init(){
48
+
49
+ $urlBase = GlobalsUGGallery::$urlBase;
50
+ if(empty($urlBase))
51
+ UniteFunctionsUG::throwError("The gallery globals object not inited!");
52
+
53
+ $this->urlPlugin = GlobalsUG::$url_media_ug;
54
+
55
+ }
56
+
57
+
58
+ /**
59
+ * get must fields that will be thrown from the settings anyway
60
+ */
61
+ protected function getArrMustFields(){
62
+ $arrMustKeys = array(
63
+ "category",
64
+ "gallery_theme",
65
+ "full_width",
66
+ "gallery_width",
67
+ "gallery_height",
68
+ "position",
69
+ "margin_top",
70
+ "margin_bottom",
71
+ "margin_left",
72
+ "margin_right"
73
+ );
74
+
75
+ return($arrMustKeys);
76
+ }
77
+
78
+
79
+ /**
80
+ *
81
+ * init gallery related variables
82
+ */
83
+ protected function initGallery($galleryID){
84
+
85
+ self::$serial++;
86
+
87
+ $this->gallery = new UniteGalleryGallery();
88
+ $this->gallery->initByID($galleryID);
89
+
90
+ //get real gallery id:
91
+ $galleryID = $this->gallery->getID();
92
+
93
+ $serial = self::$serial;
94
+ $this->galleryID = $galleryID;
95
+ $this->galleryHtmlID = "unitegallery_{$galleryID}_{$serial}";
96
+
97
+ $origParams = $this->gallery->getParams();
98
+
99
+ //set params for default settings get function
100
+ $this->arrOriginalParams = $origParams;
101
+
102
+ $enableTabs = $this->getParam("enable_category_tabs", self::FORCE_BOOLEAN);
103
+
104
+ $defaultValues = $this->getDefautSettingsValues();
105
+
106
+ //get categoty tabs settings:
107
+ if($enableTabs === true){
108
+ $defaultValuesTabs = $this->getDefautSettingsValues_tabs();
109
+ $defaultValues = array_merge($defaultValues, $defaultValuesTabs);
110
+ }
111
+
112
+ //add advanced settings (instead of merge with setting file):
113
+ $defaultValues["ug_additional_scripts"] = "";
114
+ $defaultValues["ug_additional_styles"] = "";
115
+
116
+ $origParams = UniteFunctionsUG::filterArrFields($origParams, $defaultValues, true);
117
+
118
+ $this->arrOriginalParams = array_merge($defaultValues, $origParams);
119
+
120
+ $arrMustKeys = $this->getArrMustFields();
121
+
122
+ $this->arrParams = UniteFunctionsUG::getDiffArrItems($this->arrOriginalParams, $defaultValues, $arrMustKeys);
123
+
124
+ $enableLoadmore = $this->getParam("show_loadmore",self::FORCE_BOOLEAN);
125
+
126
+ $addAjax = false;
127
+
128
+ //add tabs related options
129
+ if($enableTabs === true){
130
+ $addAjax = true;
131
+ $this->arrParams["gallery_enable_tabs"] = "true";
132
+ }
133
+
134
+ //add loadmore related options
135
+ if($enableLoadmore == true){
136
+ $arrLoadmore = $this->getLoadMoreParams();
137
+ $addAjax = true;
138
+ $this->arrParams["gallery_enable_loadmore"] = "true";
139
+ $this->arrParams["loadmore_container"] = $arrLoadmore["wrapper_id"];
140
+ }
141
+
142
+ if($addAjax == true){
143
+ $this->arrParams["gallery_urlajax"] = GlobalsUG::$url_ajax_front;
144
+ }
145
+
146
+ //add load api externally param
147
+ $this->arrParams["load_api_externally"] = "true";
148
+
149
+ $this->modifyOptions();
150
+ }
151
+
152
+
153
+
154
+ /**
155
+ * modify options
156
+ */
157
+ protected function modifyOptions(){
158
+
159
+ if($this->isTilesType == true){
160
+
161
+ //handle compact lightbox type options
162
+ $lightboxType = $this->getParam("lightbox_type");
163
+
164
+ if($lightboxType == "compact"){
165
+
166
+ $this->renameOption("lightbox_compact_overlay_opacity", "lightbox_overlay_opacity", true);
167
+ $this->renameOption("lightbox_compact_overlay_color", "lightbox_overlay_color", true);
168
+ $this->renameOption("lightbox_compact_show_numbers", "lightbox_show_numbers", true);
169
+ $this->renameOption("lightbox_compact_numbers_size", "lightbox_numbers_size", true);
170
+ $this->renameOption("lightbox_compact_numbers_color", "lightbox_numbers_color", true);
171
+ $this->renameOption("lightbox_compact_numbers_padding_top", "lightbox_numbers_padding_top", true);
172
+ $this->renameOption("lightbox_compact_numbers_padding_right", "lightbox_numbers_padding_right", true);
173
+ $this->renameOption("lightbox_compact_show_textpanel", "lightbox_show_textpanel", true);
174
+ $this->renameOption("lightbox_compact_textpanel_source", "lightbox_textpanel_source", true);
175
+ $this->renameOption("lightbox_compact_textpanel_title_color", "lightbox_textpanel_title_color", true);
176
+ $this->renameOption("lightbox_compact_textpanel_title_font_size", "lightbox_textpanel_title_font_size", true);
177
+ $this->renameOption("lightbox_compact_textpanel_title_bold", "lightbox_textpanel_title_bold", true);
178
+ $this->renameOption("lightbox_compact_textpanel_padding_left", "lightbox_textpanel_padding_left", true);
179
+ $this->renameOption("lightbox_compact_textpanel_padding_right", "lightbox_textpanel_padding_right", true);
180
+ $this->renameOption("lightbox_compact_textpanel_padding_top", "lightbox_textpanel_padding_top", true);
181
+ $this->renameOption("lightbox_compact_slider_image_border", "lightbox_slider_image_border", true);
182
+ $this->renameOption("lightbox_compact_slider_image_border_width", "lightbox_slider_image_border_width", true);
183
+ $this->renameOption("lightbox_compact_slider_image_border_color", "lightbox_slider_image_border_color", true);
184
+ $this->renameOption("lightbox_compact_slider_image_border_radius", "lightbox_slider_image_border_radius", true);
185
+ $this->renameOption("lightbox_compact_slider_image_shadow", "lightbox_slider_image_shadow", true);
186
+
187
+ $this->deleteOption("lightbox_textpanel_title_text_align");
188
+ }else{
189
+
190
+ //delete all compact related options if exists
191
+ $arrOptionsToDelete = array(
192
+ "lightbox_compact_overlay_opacity",
193
+ "lightbox_compact_overlay_color",
194
+ "lightbox_compact_show_numbers",
195
+ "lightbox_compact_numbers_size",
196
+ "lightbox_compact_numbers_color",
197
+ "lightbox_compact_numbers_padding_top",
198
+ "lightbox_compact_numbers_padding_right",
199
+ "lightbox_compact_show_textpanel",
200
+ "lightbox_compact_textpanel_source",
201
+ "lightbox_compact_textpanel_title_color",
202
+ "lightbox_compact_textpanel_title_font_size",
203
+ "lightbox_compact_textpanel_title_bold",
204
+ "lightbox_compact_textpanel_padding_top",
205
+ "lightbox_compact_textpanel_padding_left",
206
+ "lightbox_compact_textpanel_padding_right",
207
+ "lightbox_compact_slider_image_border",
208
+ "lightbox_compact_slider_image_border_width",
209
+ "lightbox_compact_slider_image_border_color",
210
+ "lightbox_compact_slider_image_border_radius",
211
+ "lightbox_compact_slider_image_shadow"
212
+ );
213
+
214
+ $this->deleteOptions($arrOptionsToDelete);
215
+ }
216
+
217
+ //handle text panel source
218
+ $lightboxSource = $this->getParam("lightbox_textpanel_source");
219
+
220
+ switch($lightboxSource){
221
+ case "desc":
222
+ $this->arrParams["lightbox_textpanel_enable_title"] = "false";
223
+ $this->arrParams["lightbox_textpanel_enable_description"] = "true";
224
+ break;
225
+ case "title_desc":
226
+ $this->arrParams["lightbox_textpanel_enable_description"] = "true";
227
+ break;
228
+ }
229
+
230
+ }else{
231
+ if($this->isParamExists("strippanel_background_transparent")){
232
+ $isTrans = $this->getParam("strippanel_background_transparent", self::FORCE_BOOLEAN);
233
+ if($isTrans == true)
234
+ $this->arrParams["strippanel_background_color"] = "transparent";
235
+ }
236
+ }
237
+
238
+ //modify thumb resolution (from old option).
239
+ $resolution = $this->getParam("thumb_resolution");
240
+ if(empty($resolution)){
241
+ $resolution = $this->getParam("tile_image_resolution");
242
+ if(!empty($resolution))
243
+ $this->arrParams["thumb_resolution"] = $resolution;
244
+ }
245
+
246
+ }
247
+
248
+
249
+ /**
250
+ * get array of skins that exists in the gallery
251
+ */
252
+ protected function getArrActiveSkins($arrAddOptions = array()){
253
+
254
+ $gallerySkin = $this->getParam("gallery_skin");
255
+
256
+ if(empty($gallerySkin))
257
+ $gallerySkin = "default";
258
+
259
+ $arrSkins = array($gallerySkin=>true);
260
+
261
+ $arrOptions = array(
262
+ "strippanel_buttons_skin",
263
+ "strippanel_handle_skin",
264
+ "slider_bullets_skin",
265
+ "slider_arrows_skin",
266
+ "slider_play_button_skin",
267
+ "slider_fullscreen_button_skin",
268
+ "slider_zoompanel_skin"
269
+ );
270
+
271
+ $arrOptions = array_merge($arrOptions, $arrAddOptions);
272
+
273
+ foreach($arrOptions as $option){
274
+ $skin = $this->getParam($option);
275
+ if(empty($skin))
276
+ continue;
277
+
278
+ $arrSkins[$skin] = true;
279
+ }
280
+
281
+ return($arrSkins);
282
+ }
283
+
284
+ private function a__________SCRIPTS___________(){}
285
+
286
+ /**
287
+ * get video types from items
288
+ */
289
+ protected function getArrItemTypes(){
290
+
291
+ if(empty($this->arrItems))
292
+ return(array());
293
+
294
+ $arrTypes = array();
295
+ foreach($this->arrItems as $item){
296
+
297
+ $type = $item->getType();
298
+
299
+ $arrTypes[$type] = true;
300
+ }
301
+
302
+ return($arrTypes);
303
+ }
304
+
305
+
306
+ /**
307
+ * put video api scripts if video links exists
308
+ */
309
+ protected function putVideoAPIScripts(){
310
+
311
+ $arrVideoTypes = $this->getArrItemTypes();
312
+
313
+ foreach($arrVideoTypes as $type => $nothing){
314
+
315
+ switch($type){
316
+ case UniteGalleryItem::TYPE_YOUTUBE:
317
+
318
+ HelperGalleryUG::addScriptAbsoluteUrl("https://www.youtube.com/player_api", "youtube-api");
319
+
320
+ break;
321
+ case UniteGalleryItem::TYPE_VIMEO:
322
+
323
+ HelperGalleryUG::addScriptAbsoluteUrl("https://f.vimeocdn.com/js/froogaloop2.min.js", "froogaloop2");
324
+
325
+ break;
326
+ case UniteGalleryItem::TYPE_HTML5VIDEO:
327
+
328
+ HelperGalleryUG::addScriptAbsoluteUrl("https://cdnjs.cloudflare.com/ajax/libs/mediaelement/2.18.1/mediaelement.min.js", "mediaelement_js");
329
+ HelperGalleryUG::addStyleAbsoluteUrl("https://cdnjs.cloudflare.com/ajax/libs/mediaelement/2.18.1/mediaelementplayer.min.css", "mediaelement_css");
330
+
331
+ break;
332
+ case UniteGalleryItem::TYPE_WISTIA:
333
+
334
+ HelperGalleryUG::addScriptAbsoluteUrl("https://fast.wistia.com/assets/external/E-v1.js", "wistia_player");
335
+
336
+ break;
337
+ }
338
+
339
+
340
+ }
341
+
342
+ }
343
+
344
+
345
+ /**
346
+ *
347
+ * put gallery scripts
348
+ */
349
+ protected function putScripts($putSkins = true){
350
+
351
+ //put jquery
352
+ $includeJQuery = $this->getParam("include_jquery", self::FORCE_BOOLEAN);
353
+
354
+ if($includeJQuery == true)
355
+ UniteProviderFunctionsUG::addjQueryInclude("unitegallery");
356
+
357
+ $this->putVideoAPIScripts();
358
+
359
+ if($this->putJsToBody == false)
360
+ HelperGalleryUG::addScriptAbsoluteUrl($this->urlPlugin."js/unitegallery.min.js", "unitegallery_main");
361
+
362
+ HelperGalleryUG::addStyleAbsoluteUrl($this->urlPlugin."css/unite-gallery.css","unite-gallery-css");
363
+
364
+ //include skins
365
+ if($putSkins == true){
366
+
367
+ $arrSkins = $this->getArrActiveSkins();
368
+
369
+ foreach($arrSkins as $skin => $nothing){
370
+ if(empty($skin) || $skin == "default")
371
+ continue;
372
+
373
+ HelperGalleryUG::addStyleAbsoluteUrl($this->urlPlugin."skins/{$skin}/{$skin}.css","ug-skin-{$skin}");
374
+ }
375
+ }
376
+
377
+ }
378
+
379
+ private function a__________END_SCRIPTS___________(){}
380
+
381
+ /**
382
+ * get default settings values
383
+ * get them only once
384
+ */
385
+ protected function getDefautSettingsValues(){
386
+
387
+ require HelperGalleryUG::getFilepathSettings("gallery_settings");
388
+
389
+ return($valuesMerged);
390
+ }
391
+
392
+ /**
393
+ * get default settings of categories
394
+ */
395
+ protected function getDefautSettingsValues_tabs(){
396
+
397
+ require GlobalsUG::$pathHelpersSettings."categorytab_main.php";
398
+ require GlobalsUG::$pathHelpersSettings."categorytab_params.php";
399
+
400
+ // get merged settings with values
401
+ $valuesMain = $settingsMain->getArrValues();
402
+ $valuesParams = $settingsParams->getArrValues();
403
+ $valuesMerged = array_merge($valuesMain, $valuesParams);
404
+
405
+ return($valuesMerged);
406
+ }
407
+
408
+
409
+ /**
410
+ * get params array defenitions that shouls be put as is from the settings
411
+ */
412
+ protected function getArrJsOptions(){
413
+
414
+ $arr = array();
415
+ $arr[] = $this->buildJsParam("gallery_theme");
416
+ $arr[] = $this->buildJsParam("gallery_width", self::VALIDATE_SIZE, self::TYPE_SIZE);
417
+ $arr[] = $this->buildJsParam("gallery_height", self::VALIDATE_SIZE, self::TYPE_SIZE);
418
+ $arr[] = $this->buildJsParam("gallery_min_width", self::VALIDATE_NUMERIC, self::TYPE_NUMBER);
419
+ $arr[] = $this->buildJsParam("gallery_min_height", self::VALIDATE_NUMERIC, self::TYPE_NUMBER);
420
+ $arr[] = $this->buildJsParam("gallery_skin");
421
+ $arr[] = $this->buildJsParam("gallery_images_preload_type");
422
+ $arr[] = $this->buildJsParam("gallery_autoplay", null, self::TYPE_BOOLEAN);
423
+ $arr[] = $this->buildJsParam("gallery_play_interval", self::VALIDATE_NUMERIC, self::TYPE_NUMBER);
424
+ $arr[] = $this->buildJsParam("gallery_pause_on_mouseover", null, self::TYPE_BOOLEAN);
425
+ $arr[] = $this->buildJsParam("gallery_mousewheel_role");
426
+ $arr[] = $this->buildJsParam("gallery_control_keyboard", null, self::TYPE_BOOLEAN);
427
+ $arr[] = $this->buildJsParam("gallery_preserve_ratio", null, self::TYPE_BOOLEAN);
428
+ $arr[] = $this->buildJsParam("gallery_shuffle", null, self::TYPE_BOOLEAN);
429
+ $arr[] = $this->buildJsParam("gallery_debug_errors", null, self::TYPE_BOOLEAN);
430
+ $arr[] = $this->buildJsParam("slider_background_color");
431
+ $arr[] = $this->buildJsParam("slider_background_opacity", self::VALIDATE_NUMERIC, self::TYPE_NUMBER);
432
+
433
+ $arr[] = $this->buildJsParam("slider_scale_mode");
434
+ $arr[] = $this->buildJsParam("slider_scale_mode_media");
435
+ $arr[] = $this->buildJsParam("slider_scale_mode_fullscreen");
436
+
437
+ $arr[] = $this->buildJsParam("slider_transition");
438
+ $arr[] = $this->buildJsParam("slider_transition_speed", self::VALIDATE_NUMERIC, self::TYPE_NUMBER);
439
+ $arr[] = $this->buildJsParam("slider_transition_easing");
440
+ $arr[] = $this->buildJsParam("slider_control_swipe", null, self::TYPE_BOOLEAN);
441
+ $arr[] = $this->buildJsParam("slider_control_zoom", null, self::TYPE_BOOLEAN);
442
+ $arr[] = $this->buildJsParam("slider_zoom_max_ratio", self::VALIDATE_NUMERIC, self::TYPE_NUMBER);
443
+ $arr[] = $this->buildJsParam("slider_enable_links", null, self::TYPE_BOOLEAN);
444
+ $arr[] = $this->buildJsParam("slider_links_newpage", null, self::TYPE_BOOLEAN);
445
+
446
+ $arr[] = $this->buildJsParam("slider_video_enable_closebutton", null, self::TYPE_BOOLEAN);
447
+
448
+ $arr[] = $this->buildJsParam("slider_controls_always_on", null, self::TYPE_BOOLEAN);
449
+ $arr[] = $this->buildJsParam("slider_controls_appear_ontap", null, self::TYPE_BOOLEAN);
450
+ $arr[] = $this->buildJsParam("slider_controls_appear_duration", self::VALIDATE_NUMERIC, self::TYPE_NUMBER);
451
+
452
+ $arr[] = $this->buildJsParam("slider_loader_type", self::VALIDATE_NUMERIC, self::TYPE_NUMBER);
453
+ $arr[] = $this->buildJsParam("slider_loader_color");
454
+
455
+ $arr[] = $this->buildJsParam("slider_enable_bullets", null, self::TYPE_BOOLEAN);
456
+ $arr[] = $this->buildJsParam("slider_bullets_skin");
457
+ $arr[] = $this->buildJsParam("slider_bullets_space_between", self::VALIDATE_NUMERIC, self::TYPE_NUMBER);
458
+ $arr[] = $this->buildJsParam("slider_bullets_align_hor");
459
+ $arr[] = $this->buildJsParam("slider_bullets_align_vert");
460
+ $arr[] = $this->buildJsParam("slider_bullets_offset_hor", self::VALIDATE_NUMERIC, self::TYPE_NUMBER);
461
+ $arr[] = $this->buildJsParam("slider_bullets_offset_vert", self::VALIDATE_NUMERIC, self::TYPE_NUMBER);
462
+
463
+ $arr[] = $this->buildJsParam("slider_enable_arrows", null, self::TYPE_BOOLEAN);
464
+ $arr[] = $this->buildJsParam("slider_arrows_skin");
465
+ $arr[] = $this->buildJsParam("slider_arrow_left_align_hor");
466
+ $arr[] = $this->buildJsParam("slider_arrow_left_align_vert");
467
+ $arr[] = $this->buildJsParam("slider_arrow_left_offset_hor", self::VALIDATE_NUMERIC, self::TYPE_NUMBER);
468
+ $arr[] = $this->buildJsParam("slider_arrow_left_offset_vert", self::VALIDATE_NUMERIC, self::TYPE_NUMBER);
469
+ $arr[] = $this->buildJsParam("slider_arrow_right_align_hor");
470
+ $arr[] = $this->buildJsParam("slider_arrow_right_align_vert");
471
+ $arr[] = $this->buildJsParam("slider_arrow_right_offset_hor", self::VALIDATE_NUMERIC, self::TYPE_NUMBER);
472
+ $arr[] = $this->buildJsParam("slider_arrow_right_offset_vert", self::VALIDATE_NUMERIC, self::TYPE_NUMBER);
473
+
474
+ $arr[] = $this->buildJsParam("slider_enable_progress_indicator", null, self::TYPE_BOOLEAN);
475
+ $arr[] = $this->buildJsParam("slider_progress_indicator_type");
476
+ $arr[] = $this->buildJsParam("slider_progress_indicator_align_hor");
477
+ $arr[] = $this->buildJsParam("slider_progress_indicator_align_vert");
478
+ $arr[] = $this->buildJsParam("slider_progress_indicator_offset_hor", self::VALIDATE_NUMERIC, self::TYPE_NUMBER);
479
+ $arr[] = $this->buildJsParam("slider_progress_indicator_offset_vert", self::VALIDATE_NUMERIC, self::TYPE_NUMBER);
480
+
481
+ $arr[] = $this->buildJsParam("slider_progressbar_color");
482
+ $arr[] = $this->buildJsParam("slider_progressbar_opacity", self::VALIDATE_NUMERIC, self::TYPE_NUMBER);
483
+ $arr[] = $this->buildJsParam("slider_progressbar_line_width", self::VALIDATE_NUMERIC, self::TYPE_NUMBER);
484
+
485
+ $arr[] = $this->buildJsParam("slider_progresspie_color1");
486
+ $arr[] = $this->buildJsParam("slider_progresspie_color2");
487
+ $arr[] = $this->buildJsParam("slider_progresspie_stroke_width", self::VALIDATE_NUMERIC, self::TYPE_NUMBER);
488
+ $arr[] = $this->buildJsParam("slider_progresspie_width", self::VALIDATE_NUMERIC, self::TYPE_NUMBER);
489
+ $arr[] = $this->buildJsParam("slider_progresspie_height", self::VALIDATE_NUMERIC, self::TYPE_NUMBER);
490
+
491
+ $arr[] = $this->buildJsParam("slider_enable_play_button", null, self::TYPE_BOOLEAN);
492
+ $arr[] = $this->buildJsParam("slider_play_button_skin");
493
+ $arr[] = $this->buildJsParam("slider_play_button_align_hor");
494
+ $arr[] = $this->buildJsParam("slider_play_button_align_vert");
495
+ $arr[] = $this->buildJsParam("slider_play_button_offset_hor", self::VALIDATE_NUMERIC, self::TYPE_NUMBER);
496
+ $arr[] = $this->buildJsParam("slider_play_button_offset_vert", self::VALIDATE_NUMERIC, self::TYPE_NUMBER);
497
+
498
+ $arr[] = $this->buildJsParam("slider_enable_fullscreen_button", null, self::TYPE_BOOLEAN);
499
+ $arr[] = $this->buildJsParam("slider_fullscreen_button_skin");
500
+ $arr[] = $this->buildJsParam("slider_fullscreen_button_align_hor");
501
+ $arr[] = $this->buildJsParam("slider_fullscreen_button_align_vert");
502
+ $arr[] = $this->buildJsParam("slider_fullscreen_button_offset_hor", self::VALIDATE_NUMERIC, self::TYPE_NUMBER);
503
+ $arr[] = $this->buildJsParam("slider_fullscreen_button_offset_vert", self::VALIDATE_NUMERIC, self::TYPE_NUMBER);
504
+
505
+ $arr[] = $this->buildJsParam("slider_enable_zoom_panel", null, self::TYPE_BOOLEAN);
506
+ $arr[] = $this->buildJsParam("slider_zoompanel_skin");
507
+ $arr[] = $this->buildJsParam("slider_zoompanel_align_hor");
508
+ $arr[] = $this->buildJsParam("slider_zoompanel_align_vert");
509
+ $arr[] = $this->buildJsParam("slider_zoompanel_offset_hor", self::VALIDATE_NUMERIC, self::TYPE_NUMBER);
510
+ $arr[] = $this->buildJsParam("slider_zoompanel_offset_vert", self::VALIDATE_NUMERIC, self::TYPE_NUMBER);
511
+
512
+ $arr[] = $this->buildJsParam("slider_enable_text_panel", null, self::TYPE_BOOLEAN);
513
+ $arr[] = $this->buildJsParam("slider_textpanel_always_on", null, self::TYPE_BOOLEAN);
514
+ $arr[] = $this->buildJsParam("slider_textpanel_align");
515
+ $arr[] = $this->buildJsParam("slider_textpanel_margin", self::VALIDATE_NUMERIC, self::TYPE_NUMBER);
516
+ $arr[] = $this->buildJsParam("slider_textpanel_text_valign");
517
+ $arr[] = $this->buildJsParam("slider_textpanel_padding_top", self::VALIDATE_NUMERIC, self::TYPE_NUMBER);
518
+ $arr[] = $this->buildJsParam("slider_textpanel_padding_bottom", self::VALIDATE_NUMERIC, self::TYPE_NUMBER);
519
+ $arr[] = $this->buildJsParam("slider_textpanel_height", self::VALIDATE_NUMERIC, self::TYPE_NUMBER);
520
+ $arr[] = $this->buildJsParam("slider_textpanel_padding_title_description", self::VALIDATE_NUMERIC, self::TYPE_NUMBER);
521
+ $arr[] = $this->buildJsParam("slider_textpanel_padding_right", self::VALIDATE_NUMERIC, self::TYPE_NUMBER);
522
+ $arr[] = $this->buildJsParam("slider_textpanel_padding_left", self::VALIDATE_NUMERIC, self::TYPE_NUMBER);
523
+ $arr[] = $this->buildJsParam("slider_textpanel_fade_duration", self::VALIDATE_NUMERIC, self::TYPE_NUMBER);
524
+ $arr[] = $this->buildJsParam("slider_textpanel_enable_title", null, self::TYPE_BOOLEAN);
525
+ $arr[] = $this->buildJsParam("slider_textpanel_title_as_link", null, self::TYPE_BOOLEAN);
526
+ $arr[] = $this->buildJsParam("slider_textpanel_enable_description", null, self::TYPE_BOOLEAN);
527
+ $arr[] = $this->buildJsParam("slider_textpanel_enable_bg", null, self::TYPE_BOOLEAN);
528
+ $arr[] = $this->buildJsParam("slider_textpanel_bg_color");
529
+ $arr[] = $this->buildJsParam("slider_textpanel_bg_opacity", self::VALIDATE_NUMERIC, self::TYPE_NUMBER);
530
+
531
+ $arr[] = $this->buildJsParam("thumb_width", self::VALIDATE_NUMERIC, self::TYPE_NUMBER);
532
+ $arr[] = $this->buildJsParam("thumb_height", self::VALIDATE_NUMERIC, self::TYPE_NUMBER);
533
+ $arr[] = $this->buildJsParam("thumb_fixed_size", null, self::TYPE_BOOLEAN);
534
+ $arr[] = $this->buildJsParam("thumb_border_effect", null, self::TYPE_BOOLEAN);
535
+ $arr[] = $this->buildJsParam("thumb_border_width", self::VALIDATE_NUMERIC, self::TYPE_NUMBER);
536
+ $arr[] = $this->buildJsParam("thumb_border_color");
537
+ $arr[] = $this->buildJsParam("thumb_over_border_width", self::VALIDATE_NUMERIC, self::TYPE_NUMBER);
538
+ $arr[] = $this->buildJsParam("thumb_over_border_color");
539
+ $arr[] = $this->buildJsParam("thumb_selected_border_width", self::VALIDATE_NUMERIC, self::TYPE_NUMBER);
540
+ $arr[] = $this->buildJsParam("thumb_selected_border_color");
541
+ $arr[] = $this->buildJsParam("thumb_round_corners_radius", self::VALIDATE_NUMERIC, self::TYPE_NUMBER);
542
+ $arr[] = $this->buildJsParam("thumb_color_overlay_effect", null, self::TYPE_BOOLEAN);
543
+ $arr[] = $this->buildJsParam("thumb_overlay_color");
544
+ $arr[] = $this->buildJsParam("thumb_overlay_opacity", self::VALIDATE_NUMERIC, self::TYPE_NUMBER);
545
+ $arr[] = $this->buildJsParam("thumb_overlay_reverse", null, self::TYPE_BOOLEAN);
546
+ $arr[] = $this->buildJsParam("thumb_image_overlay_effect", null, self::TYPE_BOOLEAN);
547
+ $arr[] = $this->buildJsParam("thumb_image_overlay_type");
548
+ $arr[] = $this->buildJsParam("thumb_transition_duration", self::VALIDATE_NUMERIC, self::TYPE_NUMBER);
549
+ $arr[] = $this->buildJsParam("thumb_transition_easing");
550
+ $arr[] = $this->buildJsParam("thumb_show_loader", null, self::TYPE_BOOLEAN);
551
+ $arr[] = $this->buildJsParam("thumb_loader_type");
552
+
553
+ $arr[] = $this->buildJsParam("strippanel_padding_top", self::VALIDATE_NUMERIC, self::TYPE_NUMBER);
554
+ $arr[] = $this->buildJsParam("strippanel_padding_bottom", self::VALIDATE_NUMERIC, self::TYPE_NUMBER);
555
+ $arr[] = $this->buildJsParam("strippanel_padding_left", self::VALIDATE_NUMERIC, self::TYPE_NUMBER);
556
+ $arr[] = $this->buildJsParam("strippanel_padding_right", self::VALIDATE_NUMERIC, self::TYPE_NUMBER);
557
+ $arr[] = $this->buildJsParam("strippanel_enable_buttons", null, self::TYPE_BOOLEAN);
558
+ $arr[] = $this->buildJsParam("strippanel_buttons_skin");
559
+ $arr[] = $this->buildJsParam("strippanel_padding_buttons", self::VALIDATE_NUMERIC, self::TYPE_NUMBER);
560
+ $arr[] = $this->buildJsParam("strippanel_buttons_role");
561
+ $arr[] = $this->buildJsParam("strippanel_enable_handle", null, self::TYPE_BOOLEAN);
562
+ $arr[] = $this->buildJsParam("strippanel_handle_align");
563
+ $arr[] = $this->buildJsParam("strippanel_handle_offset", self::VALIDATE_NUMERIC, self::TYPE_NUMBER);
564
+ $arr[] = $this->buildJsParam("strippanel_handle_skin");
565
+ $arr[] = $this->buildJsParam("strippanel_background_color");
566
+ $arr[] = $this->buildJsParam("strip_thumbs_align");
567
+ $arr[] = $this->buildJsParam("strip_space_between_thumbs", self::VALIDATE_NUMERIC, self::TYPE_NUMBER);
568
+ $arr[] = $this->buildJsParam("strip_thumb_touch_sensetivity", self::VALIDATE_NUMERIC, self::TYPE_NUMBER);
569
+ $arr[] = $this->buildJsParam("strip_scroll_to_thumb_duration", self::VALIDATE_NUMERIC, self::TYPE_NUMBER);
570
+ $arr[] = $this->buildJsParam("strip_scroll_to_thumb_easing");
571
+ $arr[] = $this->buildJsParam("strip_control_avia", null, self::TYPE_BOOLEAN);
572
+ $arr[] = $this->buildJsParam("strip_control_touch", null, self::TYPE_BOOLEAN);
573
+
574
+ $arr[] = $this->buildJsParam("gridpanel_vertical_scroll", null, self::TYPE_BOOLEAN);
575
+ $arr[] = $this->buildJsParam("gridpanel_grid_align");
576
+ $arr[] = $this->buildJsParam("gridpanel_padding_border_top", self::VALIDATE_NUMERIC, self::TYPE_NUMBER);
577
+ $arr[] = $this->buildJsParam("gridpanel_padding_border_bottom", self::VALIDATE_NUMERIC, self::TYPE_NUMBER);
578
+ $arr[] = $this->buildJsParam("gridpanel_padding_border_left", self::VALIDATE_NUMERIC, self::TYPE_NUMBER);
579
+ $arr[] = $this->buildJsParam("gridpanel_padding_border_right", self::VALIDATE_NUMERIC, self::TYPE_NUMBER);
580
+ $arr[] = $this->buildJsParam("gridpanel_arrows_skin");
581
+ $arr[] = $this->buildJsParam("gridpanel_arrows_align_vert");
582
+ $arr[] = $this->buildJsParam("gridpanel_arrows_padding_vert", self::VALIDATE_NUMERIC, self::TYPE_NUMBER);
583
+ $arr[] = $this->buildJsParam("gridpanel_arrows_align_hor");
584
+ $arr[] = $this->buildJsParam("gridpanel_arrows_padding_hor", self::VALIDATE_NUMERIC, self::TYPE_NUMBER);
585
+ $arr[] = $this->buildJsParam("gridpanel_space_between_arrows", self::VALIDATE_NUMERIC, self::TYPE_NUMBER);
586
+ $arr[] = $this->buildJsParam("gridpanel_arrows_always_on", null, self::TYPE_BOOLEAN);
587
+ $arr[] = $this->buildJsParam("gridpanel_enable_handle", null, self::TYPE_BOOLEAN);
588
+ $arr[] = $this->buildJsParam("gridpanel_handle_align");
589
+ $arr[] = $this->buildJsParam("gridpanel_handle_offset", self::VALIDATE_NUMERIC, self::TYPE_NUMBER);
590
+ $arr[] = $this->buildJsParam("gridpanel_handle_skin");
591
+ $arr[] = $this->buildJsParam("gridpanel_background_color");
592
+
593
+ $arr[] = $this->buildJsParam("grid_panes_direction");
594
+ $arr[] = $this->buildJsParam("grid_num_cols", self::VALIDATE_NUMERIC, self::TYPE_NUMBER);
595
+ $arr[] = $this->buildJsParam("grid_space_between_cols", self::VALIDATE_NUMERIC, self::TYPE_NUMBER);
596
+ $arr[] = $this->buildJsParam("grid_space_between_rows", self::VALIDATE_NUMERIC, self::TYPE_NUMBER);
597
+ $arr[] = $this->buildJsParam("grid_transition_duration", self::VALIDATE_NUMERIC, self::TYPE_NUMBER);
598
+ $arr[] = $this->buildJsParam("grid_transition_easing");
599
+ $arr[] = $this->buildJsParam("grid_carousel", null, self::TYPE_BOOLEAN);
600
+
601
+ //category tabs related
602
+ $arr[] = $this->buildJsParam("gallery_urlajax");
603
+ $arr[] = $this->buildJsParam("gallery_enable_tabs", null, self::TYPE_BOOLEAN);
604
+ $arr[] = $this->buildJsParam("tabs_type");
605
+ $arr[] = $this->buildJsParam("tabs_container");
606
+ $arr[] = $this->buildJsParam("gallery_initial_catid");
607
+ $arr[] = $this->buildJsParam("load_api_externally", null, self::TYPE_BOOLEAN);
608
+
609
+ //loadmore related
610
+ $arrLoadmore = $this->getLoadMoreParams();
611
+ if($arrLoadmore["enable"] == true){
612
+ $arr[] = $this->buildJsParam("gallery_enable_loadmore", null, self::TYPE_BOOLEAN);
613
+ $arr[] = $this->buildJsParam("loadmore_container");
614
+ }
615
+
616
+ //tiles type
617
+ if($this->isTilesType == true){
618
+
619
+ $arr[] = $this->buildJsParam("tile_width", self::VALIDATE_NUMERIC, self::TYPE_NUMBER);
620
+ $arr[] = $this->buildJsParam("tile_height", self::VALIDATE_NUMERIC, self::TYPE_NUMBER);
621
+ $arr[] = $this->buildJsParam("tile_enable_background", null, self::TYPE_BOOLEAN);
622
+ $arr[] = $this->buildJsParam("tile_background_color");
623
+ $arr[] = $this->buildJsParam("tile_enable_border", null, self::TYPE_BOOLEAN);
624
+ $arr[] = $this->buildJsParam("tile_border_width", self::VALIDATE_NUMERIC, self::TYPE_NUMBER);
625
+ $arr[] = $this->buildJsParam("tile_border_color");
626
+ $arr[] = $this->buildJsParam("tile_border_radius", self::VALIDATE_NUMERIC, self::TYPE_NUMBER);
627
+ $arr[] = $this->buildJsParam("tile_enable_outline", null, self::TYPE_BOOLEAN);
628
+ $arr[] = $this->buildJsParam("tile_outline_color");
629
+ $arr[] = $this->buildJsParam("tile_enable_shadow", null, self::TYPE_BOOLEAN);
630
+ $arr[] = $this->buildJsParam("tile_shadow_h", self::VALIDATE_NUMERIC, self::TYPE_NUMBER);
631
+ $arr[] = $this->buildJsParam("tile_shadow_v", self::VALIDATE_NUMERIC, self::TYPE_NUMBER);
632
+ $arr[] = $this->buildJsParam("tile_shadow_blur", self::VALIDATE_NUMERIC, self::TYPE_NUMBER);
633
+ $arr[] = $this->buildJsParam("tile_shadow_spread", self::VALIDATE_NUMERIC, self::TYPE_NUMBER);
634
+ $arr[] = $this->buildJsParam("tile_shadow_color");
635
+ $arr[] = $this->buildJsParam("tile_enable_action");
636
+ $arr[] = $this->buildJsParam("tile_as_link", null, self::TYPE_BOOLEAN);
637
+ $arr[] = $this->buildJsParam("tile_link_newpage", null, self::TYPE_BOOLEAN);
638
+ $arr[] = $this->buildJsParam("tile_enable_overlay", null, self::TYPE_BOOLEAN);
639
+ $arr[] = $this->buildJsParam("tile_overlay_opacity", self::VALIDATE_NUMERIC, self::TYPE_NUMBER);
640
+ $arr[] = $this->buildJsParam("tile_overlay_color");
641
+ $arr[] = $this->buildJsParam("tile_enable_icons", null, self::TYPE_BOOLEAN);
642
+ $arr[] = $this->buildJsParam("tile_show_link_icon", null, self::TYPE_BOOLEAN);
643
+ $arr[] = $this->buildJsParam("tile_space_between_icons");
644
+ $arr[] = $this->buildJsParam("tile_videoplay_icon_always_on");
645
+ $arr[] = $this->buildJsParam("tile_enable_image_effect", null, self::TYPE_BOOLEAN);
646
+ $arr[] = $this->buildJsParam("tile_image_effect_type");
647
+ $arr[] = $this->buildJsParam("tile_image_effect_reverse", null, self::TYPE_BOOLEAN);
648
+ $arr[] = $this->buildJsParam("tile_enable_textpanel", null, self::TYPE_BOOLEAN);
649
+ $arr[] = $this->buildJsParam("tile_textpanel_source");
650
+ $arr[] = $this->buildJsParam("tile_textpanel_position");
651
+
652
+ $arr[] = $this->buildJsParam("tile_textpanel_always_on", null, self::TYPE_BOOLEAN);
653
+ $arr[] = $this->buildJsParam("tile_textpanel_appear_type");
654
+ $arr[] = $this->buildJsParam("tile_textpanel_offset", self::VALIDATE_NUMERIC, self::TYPE_NUMBER);
655
+ $arr[] = $this->buildJsParam("tile_textpanel_padding_top", self::VALIDATE_NUMERIC, self::TYPE_NUMBER);
656
+ $arr[] = $this->buildJsParam("tile_textpanel_padding_bottom", self::VALIDATE_NUMERIC, self::TYPE_NUMBER);
657
+ $arr[] = $this->buildJsParam("tile_textpanel_padding_left", self::VALIDATE_NUMERIC, self::TYPE_NUMBER);
658
+ $arr[] = $this->buildJsParam("tile_textpanel_padding_right", self::VALIDATE_NUMERIC, self::TYPE_NUMBER);
659
+ $arr[] = $this->buildJsParam("tile_textpanel_bg_color");
660
+ $arr[] = $this->buildJsParam("tile_textpanel_bg_opacity", self::VALIDATE_NUMERIC, self::TYPE_NUMBER);
661
+ $arr[] = $this->buildJsParam("tile_textpanel_title_color");
662
+ $arr[] = $this->buildJsParam("tile_textpanel_title_text_align");
663
+ $arr[] = $this->buildJsParam("tile_textpanel_title_font_size", self::VALIDATE_NUMERIC, self::TYPE_NUMBER);
664
+ $arr[] = $this->buildJsParam("tile_textpanel_title_bold", null, self::TYPE_BOOLEAN);
665
+ $arr[] = $this->buildJsParam("tile_textpanel_desc_bold", null, self::TYPE_BOOLEAN);
666
+
667
+ $arr[] = $this->buildJsParam("lightbox_hide_arrows_onvideoplay", null, self::TYPE_BOOLEAN);
668
+ $arr[] = $this->buildJsParam("lightbox_slider_control_swipe", null, self::TYPE_BOOLEAN);
669
+ $arr[] = $this->buildJsParam("lightbox_slider_control_zoom", null, self::TYPE_BOOLEAN);
670
+ $arr[] = $this->buildJsParam("lightbox_close_on_emptyspace", null, self::TYPE_BOOLEAN);
671
+
672
+ $arr[] = $this->buildJsParam("lightbox_slider_zoom_max_ratio", self::VALIDATE_NUMERIC, self::TYPE_NUMBER);
673
+ $arr[] = $this->buildJsParam("lightbox_slider_transition");
674
+ $arr[] = $this->buildJsParam("lightbox_overlay_opacity", self::VALIDATE_NUMERIC, self::TYPE_NUMBER);
675
+ $arr[] = $this->buildJsParam("lightbox_overlay_color");
676
+
677
+ $arr[] = $this->buildJsParam("lightbox_top_panel_opacity", self::VALIDATE_NUMERIC, self::TYPE_NUMBER);
678
+ $arr[] = $this->buildJsParam("lightbox_show_numbers", null, self::TYPE_BOOLEAN);
679
+ $arr[] = $this->buildJsParam("lightbox_numbers_size", self::VALIDATE_NUMERIC, self::TYPE_NUMBER);
680
+ $arr[] = $this->buildJsParam("lightbox_numbers_color");
681
+ $arr[] = $this->buildJsParam("lightbox_show_textpanel", null, self::TYPE_BOOLEAN);
682
+
683
+ $arr[] = $this->buildJsParam("lightbox_textpanel_width", self::VALIDATE_NUMERIC, self::TYPE_NUMBER);
684
+ $arr[] = $this->buildJsParam("lightbox_textpanel_enable_title", null, self::TYPE_BOOLEAN);
685
+ $arr[] = $this->buildJsParam("lightbox_textpanel_enable_description", null, self::TYPE_BOOLEAN);
686
+
687
+ $arr[] = $this->buildJsParam("lightbox_textpanel_title_color");
688
+ $arr[] = $this->buildJsParam("lightbox_textpanel_title_text_align");
689
+ $arr[] = $this->buildJsParam("lightbox_textpanel_title_font_size", self::VALIDATE_NUMERIC, self::TYPE_NUMBER);
690
+ $arr[] = $this->buildJsParam("lightbox_textpanel_title_bold", null, self::TYPE_BOOLEAN);
691
+
692
+ $arr[] = $this->buildJsParam("lightbox_textpanel_desc_color");
693
+ $arr[] = $this->buildJsParam("lightbox_textpanel_desc_text_align");
694
+ $arr[] = $this->buildJsParam("lightbox_textpanel_desc_font_size", self::VALIDATE_NUMERIC, self::TYPE_NUMBER);
695
+ $arr[] = $this->buildJsParam("lightbox_textpanel_desc_bold", null, self::TYPE_BOOLEAN);
696
+
697
+ //lightbox compact related styles
698
+ $arr[] = $this->buildJsParam("lightbox_type");
699
+ $arr[] = $this->buildJsParam("lightbox_arrows_position");
700
+ $arr[] = $this->buildJsParam("lightbox_arrows_inside_alwayson", null, self::TYPE_BOOLEAN);
701
+ $arr[] = $this->buildJsParam("lightbox_numbers_padding_top", self::VALIDATE_NUMERIC, self::TYPE_NUMBER);
702
+ $arr[] = $this->buildJsParam("lightbox_numbers_padding_right", self::VALIDATE_NUMERIC, self::TYPE_NUMBER);
703
+ $arr[] = $this->buildJsParam("lightbox_textpanel_padding_left", self::VALIDATE_NUMERIC, self::TYPE_NUMBER);
704
+ $arr[] = $this->buildJsParam("lightbox_textpanel_padding_right", self::VALIDATE_NUMERIC, self::TYPE_NUMBER);
705
+ $arr[] = $this->buildJsParam("lightbox_textpanel_padding_top", self::VALIDATE_NUMERIC, self::TYPE_NUMBER);
706
+ $arr[] = $this->buildJsParam("lightbox_slider_image_border", null, self::TYPE_BOOLEAN);
707
+ $arr[] = $this->buildJsParam("lightbox_slider_image_border_width", self::VALIDATE_NUMERIC, self::TYPE_NUMBER);
708
+ $arr[] = $this->buildJsParam("lightbox_slider_image_border_color");
709
+ $arr[] = $this->buildJsParam("lightbox_slider_image_border_radius", self::VALIDATE_NUMERIC, self::TYPE_NUMBER);
710
+ $arr[] = $this->buildJsParam("lightbox_slider_image_shadow", null, self::TYPE_BOOLEAN);
711
+
712
+ } //tiles type end
713
+
714
+
715
+ return($arr);
716
+ }
717
+
718
+
719
+ /**
720
+ * put error message instead of the gallery
721
+ */
722
+ private function getErrorMessage(Exception $e, $prefix){
723
+
724
+ $message = $e->getMessage();
725
+ $trace = "";
726
+ if(GlobalsUG::SHOW_TRACE == true)
727
+ $trace = $e->getTraceAsString();
728
+
729
+ $message = $prefix . ": ".$message;
730
+
731
+ $output = HelperUG::$operations->getErrorMessageHtml($message, $trace);
732
+
733
+ return($output);
734
+ }
735
+
736
+
737
+ /**
738
+ * put javascript includes to the body before the gallery div
739
+ */
740
+ protected function putJsIncludesToBody(){
741
+ $src = $this->urlPlugin."js/unitegallery.min.js";
742
+ $html = "\n <script type='text/javascript' src='{$src}'></script>";
743
+
744
+ return($html);
745
+ }
746
+
747
+
748
+
749
+
750
+ /**
751
+ * put gallery items
752
+ */
753
+ protected function putItems($arrItems){
754
+
755
+ $thumbSize = $this->getParam("thumb_resolution");
756
+ $bigImageSize = $this->getParam("big_image_resolution");
757
+
758
+ $thumbSizeMobile = $this->getParam("thumb_resolution_mobile");
759
+ $bigImageSizeMobile = $this->getParam("big_image_resolution_mobile");
760
+
761
+ $objItems = new UniteGalleryItems();
762
+
763
+ $htmlItems = $objItems->getItemsHtmlFront($arrItems, $thumbSize, $bigImageSize, $this->isTilesType, $thumbSizeMobile, $bigImageSizeMobile);
764
+
765
+ return($htmlItems);
766
+ }
767
+
768
+
769
+ /**
770
+ * set gallery output options like put js to body etc.
771
+ */
772
+ protected function setOutputOptions(){
773
+
774
+ $jsToBody = $this->getParam("js_to_body", self::FORCE_BOOLEAN);
775
+ $this->putJsToBody = $jsToBody;
776
+
777
+ }
778
+
779
+ /**
780
+ * put inline styles
781
+ */
782
+ protected function putInlineStyle($style, $output){
783
+
784
+ //put in the body or add to inline
785
+ $putStylesInBody = $this->getParam("tab_put_styles_in_body", self::FORCE_BOOLEAN);
786
+ if($putStylesInBody == true)
787
+ $output .= "\n<style type='text/css'>{$style}</style>\n\n";
788
+ else
789
+ HelperUG::addStyleInline($style);
790
+
791
+ return($output);
792
+ }
793
+
794
+
795
+ /**
796
+ * get category tabs html
797
+ */
798
+ protected function getCategoryTabsHtml_tabs($galleryHtmlID, $objCategories){
799
+
800
+ $categories = $this->getParam("categorytabs_ids");
801
+ if(empty($categories))
802
+ return("");
803
+
804
+ $tabsID = $galleryHtmlID."_tabs";
805
+ $this->arrParams["tabs_container"] = "#".$tabsID;
806
+
807
+ $output = "";
808
+
809
+ //make inner style
810
+ $arrStyleWrapper = array();
811
+ $arrStyleTab = array();
812
+ $arrStyleTabHover = array();
813
+ $arrStyleTabSelected = array();
814
+
815
+ //make wrapper style
816
+ $position = $this->getParam("tabs_position");
817
+ if($position == "left" || $position == "right"){
818
+ $arrStyleWrapper = $this->addParamToStyleArray($arrStyleWrapper, "tabs_position", "text-align");
819
+ $arrStyleWrapper = $this->addParamToStyleArray($arrStyleWrapper, "tabs_offset", "padding-{$position}", "px", self::FORCE_NUMERIC);
820
+ }
821
+
822
+ $arrStyleWrapper = $this->addParamToStyleArray($arrStyleWrapper, "tabs_margin_top", "margin-top", "px", self::FORCE_NUMERIC);
823
+ $arrStyleWrapper = $this->addParamToStyleArray($arrStyleWrapper, "tabs_margin_bottom", "margin-bottom", "px", self::FORCE_NUMERIC);
824
+
825
+ //make tab style
826
+
827
+ //space between tabs
828
+ $arrStyleTab = $this->addParamToStyleArray($arrStyleTab, "tabs_space_between", "margin-left", "px", self::FORCE_NUMERIC);
829
+
830
+ //tab padding
831
+ $arrStyleTab = $this->addParamToStyleArray($arrStyleTab, "tab_padding_vert", "padding-top", "px", self::FORCE_NUMERIC);
832
+ $arrStyleTab = $this->addParamToStyleArray($arrStyleTab, "tab_padding_vert", "padding-bottom", "px", self::FORCE_NUMERIC);
833
+ $arrStyleTab = $this->addParamToStyleArray($arrStyleTab, "tab_padding_hor", "padding-left", "px", self::FORCE_NUMERIC);
834
+ $arrStyleTab = $this->addParamToStyleArray($arrStyleTab, "tab_padding_hor", "padding-right", "px", self::FORCE_NUMERIC);
835
+
836
+ //tab style
837
+ $arrStyleTab = $this->addParamToStyleArray($arrStyleTab, "tab_background_color", "background-color");
838
+ $arrStyleTab = $this->addParamToStyleArray($arrStyleTab, "tab_text_color", "color");
839
+ $arrStyleTab = $this->addParamToStyleArray($arrStyleTab, "tab_text_size", "font-size","px",self::FORCE_NUMERIC);
840
+ $arrStyleTab = $this->addParamToStyleArray($arrStyleTab, "tab_font_family", "font-family");
841
+ $arrStyleTab = $this->addParamToStyleArray($arrStyleTab, "tab_font_weight", "font-weight");
842
+ $arrStyleTab = $this->addParamToStyleArray($arrStyleTab, "tab_border_radius", "border-radius", "px", self::FORCE_NUMERIC);
843
+
844
+ //tab border
845
+ $enableBorder = $this->getParam("tab_enable_border", self::FORCE_BOOLEAN);
846
+ if($enableBorder == true){
847
+ $arrStyleTab = $this->addParamToStyleArray($arrStyleTab, "tab_border_width", "border-width", "px", self::FORCE_NUMERIC);
848
+ $arrStyleTab = $this->addParamToStyleArray($arrStyleTab, "tab_border_color", "border-color");
849
+ $arrStyleTab["border-style"] = "solid";
850
+ }
851
+
852
+ //tab mouseover
853
+ $enableHoverBG = $this->getParam("tab_hover_background_change", self::FORCE_BOOLEAN);
854
+ if($enableHoverBG == false)
855
+ $arrStyleTabHover["background-color"] = $this->getParam("tab_background_color")." !important";
856
+ else
857
+ $arrStyleTabHover = $this->addParamToStyleArray($arrStyleTabHover, "tab_hover_background_color", "background-color"," !important");
858
+
859
+ $enableHoverColor = $this->getParam("tab_hover_color_change", self::FORCE_BOOLEAN);
860
+ if($enableHoverColor == true)
861
+ $arrStyleTabHover = $this->addParamToStyleArray($arrStyleTabHover, "tab_hover_text_color", "color"," !important");
862
+
863
+ $enableHoverColor = $this->getParam("tab_hover_bordercolor_change", self::FORCE_BOOLEAN);
864
+ if($enableHoverColor == true)
865
+ $arrStyleTabHover = $this->addParamToStyleArray($arrStyleTabHover, "tab_hover_border_color", "border-color"," !important");
866
+
867
+ //tab selected:
868
+ $arrStyleTabSelected = $this->addParamToStyleArray($arrStyleTabSelected, "tab_selected_background_color", "background-color"," !important");
869
+
870
+ $enableSelectedColor = $this->getParam("tab_selected_color_change", self::FORCE_BOOLEAN);
871
+ if($enableSelectedColor == true)
872
+ $arrStyleTabSelected = $this->addParamToStyleArray($arrStyleTabSelected, "tab_selected_text_color", "color"," !important");
873
+
874
+
875
+ $enableSelectedBorderColor = $this->getParam("tab_selected_bordercolor_change", self::FORCE_BOOLEAN);
876
+ if($enableSelectedBorderColor == true)
877
+ $arrStyleTabSelected = $this->addParamToStyleArray($arrStyleTabSelected, "tab_selected_border_color", "border-color"," !important");
878
+
879
+ $addCSSTab = $this->getParam("tab_additional_css");
880
+ $addCSSTabHover = $this->getParam("tab_hover_additional_css");
881
+ $addCSSTabSelected = $this->getParam("tab_selected_additional_css");
882
+
883
+
884
+ //make style strings
885
+ $strStyleWrapper = UniteFunctionsUG::arrStyleToStrStyle($arrStyleWrapper, "#".$tabsID.".ug-tabs-wrapper");
886
+ $strStyleTab = UniteFunctionsUG::arrStyleToStrStyle($arrStyleTab, "#".$tabsID.".ug-tabs-wrapper a.ug-tab", $addCSSTab);
887
+ $strStyleTabHover = UniteFunctionsUG::arrStyleToStrStyle($arrStyleTabHover, "#".$tabsID.".ug-tabs-wrapper a.ug-tab:hover:not(.ug-tab-selected)", $addCSSTabHover);
888
+ $strStyleTabSelected = UniteFunctionsUG::arrStyleToStrStyle($arrStyleTabSelected, "#".$tabsID.".ug-tabs-wrapper a.ug-tab.ug-tab-selected", $addCSSTabSelected);
889
+
890
+
891
+ $style = $strStyleWrapper.$strStyleTab.$strStyleTabHover.$strStyleTabSelected;
892
+
893
+
894
+ $output = "";
895
+
896
+ $output = $this->putInlineStyle($style, $output);
897
+ $arrCats = $objCategories->getListByIds($categories);
898
+
899
+ $output .= "<div id=\"{$tabsID}\" class=\"ug-tabs-wrapper\">";
900
+
901
+ $isFirstSelected = false;
902
+ $selectedCat = $this->getParam("tabs_init_catid");
903
+ if($selectedCat == "first")
904
+ $isFirstSelected = true;
905
+
906
+ $counter = 0;
907
+
908
+ // Dear friend. Yes, you have found a place where you can
909
+ // programmically remove the limitations.
910
+ // Though you should know that it's Illigal, and not moral!
911
+ // If you like the gallery and has respect to it's developers hard work, you should purchase a full version copy!.
912
+ // Please buy it from here: https://codecanyon.net/item/unite-gallery-wordpress-gallery-plugin/10458750?ref=valiano
913
+ // You'll get lifetime support and updates, so why not, it's not so expensive!
914
+
915
+ foreach ( $arrCats as $category ) {
916
+
917
+ if($counter >= 4)
918
+ break;
919
+
920
+ $counter++;
921
+
922
+ $title = UniteFunctionsUG::getVal($category, "title");
923
+ $id = UniteFunctionsUG::getVal($category, "id");
924
+
925
+ $class = "";
926
+ if($isFirstSelected == true){
927
+ $isFirstSelected = false;
928
+ $class = " ug-tab-selected";
929
+ }else{
930
+ if($id == $selectedCat)
931
+ $class = " ug-tab-selected";
932
+ }
933
+
934
+ $output .= "<a class=\"ug-tab{$class}\" href=\"javascript:void(0)\" data-catid=\"{$id}\">{$title}</a>";
935
+ }
936
+
937
+ $output .= "</div>";
938
+
939
+ return($output);
940
+ }
941
+
942
+
943
+ /**
944
+ * get category select html
945
+ */
946
+ protected function getCategoryTabsHtml_select($galleryHtmlID, $objCategories){
947
+
948
+ $output = "";
949
+
950
+ $categories = $this->getParam("categorytabs_ids");
951
+ if(empty($categories))
952
+ return("");
953
+
954
+ $wrapperID = $galleryHtmlID."_tabs_wrapper";
955
+ $selectID = $galleryHtmlID."_tabs_select";
956
+
957
+ //set styling - to the wrapper
958
+
959
+ //style position
960
+
961
+ $arrStyleWrapper = array();
962
+ $arrStyleSelect = array();
963
+
964
+ $setPosition = $this->getParam("tab_selectbox_set_position",self::FORCE_BOOLEAN);
965
+
966
+ $position = $this->getParam("tabs_selectbox_position");
967
+ if($position == "left" || $position == "right"){
968
+ $arrStyleWrapper = $this->addParamToStyleArray($arrStyleWrapper, "tabs_selectbox_position", "text-align");
969
+ $arrStyleWrapper = $this->addParamToStyleArray($arrStyleWrapper, "tabs_selectbox_offset", "padding-{$position}", "px", self::FORCE_NUMERIC);
970
+ }
971
+
972
+ $arrStyleWrapper = $this->addParamToStyleArray($arrStyleWrapper, "tabs_selectbox_margin_top", "margin-top", "px", self::FORCE_NUMERIC);
973
+ $arrStyleWrapper = $this->addParamToStyleArray($arrStyleWrapper, "tabs_selectbox_margin_bottom", "margin-bottom", "px", self::FORCE_NUMERIC);
974
+
975
+
976
+ //style border
977
+ $styleBorder = $this->getParam("tab_style_selectbox_border",self::FORCE_BOOLEAN);
978
+
979
+ if($styleBorder == true){
980
+ $borderColor = $this->getParam("tab_selectbox_border_color");
981
+ if(!empty($borderColor))
982
+ $arrStyleSelect["border"] = "1px solid {$borderColor}";
983
+
984
+ //tab_selectbox_border_radius
985
+ $arrStyleSelect = $this->addParamToStyleArray($arrStyleSelect, "tab_selectbox_border_radius", "border-radius", "px", self::FORCE_NUMERIC);
986
+
987
+ $showOutline = $this->getParam("tab_selectbox_show_outline",self::FORCE_BOOLEAN);
988
+ if($showOutline == false)
989
+ $arrStyleSelect["outline"] = "none";
990
+ }
991
+
992
+ //style text
993
+
994
+ $styleText = $this->getParam("tab_style_selectbox_text",self::FORCE_BOOLEAN);
995
+ if($styleText == true){
996
+
997
+ $textColor = $this->getParam("tab_selectbox_color");
998
+ $arrStyleSelect = $this->addParamToStyleArrayForce($arrStyleSelect, "tab_selectbox_color", "color");
999
+ $arrStyleSelect = $this->addParamToStyleArrayForce($arrStyleSelect, "tab_selectbox_font_size", "font-size","px");
1000
+ $arrStyleSelect = $this->addParamToStyleArrayForce($arrStyleSelect, "tab_selectbox_font_weight", "font-weight");
1001
+ }
1002
+
1003
+ //change size
1004
+
1005
+ $changeSize = $this->getParam("tab_style_selectbox_size",self::FORCE_BOOLEAN);
1006
+ if($changeSize == true){
1007
+
1008
+ $arrStyleSelect = $this->addParamToStyleArrayForce($arrStyleSelect, "tab_selectbox_width", "width","px");
1009
+ $arrStyleSelect = $this->addParamToStyleArrayForce($arrStyleSelect, "tab_selectbox_height", "height","px");
1010
+
1011
+ }
1012
+
1013
+ //concat styles
1014
+
1015
+ $strStyleWrapper = "";
1016
+ if(!empty($arrStyleWrapper))
1017
+ $strStyleWrapper = UniteFunctionsUG::arrStyleToStrStyle($arrStyleWrapper, "#".$wrapperID.".ug-tabs-wrapper");
1018
+
1019
+ $addCSSSelect = $this->getParam("tab_selectbox_additional_css");
1020
+ $strStyleSelect = UniteFunctionsUG::arrStyleToStrStyle($arrStyleSelect, "#".$selectID.".ug-tabs-select", $addCSSSelect);
1021
+
1022
+ $addCssOption = $this->getParam("tab_selectbox_option_additional_css");
1023
+ $addCssOption = trim($addCssOption);
1024
+ $strStyleOption = "";
1025
+
1026
+ if(!empty($addCssOption)){
1027
+ $strStyleOption .= "#".$selectID.".ug-tabs-select option{ {$addCssOption} }";
1028
+ }
1029
+
1030
+ $style = $strStyleWrapper.$strStyleSelect.$strStyleOption;
1031
+
1032
+ //put html select
1033
+ $output = $this->putInlineStyle($style, $output);
1034
+
1035
+ $this->arrParams["tabs_container"] = "#".$selectID;
1036
+
1037
+ $arrCats = $objCategories->getListByIds($categories);
1038
+
1039
+ $output .= "<div id=\"{$wrapperID}\" class=\"ug-tabs-wrapper\">";
1040
+ $output .= "<select id=\"{$selectID}\" class=\"ug-tabs-select\">";
1041
+
1042
+ $isFirstSelected = false;
1043
+ $selectedCat = $this->getParam("tabs_init_catid");
1044
+ if($selectedCat == "first")
1045
+ $isFirstSelected = true;
1046
+
1047
+ foreach ( $arrCats as $category ) {
1048
+
1049
+ $title = UniteFunctionsUG::getVal($category, "title");
1050
+ $id = UniteFunctionsUG::getVal($category, "id");
1051
+
1052
+ $selected = "";
1053
+ if($isFirstSelected == true){
1054
+ $isFirstSelected = false;
1055
+ $selected = " selected='selected'";
1056
+ }else{
1057
+ if($id == $selectedCat)
1058
+ $selected = " selected='selected'";
1059
+ }
1060
+
1061
+ $output .= "<option{$selected} class=\"ug-option\" value=\"{$id}\">{$title}</option>";
1062
+ }
1063
+
1064
+ $output .= "</select>";
1065
+ $output .= "</div>";
1066
+
1067
+
1068
+ return $output;
1069
+ }
1070
+
1071
+
1072
+ /**
1073
+ * output categories
1074
+ */
1075
+ protected function getCategoryTabsHtml($galleryHtmlID, $objCategories ){
1076
+
1077
+ $tabsType = $this->getParam("tabs_type");
1078
+
1079
+ switch($tabsType){
1080
+ default:
1081
+ case "tabs":
1082
+ $output = $this->getCategoryTabsHtml_tabs($galleryHtmlID, $objCategories);
1083
+ break;
1084
+ case "select":
1085
+ $output = $this->getCategoryTabsHtml_select($galleryHtmlID, $objCategories);
1086
+ break;
1087
+ }
1088
+
1089
+ $output .= self::BR;
1090
+
1091
+ return $output;
1092
+ }
1093
+
1094
+
1095
+
1096
+ /**
1097
+ * get additional scripts
1098
+ */
1099
+ protected function getAdditionalScripts($serial){
1100
+
1101
+ $addScripts = $this->getParam("ug_additional_scripts");
1102
+ $addScripts = trim($addScripts);
1103
+ if(empty($addScripts))
1104
+ return($addScripts);
1105
+
1106
+ //add tabs prefix to each line
1107
+ $addScripts = UniteFunctionsUG::addPrefixToEachLine($addScripts, self::LINE_PREFIX4);
1108
+
1109
+ //replace API tab
1110
+ $varAPI = "ugapi".$serial;
1111
+ $addScripts = str_replace("[api]", $varAPI, $addScripts);
1112
+
1113
+ return($addScripts);
1114
+ }
1115
+
1116
+
1117
+ /**
1118
+ * get add styles in themes - text panel
1119
+ */
1120
+ protected function getAdditionalStyles_themes(){
1121
+
1122
+ $addStyles = "";
1123
+
1124
+ $cssTitle = $this->getParam("slider_textpanel_css_title", self::TRIM);
1125
+
1126
+ $cssTitle = UniteFunctionsUG::jsonToCss($cssTitle);
1127
+ if(!empty($cssTitle)){
1128
+ $cssTitle = "[galleryid] .ug-textpanel-title{ {$cssTitle} }";
1129
+ $addStyles .= "\n" . $cssTitle;
1130
+ }
1131
+
1132
+ //---- text panel description
1133
+ $cssDesc = $this->getParam("slider_textpanel_css_description", self::TRIM);
1134
+
1135
+ $cssDesc = UniteFunctionsUG::jsonToCss($cssDesc);
1136
+ if(!empty($cssDesc)){
1137
+ $cssDesc = "[galleryid] .ug-textpanel-description{ {$cssDesc} }";
1138
+ $addStyles .= "\n" . $cssDesc;
1139
+ }
1140
+
1141
+
1142
+ return($addStyles);
1143
+ }
1144
+
1145
+
1146
+ /**
1147
+ * get additional style in tiles types - text panel
1148
+ */
1149
+ protected function getAdditionalStyles_tiles(){
1150
+
1151
+ $addStyles = "";
1152
+
1153
+ $cssTitle = $this->getParam("tile_textpanel_additional_css", self::TRIM);
1154
+ $cssDesc = $this->getParam("tile_textpanel_desc_additional_css", self::TRIM);
1155
+
1156
+ $css = "";
1157
+ if(!empty($cssTitle)){
1158
+ $css .= "[galleryid] .ug-thumb-wrapper .ug-textpanel-title{ {$cssTitle} }";
1159
+ }
1160
+
1161
+ if(!empty($cssDesc)){
1162
+ $css .= "\n"."[galleryid] .ug-thumb-wrapper .ug-textpanel-description{ {$cssDesc} }";
1163
+ }
1164
+
1165
+
1166
+ //------- lightbox text panel description
1167
+ $enableLightboxDesc = $this->getParam("lightbox_textpanel_enable_description", self::FORCE_BOOLEAN);
1168
+ $cssLightboxDesc = $this->getParam("lightbox_textpanel_desc_addcss", self::TRIM);
1169
+
1170
+ if($enableLightboxDesc == true && !empty($cssLightboxDesc)){
1171
+ $css .= "\n".".ug-lightbox .ug-textpanel .ug-textpanel-description{ {$cssLightboxDesc} }";
1172
+ }
1173
+
1174
+ if(!empty($css))
1175
+ $addStyles .= "\n" . $css;
1176
+
1177
+
1178
+ return($addStyles);
1179
+ }
1180
+
1181
+
1182
+ /**
1183
+ * get additional styles
1184
+ */
1185
+ protected function getAdditionalStyles(){
1186
+
1187
+ $addStyles = "";
1188
+
1189
+ //add css from options (text panel)
1190
+
1191
+ if($this->isTilesType == true)
1192
+ $addStyles .= $this->getAdditionalStyles_tiles();
1193
+ else
1194
+ $addStyles .= $this->getAdditionalStyles_themes();
1195
+
1196
+ //additional styles from advaced view
1197
+ $advancedStyles = $this->getParam("ug_additional_styles",self::TRIM);
1198
+
1199
+ if(!empty($advancedStyles))
1200
+ $addStyles .= "\n".$advancedStyles;
1201
+
1202
+ //add loadmore styles
1203
+ $arrLoadmore = $this->getLoadMoreParams();
1204
+ if($arrLoadmore["enable"] == true){
1205
+ $loadmoreStyles = $this->getLoadmoreStyles($arrLoadmore);
1206
+ if(!empty($loadmoreStyles))
1207
+ $addStyles .= "\n".$loadmoreStyles;
1208
+ }
1209
+
1210
+ $addStyles = trim($addStyles);
1211
+
1212
+ if(empty($addStyles))
1213
+ return($addStyles);
1214
+
1215
+ $replaceID = "#".$this->galleryHtmlID;
1216
+
1217
+ $addStyles = str_replace("[galleryid]", $replaceID, $addStyles);
1218
+
1219
+ $addStyles = "\n/* unite gallery additional styles */ \n".$addStyles;
1220
+
1221
+ return($addStyles);
1222
+ }
1223
+
1224
+
1225
+ private function a__________LOADMORE___________(){}
1226
+
1227
+
1228
+ /**
1229
+ * get loadmore styles
1230
+ */
1231
+ protected function getLoadmoreStyles($arrLoadmore){
1232
+
1233
+ //get styles from params
1234
+ $arrStyleNormal = array();
1235
+ $arrStyleNormal = $this->addParamToStyleArray($arrStyleNormal, "loadmore_text_color", "color");
1236
+ $arrStyleNormal = $this->addParamToStyleArray($arrStyleNormal, "loadmore_border_color", "border-color");
1237
+
1238
+ $arrStyleHover = array();
1239
+ $arrStyleHover = $this->addParamToStyleArray($arrStyleHover, "loadmore_hover_back_color", "background-color");
1240
+
1241
+ //get add styles
1242
+ $addStylesNormal = UniteFunctionsUG::getVal($this->arrParams, "loadmore_button_styles");
1243
+ $addStylesHover = UniteFunctionsUG::getVal($this->arrParams, "loadmore_button_hover_styles");
1244
+ $addStylesLoader = UniteFunctionsUG::getVal($this->arrParams, "loadmore_loader_styles");
1245
+
1246
+ //get the wrapper
1247
+ $wrapperID = $arrLoadmore["wrapper_id"];
1248
+
1249
+ //make style strings
1250
+ $strStyleNormal = UniteFunctionsUG::arrStyleToStrStyle($arrStyleNormal, "#{$wrapperID} .ug-loadmore-button", $addStylesNormal);
1251
+ $strStylesHover = UniteFunctionsUG::arrStyleToStrStyle($arrStyleHover, "#{$wrapperID} .ug-loadmore-button:hover", $addStylesHover);
1252
+ $strStylesLoader = UniteFunctionsUG::arrStyleToStrStyle(array(), "#{$wrapperID} .ug-loadmore-loader", $addStylesLoader);
1253
+
1254
+ //combine styles
1255
+ $strStyles = $strStyleNormal.$strStylesHover.$strStylesLoader;
1256
+
1257
+ return($strStyles);
1258
+ }
1259
+
1260
+
1261
+ /**
1262
+ * get load more html
1263
+ */
1264
+ protected function getLoadMoreHtml($arr){
1265
+
1266
+ $wrapperID = $arr["wrapper_id"];
1267
+
1268
+ $buttonText = $arr["button_text"];
1269
+ $loaderText = $arr["loader_text"];
1270
+
1271
+
1272
+ $html = "";
1273
+ $html .= self::LINE_PREFIX1."<div id=\"{$wrapperID}\" class=\"ug-loadmore-wrapper\" style=\"display:none\">";
1274
+ $html .= self::LINE_PREFIX1." <a href=\"javascript:void(0)\" class=\"ug-loadmore-button\">".$buttonText."</a>";
1275
+ $html .= self::LINE_PREFIX1." <span class=\"ug-loadmore-loader\" style=\"display:none\">".$loaderText."</span>";
1276
+ $html .= self::LINE_PREFIX1." <span class=\"ug-loadmore-error\" style=\"display:none\"></span>";
1277
+ $html .= self::LINE_PREFIX1."</div>";
1278
+
1279
+ return($html);
1280
+ }
1281
+
1282
+
1283
+ /**
1284
+ * get load more parameters
1285
+ */
1286
+ protected function getLoadMoreParams(){
1287
+
1288
+ if(!empty($this->arrLoadMoreCache))
1289
+ return($this->arrLoadMoreCache);
1290
+
1291
+ $output = array();
1292
+
1293
+ $enableLoadmore = $this->getParam("show_loadmore", self::FORCE_BOOLEAN);
1294
+
1295
+ $output["enable"] = $enableLoadmore;
1296
+
1297
+ if($enableLoadmore == false)
1298
+ return($output);
1299
+
1300
+ //get extra params
1301
+ $output["wrapper_id"] = "ug_loadmore_wrapper_".self::$serial;
1302
+ $output["max_items"] = $this->getParam("loadmore_max_items", self::VALIDATE_NUMERIC);
1303
+ $output["min_items"] = $this->getParam("loadmore_min_items", self::VALIDATE_NUMERIC);
1304
+
1305
+ $output["button_text"] = $this->getParam("loadmore_button_text", self::VALIDATE_EXISTS);
1306
+ $output["loader_text"] = $this->getParam("loadmore_loader_text", self::VALIDATE_EXISTS);
1307
+
1308
+ $this->arrLoadMoreCache = $output;
1309
+
1310
+ return($output);
1311
+ }
1312
+
1313
+
1314
+ /**
1315
+ * disable load more if enabled
1316
+ */
1317
+ private function disableLoadMore(){
1318
+
1319
+ if($this->arrLoadMoreCache)
1320
+ $this->arrLoadMoreCache["enable"] = false;
1321
+
1322
+ }
1323
+
1324
+
1325
+ private function a__________STOP_LOADMORE___________(){}
1326
+
1327
+
1328
+ /**
1329
+ * add js loaded validation
1330
+ */
1331
+ protected function addJsLoadedValidationScripts($output){
1332
+
1333
+
1334
+ $galleryHtmlID = $this->galleryHtmlID;
1335
+
1336
+ if(GlobalsUG::$isScriptsInFooter == true)
1337
+ $output .= self::LINE_PREFIX1."<script type='text/javascript'>";
1338
+
1339
+ $output .= self::LINE_PREFIX2."window.onload = function(e) {";
1340
+
1341
+ $output .= self::LINE_PREFIX3."if(typeof ugCheckForErrors == \"undefined\"){";
1342
+
1343
+ $notIncludedMessage = "Unite Gallery Error - gallery js and css files not included";
1344
+
1345
+ if(method_exists("UniteProviderFunctionsUG", "getJsNotIncludedErrorMessage"))
1346
+ $notIncludedMessage = UniteProviderFunctionsUG::getJsNotIncludedErrorMessage();
1347
+
1348
+ $output .= self::LINE_PREFIX4."document.getElementById(\"{$galleryHtmlID}\").innerHTML = \"<span style='color:red'>{$notIncludedMessage}</span>\";}";
1349
+ $output .= self::LINE_PREFIX3."else{ ugCheckForErrors(\"{$galleryHtmlID}\", \"jquery\");}";
1350
+ $output .= self::LINE_PREFIX2."};";
1351
+
1352
+ if(GlobalsUG::$isScriptsInFooter == true)
1353
+ $output .= self::LINE_PREFIX1."</script>";
1354
+
1355
+
1356
+ return($output);
1357
+ }
1358
+
1359
+
1360
+ /**
1361
+ * put scripts
1362
+ */
1363
+ protected function putGalleryScripts($output){
1364
+
1365
+ $jsOptions = $this->buildJsParams();
1366
+
1367
+ $addScripts = $this->getAdditionalScripts(self::$serial);
1368
+ $hasAddScripts = !empty($addScripts);
1369
+
1370
+ $serial = self::$serial;
1371
+ $galleryHtmlID = $this->galleryHtmlID;
1372
+
1373
+ $scriptOutput = "";
1374
+
1375
+ if(GlobalsUG::$isScriptsInFooter == false)
1376
+ $output .= self::LINE_PREFIX1."<script type='text/javascript'>";
1377
+
1378
+ //check js loaded only once
1379
+ if($serial == 1)
1380
+ $output = $this->addJsLoadedValidationScripts($output);
1381
+
1382
+ if($this->putNoConflictMode == true)
1383
+ $scriptOutput .= self::LINE_PREFIX2."jQuery.noConflict();";
1384
+
1385
+ $scriptOutput .= self::LINE_PREFIX2."var ugapi{$serial};";
1386
+ $scriptOutput .= self::LINE_PREFIX2."jQuery(document).ready(function(){";
1387
+ $scriptOutput .= self::LINE_PREFIX3."var objUGParams = {";
1388
+ $scriptOutput .= self::LINE_PREFIX4.$jsOptions;
1389
+ $scriptOutput .= self::LINE_PREFIX3."};";
1390
+
1391
+ $scriptOutput .= self::LINE_PREFIX3."if(ugCheckForErrors('#{$galleryHtmlID}', 'cms'))";
1392
+
1393
+ if($hasAddScripts)
1394
+ $scriptOutput .= "{";
1395
+
1396
+ $scriptOutput .= self::LINE_PREFIX4."ugapi{$serial} = jQuery('#{$galleryHtmlID}').unitegallery(objUGParams);";
1397
+
1398
+ //add custom scripts
1399
+ if($hasAddScripts){
1400
+ $scriptOutput .= self::BR;
1401
+ $scriptOutput .= self::LINE_PREFIX4."// custom scripts";
1402
+ $scriptOutput .= self::BR;
1403
+ $scriptOutput .= $addScripts;
1404
+ $scriptOutput .= self::LINE_PREFIX3."}";
1405
+ }
1406
+
1407
+ $scriptOutput .= self::LINE_PREFIX2."});";
1408
+
1409
+ if(GlobalsUG::$isScriptsInFooter == true)
1410
+
1411
+ UniteProviderFunctionsUG::printCustomScript($scriptOutput);
1412
+
1413
+ else{
1414
+ $output .= $scriptOutput;
1415
+ $output .= self::LINE_PREFIX1."</script>";
1416
+ }
1417
+
1418
+ return($output);
1419
+ }
1420
+
1421
+
1422
+
1423
+ /**
1424
+ * get items for output
1425
+ */
1426
+ protected function getItemsForOutput($categoryID){
1427
+
1428
+ $items = new UniteGalleryItems();
1429
+
1430
+ $arrLoadmore = $this->getLoadMoreParams();
1431
+
1432
+ if($arrLoadmore["enable"] == true){
1433
+
1434
+ $maxItems = $arrLoadmore["max_items"];
1435
+ $minItems = $arrLoadmore["min_items"];
1436
+
1437
+ $arrItems = $items->getCatItemsLimit($categoryID, $maxItems, $minItems);
1438
+
1439
+ //check and disable loadmore if needed
1440
+ $maxItems = (int)$maxItems;
1441
+ $totalItems = $items->getTotalCatItems($categoryID);
1442
+
1443
+ if($totalItems <= $maxItems)
1444
+ $this->disableLoadMore();
1445
+
1446
+ }else{
1447
+ $arrItems = $items->getCatItems($categoryID);
1448
+ }
1449
+
1450
+ return($arrItems);
1451
+ }
1452
+
1453
+
1454
+ /**
1455
+ *
1456
+ * put the gallery
1457
+ */
1458
+ public function putGallery($galleryID, $arrOptions = array(), $initType = "id"){
1459
+
1460
+
1461
+ try{
1462
+ $objCategories = new UniteGalleryCategories();
1463
+
1464
+ $this->initGallery($galleryID);
1465
+
1466
+ $this->setOutputOptions();
1467
+
1468
+ $enableCatTabs = $this->getParam('enable_category_tabs', self::FORCE_BOOLEAN);
1469
+
1470
+ //custom items pass
1471
+ if(is_array($arrOptions) && array_key_exists("items", $arrOptions)){
1472
+
1473
+ $arrItems = $arrOptions["items"];
1474
+
1475
+ $enableCatTabs = false;
1476
+
1477
+ }else{
1478
+
1479
+ //set gallery category
1480
+ $optCatID = UniteFunctionsUG::getVal($arrOptions, "categoryid");
1481
+
1482
+ if(!empty($optCatID) && $objCategories->isCatExists($optCatID))
1483
+ $categoryID = $optCatID;
1484
+ else{
1485
+ if($enableCatTabs == true){
1486
+ $categoryID = $this->getParam("tabs_init_catid");
1487
+
1488
+ if($categoryID == "first"){ //get first category from tabs
1489
+ $strCatIDs = $this->getParam("categorytabs_ids");
1490
+ $arrIDs = explode("," , $strCatIDs);
1491
+ if(!empty($arrIDs))
1492
+ $categoryID = $arrIDs[0];
1493
+ }
1494
+
1495
+ if(empty($categoryID) || is_numeric($categoryID) == false)
1496
+ $categoryID = $this->getParam("category");
1497
+ }else
1498
+ $categoryID = $this->getParam("category");
1499
+ }
1500
+
1501
+ if(empty($categoryID))
1502
+ UniteFunctionsUG::throwError(__("No items category selected", UNITEGALLERY_TEXTDOMAIN));
1503
+
1504
+ //get items
1505
+ $arrItems = $this->getItemsForOutput($categoryID);
1506
+ }
1507
+
1508
+
1509
+ if(empty($arrItems))
1510
+ UniteFunctionsUG::throwError("No gallery items found", UNITEGALLERY_TEXTDOMAIN);
1511
+
1512
+ $this->arrItems = $arrItems;
1513
+
1514
+
1515
+ $this->putScripts();
1516
+
1517
+ //set wrapper style
1518
+
1519
+ //size validation
1520
+ $this->getParam("gallery_width", self::FORCE_SIZE);
1521
+ if($this->isTilesType == false)
1522
+ $this->getParam("gallery_height", self::VALIDATE_NUMERIC);
1523
+
1524
+ $fullWidth = $this->getParam("full_width", self::FORCE_BOOLEAN);
1525
+
1526
+ if($fullWidth == true){
1527
+ $this->arrParams["gallery_width"] = "100%";
1528
+ }
1529
+
1530
+ $wrapperStyle = $this->getPositionString();
1531
+
1532
+ //set tabs html
1533
+ $htmlTabs = "";
1534
+ if($enableCatTabs == true){
1535
+ $htmlTabs = $this->getCategoryTabsHtml($this->galleryHtmlID, $objCategories);
1536
+ $this->arrParams["gallery_initial_catid"] = $categoryID;
1537
+ }
1538
+
1539
+ //set loadmore html
1540
+ $arrLoadmore = $this->getLoadMoreParams();
1541
+ $enableLoadmore = $arrLoadmore["enable"];
1542
+ if($enableLoadmore == true)
1543
+ $htmlLoadMore = $this->getLoadMoreHtml($arrLoadmore);
1544
+ //get output related variables
1545
+
1546
+ $addStyles = $this->getAdditionalStyles();
1547
+ $position = $this->getParam("position");
1548
+ $isRtlWrapper = ($position == "right");
1549
+ if($isRtlWrapper == true){
1550
+ $rtlWrapperStyle = $wrapperStyle;
1551
+ if(!empty($rtlWrapperStyle))
1552
+ $rtlWrapperStyle = " style='$rtlWrapperStyle'";
1553
+ $wrapperStyle = ""; //move the wrapper style to rtl wrapper
1554
+ }
1555
+ if(!empty($wrapperStyle))
1556
+ $wrapperStyle = " style='$wrapperStyle'";
1557
+ global $uniteGalleryVersion;
1558
+ $output = "
1559
+ \n
1560
+ <!-- START UNITE GALLERY LITE {$uniteGalleryVersion} -->
1561
+
1562
+ ";
1563
+ if(!empty($addStyles))
1564
+ $output = $this->putInlineStyle($addStyles, $output);
1565
+
1566
+ if($this->putJsToBody == true)
1567
+ $output .= $this->putJsIncludesToBody();
1568
+
1569
+
1570
+ if($enableCatTabs == true)
1571
+ $output .= $htmlTabs;
1572
+ //add rtl prefix to get the gallery to right if needed
1573
+ if($isRtlWrapper == true){
1574
+ $output .= self::LINE_PREFIX1."<div class='ug-rtl'{$rtlWrapperStyle}>";
1575
+ }
1576
+
1577
+ $output .= self::LINE_PREFIX1."<div id='{$this->galleryHtmlID}' class='unite-gallery'{$wrapperStyle}>";
1578
+ $output .= self::LINE_PREFIX2.$this->putItems($arrItems);
1579
+ $output .= self::LINE_PREFIX1."</div>";
1580
+ if($isRtlWrapper == true)
1581
+ $output .= self::LINE_PREFIX1."</div>";
1582
+ //put loadmore html
1583
+ if($enableLoadmore == true){
1584
+ $output .= self::BR;
1585
+ $output .= $htmlLoadMore;
1586
+ }
1587
+ $output .= self::BR;
1588
+
1589
+ $output = $this->putGalleryScripts($output);
1590
+
1591
+ $output .= self::BR;
1592
+
1593
+ $output .= self::LINE_PREFIX1."<!-- END UNITEGALLERY LITE-->";
1594
+
1595
+ $compressOutput = $this->getParam("compress_output", self::FORCE_BOOLEAN);
1596
+
1597
+ if($compressOutput == true){
1598
+ $output = str_replace("\r", "", $output);
1599
+ $output = str_replace("\n", "", $output);
1600
+ $output = trim($output);
1601
+ }
1602
+
1603
+ return $output;
1604
+ ?>
1605
+
1606
+ <?php
1607
+
1608
+ }catch(Exception $e){
1609
+ $prefix = __("Unite Gallery Error",UNITEGALLERY_TEXTDOMAIN);
1610
+ $output = $this->getErrorMessage($e, $prefix);
1611
+ return($output);
1612
+ }
1613
+
1614
+ }
1615
+ }
1616
+
1617
+ ?>
helpers/classes/settings_ug.class.php ADDED
@@ -0,0 +1,88 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+
4
+ defined('UNITEGALLERY_INC') or die('Restricted access');
5
+
6
+
7
+ class UniteGallerySettingsUG extends UniteSettingsAdvancedUG{
8
+
9
+
10
+ /**
11
+ * add items category select
12
+ */
13
+ public function addItemsCategorySelect($name = "category", $title = null, $isNewGallery = false){
14
+
15
+ if($title == null)
16
+ $title = __("Item Category", UNITEGALLERY_TEXTDOMAIN);
17
+
18
+ $objCategories = new UniteGalleryCategories();
19
+
20
+ $addType = "empty";
21
+ if($isNewGallery == true)
22
+ $addType = "new";
23
+
24
+ $arrCats = $objCategories->getCatsShort($addType);
25
+
26
+ //set selected category
27
+ if($isNewGallery == true)
28
+ $defaultCat = "new";
29
+ else
30
+ $defaultCat = UniteFunctionsUG::getFirstNotEmptyKey($arrCats);
31
+
32
+ $this->addSelect($name, $arrCats, $title, $defaultCat);
33
+ }
34
+
35
+
36
+ /**
37
+ * get skins array
38
+ */
39
+ private function getArrSkins($noInherit = false){
40
+
41
+ $arrSkins = array();
42
+ if($noInherit == false)
43
+ $arrSkins[""] = __("[Global Skin]", UNITEGALLERY_TEXTDOMAIN);
44
+
45
+ $arrSkins["default"] = "Default";
46
+ $arrSkins["alexis"] = "Alexis";
47
+
48
+ return($arrSkins);
49
+ }
50
+
51
+ /**
52
+ * add transitions array item to some select
53
+ */
54
+ public function updateSelectToSkins($name, $default, $noInherit = false){
55
+
56
+ $arrSkins = $this->getArrSkins($noInherit);
57
+ $this->updateSettingItems($name, $arrSkins, $default);
58
+
59
+ }
60
+
61
+
62
+ /**
63
+ * add hidden type option
64
+ * @param $name
65
+ */
66
+ public function addHidden( $name ){
67
+ $this->add($name, "", " ", self::TYPE_HIDDEN);
68
+ }
69
+
70
+
71
+ /**
72
+ * update text panel position setting, remove top/bottom from
73
+ */
74
+ public function helper_updateTextPanelPosition(){
75
+
76
+ $arrItems = array();
77
+ $arrItems["inside_bottom"] = __("Inside Bottom", UNITEGALLERY_TEXTDOMAIN);
78
+ $arrItems["inside_top"] = __("Inside Top", UNITEGALLERY_TEXTDOMAIN);
79
+ $arrItems["middle"] = __("Middle", UNITEGALLERY_TEXTDOMAIN);
80
+
81
+ $this->updateSettingItems("tile_textpanel_position", $arrItems);
82
+
83
+ }
84
+
85
+
86
+ }
87
+
88
+ ?>
helpers/index.html ADDED
File without changes
helpers/settings/advancedtab_main.php ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ defined('UNITEGALLERY_INC') or die('Restricted access');
4
+
5
+
6
+ $settingsMain = new UniteGallerySettingsUG();
7
+
8
+ $params = array();
9
+ $params["style"] = "height:200px;";
10
+ $params["description"] = "The additional scripts will be added to the javascript gallery output on the page. Special tag [api] will replace gallery API variable";
11
+
12
+ $settingsMain->addTextArea("ug_additional_scripts", "", __("Additional Scripts <br>( Javascript )", UNITEGALLERY_TEXTDOMAIN), $params);
13
+
14
+ $settingsMain->addHr();
15
+
16
+ $params["description"] = "The additional styles will be added befor gallery include. Special tag [galleryid] will replace be replaced by current gallery ID.";
17
+
18
+ $settingsMain->addTextArea("ug_additional_styles", "", __("Additional Styles <br> ( CSS )", UNITEGALLERY_TEXTDOMAIN), $params);
19
+
20
+
21
+
22
+ ?>
helpers/settings/advancedtab_params.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ defined('UNITEGALLERY_INC') or die('Restricted access');
4
+
5
+ $settingsParams = new UniteGallerySettingsUG();
6
+ $settingsParams->loadXMLFile(GlobalsUG::$pathHelpersSettings."advancedtab_params.xml");
7
+
8
+
9
+ ?>
helpers/settings/advancedtab_params.xml ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+
3
+ <fields>
4
+
5
+ <fieldset name="export_import" label="Export / Import Settings" icon="eg-icon-cog-alt">
6
+
7
+ <field name="export_gallery_settings"
8
+ type="button"
9
+ default="Export Settings"
10
+ label="Export Gallery Settings"
11
+ description="Export gallery settings - download file with all settings"
12
+ >
13
+ </field>
14
+
15
+ <field name="import_gallery_settings"
16
+ type="button"
17
+ default="Import Settings"
18
+ label="Import Gallery Settings"
19
+ description="Import gallery settings from the file previously imported"
20
+ >
21
+ </field>
22
+
23
+ <field type="hr"></field>
24
+
25
+
26
+ </fieldset>
27
+
28
+ </fields>
helpers/settings/categorytab_main.php ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ defined('UNITEGALLERY_INC') or die('Restricted access');
4
+
5
+
6
+ $settingsMain = new UniteGallerySettingsUG();
7
+
8
+ $settingsMain->addRadioBoolean("enable_category_tabs", __("Enable Category Tabs", UNITEGALLERY_TEXTDOMAIN), false);
9
+
10
+ $settingsMain->addHr();
11
+
12
+ $settingsMain->addRadio("tabs_type", array("tabs"=>"Tabs","select"=>"Select Box"), __("Category Tabs Type", UNITEGALLERY_TEXTDOMAIN), "tabs");
13
+
14
+ $settingsMain->addHr();
15
+
16
+ //add categories select
17
+ $objCategories = new UniteGalleryCategories();
18
+ $arrCats = $objCategories->getCatsShort();
19
+ $settingsMain->addSelect("available_cats", $arrCats, __("Available Categories", UNITEGALLERY_TEXTDOMAIN),"");
20
+
21
+ $settingsMain->addTextBox("categorytabs_ids", "", "Hidden Cats", array("hidden"=>true));
22
+
23
+ $settingsMain->addSelect("tabs_init_catid", array(), __("First Selected Tab", UNITEGALLERY_TEXTDOMAIN),"");
24
+
25
+
26
+ ?>
helpers/settings/categorytab_params.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ defined('UNITEGALLERY_INC') or die('Restricted access');
4
+
5
+ $settingsParams = new UniteGallerySettingsUG();
6
+ $settingsParams->loadXMLFile(GlobalsUG::$pathHelpersSettings."categorytab_params.xml");
7
+
8
+ $settingsParams->updateSelectToAlignHor("tabs_position");
9
+ $settingsParams->updateSelectToAlignHor("tabs_selectbox_position");
10
+
11
+
12
+ ?>
helpers/settings/categorytab_params.xml ADDED
@@ -0,0 +1,506 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+
3
+ <fields>
4
+
5
+ <fieldset name="general" label="Tabs Position" icon="eg-icon-cog-alt">
6
+
7
+ <field name="tabs_space_between"
8
+ type="text"
9
+ default="5"
10
+ label="Space Between Tabs"
11
+ unit="px"
12
+ description="Space between tabs">
13
+ </field>
14
+
15
+ <field type="hr"></field>
16
+
17
+ <field name="tabs_position"
18
+ type="list"
19
+ default="center"
20
+ label="Tabs Panel Position"
21
+ description="The position of the tab panel">
22
+ </field>
23
+
24
+ <field name="tabs_offset"
25
+ type="text"
26
+ default="0"
27
+ label="Tabs Panel Offset"
28
+ unit="px"
29
+ description="Space from the side(left or right) of the tabs panel">
30
+ </field>
31
+
32
+ <field type="control"
33
+ parent="tabs_position"
34
+ ctype="disable"
35
+ child="tabs_offset"
36
+ value="center"
37
+ />
38
+
39
+ <field type="hr"></field>
40
+
41
+ <field name="tabs_margin_top"
42
+ type="text"
43
+ default="0"
44
+ label="Tabs Panel Margin Top"
45
+ unit="px"
46
+ description="Margin top of the tabs panel, space from the top to the panel">
47
+ </field>
48
+
49
+ <field name="tabs_margin_bottom"
50
+ type="text"
51
+ default="0"
52
+ label="Tabs Panel Margin Bottom"
53
+ unit="px"
54
+ description="Space between the tabs panel and the gallery">
55
+ </field>
56
+
57
+ </fieldset>
58
+
59
+ <fieldset name="tab_style" label="Tab Style" icon="eg-icon-cog-alt">
60
+
61
+ <field name="tab_padding_vert"
62
+ type="text"
63
+ default="6"
64
+ label="Tab Padding Top / Bottom"
65
+ unit="px"
66
+ description="Top and bottom padding of the tab">
67
+ </field>
68
+
69
+ <field name="tab_padding_hor"
70
+ type="text"
71
+ default="8"
72
+ label="Tab Padding Left / Right"
73
+ unit="px"
74
+ description="Left and right padding of the tab">
75
+ </field>
76
+
77
+ <field type="hr"></field>
78
+
79
+ <field name="tab_background_color"
80
+ type="color"
81
+ default="#333333"
82
+ label="Tab Background Color"
83
+ description="Backgroud color of the tab">
84
+ </field>
85
+
86
+ <field name="tab_text_color"
87
+ type="color"
88
+ default="#ffffff"
89
+ label="Tab Text Color"
90
+ description="The font color of the tab">
91
+ </field>
92
+
93
+ <field name="tab_text_size"
94
+ type="text"
95
+ default="12"
96
+ label="Tab Text Size"
97
+ unit="px"
98
+ description="The text size of the tab">
99
+ </field>
100
+
101
+ <field name="tab_font_family"
102
+ type="text"
103
+ default=""
104
+ label="Tab Font Family"
105
+ description="Enter custom font family. If not set, will take the font family from your website css">
106
+ </field>
107
+
108
+ <field name="tab_font_weight"
109
+ type="radio"
110
+ default="normal"
111
+ label="Tab Font Weight"
112
+ description="The font style of the tab">
113
+ <option value="normal" text="Normal"></option>
114
+ <option value="bold" text="Bold"></option>
115
+ </field>
116
+
117
+ <field name="tab_border_radius"
118
+ type="text"
119
+ default="3"
120
+ label="Tab Border Radius"
121
+ unit="px"
122
+ description="Tab border radius">
123
+ </field>
124
+
125
+ <field type="hr"></field>
126
+
127
+ <field name="tab_enable_border"
128
+ type="boolean"
129
+ default="false"
130
+ label="&lt;b&gt;Enable Border&lt;/b&gt;"
131
+ description="Enable border of the tab">
132
+ </field>
133
+
134
+ <field type="bulk_control_start"
135
+ parent="tab_enable_border"
136
+ ctype="show"
137
+ value="true"
138
+ />
139
+
140
+ <field name="tab_border_width"
141
+ type="text"
142
+ default="1"
143
+ unit="px"
144
+ label="&amp;nbsp; Tab Border Width"
145
+ description="Tab border width">
146
+ </field>
147
+
148
+ <field name="tab_border_color"
149
+ type="color"
150
+ default="#969696"
151
+ label="&amp;nbsp; Tab Border Color"
152
+ description="">
153
+ </field>
154
+
155
+ <field type="bulk_control_end"/>
156
+
157
+ <field type="hr"></field>
158
+
159
+ <field name="tab_additional_css"
160
+ type="textarea"
161
+ default=""
162
+ label="Tab Additional CSS"
163
+ description="Type the additional css for normal styling, like shadow or glow for example.">
164
+ </field>
165
+
166
+
167
+ </fieldset>
168
+
169
+ <fieldset name="tab_mouseover" label="Tab Mouseover Style" icon="eg-icon-cog-alt">
170
+
171
+ <field name="tab_hover_background_change"
172
+ type="boolean"
173
+ default="true"
174
+ label="Change Background Color"
175
+ description="To change the background color on mouse over or not">
176
+ </field>
177
+
178
+ <field name="tab_hover_background_color"
179
+ type="color"
180
+ default="#707070"
181
+ label="&amp;nbsp; Tab Mouseover Background Color"
182
+ description="Tab background color on mouseover">
183
+ </field>
184
+
185
+ <field type="control"
186
+ parent="tab_hover_background_change"
187
+ ctype="enable"
188
+ child="tab_hover_background_color"
189
+ value="true"
190
+ />
191
+
192
+ <field type="hr"></field>
193
+
194
+ <field name="tab_hover_color_change"
195
+ type="boolean"
196
+ default="false"
197
+ label="Change Text Color"
198
+ description="To change the text color on mouse over or not">
199
+ </field>
200
+
201
+ <field name="tab_hover_text_color"
202
+ type="color"
203
+ default="#ffffff"
204
+ label="&amp;nbsp; Tab Mouseover Text Color"
205
+ description="The font color of the tab">
206
+ </field>
207
+
208
+ <field type="control"
209
+ parent="tab_hover_color_change"
210
+ ctype="enable"
211
+ child="tab_hover_text_color"
212
+ value="true"
213
+ />
214
+
215
+ <field type="hr"></field>
216
+
217
+ <field name="tab_hover_bordercolor_change"
218
+ type="boolean"
219
+ default="false"
220
+ label="Change Border Color"
221
+ description="To change the border color on mouse over or not">
222
+ </field>
223
+
224
+ <field name="tab_hover_border_color"
225
+ type="color"
226
+ default="#969696"
227
+ label="&amp;nbsp; Tab Mouseover Border Color"
228
+ description="">
229
+ </field>
230
+
231
+ <field type="control"
232
+ parent="tab_hover_bordercolor_change"
233
+ ctype="enable"
234
+ child="tab_hover_border_color"
235
+ value="true"
236
+ />
237
+
238
+ <field type="hr"></field>
239
+
240
+ <field name="tab_hover_additional_css"
241
+ type="textarea"
242
+ default=""
243
+ label="Tab Mouseover Additional CSS"
244
+ description="Type the additional css for mouseover tab styling.">
245
+ </field>
246
+
247
+ </fieldset>
248
+
249
+ <fieldset name="tab_selected" label="Selected Tab Style" icon="eg-icon-cog-alt">
250
+
251
+ <field name="tab_selected_background_color"
252
+ type="color"
253
+ default="#2077a2"
254
+ label="Selected Tab Background Color"
255
+ description="Selected tab background color">
256
+ </field>
257
+
258
+ <field type="hr"></field>
259
+
260
+ <field name="tab_selected_color_change"
261
+ type="boolean"
262
+ default="false"
263
+ label="Change Text Color"
264
+ description="To change the text color on mouse over or not">
265
+ </field>
266
+
267
+ <field name="tab_selected_text_color"
268
+ type="color"
269
+ default="#ffffff"
270
+ label="&amp;nbsp; Selected Tab Text Color"
271
+ description="The font color of the tab">
272
+ </field>
273
+
274
+ <field type="control"
275
+ parent="tab_selected_color_change"
276
+ ctype="enable"
277
+ child="tab_selected_text_color"
278
+ value="true"
279
+ />
280
+
281
+ <field type="hr"></field>
282
+
283
+ <field name="tab_selected_bordercolor_change"
284
+ type="boolean"
285
+ default="false"
286
+ label="Change Border Color"
287
+ description="To change the border color on mouse over or not">
288
+ </field>
289
+
290
+ <field name="tab_selected_border_color"
291
+ type="color"
292
+ default="#969696"
293
+ label="&amp;nbsp; Selected Tab Border Color"
294
+ description="">
295
+ </field>
296
+
297
+ <field type="control"
298
+ parent="tab_selected_bordercolor_change"
299
+ ctype="enable"
300
+ child="tab_selected_border_color"
301
+ value="true"
302
+ />
303
+
304
+ <field type="hr"></field>
305
+
306
+ <field name="tab_selected_additional_css"
307
+ type="textarea"
308
+ default=""
309
+ label="Selected Tab Additional CSS"
310
+ description="Type the additional css for selected tab styling.">
311
+ </field>
312
+
313
+ </fieldset>
314
+
315
+ <fieldset name="selectbox_style" label="Select Box Styling" icon="eg-icon-cog-alt">
316
+
317
+ <field name="tab_selectbox_set_position"
318
+ type="boolean"
319
+ default="false"
320
+ label="&lt;b&gt;Set Position&lt;/b&gt;"
321
+ description="Set position of the select box">
322
+ </field>
323
+
324
+ <field type="bulk_control_start"
325
+ parent="tab_selectbox_set_position"
326
+ ctype="show"
327
+ value="true"
328
+ />
329
+
330
+ <field name="tabs_selectbox_position"
331
+ type="list"
332
+ default="center"
333
+ label="&amp;nbsp; Select Box Position"
334
+ description="The position of the tab panel">
335
+ </field>
336
+
337
+ <field name="tabs_selectbox_offset"
338
+ type="text"
339
+ default="0"
340
+ label="&amp;nbsp; Select Box Offset"
341
+ unit="px"
342
+ description="Space from the side(left or right) of the tabs panel">
343
+ </field>
344
+
345
+ <field type="control"
346
+ parent="tabs_selectbox_position"
347
+ ctype="disable"
348
+ child="tabs_selectbox_offset"
349
+ value="center"
350
+ />
351
+
352
+ <field name="tabs_selectbox_margin_top"
353
+ type="text"
354
+ default="0"
355
+ label="&amp;nbsp; Select Box Margin Top"
356
+ unit="px"
357
+ description="Margin top of the tabs panel, space from the top to the panel">
358
+ </field>
359
+
360
+ <field name="tabs_selectbox_margin_bottom"
361
+ type="text"
362
+ default="0"
363
+ label="&amp;nbsp; Select Box Margin Bottom"
364
+ unit="px"
365
+ description="Space between the tabs panel and the gallery">
366
+ </field>
367
+
368
+ <field type="bulk_control_end"/>
369
+
370
+ <field type="hr"></field>
371
+
372
+ <field name="tab_style_selectbox_border"
373
+ type="boolean"
374
+ default="false"
375
+ label="&lt;b&gt;Set Border Style&lt;/b&gt;"
376
+ description="choose to style select box border">
377
+ </field>
378
+
379
+ <field type="bulk_control_start"
380
+ parent="tab_style_selectbox_border"
381
+ ctype="show"
382
+ value="true"
383
+ />
384
+
385
+ <field name="tab_selectbox_border_color"
386
+ type="color"
387
+ default="#000000"
388
+ label="&amp;nbsp; Select Box Border Color"
389
+ description="select box border color"></field>
390
+
391
+ <field name="tab_selectbox_border_radius"
392
+ type="text"
393
+ default="0"
394
+ label="&amp;nbsp; Select Box Border Radius"
395
+ unit="px"
396
+ description="Select box border radius"></field>
397
+
398
+ <field name="tab_selectbox_show_outline"
399
+ type="boolean"
400
+ default="true"
401
+ label="&amp;nbsp; Show Select Box Outline"
402
+ description="Show or not select box outline">
403
+ </field>
404
+
405
+ <field type="bulk_control_end"/>
406
+
407
+ <field type="hr"></field>
408
+
409
+ <field name="tab_style_selectbox_text"
410
+ type="boolean"
411
+ default="false"
412
+ label="&lt;b&gt;Set Text Style&lt;/b&gt;"
413
+ description="choose to style select box text">
414
+ </field>
415
+
416
+ <field type="bulk_control_start"
417
+ parent="tab_style_selectbox_text"
418
+ ctype="show"
419
+ value="true"
420
+ />
421
+
422
+ <field name="tab_selectbox_color"
423
+ type="color"
424
+ default="#000000"
425
+ label="&amp;nbsp; Select Box Color"
426
+ description="Select box color."></field>
427
+
428
+ <field name="tab_selectbox_font_size"
429
+ type="text"
430
+ default="14"
431
+ label="&amp;nbsp; Select Box Font Size"
432
+ unit="px"
433
+ description="Select box font size."></field>
434
+
435
+ <field name="tab_selectbox_font_weight"
436
+ type="radio"
437
+ default="normal"
438
+ label="&amp;nbsp; Select Box Font Weight"
439
+ description="The font style of the select box">
440
+ <option value="normal" text="Normal"></option>
441
+ <option value="bold" text="Bold"></option>
442
+ </field>
443
+
444
+ <field type="bulk_control_end"/>
445
+
446
+ <field type="hr"></field>
447
+
448
+ <field name="tab_style_selectbox_size"
449
+ type="boolean"
450
+ default="false"
451
+ label="&lt;b&gt;Set Size&lt;/b&gt;"
452
+ description="change select box size">
453
+ </field>
454
+
455
+ <field type="bulk_control_start"
456
+ parent="tab_style_selectbox_size"
457
+ ctype="show"
458
+ value="true"
459
+ />
460
+
461
+ <field name="tab_selectbox_width"
462
+ type="text"
463
+ default=""
464
+ label="&amp;nbsp; Select Box Width"
465
+ unit="px"
466
+ description="Select box width, if empty string don't change value"></field>
467
+
468
+ <field name="tab_selectbox_height"
469
+ type="text"
470
+ default=""
471
+ label="&amp;nbsp; Select Box Height"
472
+ unit="px"
473
+ description="Select box height, if empty string don't change value"></field>
474
+
475
+ <field type="bulk_control_end"/>
476
+
477
+ <field type="hr"></field>
478
+
479
+ <field name="tab_selectbox_additional_css"
480
+ type="textarea"
481
+ default=""
482
+ label="Select Box Additional CSS"
483
+ description="Type the additional css for select box styling.">
484
+ </field>
485
+
486
+ <field name="tab_selectbox_option_additional_css"
487
+ type="textarea"
488
+ default=""
489
+ label="Select Box Option Additional CSS"
490
+ description="Type the additional css for select box option styling.">
491
+ </field>
492
+
493
+ </fieldset>
494
+
495
+ <fieldset name="tab_troubleshooting" label="Troubleshooting" icon="eg-icon-cog-alt">
496
+
497
+ <field name="tab_put_styles_in_body"
498
+ type="boolean"
499
+ default="false"
500
+ label="Put Styles In Body"
501
+ description="If you made some changes, but don't see it in the gallery, you can turn this option. It will put the styles right into the body before gallery html">
502
+ </field>
503
+
504
+ </fieldset>
505
+
506
+ </fields>
helpers/settings/general.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+
4
+ defined('UNITEGALLERY_INC') or die('Restricted access');
5
+
6
+
7
+ $settings = new UniteGallerySettingsUG();
8
+ $settings->loadXMLFile(GlobalsUG::$pathHelpersSettings."general.xml");
9
+
10
+ $settings->updateSelectToSkins("gallery_skin", "default", true);
11
+
12
+ ?>
helpers/settings/general.xml ADDED
@@ -0,0 +1,114 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+
3
+ <fields>
4
+
5
+ <fieldset name="general" label="General Settings" icon="eg-icon-cog-alt">
6
+
7
+ <field name="gallery_skin"
8
+ type="list"
9
+ default=""
10
+ label="Gallery Skin"
11
+ description="the global skin of the gallery. Will change all gallery items by default.">
12
+ </field>
13
+
14
+ <field name="gallery_images_preload_type"
15
+ type="list"
16
+ default="minimal"
17
+ label="Images Preload Type"
18
+ description="The images preload type. &lt;br&gt; minimal - only image nabours will be loaded each time. &lt;br&gt; visible - visible thumbs images will be loaded each time. &lt;br&gt; all - load all the images first time.">
19
+ <option value="minimal" text="Minimal"></option>
20
+ <option value="visible" text="Visible Items"></option>
21
+ <option value="all" text="All Items"></option>
22
+ </field>
23
+
24
+ <field type="hr"></field>
25
+
26
+ <field name="gallery_autoplay"
27
+ type="boolean"
28
+ default="false"
29
+ label="Autoplay At Start"
30
+ description="begin slideshow autoplay on start">
31
+ </field>
32
+
33
+ <field type="bulk_control_start"
34
+ parent="gallery_autoplay"
35
+ ctype="enable"
36
+ value="true"
37
+ />
38
+
39
+ <field name="gallery_play_interval"
40
+ type="text"
41
+ default="3000"
42
+ label="Play Interval"
43
+ unit="ms"
44
+ description="play interval of the slideshow. after that time the slide will change">
45
+ </field>
46
+
47
+ <field name="gallery_pause_on_mouseover"
48
+ type="boolean"
49
+ default="true"
50
+ label="Pause Playing on Mouseover"
51
+ description="pause on mouseover when playing slideshow">
52
+ </field>
53
+
54
+ <field type="bulk_control_end"></field>
55
+
56
+ <field type="hr"></field>
57
+
58
+ <field name="gallery_mousewheel_role"
59
+ type="list"
60
+ default="zoom"
61
+ label="Mouse Wheel Role"
62
+ description="The role of mouse wheel. Zoom image, advance items, or none">
63
+ <option value="none" text="None"></option>
64
+ <option value="zoom" text="Zoom Image"></option>
65
+ <option value="advance" text="Advance Items"></option>
66
+ </field>
67
+
68
+ <field name="gallery_control_keyboard"
69
+ type="boolean"
70
+ default="true"
71
+ label="Keyboard Control"
72
+ description="Allow to control gallery with keyboard (left, right arrows)">
73
+ </field>
74
+
75
+ <field name="gallery_carousel"
76
+ type="boolean"
77
+ default="true"
78
+ label="Carousel Mode"
79
+ description="next button on last image goes to first image.">
80
+ </field>
81
+
82
+ <field name="gallery_preserve_ratio"
83
+ type="boolean"
84
+ default="true"
85
+ label="Preserve Ratio On Resize"
86
+ description="Preserve width and height ratio on gallery resize">
87
+ </field>
88
+
89
+ <field name="gallery_shuffle"
90
+ type="boolean"
91
+ default="false"
92
+ label="Shuffle Items At Start"
93
+ description="Shuffle (randomize) items at gallery start">
94
+ </field>
95
+
96
+ <field type="hr"></field>
97
+
98
+ <field name="slider_background_color"
99
+ type="color"
100
+ default="#000000"
101
+ label="Gallery Background Color"
102
+ description="set custom background color on slider area. If not set it will be taken from css">
103
+ </field>
104
+
105
+ <field name="slider_background_opacity"
106
+ type="text"
107
+ default="1"
108
+ label="Gallery Background Opacity"
109
+ description="The opacity of the gallery background. Set to 0 for transparent background, and give some color">
110
+ </field>
111
+
112
+ </fieldset>
113
+
114
+ </fields>
helpers/settings/grid_panel.php ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+
4
+ defined('UNITEGALLERY_INC') or die('Restricted access');
5
+
6
+
7
+ $settings = new UniteGallerySettingsUG();
8
+ $settings->loadXMLFile(GlobalsUG::$pathHelpersSettings."grid_panel.xml");
9
+
10
+
11
+ $settings->updateSelectToAlignCombo("gridpanel_grid_align");
12
+ $settings->updateSelectToSkins("gridpanel_arrows_skin", "");
13
+ $settings->updateSelectToAlignCombo("gridpanel_handle_align");
14
+ $settings->updateSelectToSkins("gridpanel_handle_skin", "");
15
+ $settings->updateSelectToEasing("grid_transition_easing");
16
+
17
+
18
+ ?>
helpers/settings/grid_panel.xml ADDED
@@ -0,0 +1,210 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+
3
+ <fields>
4
+
5
+ <fieldset name="grid_panel" label="Grid Thumbs Panel" icon="eg-icon-cog-alt">
6
+
7
+ <field name="grid_num_cols"
8
+ type="text"
9
+ default="2"
10
+ label="Number Of Columns"
11
+ description="number of grid columns">
12
+ </field>
13
+
14
+ <field name="grid_space_between_cols"
15
+ type="text"
16
+ default="10"
17
+ label="Space Between Columns"
18
+ unit="px"
19
+ description="the space between columns">
20
+ </field>
21
+
22
+ <field name="grid_space_between_rows"
23
+ type="text"
24
+ default="10"
25
+ label="Space Between Rows"
26
+ unit="px"
27
+ description="the space between rows">
28
+ </field>
29
+
30
+ <field name="gridpanel_vertical_scroll"
31
+ type="list"
32
+ default="true"
33
+ label="Scroll Type"
34
+ description="select grid scroll type (direction) - for right, left panels only">
35
+ <option value="true" text="Vertical"></option>
36
+ <option value="false" text="Horizontal"></option>
37
+ </field>
38
+
39
+ <field name="gridpanel_grid_align"
40
+ type="list"
41
+ default="middle"
42
+ label="Grid Panel Align"
43
+ description="the align of the thumbnails grid inside the panel"/>
44
+
45
+ <field name="grid_carousel"
46
+ type="boolean"
47
+ default="false"
48
+ label="Grid Carousel"
49
+ description="next pane goes to first when last">
50
+ </field>
51
+
52
+ <field type="hr"></field>
53
+
54
+ <field name="gridpanel_background_color"
55
+ type="color"
56
+ default=""
57
+ label="Grid Panel Background Color"
58
+ description="background color of the grid wrapper, if not set, it will be taken from the css">
59
+ </field>
60
+
61
+ <field type="hr"></field>
62
+
63
+
64
+ <field name="gridpanel_padding_border_top"
65
+ type="text"
66
+ default="10"
67
+ label="Grid Panel Padding Top"
68
+ unit="px"
69
+ description="padding between the top border of the panel">
70
+ </field>
71
+
72
+ <field name="gridpanel_padding_border_bottom"
73
+ type="text"
74
+ default="4"
75
+ label="Grid Panel Padding Bottom"
76
+ unit="px"
77
+ description="padding between the bottom border of the panel">
78
+ </field>
79
+
80
+ <field name="gridpanel_padding_border_left"
81
+ type="text"
82
+ default="10"
83
+ label="Grid Panel Padding Left"
84
+ unit="px"
85
+ description="padding between the left border of the panel">
86
+ </field>
87
+
88
+ <field name="gridpanel_padding_border_right"
89
+ type="text"
90
+ default="10"
91
+ label="Grid Panel Padding Right"
92
+ unit="px"
93
+ description="padding between the right border of the panel">
94
+ </field>
95
+
96
+ <field type="hr"></field>
97
+
98
+ <field name="gridpanel_arrows_skin"
99
+ type="list"
100
+ default=""
101
+ label="Grid Panel Arrows Skin"
102
+ description="skin of the arrows"/>
103
+
104
+ <field name="gridpanel_arrows_align_vert"
105
+ type="list"
106
+ default="middle"
107
+ label="Grid Panel Arrows Vertical Align"
108
+ description="vertical align of arrows, to the top and bottom botders, to the grid, or in the middle space.">
109
+ <option value="middle" text="Middle"></option>
110
+ <option value="borders" text="Borders"></option>
111
+ <option value="grid" text="Grid"></option>
112
+ </field>
113
+
114
+ <field name="gridpanel_arrows_padding_vert"
115
+ type="text"
116
+ default="4"
117
+ label="Grid Panel Arrows Vertical Padding"
118
+ unit="px"
119
+ description="padding between the arrows and the grid, in case of middle align, it will be minimal padding">
120
+ </field>
121
+
122
+ <field name="gridpanel_arrows_align_hor"
123
+ type="list"
124
+ default="center"
125
+ label="Grid Panel Arrows Horizontal Align"
126
+ description="borders, grid, center - horizontal align of arrows, to the left and right botders, to the grid, or in the center space.">
127
+ <option value="center" text="Center"></option>
128
+ <option value="borders" text="Borders"></option>
129
+ <option value="grid" text="Grid"></option>
130
+ </field>
131
+
132
+ <field name="gridpanel_arrows_padding_hor"
133
+ type="text"
134
+ default="10"
135
+ label="Grid Panel Arrows Horizontal Padding"
136
+ unit="px"
137
+ description="minimal size from the grid in case of 'borders' and size from the grid in case of 'grid'">
138
+ </field>
139
+
140
+ <field name="gridpanel_space_between_arrows"
141
+ type="text"
142
+ default="20"
143
+ label="Grid Panel Space Between Arrows"
144
+ unit="px"
145
+ description="space between arrows on left / right panel positions and horizontal grids only">
146
+ </field>
147
+
148
+ <field name="gridpanel_arrows_always_on"
149
+ type="boolean"
150
+ default="false"
151
+ label="Grid Panel Arrows Always On"
152
+ description="always show arrows even if the grid is one pane only">
153
+ </field>
154
+
155
+ <field type="hr"></field>
156
+
157
+ <field name="gridpanel_enable_handle"
158
+ type="boolean"
159
+ default="true"
160
+ label="&lt;b&gt;Grid Panel Show Close Handle&lt;/b&gt;"
161
+ description="enable grid close handle">
162
+ </field>
163
+
164
+ <field type="bulk_control_start"
165
+ parent="gridpanel_enable_handle"
166
+ ctype="show"
167
+ value="true"
168
+ />
169
+
170
+ <field name="gridpanel_handle_align"
171
+ type="list"
172
+ default="top"
173
+ label="&amp;nbsp; Grid Panel Handle Align"
174
+ description="close handle tip align on the handle bar according panel orientation"/>
175
+
176
+ <field name="gridpanel_handle_offset"
177
+ type="text"
178
+ default="0"
179
+ label="&amp;nbsp; Grid Panel Handle Offset"
180
+ unit="px"
181
+ description="offset of handle bar according the align">
182
+ </field>
183
+
184
+ <field name="gridpanel_handle_skin"
185
+ type="list"
186
+ default=""
187
+ label="&amp;nbsp; Grid Panel Handle Skin"
188
+ description="skin of the handle, if empty inherit from gallery skin"/>
189
+
190
+ <field type="bulk_control_end"/>
191
+
192
+ <field type="hr"></field>
193
+
194
+ <field name="grid_transition_duration"
195
+ type="text"
196
+ default="300"
197
+ label="Grid Transition Duration"
198
+ unit="ms"
199
+ description="transition of the panes change duration">
200
+ </field>
201
+
202
+ <field name="grid_transition_easing"
203
+ type="list"
204
+ default="easeInOutQuad"
205
+ label="Grid Transition Easing"
206
+ description="transition of the panes change easing function"/>
207
+
208
+ </fieldset>
209
+
210
+ </fields>
helpers/settings/index.html ADDED
File without changes
helpers/settings/lightbox.php ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+
4
+ defined('UNITEGALLERY_INC') or die('Restricted access');
5
+
6
+
7
+ $settings = new UniteGallerySettingsUG();
8
+ $settings->loadXMLFile(GlobalsUG::$pathHelpersSettings."lightbox.xml");
9
+
10
+ $settings->updateSelectToAlignHor("lightbox_textpanel_title_text_align");
11
+
helpers/settings/lightbox.xml ADDED
@@ -0,0 +1,420 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+
3
+ <fields>
4
+
5
+ <fieldset name="lightbox" label="Lightbox" icon="eg-icon-cog-alt">
6
+
7
+ <field name="lightbox_type"
8
+ type="list"
9
+ default="wide"
10
+ label="&lt;b&gt;Lightbox Type&lt;/b&gt;"
11
+ description="Choose a lightbox type, wide or compact">
12
+ <option value="wide" text="Wide"></option>
13
+ <option value="compact" text="Compact"></option>
14
+ </field>
15
+
16
+ <field type="hr"></field>
17
+
18
+ <field name="lightbox_hide_arrows_onvideoplay"
19
+ type="boolean"
20
+ default="true"
21
+ label="Hide Arrows On Video Play"
22
+ description="Hide arrows on video play"></field>
23
+
24
+ <field name="lightbox_slider_control_swipe"
25
+ type="boolean"
26
+ default="true"
27
+ label="Enable Slider Swipe"
28
+ description="Enable swipe touch control on mobile phones">
29
+ </field>
30
+
31
+ <field name="lightbox_slider_control_zoom"
32
+ type="boolean"
33
+ default="true"
34
+ label="Enable Slider Zooming"
35
+ description="Enable mouse wheel and pinch zooming of the lightbox slider">
36
+ </field>
37
+
38
+ <field name="lightbox_slider_zoom_max_ratio" type="text" default="6"
39
+ label="Zoom Max Ratio" description="Max zoom ratio. The zooming will stop after this value.">
40
+ </field>
41
+
42
+ <field type="control" parent="lightbox_slider_control_zoom" ctype="enable"
43
+ child="lightbox_slider_zoom_max_ratio" value="true" />
44
+
45
+ <field name="gallery_mousewheel_role"
46
+ type="list"
47
+ default="zoom"
48
+ label="Mouse Wheel Role"
49
+ description="The role of mouse wheel. Zoom image, advance items, or none">
50
+ <option value="none" text="None"></option>
51
+ <option value="zoom" text="Zoom Image"></option>
52
+ <option value="advance" text="Advance Items"></option>
53
+ </field>
54
+
55
+ <field name="lightbox_slider_transition"
56
+ type="list"
57
+ default="fade"
58
+ label="Lightbox Slider Transition"
59
+ description="The transition when the image is advanced (by arrow or mouse wheel). Slide or Fade.">
60
+ <option value="slide" text="Slide"></option>
61
+ <option value="fade" text="Fade"></option>
62
+ </field>
63
+
64
+ <field name="lightbox_close_on_emptyspace"
65
+ type="boolean"
66
+ default="true"
67
+ label="Close On Empty Space Click"
68
+ description="Close the lightbox on empty space click">
69
+ </field>
70
+
71
+ </fieldset>
72
+
73
+ <fieldset name="lightbox_wide_design" label="Lightbox Wide Design" icon="eg-icon-cog-alt">
74
+
75
+ <field name="lightbox_overlay_opacity"
76
+ type="text"
77
+ default="1"
78
+ label="Lightbox Overlay Opacity"
79
+ description="The opacity of the lightbox overlay. Values (0-1)">
80
+ </field>
81
+
82
+ <field name="lightbox_overlay_color"
83
+ type="color"
84
+ default="#000000"
85
+ label="Lightbox Overlay Color"
86
+ description="The color of the lightbox overlay">
87
+ </field>
88
+
89
+ <field name="lightbox_top_panel_opacity"
90
+ type="text"
91
+ default="0.4"
92
+ label="Lightbox Top Panel Opacity"
93
+ description="The opacity of the top panel. Values (0-1)">
94
+ </field>
95
+
96
+ <field type="hr"></field>
97
+
98
+ <field name="lightbox_show_numbers"
99
+ type="boolean"
100
+ default="true"
101
+ label="&lt;b&gt;Show Item Numbers&lt;/b&gt;"
102
+ description="Show number of items and total items at the left top">
103
+ </field>
104
+
105
+ <field type="bulk_control_start"
106
+ parent="lightbox_show_numbers"
107
+ ctype="show"
108
+ value="true"
109
+ />
110
+
111
+ <field name="lightbox_numbers_size"
112
+ type="text"
113
+ default="14"
114
+ label="&amp;nbsp; Lightbox Numbers Size"
115
+ unit="px"
116
+ description="The size of the numbers text">
117
+ </field>
118
+
119
+ <field name="lightbox_numbers_color"
120
+ type="color"
121
+ default="#e5e5e5"
122
+ label="&amp;nbsp; Lightbox Numbers Color"
123
+ description="The color of the numbers.">
124
+ </field>
125
+
126
+ <field type="bulk_control_end"/>
127
+
128
+ <field type="hr"></field>
129
+
130
+ <field name="lightbox_show_textpanel"
131
+ type="boolean"
132
+ default="true"
133
+ label="&lt;b&gt;Show Text Panel&lt;/b&gt;"
134
+ description="Show lightbox text panel at the top center"></field>
135
+
136
+ <field type="bulk_control_start"
137
+ parent="lightbox_show_textpanel"
138
+ ctype="show"
139
+ value="true"
140
+ />
141
+
142
+ <field name="lightbox_textpanel_width"
143
+ type="text"
144
+ default="550"
145
+ label="&amp;nbsp; Lightbox Text Panel Width"
146
+ unit="px"
147
+ description="the width of the text panel"></field>
148
+
149
+ <field name="lightbox_textpanel_source"
150
+ type="list"
151
+ default="title"
152
+ label="&amp;nbsp; Lightbox Text Panel Text Source"
153
+ description="Choose the source for the text line on the lightbox">
154
+ <option value="title" text="Title"></option>
155
+ <option value="desc" text="Description"></option>
156
+ <option value="title_desc" text="Title And Description"></option>
157
+ </field>
158
+
159
+ <field type="hr"></field>
160
+
161
+ <field name="lightbox_textpanel_title_color"
162
+ type="color"
163
+ default="#e5e5e5"
164
+ label="&amp;nbsp; Lightbox Text Panel Text Color"
165
+ description="text panel text color, leave empty for default">
166
+ </field>
167
+
168
+ <field name="lightbox_textpanel_title_text_align"
169
+ type="list"
170
+ default="left"
171
+ label="&amp;nbsp; Lightbox Text Panel Text Align"
172
+ description="text panel text color, leave empty for default">
173
+ </field>
174
+
175
+ <field name="lightbox_textpanel_title_font_size"
176
+ type="text"
177
+ default="14"
178
+ label="&amp;nbsp; Lightbox Text Panel Font Size"
179
+ description="textg panel font size, leave empty for default"></field>
180
+
181
+ <field name="lightbox_textpanel_title_bold"
182
+ type="boolean"
183
+ default="false"
184
+ label="&amp;nbsp; Lightbox Text Panel Bold Text"
185
+ description="text panel bold text"></field>
186
+
187
+ <field name="lightbox_textpanel_desc_addcss"
188
+ type="textarea"
189
+ default=""
190
+ label="&amp;nbsp; Lightbox Text Panel Description Additional CSS"
191
+ description="Lightbox textpanel description additional css like color:red !important; text-style:inline; etc. &lt;br&gt; Please use !important to override title styles. &lt;br&gt; By default description style is equal to title style.">
192
+ </field>
193
+
194
+ <field type="bulk_control_end"/>
195
+
196
+ <field type="control"
197
+ parent="lightbox_textpanel_source"
198
+ ctype="enable"
199
+ child="lightbox_textpanel_desc_addcss"
200
+ value="title_desc"
201
+ />
202
+
203
+ </fieldset>
204
+
205
+
206
+ <!-- ********** Lightbox Compact Design ********** -->
207
+
208
+
209
+ <fieldset name="lightbox_compact_design" label="Lightbox Compact Design" icon="eg-icon-cog-alt">
210
+
211
+ <field name="lightbox_compact_overlay_opacity"
212
+ type="text"
213
+ default="0.6"
214
+ label="Lightbox Overlay Opacity"
215
+ description="The opacity of the lightbox overlay. Values (0-1)">
216
+ </field>
217
+
218
+ <field name="lightbox_compact_overlay_color"
219
+ type="color"
220
+ default="#000000"
221
+ label="Lightbox Overlay Color"
222
+ description="The color of the lightbox overlay">
223
+ </field>
224
+
225
+ <field type="hr"></field>
226
+
227
+ <field name="lightbox_arrows_position"
228
+ type="list"
229
+ default="sides"
230
+ label="&lt;b&gt;Lightbox Arrows Position&lt;/b&gt;"
231
+ description="The position of lightbox arrows. on the sides or inside the image">
232
+ <option value="sides" text="On The Sides"></option>
233
+ <option value="inside" text="Inside The Image"></option>
234
+ </field>
235
+
236
+ <field name="lightbox_arrows_inside_alwayson"
237
+ type="boolean"
238
+ default="false"
239
+ label="Lightbox Arrows Always On"
240
+ description="The arrows will be always visible, or show on mouseover">
241
+ </field>
242
+
243
+ <field type="control"
244
+ parent="lightbox_arrows_position"
245
+ ctype="enable"
246
+ child="lightbox_arrows_inside_alwayson"
247
+ value="inside"
248
+ />
249
+
250
+ <field type="hr"></field>
251
+
252
+ <field name="lightbox_compact_show_numbers"
253
+ type="boolean"
254
+ default="true"
255
+ label="&lt;b&gt;Show Item Numbers&lt;/b&gt;"
256
+ description="Show number of items and total items at the left top">
257
+ </field>
258
+
259
+ <field type="bulk_control_start"
260
+ parent="lightbox_compact_show_numbers"
261
+ ctype="show"
262
+ value="true"
263
+ />
264
+
265
+ <field name="lightbox_compact_numbers_size"
266
+ type="text"
267
+ default="14"
268
+ label="&amp;nbsp; Lightbox Numbers Size"
269
+ unit="px"
270
+ description="The size of the numbers text">
271
+ </field>
272
+
273
+ <field name="lightbox_compact_numbers_color"
274
+ type="color"
275
+ default="#e5e5e5"
276
+ label="&amp;nbsp; Lightbox Numbers Color"
277
+ description="The color of the numbers">
278
+ </field>
279
+
280
+ <field name="lightbox_compact_numbers_padding_top"
281
+ type="text"
282
+ default="7"
283
+ label="&amp;nbsp; Lightbox Numbers Padding Top"
284
+ unit="px"
285
+ description="The top padding of the numbers text">
286
+ </field>
287
+
288
+ <field name="lightbox_compact_numbers_padding_right"
289
+ type="text"
290
+ default="5"
291
+ label="&amp;nbsp; Lightbox Numbers Padding Right"
292
+ unit="px"
293
+ description="The right padding of the numbers text">
294
+ </field>
295
+
296
+ <field type="bulk_control_end"/>
297
+
298
+ <field type="hr"></field>
299
+
300
+ <field name="lightbox_compact_show_textpanel"
301
+ type="boolean"
302
+ default="true"
303
+ label="&lt;b&gt;Show Text Panel&lt;/b&gt;"
304
+ description="Show lightbox text panel at the top center"></field>
305
+
306
+ <field type="bulk_control_start"
307
+ parent="lightbox_compact_show_textpanel"
308
+ ctype="show"
309
+ value="true"
310
+ />
311
+
312
+
313
+ <field name="lightbox_compact_textpanel_source"
314
+ type="list"
315
+ default="title"
316
+ label="&amp;nbsp; Lightbox Text Panel Text Source"
317
+ description="Choose the source for the text line on the lightbox">
318
+ <option value="title" text="Title"></option>
319
+ <option value="desc" text="Description"></option>
320
+ </field>
321
+
322
+
323
+ <field name="lightbox_compact_textpanel_title_color"
324
+ type="color"
325
+ default="#e5e5e5"
326
+ label="&amp;nbsp; Lightbox Text Panel Text Color"
327
+ description="text panel text color, leave empty for default">
328
+ </field>
329
+
330
+ <field name="lightbox_compact_textpanel_title_font_size"
331
+ type="text"
332
+ default="14"
333
+ label="&amp;nbsp; Lightbox Text Panel Font Size"
334
+ description="textg panel font size, leave empty for default"></field>
335
+
336
+ <field name="lightbox_compact_textpanel_title_bold"
337
+ type="boolean"
338
+ default="false"
339
+ label="&amp;nbsp; Lightbox Text Panel Bold Text"
340
+ description="text panel bold text"></field>
341
+
342
+ <field name="lightbox_compact_textpanel_padding_top"
343
+ type="text"
344
+ default="5"
345
+ label="&amp;nbsp; Lightbox Text Panel Padding Top"
346
+ unit="px"
347
+ description="The space from top of the textpanel">
348
+ </field>
349
+
350
+ <field name="lightbox_compact_textpanel_padding_left"
351
+ type="text"
352
+ default="10"
353
+ label="&amp;nbsp; Lightbox Text Panel Padding Left"
354
+ unit="px"
355
+ description="The space from left of the textpanel">
356
+ </field>
357
+
358
+ <field name="lightbox_compact_textpanel_padding_right"
359
+ type="text"
360
+ default="10"
361
+ label="&amp;nbsp; Lightbox Text Panel Padding Right"
362
+ unit="px"
363
+ description="The space from right of the textpanel">
364
+ </field>
365
+
366
+
367
+ <field type="bulk_control_end"/>
368
+
369
+ <field type="hr"></field>
370
+
371
+ <field name="lightbox_compact_slider_image_border"
372
+ type="boolean"
373
+ default="true"
374
+ label="&lt;b&gt;Enable Lightbox Image Border&lt;/b&gt;"
375
+ description="Enable border around the image">
376
+ </field>
377
+
378
+ <field type="bulk_control_start"
379
+ parent="lightbox_compact_slider_image_border"
380
+ ctype="show"
381
+ value="true"
382
+ />
383
+
384
+ <field name="lightbox_compact_slider_image_border_width"
385
+ type="text"
386
+ default="10"
387
+ label="&amp;nbsp; Lightbox Image Border Width"
388
+ unit="px"
389
+ description="Lightbox image border width">
390
+ </field>
391
+
392
+ <field name="lightbox_compact_slider_image_border_color"
393
+ type="color"
394
+ default="#ffffff"
395
+ label="&amp;nbsp; Lightbox Image Border Color"
396
+ description="Lightbox image border color">
397
+ </field>
398
+
399
+ <field name="lightbox_compact_slider_image_border_radius"
400
+ type="text"
401
+ default="0"
402
+ label="&amp;nbsp; Lightbox Image Border Radius"
403
+ unit="px"
404
+ description="Lightbox Image Border Radius">
405
+ </field>
406
+
407
+ <field type="bulk_control_end"/>
408
+
409
+ <field type="hr"></field>
410
+
411
+ <field name="lightbox_compact_slider_image_shadow"
412
+ type="boolean"
413
+ default="true"
414
+ label="&lt;b&gt;Enable Lightbox Image Shadow&lt;/b&gt;"
415
+ description="Enable shadow around lightbox image">
416
+ </field>
417
+
418
+ </fieldset>
419
+
420
+ </fields>
helpers/settings/loadmore.php ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ defined('UNITEGALLERY_INC') or die('Restricted access');
4
+
5
+ $settings = new UniteGallerySettingsUG();
6
+
7
+ $isFullVersion = GlobalsUG::$isFullVersion;
8
+
9
+ if($isFullVersion){
10
+
11
+ $settings->loadXMLFile(GlobalsUG::$pathFullVersion."helpers/settings/loadmore.xml");
12
+
13
+ }else{
14
+ $settings->loadXMLFile(GlobalsUG::$pathHelpersSettings."loadmore.xml");
15
+ }
helpers/settings/loadmore.xml ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+
3
+ <fields>
4
+
5
+ <fieldset name="loadmore" label="Load More" icon="eg-icon-cog-alt">
6
+
7
+ <field name="textloadmore"
8
+ type="statictext"
9
+ default=""
10
+ label="This feature available in full version only."
11
+ >
12
+ </field>
13
+
14
+ </fieldset>
15
+
16
+ </fields>
helpers/settings/main.php ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ defined('UNITEGALLERY_INC') or die('Restricted access');
4
+
5
+
6
+ if(!isset($isNewGallery))
7
+ $isNewGallery = false;
8
+
9
+ $settingsMain = new UniteGallerySettingsUG();
10
+ $settingsMain->addTextBox("title", "",__("Gallery Title",UNITEGALLERY_TEXTDOMAIN),array("description"=>__("The title of the gallery. Example: Gallery1",UNITEGALLERY_TEXTDOMAIN),"required"=>"true"));
11
+ $settingsMain->addTextBox("alias", "",__("Gallery Alias",UNITEGALLERY_TEXTDOMAIN),array("description"=>__("The alias that will be used for embedding the gallery. Example: gallery1",UNITEGALLERY_TEXTDOMAIN),"required"=>"true", "class"=>"input-alias"));
12
+
13
+ if($isNewGallery == false){
14
+ $settingsMain = UniteProviderFunctionsUG::addPositionToMainSettings($settingsMain);
15
+
16
+ //add gallery theme settings
17
+ //add gallery theme settings
18
+ $textChangeTheme = __("Change",UNITEGALLERY_TEXTDOMAIN);
19
+ $params = array("class"=>"small","readonly"=>"true",
20
+ UniteGallerySettingsUG::PARAM_ADDTEXT=>"<a id='ug_button_change_theme' href='javascript:void(0)' class='unite-button-secondary'>$textChangeTheme</a>");
21
+
22
+ $params[UniteSettingsUG::PARAM_NOSETVAL] = true;
23
+
24
+ $galleryTypeTitle = GlobalsUGGallery::$gallery->getTypeTitle();
25
+
26
+ $settingsMain->addTextbox("gallery_theme_info", $galleryTypeTitle, "Gallery Theme",$params);
27
+ }
28
+
29
+ $settingsMain->addHr();
30
+
31
+ $settingsMain->addItemsCategorySelect("category", null, $isNewGallery);
32
+
33
+ if($isNewGallery == false) {
34
+ $settingsMain->addHr();
35
+ $settingsMain->addRadioBoolean("enable_category_tabs", __("Enable Category Tabs", UNITEGALLERY_TEXTDOMAIN), false);
36
+ }
37
+
38
+ $settingsMain->addHr();
39
+
40
+ $params = array("class"=>"input-number","unit"=>"px");
41
+
42
+ $paramsWidth = $params;
43
+ $paramsHeight = $params;
44
+ $paramsWidth[UniteSettingsUG::PARAM_ADDFIELD] = "gallery_height";
45
+ $paramsHeight[UniteSettingsUG::PARAM_NODRAW] = true;
46
+
47
+ $settingsMain->addRadioBoolean("full_width", "Full Width", false);
48
+
49
+ $settingsMain->addTextbox("gallery_width", "900", __("Width", UNITEGALLERY_TEXTDOMAIN),$paramsWidth);
50
+ $settingsMain->addTextbox("gallery_height", "400", __("Height", UNITEGALLERY_TEXTDOMAIN),$paramsHeight);
51
+
52
+ $settingsMain->addControl("full_width", "gallery_width", "hide", "true");
53
+
54
+ //in case of existing gallery
55
+ if($isNewGallery == false){
56
+ $settingsMain->addHr();
57
+
58
+ $settingsMain->addTextbox("gallery_min_width", "150", __("Min. Width", UNITEGALLERY_TEXTDOMAIN),$params);
59
+ $settingsMain->addTextbox("gallery_min_height", "100", __("Min. Height", UNITEGALLERY_TEXTDOMAIN),$params);
60
+ }
61
+
62
+
63
+ ?>
helpers/settings/main_tiles.php ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ defined('UNITEGALLERY_INC') or die('Restricted access');
4
+
5
+
6
+ if(!isset($isNewGallery))
7
+ $isNewGallery = false;
8
+
9
+ $settingsMain = new UniteGallerySettingsUG();
10
+ $settingsMain->addTextBox("title", "",__("Gallery Title",UNITEGALLERY_TEXTDOMAIN),array("description"=>__("The title of the gallery. Example: Gallery1",UNITEGALLERY_TEXTDOMAIN),"required"=>"true"));
11
+ $settingsMain->addTextBox("alias", "",__("Gallery Alias",UNITEGALLERY_TEXTDOMAIN),array("description"=>__("The alias that will be used for embedding the gallery. Example: gallery1",UNITEGALLERY_TEXTDOMAIN),"required"=>"true", "class"=>"input-alias"));
12
+
13
+ if($isNewGallery == false){
14
+ $settingsMain = UniteProviderFunctionsUG::addPositionToMainSettings($settingsMain);
15
+
16
+ //add gallery theme settings
17
+ $textChangeTheme = __("Change",UNITEGALLERY_TEXTDOMAIN);
18
+ $params = array("class"=>"small","readonly"=>"true",
19
+ UniteGallerySettingsUG::PARAM_ADDTEXT=>"<a id='ug_button_change_theme' href='javascript:void(0)' class='unite-button-secondary'>$textChangeTheme</a>");
20
+
21
+ $params[UniteSettingsUG::PARAM_NOSETVAL] = true;
22
+
23
+ $galleryTypeTitle = GlobalsUGGallery::$gallery->getTypeTitle();
24
+
25
+ $settingsMain->addTextbox("gallery_theme_info", $galleryTypeTitle, "Gallery Theme",$params);
26
+
27
+ }
28
+
29
+ $settingsMain->addHr();
30
+
31
+ $settingsMain->addItemsCategorySelect("category", null, $isNewGallery);
32
+
33
+ if ( $isNewGallery == false ) {
34
+ $settingsMain->addHr();
35
+ $settingsMain->addRadioBoolean("enable_category_tabs", __("Enable Category Tabs", UNITEGALLERY_TEXTDOMAIN), false);
36
+
37
+ $settingsMain->addControl("enable_category_tabs", "category", "enable", "false");
38
+ }
39
+
40
+ $settingsMain->addHr();
41
+
42
+ $params = array("class"=>"input-number","unit"=>"px");
43
+
44
+ $settingsMain->addRadioBoolean("full_width", "Full Width", true);
45
+
46
+
47
+ $settingsMain->addTextbox("gallery_width", "1000", __("Width", UNITEGALLERY_TEXTDOMAIN),$params);
48
+
49
+ $settingsMain->addControl("full_width", "gallery_width", "hide", "true");
50
+
51
+ //in case of existing gallery
52
+ if($isNewGallery == false){
53
+ $settingsMain->addHr();
54
+
55
+ $settingsMain->addTextbox("gallery_min_width", "150", __("Min. Width", UNITEGALLERY_TEXTDOMAIN),$params);
56
+ }
57
+
58
+
59
+ ?>
helpers/settings/position.php ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ <?php
2
+ $settings = new UniteGallerySettingsUG();
3
+ $settings->loadXMLFile(GlobalsUG::$pathHelpersSettings."position.xml");
4
+ ?>
helpers/settings/position.xml ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+
3
+ <fields>
4
+
5
+ <fieldset name="position" label="Position" icon="eg-icon-resize-full-alt">
6
+ <field name="position" type="list" default="center" label="Position on the page" description="The position of the slider on the page, &lt;br&gt; default - no styles added, &lt;br&gt; float:left, float:right, margin:0px auto;">
7
+ <option value="default" text="Default" />
8
+ <option value="left" text="Align Left" />
9
+ <option value="center" text="Center" />
10
+ <option value="right" text="Align Right" />
11
+ </field>
12
+ <field name="margin_top" type="text" label="Margin Top" default="0" unit="px" datatype="number" description="The top margin of the slider wrapper div" />
13
+ <field name="margin_bottom" type="text" label="Margin Bottom" default="0" unit="px" datatype="number" description="The bottom margin of the slider wrapper div" />
14
+ <field name="margin_left" type="text" label="Margin Left" default="0" unit="px" datatype="number" description="The left margin of the slider wrapper div" />
15
+ <field name="margin_right" type="text" label="Margin Right" default="0" unit="px" datatype="number" description="The right margin of the slider wrapper div" />
16
+ <field type="control" ctype="disable" parent="position" child="margin_left" value="center" />
17
+ <field type="control" ctype="disable" parent="position" child="margin_right" value="center" />
18
+ </fieldset>
19
+
20
+
21
+ </fields>
helpers/settings/position_tiles.php ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ <?php
2
+ $settings = new UniteGallerySettingsUG();
3
+ $settings->loadXMLFile(GlobalsUG::$pathHelpersSettings."position_tiles.xml");
4
+ ?>
helpers/settings/position_tiles.xml ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+
3
+ <fields>
4
+
5
+ <fieldset name="position" label="Position" icon="eg-icon-resize-full-alt">
6
+ <field name="position" type="list" default="center" label="Position on the page" description="The position of the slider on the page, &lt;br&gt; default - no styles added, &lt;br&gt; float:left, float:right, margin:0px auto;">
7
+ <option value="default" text="Default" />
8
+ <option value="left" text="Left" />
9
+ <option value="center" text="Center" />
10
+ <option value="right" text="Right" />
11
+ </field>
12
+ <field name="margin_top" type="text" label="Margin Top" default="0" unit="px" datatype="number" description="The top margin of the slider wrapper div" />
13
+ <field name="margin_bottom" type="text" label="Margin Bottom" default="0" unit="px" datatype="number" description="The bottom margin of the slider wrapper div" />
14
+ <field name="margin_left" type="text" label="Margin Left" default="0" unit="px" datatype="number" description="The left margin of the slider wrapper div" />
15
+ <field name="margin_right" type="text" label="Margin Right" default="0" unit="px" datatype="number" description="The right margin of the slider wrapper div" />
16
+ <field type="control" ctype="disable" parent="position" child="margin_left" value="center" />
17
+ <field type="control" ctype="disable" parent="position" child="margin_right" value="center" />
18
+ </fieldset>
19
+
20
+
21
+ </fields>
helpers/settings/slider_main.php ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+
4
+ defined('UNITEGALLERY_INC') or die('Restricted access');
5
+
6
+
7
+ $settings = new UniteGallerySettingsUG();
8
+
9
+ $settings->loadXMLFile(GlobalsUG::$pathHelpersSettings."slider_main.xml");
10
+
11
+ $settings->updateSelectToEasing("slider_transition_easing");
12
+
13
+ $settings->updateSelectToSkins("slider_bullets_skin", "");
14
+ $settings->updateSelectToAlignHor("slider_bullets_align_hor");
15
+ $settings->updateSelectToAlignVert("slider_bullets_align_vert");
16
+
17
+ $settings->updateSelectToSkins("slider_arrows_skin", "");
18
+ $settings->updateSelectToAlignHor("slider_arrow_left_align_hor");
19
+ $settings->updateSelectToAlignVert("slider_arrow_left_align_vert");
20
+ $settings->updateSelectToAlignHor("slider_arrow_right_align_hor");
21
+ $settings->updateSelectToAlignVert("slider_arrow_right_align_vert");
22
+
23
+ $settings->updateSelectToAlignHor("slider_arrow_right_align_hor");
24
+ $settings->updateSelectToAlignVert("slider_arrow_right_align_vert");
25
+
26
+ $settings->updateSelectToAlignHor("slider_progress_indicator_align_hor");
27
+ $settings->updateSelectToAlignVert("slider_progress_indicator_align_vert");
28
+
29
+ $settings->updateSelectToSkins("slider_play_button_skin", "");
30
+ $settings->updateSelectToAlignHor("slider_play_button_align_hor");
31
+ $settings->updateSelectToAlignVert("slider_play_button_align_vert");
32
+
33
+ $settings->updateSelectToSkins("slider_fullscreen_button_skin", "");
34
+ $settings->updateSelectToAlignHor("slider_fullscreen_button_align_hor");
35
+ $settings->updateSelectToAlignVert("slider_fullscreen_button_align_vert");
36
+
37
+ $settings->updateSelectToSkins("slider_zoompanel_skin", "");
38
+ $settings->updateSelectToAlignHor("slider_zoompanel_align_hor");
39
+ $settings->updateSelectToAlignVert("slider_zoompanel_align_vert");
40
+
41
+ if(method_exists("UniteProviderFunctionsUG", "addBigImageSizeSettings"))
42
+ $settings = UniteProviderFunctionsUG::addBigImageSizeSettings($settings, false, "slider_scale_mode_fullscreen");
43
+
44
+
45
+ ?>
helpers/settings/slider_main.xml ADDED
@@ -0,0 +1,443 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+
3
+ <fields>
4
+
5
+ <fieldset name="slider" label="Slider Area" icon="eg-icon-cog-alt">
6
+
7
+ <field name="slider_scale_mode" type="list" default="fill"
8
+ label="Scale Mode"
9
+ description="Scale mode for slider images that related to media items. &lt;br&gt;&lt;br&gt; &lt;b&gt;Fill&lt;/b&gt;: scale down and up the image to always fit the slider. &lt;br&gt;&lt;br&gt; &lt;b&gt;Down&lt;/b&gt;: scale down only, smaller images will be shown, don't enlarge images (scale up). &lt;br&gt;&lt;br&gt; &lt;b&gt;Fill&lt;/b&gt;: fill the entire slider space by scaling, cropping and centering the image. &lt;br&gt;&lt;br&gt; &lt;b&gt;Fit Vertical&lt;/b&gt;: make the image always fill the vertical slider area">
10
+ <option value="fit" text="Fit"></option>
11
+ <option value="down" text="Down"></option>
12
+ <option value="fill" text="Fill"></option>
13
+ <option value="fitvert" text="Fit Vertical"></option>
14
+ </field>
15
+
16
+ <field name="slider_scale_mode_media" type="list" default="fill"
17
+ label="Scale Mode For Media Items"
18
+ description="Scale mode for slider images that related to media items. &lt;br&gt;&lt;br&gt; &lt;b&gt;Fill&lt;/b&gt;: scale down and up the image to always fit the slider. &lt;br&gt;&lt;br&gt; &lt;b&gt;Down&lt;/b&gt;: scale down only, smaller images will be shown, don't enlarge images (scale up). &lt;br&gt;&lt;br&gt; &lt;b&gt;Fill&lt;/b&gt;: fill the entire slider space by scaling, cropping and centering the image. &lt;br&gt;&lt;br&gt; &lt;b&gt;Fit Vertical&lt;/b&gt;: make the image always fill the vertical slider area">
19
+ <option value="fit" text="Fit"></option>
20
+ <option value="down" text="Down"></option>
21
+ <option value="fill" text="Fill"></option>
22
+ <option value="fitvert" text="Fit Vertical"></option>
23
+ </field>
24
+
25
+ <field name="slider_scale_mode_fullscreen" type="list" default="down"
26
+ label="Scale Mode For Fullscreen"
27
+ description="Scale mode for slider images that related to media items. &lt;br&gt;&lt;br&gt; &lt;b&gt;Fill&lt;/b&gt;: scale down and up the image to always fit the slider. &lt;br&gt;&lt;br&gt; &lt;b&gt;Down&lt;/b&gt;: scale down only, smaller images will be shown, don't enlarge images (scale up). &lt;br&gt;&lt;br&gt; &lt;b&gt;Fill&lt;/b&gt;: fill the entire slider space by scaling, cropping and centering the image. &lt;br&gt;&lt;br&gt; &lt;b&gt;Fit Vertical&lt;/b&gt;: make the image always fill the vertical slider area">
28
+ <option value="fit" text="Fit"></option>
29
+ <option value="down" text="Down"></option>
30
+ <option value="fill" text="Fill"></option>
31
+ <option value="fitvert" text="Fit Vertical"></option>
32
+ </field>
33
+
34
+ <field type="hr"></field>
35
+
36
+ <field name="slider_controls_always_on" type="boolean" default="true"
37
+ label="Controls Always On"
38
+ description="Set on slider controls (arrows, bullets, zoom panel) always on, if no - show only on mouseover">
39
+ </field>
40
+
41
+ <field type="bulk_control_start" parent="slider_controls_always_on"
42
+ ctype="enable" value="false" />
43
+
44
+ <field name="slider_controls_appear_duration" type="text"
45
+ default="300" label="Controls Appear Duration" unit="ms"
46
+ description="the duration of appearing controls">
47
+ </field>
48
+
49
+ <field name="slider_controls_appear_ontap" type="boolean"
50
+ default="true" label="Controls Appear On Tap" description="appear controls on tap event on touch devices">
51
+ </field>
52
+
53
+ <field type="bulk_control_end" />
54
+
55
+ <field name="edit_slider_padding" type="boolean" default="false"
56
+ label="Edit Slider Area Padding" description="Check yes if you want to edit slider area padding.">
57
+ </field>
58
+
59
+ <field type="bulk_control_start" parent="edit_slider_padding"
60
+ ctype="show" value="true" />
61
+
62
+ <field name="slider_item_padding_top" type="text" default="0"
63
+ label="&amp;nbsp; Slider Padding Top" unit="px"
64
+ description="padding top of the slider item">
65
+ </field>
66
+
67
+ <field name="slider_item_padding_bottom" type="text" default="0"
68
+ label="&amp;nbsp; Slider Padding Bottom" unit="px"
69
+ description="padding bottom of the slider item">
70
+ </field>
71
+
72
+ <field name="slider_item_padding_left" type="text" default="0"
73
+ label="&amp;nbsp; Slider Padding Left" unit="px"
74
+ description="padding left of the slider item">
75
+ </field>
76
+
77
+ <field name="slider_item_padding_right" type="text" default="0"
78
+ label="&amp;nbsp; Slider Padding Right" unit="px"
79
+ description="padding right of the slider item">
80
+ </field>
81
+
82
+ <field type="bulk_control_end"></field>
83
+
84
+ <field type="hr"></field>
85
+
86
+ <field name="slider_transition" type="list" default="slide"
87
+ label="Slides Change Transition" description="the transition of the slide change">
88
+ <option value="slide" text="Slide"></option>
89
+ <option value="fade" text="Fade"></option>
90
+ </field>
91
+
92
+ <field name="slider_transition_speed" type="text" default="300"
93
+ label="Transition Duration" unit="ms"
94
+ description="transition duration of slide change">
95
+ </field>
96
+
97
+ <field name="slider_transition_easing" type="list" default="easeInOutQuad"
98
+ label="Transition Easing Function" description="transition easing function of slide change">
99
+ </field>
100
+
101
+ <field type="hr"></field>
102
+
103
+ <field name="slider_control_swipe" type="boolean" default="true"
104
+ label="Enable Swipe Control" description="enable swiping control on touch devices and using the mouse">
105
+ </field>
106
+
107
+ <field name="slider_control_zoom" type="boolean" default="true"
108
+ label="Enable Image Zooming"
109
+ description="Enable zooming control, zoom on mouse wheel and on punch gesture on touch devices">
110
+ </field>
111
+
112
+ <field name="slider_zoom_max_ratio" type="text" default="6"
113
+ label="Zoom Max Ratio" description="Max zoom ratio. The zooming will stop after this value.">
114
+ </field>
115
+
116
+ <field type="control" parent="slider_control_zoom" ctype="enable"
117
+ child="slider_zoom_max_ratio" value="true" />
118
+
119
+ <field type="hr"></field>
120
+
121
+ <field name="slider_enable_links"
122
+ type="boolean"
123
+ default="true"
124
+ label="Enable Slide As Link"
125
+ description="enable slide as link functionality, you have to enter the links in edit items of cause">
126
+ </field>
127
+
128
+ <field name="slider_links_newpage"
129
+ type="boolean"
130
+ default="false"
131
+ label="Open Links In New Page"
132
+ description="open the slide link in new page">
133
+ </field>
134
+
135
+ <field type="hr"></field>
136
+
137
+ <field name="slider_video_enable_closebutton"
138
+ type="boolean"
139
+ default="true"
140
+ label="Enable Video Close Button"
141
+ description="Enable video close button on video play on right top corner"></field>
142
+
143
+ </fieldset>
144
+
145
+ <fieldset name="slider_elements_bullets" label="On Slider (Loader, Arrows, Bullets)"
146
+ icon="eg-icon-cog-alt">
147
+
148
+
149
+ <field name="slider_loader_type" type="list" default="1"
150
+ label="Slider Loader Shape" description="shape of the loader (1-7)">
151
+ <option value="1" text="Shape 1"></option>
152
+ <option value="2" text="Shape 2"></option>
153
+ <option value="3" text="Shape 3"></option>
154
+ <option value="4" text="Shape 4"></option>
155
+ <option value="5" text="Shape 5"></option>
156
+ <option value="6" text="Shape 6"></option>
157
+ <option value="7" text="Shape 7"></option>
158
+ </field>
159
+
160
+ <field name="slider_loader_color" type="list" default="white"
161
+ label="Slider Loader Color" description="color of the loader: (black , white)">
162
+ <option value="white" text="White"></option>
163
+ <option value="black" text="Black"></option>
164
+ </field>
165
+
166
+ <field type="hr"></field>
167
+
168
+ <field name="slider_enable_bullets" type="boolean" default="false"
169
+ label="&lt;b&gt;Show Bullets&lt;/b&gt;" description="show the bullets onslider element">
170
+ </field>
171
+
172
+ <field type="bulk_control_start" parent="slider_enable_bullets"
173
+ ctype="show" value="true" />
174
+
175
+ <field name="slider_bullets_skin" type="list" default=""
176
+ label="&amp;nbsp; Bullets Skin" description="skin of the bullets, if empty inherit from gallery skin">
177
+ </field>
178
+
179
+ <field name="slider_bullets_space_between" type="text" default="-1"
180
+ label="&amp;nbsp; Space Between Bullets"
181
+ description="set the space between bullets. If -1 then will be set default space from the skins">
182
+ </field>
183
+
184
+ <field name="slider_bullets_align_hor" type="list" default="center"
185
+ label="&amp;nbsp; Bullets Horizontal Align" description="bullets horizontal align">
186
+ </field>
187
+
188
+ <field name="slider_bullets_align_vert" type="list" default="bottom"
189
+ label="&amp;nbsp; Bullets Vertical Align" description="bullets vertical algin">
190
+ </field>
191
+
192
+ <field name="slider_bullets_offset_hor" type="text" default="0"
193
+ label="&amp;nbsp; Bullets Horizontal Offset" unit="px"
194
+ description="bullets horizontal offset">
195
+ </field>
196
+
197
+ <field name="slider_bullets_offset_vert" type="text" default="10"
198
+ label="&amp;nbsp; Bullets Vertical Offset" unit="px"
199
+ description="bullets vertical offset">
200
+ </field>
201
+
202
+ <field type="bulk_control_end" />
203
+
204
+ <field type="hr"></field>
205
+
206
+ <field name="slider_enable_arrows" type="boolean" default="true"
207
+ label="&lt;b&gt;Show Slider Arrows&lt;/b&gt;" description="show the arrows onslider element">
208
+ </field>
209
+
210
+ <field type="bulk_control_start" parent="slider_enable_arrows"
211
+ ctype="show" value="true" />
212
+
213
+ <field name="slider_arrows_skin" type="list" default=""
214
+ label="&amp;nbsp; Slider Arrows Skin" description="skin of the slider arrows, if empty inherit from gallery skin">
215
+ </field>
216
+
217
+ <field name="slider_arrow_left_align_hor" type="list" default="left"
218
+ label="&amp;nbsp; Left Arrow Horizontal Align" description="left arrow horizontal align">
219
+ </field>
220
+
221
+ <field name="slider_arrow_left_align_vert" type="list" default="middle"
222
+ label="&amp;nbsp; Left Arrow Vertical Align" description="left arrow vertical algin">
223
+ </field>
224
+
225
+ <field name="slider_arrow_left_offset_hor" type="text" default="20"
226
+ label="&amp;nbsp; Left Arrow Horizontal Offset" unit="px"
227
+ description="left arrow horizontal offset">
228
+ </field>
229
+
230
+ <field name="slider_arrow_left_offset_vert" type="text" default="0"
231
+ label="&amp;nbsp; Left Arrow Vertical Offset" unit="px"
232
+ description="left arrow vertical offset">
233
+ </field>
234
+
235
+ <field name="slider_arrow_right_align_hor" type="list" default="right"
236
+ label="&amp;nbsp; Right Arrow Horizontal Align" description="right arrow horizontal align">
237
+ </field>
238
+
239
+ <field name="slider_arrow_right_align_vert" type="list" default="middle"
240
+ label="&amp;nbsp; Right Arrow Vertical Align" description="right arrow vertical algin">
241
+ </field>
242
+
243
+ <field name="slider_arrow_right_offset_hor" type="text" default="20"
244
+ label="&amp;nbsp; Right Arrow Horizontal Offset" unit="px"
245
+ description="right arrow horizontal offset">
246
+ </field>
247
+
248
+ <field name="slider_arrow_right_offset_vert" type="text"
249
+ default="0" label="&amp;nbsp; Right Arrow Vertical Offset" unit="px"
250
+ description="right arrow vertical offset">
251
+ </field>
252
+
253
+ <field type="bulk_control_end" />
254
+
255
+ </fieldset>
256
+
257
+ <fieldset name="slider_elemnents_progressbar" label="On Slider (Progress Indicator)"
258
+ icon="eg-icon-cog-alt">
259
+
260
+ <field name="slider_enable_progress_indicator" type="boolean"
261
+ default="true" label="&lt;b&gt;Show Progress Indicator&lt;/b&gt;"
262
+ description="enable progress indicator onslider element">
263
+ </field>
264
+
265
+ <field type="bulk_control_start" parent="slider_enable_progress_indicator"
266
+ ctype="show" value="true" />
267
+
268
+ <field name="slider_progress_indicator_type" type="list"
269
+ default="pie" label="&amp;nbsp; Progress Indicator Type"
270
+ description="Progress indicator type. if pie not supported, it will switch to bar automatically.">
271
+ <option value="pie" text="Pie"></option>
272
+ <option value="pie2" text="Pie2"></option>
273
+ <option value="bar" text="Bar"></option>
274
+ </field>
275
+
276
+ <field name="slider_progress_indicator_align_hor" type="list"
277
+ default="left" label="&amp;nbsp; Progress Indicator Horizontal Align"
278
+ description="progress indicator horizontal align">
279
+ </field>
280
+
281
+ <field name="slider_progress_indicator_align_vert" type="list"
282
+ default="top" label="&amp;nbsp; Progress Indicator Vertical Align"
283
+ description="progress indicator vertical algin">
284
+ </field>
285
+
286
+ <field name="slider_progress_indicator_offset_hor" type="text"
287
+ default="16" label="&amp;nbsp; Progress Indicator Horizontal Offset"
288
+ unit="px" description="progress indicator horizontal offset">
289
+ </field>
290
+
291
+ <field name="slider_progress_indicator_offset_vert" type="text"
292
+ default="36" label="&amp;nbsp; Progress Indicator Vertical Offset"
293
+ unit="px" description="progress indicator vertical offset">
294
+ </field>
295
+
296
+ <field type="hr"></field>
297
+
298
+ <field name="slider_progressbar_color" type="color" default="#ffffff"
299
+ label="Progress Bar Color" description="progress bar color">
300
+ </field>
301
+
302
+ <field name="slider_progressbar_opacity" type="text" default="0.6"
303
+ label="Progress Bar Opacity" description="progress bar opacity">
304
+ </field>
305
+
306
+ <field name="slider_progressbar_line_width" type="text" default="5"
307
+ label="Progress Bar Line Width" unit="px" description="progress bar line width">
308
+ </field>
309
+
310
+ <field type="hr"></field>
311
+
312
+ <field name="slider_progresspie_color1" type="color" default="#b5b5b5"
313
+ label="Progress Pie Color" description="the first color of the progress pie">
314
+ </field>
315
+
316
+ <field name="slider_progresspie_color2" type="color" default="#e5e5e5"
317
+ label="Progress Pie Second Color" description="progress pie second color ">
318
+ </field>
319
+
320
+ <field name="slider_progresspie_stroke_width" type="text"
321
+ default="6" label="Progress Pie Stroke Width" unit="px"
322
+ description="progress pie stroke width">
323
+ </field>
324
+
325
+ <field name="slider_progresspie_width" type="text" default="30"
326
+ label="Progress Pie Width" unit="px" description="progess pie width">
327
+ </field>
328
+
329
+ <field name="slider_progresspie_height" type="text" default="30"
330
+ label="Progress Pie Height" description="progress pie height">
331
+ </field>
332
+
333
+ <field type="bulk_control_end" />
334
+
335
+ </fieldset>
336
+
337
+ <fieldset name="onslider_buttons" label="On Slider (Buttons, Zoom Panel)"
338
+ icon="eg-icon-cog-alt">
339
+
340
+ <field name="slider_enable_play_button" type="boolean" default="true"
341
+ label="&lt;b&gt;Show Play Button&lt;/b&gt;" description="enable play / pause button onslider element">
342
+ </field>
343
+
344
+ <field type="bulk_control_start" parent="slider_enable_play_button"
345
+ ctype="show" value="true" />
346
+
347
+ <field name="slider_play_button_skin" type="list" default=""
348
+ label="&amp;nbsp; Play Button Skin" description="skin of the slider play button">
349
+ </field>
350
+
351
+ <field name="slider_play_button_align_hor" type="list" default="left"
352
+ label="&amp;nbsp; Play Button Horizontal Align" description="play button horizontal align">
353
+ </field>
354
+
355
+ <field name="slider_play_button_align_vert" type="list" default="top"
356
+ label="&amp;nbsp; Play Button Vertical Align" description="play button vertical algin">
357
+ </field>
358
+
359
+ <field name="slider_play_button_offset_hor" type="text" default="40"
360
+ label="&amp;nbsp; Play Button Horizontal Offset" unit="px"
361
+ description="play button horizontal offset">
362
+ </field>
363
+
364
+ <field name="slider_play_button_offset_vert" type="text"
365
+ default="8" label="&amp;nbsp; Play Button Vertical Offset" unit="px"
366
+ description="play button vertical offset">
367
+ </field>
368
+
369
+ <field type="bulk_control_end" />
370
+
371
+ <field type="hr" name="hr_buttons1"></field>
372
+
373
+ <field name="slider_enable_fullscreen_button" type="boolean"
374
+ default="true" label="&lt;b&gt;Show Fullscreen Button&lt;/b&gt;"
375
+ description="enable fullscreen button onslider element">
376
+ </field>
377
+
378
+ <field type="bulk_control_start" parent="slider_enable_fullscreen_button"
379
+ ctype="show" value="true" />
380
+
381
+ <field name="slider_fullscreen_button_skin" type="list" default=""
382
+ label="&amp;nbsp; Fullscreen Button Skin" description="skin of the slider fullscreen button">
383
+ </field>
384
+
385
+ <field name="slider_fullscreen_button_align_hor" type="list"
386
+ default="left" label="&amp;nbsp; Fullscreen Button Horizontal Align"
387
+ description="fullscreen button horizontal align">
388
+ </field>
389
+
390
+ <field name="slider_fullscreen_button_align_vert" type="list"
391
+ default="top" label="&amp;nbsp; Fullscreen Button Vertical Align"
392
+ description="fullscreen button vertical algin">
393
+ </field>
394
+
395
+ <field name="slider_fullscreen_button_offset_hor" type="text"
396
+ default="11" label="&amp;nbsp; Fullscreen Button Horizontal Offset"
397
+ unit="px" description="fullscreen button horizontal offset">
398
+ </field>
399
+
400
+ <field name="slider_fullscreen_button_offset_vert" type="text"
401
+ default="9" label="&amp;nbsp; Fullscreen Button Vertical Offset"
402
+ unit="px" description="fullscreen button vertical offset">
403
+ </field>
404
+
405
+ <field type="bulk_control_end" />
406
+
407
+ <field type="hr" name="hr_buttons2"></field>
408
+
409
+ <field name="slider_enable_zoom_panel" type="boolean" default="true"
410
+ label="&lt;b&gt;Show Zoom Panel&lt;/b&gt;" description="enable the zoom buttons, works together with zoom control.">
411
+ </field>
412
+
413
+ <field type="bulk_control_start" parent="slider_enable_zoom_panel"
414
+ ctype="show" value="true" />
415
+
416
+ <field name="slider_zoompanel_skin" type="list" default=""
417
+ label="&amp;nbsp; Zoom Panel Skin" description="skin of the slider zoom panel">
418
+ </field>
419
+
420
+ <field name="slider_zoompanel_align_hor" type="list" default="right"
421
+ label="&amp;nbsp; Zoom Panel Horizontal Align" description="zoom panel horizontal align">
422
+ </field>
423
+
424
+ <field name="slider_zoompanel_align_vert" type="list" default="top"
425
+ label="&amp;nbsp; Zoom Panel Vertical Align" description="zoom panel vertical algin">
426
+ </field>
427
+
428
+ <field name="slider_zoompanel_offset_hor" type="text" default="12"
429
+ label="&amp;nbsp; Zoom Panel Horizontal Offset" unit="px"
430
+ description="zoom panel horizontal offset">
431
+ </field>
432
+
433
+ <field name="slider_zoompanel_offset_vert" type="text" default="10"
434
+ label="&amp;nbsp; Zoom Panel Vertical Offset" unit="px"
435
+ description="zoom panel vertical offset">
436
+ </field>
437
+
438
+ <field type="bulk_control_end" />
439
+
440
+ </fieldset>
441
+
442
+
443
+ </fields>
helpers/settings/slider_textpanel.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ defined('UNITEGALLERY_INC') or die('Restricted access');
4
+
5
+
6
+ $settings = new UniteGallerySettingsUG();
7
+ $settings->loadXMLFile(GlobalsUG::$pathHelpersSettings."slider_textpanel.xml");
8
+
9
+ $settings->updateSelectToAlignVert("slider_textpanel_text_valign");
10
+
helpers/settings/slider_textpanel.xml ADDED
@@ -0,0 +1,182 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+
3
+ <fields>
4
+
5
+ <fieldset name="onslider_textpanel" label="On Slider (Text Panel)" icon="eg-icon-cog-alt">
6
+
7
+ <field name="slider_enable_text_panel"
8
+ type="boolean"
9
+ default="true"
10
+ label="Show Text Panel"
11
+ description="enable the text panel">
12
+ </field>
13
+
14
+ <field type="bulk_control_start"
15
+ parent="slider_enable_text_panel"
16
+ ctype="show"
17
+ value="true"
18
+ />
19
+
20
+ <field name="slider_textpanel_always_on"
21
+ type="boolean"
22
+ default="true"
23
+ label="Text Panel Always On"
24
+ description="text panel are always on, if no - show only on mouseover">
25
+ </field>
26
+
27
+ <field type="hr" name="hr_textpanel1"></field>
28
+
29
+ <field name="slider_textpanel_align"
30
+ type="list"
31
+ default="bottom"
32
+ label="Text Panel Align"
33
+ description="The align of the text panel to some side of the slider">
34
+ <option value="top" text="Top"></option>
35
+ <option value="bottom" text="Bottom"></option>
36
+ </field>
37
+
38
+ <field name="slider_textpanel_margin"
39
+ type="text"
40
+ default="0"
41
+ label="Text Panel Margin"
42
+ description="margin from the textpanel position according the textpanel align option">
43
+ </field>
44
+
45
+ <field name="slider_textpanel_text_valign"
46
+ type="list"
47
+ default="middle"
48
+ label="Text Vertical Align"
49
+ description="text vertical align">
50
+ </field>
51
+
52
+ <field name="slider_textpanel_padding_top"
53
+ type="text"
54
+ default="10"
55
+ label="Text Panel Padding Top"
56
+ unit="px"
57
+ description="textpanel padding top">
58
+ </field>
59
+
60
+ <field name="slider_textpanel_padding_bottom"
61
+ type="text"
62
+ default="10"
63
+ label="Text Panel Padding Bottom"
64
+ unit="px"
65
+ description="textpanel padding bottom">
66
+ </field>
67
+
68
+ <field name="slider_textpanel_height"
69
+ type="text"
70
+ default="-1"
71
+ label="Text Panel Height"
72
+ unit="px"
73
+ description="textpanel height. if it has negative value (for example -1) it will be set dynamically">
74
+ </field>
75
+
76
+ <field name="slider_textpanel_padding_title_description"
77
+ type="text"
78
+ default="5"
79
+ label="Padding Between Title And Description"
80
+ unit="px"
81
+ description="padding between title and description">
82
+ </field>
83
+
84
+ <field name="slider_textpanel_padding_left"
85
+ type="text"
86
+ default="11"
87
+ label="Text Panel Padding Left"
88
+ unit="px"
89
+ description="cut some space for text from left">
90
+ </field>
91
+
92
+ <field name="slider_textpanel_padding_right"
93
+ type="text"
94
+ default="11"
95
+ label="Text Panel Padding Right"
96
+ unit="px"
97
+ description="cut some space for text from right">
98
+ </field>
99
+
100
+ <field type="hr"></field>
101
+
102
+ <field name="slider_textpanel_fade_duration"
103
+ type="text"
104
+ default="200"
105
+ label="Text Panel Fade Duration"
106
+ unit="ms"
107
+ description="the fade duration of textpanel appear">
108
+ </field>
109
+
110
+ <field name="slider_textpanel_enable_title"
111
+ type="boolean"
112
+ default="true"
113
+ label="Enable Title Text"
114
+ description="enable the title text">
115
+ </field>
116
+
117
+ <field name="slider_textpanel_title_as_link"
118
+ type="boolean"
119
+ default="false"
120
+ label="Title Text As Link"
121
+ description="Set title text as link if the link available">
122
+ </field>
123
+
124
+ <field type="control"
125
+ parent="slider_textpanel_enable_title"
126
+ ctype="enable"
127
+ child="slider_textpanel_title_as_link"
128
+ value="true"
129
+ />
130
+
131
+ <field name="slider_textpanel_enable_description"
132
+ type="boolean"
133
+ default="true"
134
+ label="Enable Description Text"
135
+ description="enable the description text">
136
+ </field>
137
+
138
+ <field type="hr"></field>
139
+
140
+ <field name="slider_textpanel_enable_bg"
141
+ type="boolean"
142
+ default="true"
143
+ label="Enable Text Panel Background"
144
+ description="enable the textpanel background">
145
+ </field>
146
+
147
+ <field name="slider_textpanel_bg_color"
148
+ type="color"
149
+ default="#000000"
150
+ label="Text Panel Background Color"
151
+ description="textpanel background color">
152
+ </field>
153
+
154
+ <field name="slider_textpanel_bg_opacity"
155
+ type="text"
156
+ default="0.4"
157
+ label="Text Panel Background Opacity"
158
+ description="text panel background opacity">
159
+ </field>
160
+
161
+ <field type="hr"></field>
162
+
163
+ <field name="slider_textpanel_css_title"
164
+ type="textarea"
165
+ default=""
166
+ label="Title Additional CSS"
167
+ description="textpanel title additional css like color:red; font-family:verdana">
168
+ </field>
169
+
170
+ <field name="slider_textpanel_css_description"
171
+ type="textarea"
172
+ default=""
173
+ label="Description Additional CSS"
174
+ description="textpanel description additional css like color:red; font-family:verdana">
175
+ </field>
176
+
177
+ <field type="bulk_control_end"/>
178
+
179
+ </fieldset>
180
+
181
+
182
+ </fields>
helpers/settings/strip_panel.php ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+
4
+ defined('UNITEGALLERY_INC') or die('Restricted access');
5
+
6
+
7
+ $settings = new UniteGallerySettingsUG();
8
+ $settings->loadXMLFile(GlobalsUG::$pathHelpersSettings."strip_panel.xml");
9
+
10
+ $settings->updateSelectToSkins("strippanel_buttons_skin", "");
11
+ $settings->updateSelectToSkins("strippanel_handle_skin", "");
12
+
13
+ $settings->updateSelectToAlignCombo("strippanel_handle_align");
14
+ $settings->updateSelectToEasing("strip_scroll_to_thumb_easing");
15
+ $settings->updateSelectToAlignCombo("strip_thumbs_align");
16
+
17
+
18
+ ?>
helpers/settings/strip_panel.xml ADDED
@@ -0,0 +1,194 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+
3
+ <fields>
4
+ <fieldset name="strip_panel" label="Thumbs Panel" icon="eg-icon-cog-alt">
5
+
6
+ <field name="strippanel_padding_top"
7
+ type="text"
8
+ default="8"
9
+ label="Panel Padding Top"
10
+ unit="px"
11
+ description="space from top of the panel">
12
+ </field>
13
+
14
+ <field name="strippanel_padding_bottom"
15
+ type="text"
16
+ default="8"
17
+ label="Panel Padding Bottom"
18
+ unit="px"
19
+ description="space from bottom of the panel">
20
+ </field>
21
+
22
+ <field name="strippanel_padding_left"
23
+ type="text"
24
+ default="0"
25
+ label="Panel Padding Left"
26
+ unit="px"
27
+ description="space from left of the panel">
28
+ </field>
29
+
30
+ <field name="strippanel_padding_right"
31
+ type="text"
32
+ default="0"
33
+ label="Panel Padding Right"
34
+ unit="px"
35
+ description="space from right of the panel">
36
+ </field>
37
+
38
+ <field type="hr"></field>
39
+
40
+ <field name="strippanel_background_color"
41
+ type="color"
42
+ default="#000000"
43
+ label="Panel Background Color"
44
+ description="background color of the strip wrapper, if not set, it will be taken from the css">
45
+ </field>
46
+
47
+
48
+ <field name="strippanel_background_transparent"
49
+ type="boolean"
50
+ default="false"
51
+ label="Panel Background Transparent"
52
+ description="Set the panel background color as transparent">
53
+ </field>
54
+
55
+ <field type="control"
56
+ parent="strippanel_background_transparent"
57
+ ctype="enable"
58
+ child="strippanel_background_color"
59
+ value="false"
60
+ />
61
+
62
+ <field type="hr"></field>
63
+
64
+ <field name="strippanel_enable_buttons"
65
+ type="boolean"
66
+ default="true"
67
+ label="&lt;b&gt;Enable Panel Side Buttons&lt;/b&gt;"
68
+ description="enable buttons from the sides of the panel">
69
+ </field>
70
+
71
+ <field type="bulk_control_start"
72
+ parent="strippanel_enable_buttons"
73
+ ctype="show"
74
+ value="true"
75
+ />
76
+
77
+ <field name="strippanel_buttons_skin"
78
+ type="list"
79
+ default=""
80
+ label="&amp;nbsp; Panel Side Buttons Skin"
81
+ description="Select the skin of the panel side buttons."/>
82
+
83
+ <field name="strippanel_padding_buttons"
84
+ type="text"
85
+ default="2"
86
+ label="&amp;nbsp; Panel Side Buttons Padding"
87
+ unit="px"
88
+ description="">
89
+ </field>
90
+
91
+ <field name="strippanel_buttons_role"
92
+ type="list"
93
+ default="scroll_strip"
94
+ label="&amp;nbsp; Panel Side Buttons Role"
95
+ description="the role of the buttons">
96
+ <option value="scroll_strip" text="Scroll Strip"></option>
97
+ <option value="advance_item" text="Advance Item"></option>
98
+ </field>
99
+
100
+ <field type="bulk_control_end"/>
101
+
102
+ <field type="hr"></field>
103
+
104
+ <field name="strippanel_enable_handle"
105
+ type="boolean"
106
+ default="true"
107
+ label="&lt;b&gt;Show Panel Close Handle&lt;/b&gt;"
108
+ description="enable panel close / open handle">
109
+ </field>
110
+
111
+ <field type="bulk_control_start"
112
+ parent="strippanel_enable_handle"
113
+ ctype="show"
114
+ value="true"
115
+ />
116
+
117
+ <field name="strippanel_handle_align"
118
+ type="list"
119
+ default="top"
120
+ label="&amp;nbsp; Panel Handle Align"
121
+ description="close handle tip align on the handle bar according panel orientation"/>
122
+
123
+ <field name="strippanel_handle_offset"
124
+ type="text"
125
+ default="0"
126
+ label="&amp;nbsp; Panel Handle Offset"
127
+ unit="px"
128
+ description="offset of handle bar according the align">
129
+ </field>
130
+
131
+ <field name="strippanel_handle_skin"
132
+ type="list"
133
+ default=""
134
+ label="&amp;nbsp; Panel Handle Skin"
135
+ description="the skin of the handle"/>
136
+
137
+ <field type="bulk_control_end"/>
138
+
139
+ <field type="hr"></field>
140
+
141
+ <field name="strip_thumbs_align"
142
+ type="list"
143
+ default="left"
144
+ label="Panel Thumbs Align"
145
+ description="the align of the thumbs when they smaller then the strip size."/>
146
+
147
+ <field name="strip_space_between_thumbs"
148
+ type="text"
149
+ default="6"
150
+ label="Space Between Thumbs"
151
+ unit="px"
152
+ description="space between thumbs">
153
+ </field>
154
+
155
+ <field name="strip_scroll_to_thumb_duration"
156
+ type="text"
157
+ default="500"
158
+ label="Scroll To Thumb Duration"
159
+ unit="ms"
160
+ description="duration of scrolling to thumb">
161
+ </field>
162
+
163
+ <field name="strip_scroll_to_thumb_easing"
164
+ type="list"
165
+ default="easeOutCubic"
166
+ label="Scroll To Thumb Easning"
167
+ description="easing of scrolling to thumb animation"/>
168
+
169
+ <field type="hr"></field>
170
+
171
+ <field name="strip_control_avia"
172
+ type="boolean"
173
+ default="true"
174
+ label="Enable Mouseover Control"
175
+ description="move the strip according strip moseover position">
176
+ </field>
177
+
178
+ <field name="strip_control_touch"
179
+ type="boolean"
180
+ default="true"
181
+ label="Enable Touch Control"
182
+ description="move the strip by dragging it in touch enabled devices">
183
+ </field>
184
+
185
+ <field name="strip_thumb_touch_sensetivity"
186
+ type="text"
187
+ default="15"
188
+ label="Panel Touch Sensetivity"
189
+ description="from 1-100, 1 - most sensetive, 100 - most unsensetive">
190
+ </field>
191
+
192
+ </fieldset>
193
+
194
+ </fields>
helpers/settings/thumbnail.php ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+
4
+ defined('UNITEGALLERY_INC') or die('Restricted access');
5
+
6
+
7
+ $settings = new UniteGallerySettingsUG();
8
+ $settings->loadXMLFile(GlobalsUG::$pathHelpersSettings."thumbnail.xml");
9
+
10
+ $settings->updateSelectToEasing("thumb_transition_easing");
11
+
12
+ //add thumbnail size select
13
+
14
+ if(method_exists("UniteProviderFunctionsUG", "getThumbSizesSmall")){
15
+ $arrSizesSmall = UniteProviderFunctionsUG::getThumbSizesSmall($settings);
16
+
17
+ $params = array();
18
+ $params["description"] = __("Choose system resolution for the thumbs, note that some of it can be cropped", UNITEGALLERY_TEXTDOMAIN);
19
+ $params[UniteSettingsUG::PARAM_ADD_SETTING_AFTER] = "thumb_height";
20
+
21
+ $settings->addSelect("thumb_resolution", $arrSizesSmall, __("Thumb Resolution", UNITEGALLERY_TEXTDOMAIN),"medium", $params);
22
+
23
+ }
24
+
25
+
26
+
27
+ ?>
helpers/settings/thumbnail.xml ADDED
@@ -0,0 +1,204 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+
3
+ <fields>
4
+ <fieldset name="thumb_design" label="Thumbnail" icon="eg-icon-cog-alt">
5
+
6
+ <field name="thumb_fixed_size"
7
+ type="radio"
8
+ default="true"
9
+ label="Thumb Dynamic Size"
10
+ hidden="true"
11
+ description="Set the thumb to be dynamic size to keep thumbnail image ratio.">
12
+ <option value="false" text="Yes"></option>
13
+ <option value="true" text="No"></option>
14
+ </field>
15
+
16
+
17
+ <field name="thumb_width"
18
+ type="text"
19
+ default="88"
20
+ label="Thumb Width"
21
+ unit="px"
22
+ description="thumb width">
23
+ </field>
24
+
25
+ <field name="thumb_height"
26
+ type="text"
27
+ default="50"
28
+ label="Thumb Height"
29
+ unit="px"
30
+ description="thumb height">
31
+ </field>
32
+
33
+ <field type="hr"></field>
34
+
35
+ <field name="thumb_border_effect"
36
+ type="boolean"
37
+ default="true"
38
+ label="&lt;b&gt;Thumb Border Effect&lt;/b&gt;"
39
+ description="enable the thumbnail border effect, if the thumbnail will has border or not.">
40
+ </field>
41
+
42
+ <field type="bulk_control_start"
43
+ parent="thumb_border_effect"
44
+ ctype="show"
45
+ value="true"
46
+ />
47
+
48
+ <field name="thumb_border_width"
49
+ type="text"
50
+ default="0"
51
+ label="&amp;nbsp; Thumb Border Width"
52
+ unit="px"
53
+ description="thumb border width regular state">
54
+ </field>
55
+
56
+ <field name="thumb_border_color"
57
+ type="color"
58
+ default="#000000"
59
+ label="&amp;nbsp; Thumb Border Color"
60
+ description="thumbnail border color regular state">
61
+ </field>
62
+
63
+ <field name="thumb_over_border_width"
64
+ type="text"
65
+ default="0"
66
+ label="&amp;nbsp; Thumb Mouseover Border Width"
67
+ unit="px"
68
+ description="thumb border width in mouseover state">
69
+ </field>
70
+
71
+ <field name="thumb_over_border_color"
72
+ type="color"
73
+ default="#d9d9d9"
74
+ label="&amp;nbsp; Thumb Mouseover Border Color"
75
+ description="thumb border color in mouseover state">
76
+ </field>
77
+
78
+ <field name="thumb_selected_border_width"
79
+ type="text"
80
+ default="1"
81
+ label="&amp;nbsp; Thumb Selected Border Width"
82
+ unit="px"
83
+ description="thumb width in selected state">
84
+ </field>
85
+
86
+ <field name="thumb_selected_border_color"
87
+ type="color"
88
+ default="#d9d9d9"
89
+ label="&amp;nbsp; Thumb Selected Border Color"
90
+ description="thumb border color in selected state">
91
+ </field>
92
+
93
+ <field name="thumb_round_corners_radius"
94
+ type="text"
95
+ default="0"
96
+ label="&amp;nbsp; Thumb Border Radius"
97
+ unit="px"
98
+ description="thumb border radius">
99
+ </field>
100
+
101
+ <field type="bulk_control_end"/>
102
+
103
+ <field type="hr"></field>
104
+
105
+ <field name="thumb_color_overlay_effect"
106
+ type="boolean"
107
+ default="true"
108
+ label="&lt;b&gt;Thumb Color Overlay Effect&lt;/b&gt;"
109
+ description="thumb color overlay effect, release the overlay on mouseover and selected states">
110
+ </field>
111
+
112
+ <field type="bulk_control_start"
113
+ parent="thumb_color_overlay_effect"
114
+ ctype="show"
115
+ value="true"
116
+ />
117
+
118
+ <field name="thumb_overlay_color"
119
+ type="color"
120
+ default="#000000"
121
+ label="&amp;nbsp; Thumb Overlay Color"
122
+ description="thumb overlay color">
123
+ </field>
124
+
125
+ <field name="thumb_overlay_opacity"
126
+ type="text"
127
+ default="0.4"
128
+ label="&amp;nbsp; Thumb Overlay Opacity"
129
+ description="thumb overlay color opacity">
130
+ </field>
131
+
132
+ <field name="thumb_overlay_reverse"
133
+ type="boolean"
134
+ default="false"
135
+ label="&amp;nbsp; Thumb Overlay Reverse"
136
+ description="reverse the overlay, will be shown on selected state only">
137
+ </field>
138
+
139
+ <field type="bulk_control_end"/>
140
+
141
+ <field type="hr"></field>
142
+
143
+ <field name="thumb_image_overlay_effect"
144
+ type="boolean"
145
+ default="false"
146
+ label="&lt;b&gt;Thumb Image Overlay Effect&lt;/b&gt;"
147
+ description="images overlay effect on normal state only">
148
+ </field>
149
+
150
+ <field name="thumb_image_overlay_type"
151
+ type="list"
152
+ default="bw"
153
+ label="&amp;nbsp; Thumb Image Overlay Type"
154
+ description="the type of image effect overlay, black and white, sepia and blur.">
155
+ <option value="bw" text="Black and White"></option>
156
+ <option value="blur" text="Blur"></option>
157
+ <option value="sepia" text="Sepia"></option>
158
+ </field>
159
+
160
+ <field type="control"
161
+ parent="thumb_image_overlay_effect"
162
+ ctype="show"
163
+ child="thumb_image_overlay_type"
164
+ value="true"
165
+ />
166
+
167
+ <field type="hr"></field>
168
+
169
+ <field name="thumb_transition_duration"
170
+ type="text"
171
+ default="200"
172
+ label="Thumb Transition Duration"
173
+ unit="ms"
174
+ description="thumb effect transition duration">
175
+ </field>
176
+
177
+ <field name="thumb_transition_easing"
178
+ type="list"
179
+ default="easeOutQuad"
180
+ label="Thumb Transition Easing"
181
+ description="thumb effect transition easing"/>
182
+
183
+ <field type="hr"></field>
184
+
185
+ <field name="thumb_show_loader"
186
+ type="boolean"
187
+ default="true"
188
+ label="Thumb Show Loader"
189
+ description="show thumbnail loader">
190
+ </field>
191
+
192
+ <field name="thumb_loader_type"
193
+ type="list"
194
+ default="dark"
195
+ label="Thumb Loader Type"
196
+ description="the type of thumb loader">
197
+ <option value="dark" text="Dark"></option>
198
+ <option value="light" text="Light"></option>
199
+ </field>
200
+
201
+
202
+ </fieldset>
203
+
204
+ </fields>
helpers/settings/tiles_design.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ defined('UNITEGALLERY_INC') or die('Restricted access');
4
+
5
+ $settings = new UniteGallerySettingsUG();
6
+ $settings->loadXMLFile(GlobalsUG::$pathHelpersSettings."tiles_design.xml");
7
+
8
+
9
+
10
+ ?>
helpers/settings/tiles_design.xml ADDED
@@ -0,0 +1,331 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+
3
+ <fields>
4
+ <fieldset name="tile_design" label="Tile Design" icon="eg-icon-cog-alt">
5
+
6
+ <field name="tile_enable_action"
7
+ type="boolean"
8
+ default="true"
9
+ label="Enable Lightbox"
10
+ description="Enable lightbox on tile click">
11
+ </field>
12
+
13
+ <field name="tile_as_link"
14
+ type="boolean"
15
+ default="false"
16
+ label="&lt;b&gt;Tile As Link&lt;/b&gt;"
17
+ description="act the tile as link, no lightbox will appear"></field>
18
+
19
+ <field name="tile_link_newpage"
20
+ type="list"
21
+ default="true"
22
+ label="Open Link In"
23
+ description="open the tile link in new or same page">
24
+ <option value="true" text="New Page"></option>
25
+ <option value="false" text="Same Page"></option>
26
+ </field>
27
+
28
+ <field type="control"
29
+ parent="tile_as_link"
30
+ ctype="show"
31
+ child="tile_link_newpage"
32
+ value="true" />
33
+
34
+ <field type="hr"></field>
35
+
36
+ <field name="tile_enable_background"
37
+ type="boolean"
38
+ default="true"
39
+ label="&lt;b&gt;Enable Background&lt;/b&gt;"
40
+ description="Enable background of the tile">
41
+ </field>
42
+
43
+ <field name="tile_background_color"
44
+ type="color"
45
+ default="#f0f0f0"
46
+ label="&amp;nbsp; Tile Background Color"
47
+ description="The background color of the tile">
48
+ </field>
49
+
50
+ <field type="control"
51
+ parent="tile_enable_background"
52
+ ctype="show"
53
+ child="tile_background_color"
54
+ value="true"
55
+ />
56
+
57
+ <field type="hr"></field>
58
+
59
+ <field name="tile_enable_border"
60
+ type="boolean"
61
+ default="false"
62
+ label="&lt;b&gt;Enable Border&lt;/b&gt;"
63
+ description="enable border of the tile"></field>
64
+
65
+ <field type="bulk_control_start"
66
+ parent="tile_enable_border"
67
+ ctype="show"
68
+ value="true"
69
+ />
70
+
71
+ <field name="tile_border_width"
72
+ type="text"
73
+ default="3"
74
+ label="&amp;nbsp; Tile Border Width"
75
+ unit="px"
76
+ description="tile border width"></field>
77
+
78
+ <field name="tile_border_color"
79
+ type="color"
80
+ default="#f0f0f0"
81
+ label="&amp;nbsp; Tile Border Color"
82
+ description="tile border color"></field>
83
+
84
+ <field name="tile_border_radius"
85
+ type="text"
86
+ default="0"
87
+ label="&amp;nbsp; Tile Border Radius"
88
+ unit="px"
89
+ description="tile border radius (applied to border only, not to outline)"></field>
90
+
91
+ <field type="bulk_control_end"/>
92
+
93
+ <field type="hr"></field>
94
+
95
+ <field name="tile_enable_outline"
96
+ type="boolean"
97
+ default="false"
98
+ label="&lt;b&gt;Enable Outline&lt;/b&gt;"
99
+ description="enable outline of the tile - 1 pixel width only, (works only together with the border)"></field>
100
+
101
+ <field type="bulk_control_start"
102
+ parent="tile_enable_outline"
103
+ ctype="show"
104
+ value="true"/>
105
+
106
+ <field name="tile_outline_color"
107
+ type="color"
108
+ default="#8b8b8b"
109
+ label="&amp;nbsp; Tile Outline Color"
110
+ description="tile outline color"></field>
111
+
112
+ <field type="bulk_control_end"/>
113
+
114
+ <field type="hr"></field>
115
+
116
+ <field name="tile_enable_shadow"
117
+ type="boolean"
118
+ default="false"
119
+ label="&lt;b&gt;Enable Shadow&lt;/b&gt;"
120
+ description="enable shadow of the tile"></field>
121
+
122
+ <field type="bulk_control_start"
123
+ parent="tile_enable_shadow"
124
+ ctype="show"
125
+ value="true"/>
126
+
127
+ <field name="tile_shadow_h"
128
+ type="text"
129
+ default="1"
130
+ label="&amp;nbsp; Tile Shadow Pos Hor"
131
+ unit="px"
132
+ description="position of horizontal shadow"></field>
133
+
134
+ <field name="tile_shadow_v"
135
+ type="text"
136
+ default="1"
137
+ label="&amp;nbsp; Tile Shadow Pos Vert"
138
+ unit="px"
139
+ description="position of vertical shadow"></field>
140
+
141
+ <field name="tile_shadow_blur"
142
+ type="text"
143
+ default="3"
144
+ label="&amp;nbsp; Tile Shadow Blur"
145
+ description="shadow blur"></field>
146
+
147
+ <field name="tile_shadow_spread"
148
+ type="text"
149
+ default="2"
150
+ label="&amp;nbsp; Tile Shadow Spread"
151
+ description="shadow spread"></field>
152
+
153
+ <field name="tile_shadow_color"
154
+ type="color"
155
+ default="#8b8b8b"
156
+ label="&amp;nbsp; Tile Shadow Color"
157
+ description="shadow color"></field>
158
+
159
+ <field type="bulk_control_end"/>
160
+
161
+ <field type="hr"></field>
162
+
163
+ <field name="tile_enable_image_effect"
164
+ type="boolean"
165
+ default="false"
166
+ label="&lt;b&gt;Enable Image Effect&lt;/b&gt;"
167
+ description="enable tile image effect">
168
+ </field>
169
+
170
+ <field type="bulk_control_start"
171
+ parent="tile_enable_image_effect"
172
+ ctype="show"
173
+ value="true" />
174
+
175
+ <field name="tile_image_effect_type"
176
+ type="list"
177
+ default="bw"
178
+ label="&amp;nbsp; Tile Image Effect Type"
179
+ description="tile effect type">
180
+ <option value="bw" text="Black And White"></option>
181
+ <option value="blur" text="Blur"></option>
182
+ <option value="sepia" text="Sepia"></option>
183
+ </field>
184
+
185
+ <field name="tile_image_effect_reverse"
186
+ type="boolean"
187
+ default="false"
188
+ label="&amp;nbsp; Tile Effect Reverse"
189
+ description="reverce the image, set only on mouseover state"></field>
190
+
191
+ <field type="bulk_control_end"/>
192
+
193
+ <field type="hr"></field>
194
+
195
+ <field name="tile_enable_overlay"
196
+ type="boolean"
197
+ default="true"
198
+ label="&lt;b&gt;Enable Mouseover Overlay&lt;/b&gt;"
199
+ description="enable tile color overlay on mouseover"> </field>
200
+
201
+ <field type="bulk_control_start"
202
+ parent="tile_enable_overlay"
203
+ ctype="show"
204
+ value="true"/>
205
+
206
+ <field name="tile_overlay_opacity"
207
+ type="text"
208
+ default="0.4"
209
+ label="&amp;nbsp; Tile Overlay Opacity"
210
+ description="tile overlay opacity"></field>
211
+
212
+ <field name="tile_overlay_color"
213
+ type="color"
214
+ default="#000000"
215
+ label="&amp;nbsp; Tile Overlay Color"
216
+ description="tile overlay color"></field>
217
+
218
+ <field type="hr"></field>
219
+
220
+ <field type="bulk_control_end"/>
221
+
222
+ <field name="tile_enable_icons"
223
+ type="boolean"
224
+ default="true"
225
+ label="&lt;b&gt;Enable Icons On Mouseover&lt;/b&gt;"
226
+ description="enable icons in mouseover mode"></field>
227
+
228
+ <field type="bulk_control_start"
229
+ parent="tile_enable_icons"
230
+ ctype="show"
231
+ value="true"/>
232
+
233
+ <field name="tile_show_link_icon"
234
+ type="boolean"
235
+ default="false"
236
+ label="&amp;nbsp; Show Link Icon"
237
+ description="show link icon (if the tile has a link). Make the tile look as 'portfolio style' In case of 'Tile As Link' option not enabled">
238
+ </field>
239
+
240
+ <field name="tile_space_between_icons"
241
+ type="text"
242
+ default="26"
243
+ label="&amp;nbsp; Space Between Icons"
244
+ unit="px"
245
+ description="initial space between icons, (on small tiles it may change)"></field>
246
+
247
+ <field name="tile_videoplay_icon_always_on"
248
+ type="list"
249
+ default="never"
250
+ label="&amp;nbsp; Always Show Video Play Icon"
251
+ description="Always show the video play icon in case that the item is video. Not only on mouseover">
252
+ <option value="always" text="Always Show"></option>
253
+ <option value="never" text="Never Show"></option>
254
+ <option value="mobile_only" text="Show on Mobile Only"></option>
255
+ <option value="desktop_only" text="Show on Desktop Only"></option>
256
+ </field>
257
+
258
+ <field type="bulk_control_end"/>
259
+
260
+ <field type="hr"></field>
261
+
262
+ <field name="tile_enable_textpanel"
263
+ type="boolean"
264
+ default="false"
265
+ label="&lt;b&gt;Enable Tile Text Panel&lt;/b&gt;"
266
+ description="enable tile text panel"></field>
267
+
268
+ <field type="bulk_control_start"
269
+ parent="tile_enable_textpanel"
270
+ ctype="show"
271
+ value="true" />
272
+
273
+ <field name="tile_textpanel_source"
274
+ type="list"
275
+ default="title"
276
+ label="&amp;nbsp; Tile Text Panel Source"
277
+ description="The source of text panel. Description, Title type will show the description. If description is empty it will show the title.">
278
+ <option value="title" text="Title"></option>
279
+ <option value="desc" text="Description"></option>
280
+ <option value="desc_title" text="Description or Title (if desc empty)"></option>
281
+ <option value="title_and_desc" text="Title and Description"></option>
282
+ </field>
283
+
284
+ <field name="tile_textpanel_position"
285
+ type="list"
286
+ default="inside_bottom"
287
+ label="&amp;nbsp; Tile Text Panel Position"
288
+ description="Choose the text panel position for the tile. For the 'top/bottom' positions the text panel is always visible.">
289
+ <option value="inside_bottom" text="Inside Bottom"></option>
290
+ <option value="bottom" text="Bottom"></option>
291
+ <option value="inside_top" text="Inside Top"></option>
292
+ <option value="top" text="Top"></option>
293
+ <option value="middle" text="Middle"></option>
294
+ </field>
295
+
296
+ <field name="tile_textpanel_always_on"
297
+ type="boolean"
298
+ default="false"
299
+ label="&amp;nbsp; Tile Text Panel Always On"
300
+ description="Set tile text panel always visible"></field>
301
+
302
+ <field name="tile_textpanel_appear_type"
303
+ type="list"
304
+ default="slide"
305
+ label="&amp;nbsp; Tile Text Panel Appear Type"
306
+ description="The appear type of the text panel">
307
+ <option value="slide" text="Slide"></option>
308
+ <option value="fade" text="Fade"></option>
309
+ </field>
310
+
311
+ <field type="control"
312
+ parent="tile_textpanel_always_on"
313
+ ctype="enable"
314
+ child="tile_textpanel_appear_type"
315
+ value="false" />
316
+
317
+
318
+ <field type="bulk_control_end"/>
319
+
320
+ <field type="control"
321
+ parent="tile_textpanel_position"
322
+ ctype="disable"
323
+ child="tile_textpanel_always_on,tile_textpanel_appear_type"
324
+ value="top,bottom"
325
+ />
326
+
327
+
328
+
329
+ </fieldset>
330
+
331
+ </fields>
helpers/settings/tiles_textpanel.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ defined('UNITEGALLERY_INC') or die('Restricted access');
4
+
5
+
6
+ $settings = new UniteGallerySettingsUG();
7
+ $settings->loadXMLFile(GlobalsUG::$pathHelpersSettings."tiles_textpanel.xml");
8
+
9
+ $settings->updateSelectToAlignHor("tile_textpanel_title_text_align");
helpers/settings/tiles_textpanel.xml ADDED
@@ -0,0 +1,127 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+
3
+ <fields>
4
+
5
+ <fieldset name="tile_textpanel" label="Tile Text Panel Options" icon="eg-icon-cog-alt">
6
+
7
+ <field name="tile_textpanel_offset"
8
+ type="text"
9
+ default="0"
10
+ label="Text Panel Offset Vert"
11
+ unit="px"
12
+ description="Vertical offset for the textpanel. Works for inside position types.">
13
+ </field>
14
+
15
+ <field type="hr"></field>
16
+
17
+ <field name="tile_textpanel_padding_top"
18
+ type="text"
19
+ default="8"
20
+ label="Text Panel Padding Top"
21
+ unit="px"
22
+ description="textpanel padding top">
23
+ </field>
24
+
25
+ <field name="tile_textpanel_padding_bottom"
26
+ type="text"
27
+ default="8"
28
+ label="Text Panel Padding Bottom"
29
+ unit="px"
30
+ description="textpanel padding bottom">
31
+ </field>
32
+
33
+ <field name="tile_textpanel_padding_left"
34
+ type="text"
35
+ default="11"
36
+ label="Text Panel Padding Left"
37
+ unit="px"
38
+ description="cut some space for text from left">
39
+ </field>
40
+
41
+ <field name="tile_textpanel_padding_right"
42
+ type="text"
43
+ default="11"
44
+ label="Text Panel Padding Right"
45
+ unit="px"
46
+ description="cut some space for text from right">
47
+ </field>
48
+
49
+ <field type="hr"></field>
50
+
51
+ <field name="tile_textpanel_bg_color"
52
+ type="color"
53
+ default="#000000"
54
+ label="Text Panel Background Color"
55
+ description="textpanel background color">
56
+ </field>
57
+
58
+ <field name="tile_textpanel_bg_opacity"
59
+ type="text"
60
+ default="0.6"
61
+ label="Text Panel Background Opacity"
62
+ description="text panel background opacity">
63
+ </field>
64
+
65
+ <field type="hr"></field>
66
+
67
+ <field name="tile_textpanel_title_color"
68
+ type="color"
69
+ default="#ffffff"
70
+ label="Text Panel Text Color"
71
+ description="text panel text color, leave empty for default">
72
+ </field>
73
+
74
+ <field name="tile_textpanel_title_text_align"
75
+ type="list"
76
+ default="left"
77
+ label="Text Panel Text Align"
78
+ description="text panel text color, leave empty for default">
79
+ </field>
80
+
81
+ <field name="tile_textpanel_title_font_size"
82
+ type="text"
83
+ default="14"
84
+ label="Text Panel Font Size"
85
+ description="textg panel font size, leave empty for default"></field>
86
+
87
+ <field name="tile_textpanel_title_bold"
88
+ type="boolean"
89
+ default="true"
90
+ label="Text Panel Bold Text"
91
+ description="text panel bold text"></field>
92
+
93
+ <field name="tile_textpanel_additional_css"
94
+ type="textarea"
95
+ default=""
96
+ label="Text Panel Additional CSS"
97
+ description="textpanel additional css like font-family:verdana; text-style:inline;">
98
+ </field>
99
+
100
+ <field type="bulk_control_start"
101
+ parent="tile_textpanel_source"
102
+ ctype="show"
103
+ value="title_and_desc"
104
+ />
105
+
106
+ <field type="hr"></field>
107
+
108
+ <field name="tile_textpanel_desc_bold"
109
+ type="boolean"
110
+ default="false"
111
+ label="Text Panel Description Bold Text"
112
+ description="text panel description bold text"></field>
113
+
114
+ <field name="tile_textpanel_desc_additional_css"
115
+ type="textarea"
116
+ default=""
117
+ label="Text Panel Description Additional CSS"
118
+ description="textpanel additional css for description like font-family:verdana; text-style:inline;">
119
+ </field>
120
+
121
+
122
+ <field type="bulk_control_end"/>
123
+
124
+ </fieldset>
125
+
126
+
127
+ </fields>
helpers/settings/troubleshooting.php ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+
4
+ defined('UNITEGALLERY_INC') or die('Restricted access');
5
+
6
+
7
+ $settings = new UniteGallerySettingsUG();
8
+ $settings->loadXMLFile(GlobalsUG::$pathHelpersSettings."troubleshooting.xml");
9
+
10
+ if(method_exists("UniteProviderFunctionsUG", "modifyTroubleshooterSettings"))
11
+ $settings = UniteProviderFunctionsUG::modifyTroubleshooterSettings($settings);
12
+
13
+
14
+ ?>
helpers/settings/troubleshooting.xml ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+
3
+ <fields>
4
+
5
+ <fieldset name="advanced" label="Advanced" icon="eg-icon-cog-alt">
6
+
7
+ <field name="show_advanced_tab"
8
+ type="boolean"
9
+ default="false"
10
+ label="Show Advanced Tab"
11
+ description="Show advanced tab, at the top near settings/items/preview tabs where can be edited advanced scripts or styles to be add to the gallery">
12
+ </field>
13
+
14
+ </fieldset>
15
+ <fieldset name="troubleshooting" label="Troubleshooting" icon="eg-icon-cog-alt">
16
+
17
+ <field name="include_jquery"
18
+ type="boolean"
19
+ default="true"
20
+ label="Include jQuery Library"
21
+ description="Add include of jquery js. If you have jquery include in other module, and you don't want to double include, choose 'No'">
22
+ </field>
23
+
24
+ <field name="js_to_body"
25
+ type="boolean"
26
+ default="false"
27
+ label="Put JS Includes To Body"
28
+ description="Put the gallery javascript includes to body. This may help in situations when multiple jquery.js libraries are loaded.">
29
+ </field>
30
+
31
+ <field name="compress_output"
32
+ type="boolean"
33
+ default="false"
34
+ label="Compress Output"
35
+ description="Sometimes some output filters adds html tags at the html / javascript output. It breaks the gallery from appear. Try this option when you see weird code like output.">
36
+ </field>
37
+
38
+ <field name="gallery_debug_errors"
39
+ type="boolean"
40
+ default="false"
41
+ label="Debug Javascript Errors"
42
+ description="show error message when there is some error on the gallery area">
43
+ </field>
44
+
45
+ </fieldset>
46
+
47
+
48
+ </fields>
helpers/templates/gallery_advanced.php ADDED
@@ -0,0 +1,91 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+
4
+ defined('UNITEGALLERY_INC') or die('Restricted access');
5
+
6
+ require HelperGalleryUG::getPathHelperTemplate("header");
7
+
8
+ $selectedGalleryTab = "advanced";
9
+ require HelperGalleryUG::getPathHelperTemplate("gallery_edit_tabs");
10
+ $operations = new UGOperations();
11
+
12
+ ?>
13
+
14
+ <div class="settings_panel ug-settings-advanced">
15
+
16
+ <div class="settings_panel_left">
17
+
18
+ <div class="settings_panel_box settings_panel_single">
19
+
20
+ <?php $outputMain->draw("form_gallery_advanced_main",true)?>
21
+
22
+ <div class="vert_sap40"></div>
23
+
24
+ <div id="update_button_wrapper" class="update_button_wrapper">
25
+ <a class='unite-button-primary' href='javascript:void(0)' id="button_save_gallery" ><?php _e("Update Settings",UNITEGALLERY_TEXTDOMAIN); ?></a>
26
+ <div id="loader_update" class="loader_round" style="display:none;"><?php _e("Updating",UNITEGALLERY_TEXTDOMAIN); ?>...</div>
27
+ <div id="update_gallery_success" class="success_message" class="display:none;"></div>
28
+ </div>
29
+
30
+ <a id="button_close_gallery" class='unite-button-secondary float_left mleft_10' href='<?php echo HelperGalleryUG::getUrlViewGalleriesList() ?>' ><?php _e("Close",UNITEGALLERY_TEXTDOMAIN); ?></a>
31
+
32
+ <div class="vert_sap20"></div>
33
+
34
+ <div id="error_message_settings" class="unite_error_message" style="display:none"></div>
35
+
36
+ </div>
37
+ </div> <!-- settings panel left -->
38
+
39
+ <div class="settings_panel_right">
40
+ <?php $outputParams->draw("form_gallery_advanced_params",true); ?>
41
+ </div>
42
+
43
+ <div class="unite-clear"></div>
44
+
45
+ </div>
46
+
47
+ <div id="dialog_import_gallery" title="<?php _e("Import Gallery Settings",UNITEGALLERY_TEXTDOMAIN)?>" style="display:none;">
48
+ <br>
49
+ <div class="unite-dialog-desc">
50
+ <?php _e("To import the settings please select the gallery settings export file.",UNITEGALLERY_TEXTDOMAIN) ?>
51
+
52
+ <br>
53
+
54
+ <?php _e("Note, that the gallery global type (tiles / themes) should be the same.", UNITEGALLERY_TEXTDOMAIN)?>
55
+ <br><br>
56
+ <?php _e("Current settings will be replaced. All the settings from the left side (items category, gallery size) will remain unchanged.", UNITEGALLERY_TEXTDOMAIN)?>
57
+
58
+ <br><br>
59
+ <?php _e("File example: unitegallery_gallery1.txt",UNITEGALLERY_TEXTDOMAIN)?> </div>
60
+
61
+ <br>
62
+
63
+ <form action="<?php echo GlobalsUG::$url_ajax?>" enctype="multipart/form-data" method="post">
64
+
65
+ <?php $operations->putAjaxFormFields("import_gallery_settings",$galleryID)?>
66
+
67
+ <?php _e("Choose the export file:",UNITEGALLERY_TEXTDOMAIN)?>
68
+ <br><br>
69
+
70
+ <input type="file" name="export_file" class="ug-input-file">
71
+
72
+ <br><br>
73
+
74
+ <input type="submit" class='unite-button-primary' value="<?php _e("Import Settings",UNITEGALLERY_TEXTDOMAIN)?>">
75
+ </form>
76
+
77
+ <br><br>
78
+
79
+ </div>
80
+
81
+
82
+ <script type="text/javascript">
83
+
84
+ jQuery(document).ready(function(){
85
+ var linkExport = "<?php echo $linkExport?>";
86
+ var objAdmin = new UGAdmin();
87
+ objAdmin.initAdvancedView(linkExport);
88
+ });
89
+
90
+ </script>
91
+
helpers/templates/gallery_categorytabs.php ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+
4
+ defined('UNITEGALLERY_INC') or die('Restricted access');
5
+
6
+ require HelperGalleryUG::getPathHelperTemplate("header");
7
+
8
+ $selectedGalleryTab = "categorytabs";
9
+ require HelperGalleryUG::getPathHelperTemplate("gallery_edit_tabs");
10
+
11
+
12
+ ?>
13
+
14
+ <div class="settings_panel">
15
+
16
+ <div class="settings_panel_left">
17
+ <div class="settings_panel_left_inner settings_panel_box">
18
+
19
+ <?php $outputMain->draw("form_gallery_category_settings",true)?>
20
+
21
+ <div class="vert_sap20"></div>
22
+
23
+ <div>* The lite version has a limitation of 4 category tabs per gallery in output. <a target="_blank" href="https://codecanyon.net/item/unite-gallery-wordpress-gallery-plugin/10458750?ref=valiano">Get Full Version!</a> </div>
24
+
25
+ <div class="vert_sap40"></div>
26
+
27
+ <div id="update_button_wrapper" class="update_button_wrapper">
28
+ <a class='unite-button-primary' href='javascript:void(0)' id="button_save_gallery" ><?php _e("Update Settings",UNITEGALLERY_TEXTDOMAIN); ?></a>
29
+ <div id="loader_update" class="loader_round" style="display:none;"><?php _e("Updating",UNITEGALLERY_TEXTDOMAIN); ?>...</div>
30
+ <div id="update_gallery_success" class="success_message" class="display:none;"></div>
31
+ </div>
32
+
33
+ <a id="button_close_gallery" class='unite-button-secondary float_left mleft_10' href='<?php echo HelperGalleryUG::getUrlViewGalleriesList() ?>' ><?php _e("Close",UNITEGALLERY_TEXTDOMAIN); ?></a>
34
+
35
+ <div class="vert_sap20"></div>
36
+
37
+ <div id="error_message_settings" class="unite_error_message" style="display:none"></div>
38
+
39
+ </div>
40
+ </div>
41
+ <div class="settings_panel_right">
42
+ <?php $outputParams->draw("form_gallery_category_settings_params",true); ?>
43
+ </div>
44
+
45
+ <div class="unite-clear"></div>
46
+ </div>
47
+
48
+ <script type="text/javascript">
49
+
50
+ jQuery(document).ready(function(){
51
+ var objAdmin = new UGAdmin();
52
+ objAdmin.initCategoryTabsView();
53
+ });
54
+
55
+ </script>
56
+
helpers/templates/gallery_edit.php ADDED
@@ -0,0 +1,92 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ defined('UNITEGALLERY_INC') or die('Restricted access');
4
+
5
+ require HelperGalleryUG::getPathHelperTemplate("header");
6
+
7
+ $selectedGalleryTab = "settings";
8
+ require HelperGalleryUG::getPathHelperTemplate("gallery_edit_tabs")
9
+ ?>
10
+
11
+ <div class="settings_panel">
12
+
13
+ <div class="settings_panel_left">
14
+ <div class="settings_panel_left_inner settings_panel_box">
15
+ <?php $outputMain->draw("form_gallery_main",true)?>
16
+
17
+ <?php require HelperGalleryUG::getPathHelperTemplate("gallery_edit_buttons")?>
18
+ </div>
19
+ </div>
20
+ <div class="settings_panel_right">
21
+ <?php $outputParams->draw("form_gallery_params",true); ?>
22
+ </div>
23
+
24
+ <div class="unite-clear"></div>
25
+ </div>
26
+
27
+ <?php
28
+
29
+ if(method_exists("UniteProviderFunctionsUG", "dialogShortcodeReplace")):
30
+ UniteProviderFunctionsUG::dialogShortcodeReplace();
31
+ else:
32
+ ?>
33
+
34
+ <div id="dialog_shortcode" class="unite-inputs" title="<?php _e("Generate Shortcode",UNITEGALLERY_TEXTDOMAIN)?>" style="display:none;">
35
+ <br><br>
36
+
37
+ <div class="mbottom_5">
38
+ <?php _e("Generated shortcode for using with other categories",UNITEGALLERY_TEXTDOMAIN)?>:
39
+ </div>
40
+
41
+ <input id="ds_shortcode" type="text" class="input-regular input-readonly">
42
+
43
+ <div class="vert_sap20"></div>
44
+
45
+ <div class="mbottom_5">
46
+ <?php _e("Select category below", UNITEGALLERY_TEXTDOMAIN)?>:
47
+ </div>
48
+
49
+ <?php echo $htmlSelectCats?>
50
+ <div class="vert_sap20"></div>
51
+
52
+ </div>
53
+
54
+ <?php endif?>
55
+
56
+
57
+ <div id="ug_dialog_change_theme" class="dialog_new_gallery" title="<?php _e("Choose a gallery theme to change",UNITEGALLERY_TEXTDOMAIN)?>" style="display:none">
58
+ <div class="unite-admin unite-dialog-inside">
59
+ <ul id="ug_list_change_themes" class="list_galleries">
60
+ <?php foreach($arrGalleryTypes as $gallery):
61
+ $themeType = UniteFunctionsUG::getVal($gallery, "name");
62
+ $galleryTitle = UniteFunctionsUG::getVal($gallery, "title");
63
+
64
+ $classAdd = "";
65
+ if($themeType == $galleryType)
66
+ $classAdd = " button-disabled";
67
+
68
+ ?>
69
+ <li><a class="unite-button-secondary ug-link-theme <?php echo $classAdd?>" href="javascript:void(0)" data-name="<?php echo $themeType?>"><?php echo $galleryTitle?></a></li>
70
+ <?php endforeach;?>
71
+ </ul>
72
+ <div class="unite-clear"></div>
73
+
74
+ <br>
75
+
76
+ <div style="height:30px;">
77
+ <span id="ug_list_change_themes_loader" class="loader_text" style="display:none">Changing theme...</span>
78
+ <span id="ug_list_change_themes_error" class="unite-color-red" style="display:none"></span>
79
+ <span id="ug_list_change_themes_success" class="unite_success_message" style="display:none"></span>
80
+ </div>
81
+ </div>
82
+
83
+
84
+ <script type="text/javascript">
85
+
86
+ jQuery(document).ready(function(){
87
+ var objAdmin = new UGAdmin();
88
+ objAdmin.initCommonEditGalleryView();
89
+ });
90
+
91
+ </script>
92
+
helpers/templates/gallery_edit_buttons.php ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+
4
+ defined('UNITEGALLERY_INC') or die('Restricted access');
5
+
6
+ ?>
7
+ <div class="vert_sap40"></div>
8
+
9
+ <div id="update_button_wrapper" class="update_button_wrapper">
10
+ <a class='unite-button-primary' href='javascript:void(0)' id="button_save_gallery" ><?php _e("Update Gallery",UNITEGALLERY_TEXTDOMAIN); ?></a>
11
+ <div id="loader_update" class="loader_round" style="display:none;"><?php _e("Updating",UNITEGALLERY_TEXTDOMAIN); ?>...</div>
12
+ <div id="update_gallery_success" class="success_message" class="display:none;"></div>
13
+ </div>
14
+
15
+ <a id="button_delete_gallery" class='unite-button-secondary float_left mleft_10' href='javascript:void(0)' ><?php _e("Delete Gallery",UNITEGALLERY_TEXTDOMAIN); ?></a>
16
+
17
+ <a id="button_close_gallery" class='unite-button-secondary float_left mleft_10' href='<?php echo HelperGalleryUG::getUrlViewGalleriesList() ?>' ><?php _e("Close",UNITEGALLERY_TEXTDOMAIN); ?></a>
18
+
19
+ <div class="vert_sap20"></div>
20
+
21
+ <div id="error_message_settings" class="unite_error_message" style="display:none"></div>
22
+
helpers/templates/gallery_edit_tabs.php ADDED
@@ -0,0 +1,84 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ defined('UNITEGALLERY_INC') or die('Restricted access');
4
+
5
+ $classSettings = "";
6
+ $classItems = "";
7
+ $classCategoryTabs = "";
8
+ $classAdvanced = "";
9
+ $classPreview = "";
10
+
11
+ if(isset($selectedGalleryTab)){
12
+ switch($selectedGalleryTab){
13
+ default:
14
+ case "settings":
15
+ $classSettings = "class='selected'";
16
+ break;
17
+ case "items":
18
+ $classItems = "class='selected'";
19
+ break;
20
+ case "preview":
21
+ $classPreview = "class='selected'";
22
+ break;
23
+ case "categorytabs":
24
+ $classCategoryTabs = "selected";
25
+ break;
26
+ case "advanced":
27
+ $classAdvanced = "selected";
28
+ break;
29
+ }
30
+ }
31
+
32
+ //category tabs
33
+ $enableTabs = GlobalsUGGallery::$gallery->getParam("enable_category_tabs");
34
+ $enableTabs = UniteFunctionsUG::strToBool($enableTabs);
35
+
36
+ if($enableTabs == false){
37
+ $classCategoryTabs .= " unite-tab-hidden";
38
+ }
39
+
40
+ if(!empty($classCategoryTabs))
41
+ $classCategoryTabs = "class='{$classCategoryTabs}'";
42
+ //-------- advanced tab
43
+ $showAdvanced = GlobalsUGGallery::$gallery->getParam("show_advanced_tab");
44
+ $showAdvanced = UniteFunctionsUG::strToBool($showAdvanced);
45
+
46
+
47
+
48
+ if($showAdvanced == false){
49
+ $classAdvanced .= " unite-tab-hidden";
50
+ }
51
+ if(!empty($classAdvanced))
52
+ $classAdvanced = "class='{$classAdvanced}'";
53
+
54
+
55
+ ?>
56
+
57
+ <div class='settings_tabs'>
58
+ <ul class="list-tabs-settings">
59
+ <li <?php echo $classSettings?>>
60
+ <a href="<?php echo HelperGalleryUG::getUrlViewCurrentGallery()?>"><?php _e("Settings", UNITEGALLERY_TEXTDOMAIN)?></a>
61
+ </li>
62
+ <li id="tab_categorytabs_settings" <?php echo $classCategoryTabs?> >
63
+ <a href="<?php echo HelperGalleryUG::getUrlViewCategoryTabs()?>"><?php _e("Category Tabs Settings", UNITEGALLERY_TEXTDOMAIN)?></a>
64
+ </li>
65
+ <li id="tab_advanced_settings" <?php echo $classAdvanced?> >
66
+ <a href="<?php echo HelperGalleryUG::getUrlViewAdvanced()?>"><?php _e("Advanced", UNITEGALLERY_TEXTDOMAIN)?></a>
67
+ </li>
68
+ <li <?php echo $classItems?>>
69
+ <a href="<?php echo HelperGalleryUG::getUrlViewItems()?>"><?php _e("Items", UNITEGALLERY_TEXTDOMAIN)?></a>
70
+ </li>
71
+ <li <?php echo $classPreview?>>
72
+ <a href="<?php echo HelperGalleryUG::getUrlViewPreview()?>"><?php _e("Preview", UNITEGALLERY_TEXTDOMAIN)?></a>
73
+ </li>
74
+ </ul>
75
+
76
+ <div class='settings_limit_message'>
77
+ This gallery has limitations: <b> <?php echo $ugMaxItems?> items limit </b> in the preview and output.
78
+ <br>
79
+ For removing the limitations, upgrade to <b>"Unite Gallery Full Version"</b>.
80
+ &nbsp; <a href="https://codecanyon.net/item/unite-gallery-wordpress-gallery-plugin/10458750?ref=valiano" target="_blank">Get It Now!</a>
81
+ </div>
82
+
83
+ <div class="unite-clear"></div>
84
+ </div>
helpers/templates/gallery_new.php ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ defined('UNITEGALLERY_INC') or die('Restricted access');
4
+
5
+ ?>
6
+ <?php require HelperGalleryUG::getPathHelperTemplate("header"); ?>
7
+
8
+
9
+ <div class="settings_panel">
10
+
11
+ <div class="settings_panel_left">
12
+ <div class="settings_panel_left_inner settings_panel_box">
13
+ <?php $outputMain->draw("form_gallery_main",true)?>
14
+
15
+ <?php require HelperGalleryUG::getPathHelperTemplate("gallery_new_buttons")?>
16
+
17
+ </div>
18
+
19
+ </div>
20
+
21
+ <div class="settings_panel_right">
22
+ <?php //$outputParams->draw("form_gallery_params",true); ?>
23
+ </div>
24
+
25
+ <div class="unite-clear"></div>
26
+ </div>
27
+
28
+ <script type="text/javascript">
29
+
30
+ jQuery(document).ready(function(){
31
+
32
+ var objAdmin = new UGAdmin();
33
+ objAdmin.initCommonAddGalleryView();
34
+
35
+ });
36
+
37
+ </script>
38
+
helpers/templates/gallery_new_buttons.php ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ defined('UNITEGALLERY_INC') or die('Restricted access');
4
+
5
+ ?>
6
+ <div class="vert_sap40"></div>
7
+
8
+ <a id="button_save_gallery" class='unite-button-primary' href='javascript:void(0)' ><?php _e("Create Gallery",UNITEGALLERY_TEXTDOMAIN); ?></a>
9
+
10
+ <span class="hor_sap"></span>
11
+
12
+ <a class='unite-button-secondary' href='<?php echo HelperGalleryUG::getUrlViewGalleriesList() ?>' ><?php _e("Close",UNITEGALLERY_TEXTDOMAIN); ?></a>
13
+
14
+ <div class="vert_sap20"></div>
15
+
16
+ <div id="error_message_settings" class="unite_error_message" style="display:none"></div>
17
+
helpers/templates/header.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ defined('UNITEGALLERY_INC') or die('Restricted access');
4
+
5
+ // require $headerTitle variable
6
+
7
+ require HelperUG::getPathTemplate("header");
8
+
9
+ ?>
helpers/templates/index.html ADDED
File without changes
helpers/views/advanced.php ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ defined('UNITEGALLERY_INC') or die('Restricted access');
4
+
5
+ $galleryID = GlobalsUGGallery::$galleryID;
6
+
7
+ //add codemirror scripts
8
+ HelperUG::addScriptAbsoluteUrl(GlobalsUG::$urlPlugin."js/codemirror/codemirror.js", "codemirror_js");
9
+ HelperUG::addScriptAbsoluteUrl(GlobalsUG::$urlPlugin."js/codemirror/css.js", "codemirror_cssjs");
10
+ HelperUG::addScriptAbsoluteUrl(GlobalsUG::$urlPlugin."js/codemirror/javascript.js", "codemirror_jsjs");
11
+ HelperUG::addStyleAbsoluteUrl(GlobalsUG::$urlPlugin."js/codemirror/codemirror.css", "codemirror_css");
12
+
13
+ //enable advanced tab if disabled
14
+ $showAdvanced = GlobalsUGGallery::$gallery->getParam("show_advanced_tab");
15
+ $showAdvanced = UniteFunctionsUG::strToBool($showAdvanced);
16
+
17
+ if($showAdvanced == false){
18
+ GlobalsUGGallery::$gallery->updateParam("show_advanced_tab", "true");
19
+ }
20
+
21
+ require GlobalsUG::$pathHelpersSettings."advancedtab_main.php";
22
+ require GlobalsUG::$pathHelpersSettings."advancedtab_params.php";
23
+
24
+
25
+ $outputMain = new UniteSettingsProductUG();
26
+ $outputParams = new UniteSettingsProductSidebarUG();
27
+
28
+
29
+ $galleryTitle = GlobalsUGGallery::$gallery->getTitle();
30
+
31
+ $headerTitle = $galleryTitle . __(" - [advanced settings]",UNITEGALLERY_TEXTDOMAIN);
32
+
33
+ $arrValues = GlobalsUGGallery::$gallery->getParams();
34
+
35
+ //set setting values from the slider
36
+ $settingsMain->setStoredValues($arrValues);
37
+ $settingsParams->setStoredValues($arrValues);
38
+
39
+ $outputMain->init($settingsMain);
40
+ $outputParams->init($settingsParams);
41
+
42
+ $linkExport = HelperUG::getUrlAjaxActions("export_gallery_settings","galleryid={$galleryID}");
43
+
44
+
45
+ require HelperGalleryUG::getPathHelperTemplate("gallery_advanced");
46
+ ?>
helpers/views/categorytabs.php ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ defined('UNITEGALLERY_INC') or die('Restricted access');
4
+
5
+ //require settings
6
+ $galleryID = GlobalsUGGallery::$galleryID;
7
+
8
+ //enable tabs if disabled
9
+ $enableTabs = GlobalsUGGallery::$gallery->getParam("enable_category_tabs");
10
+ $enableTabs = UniteFunctionsUG::strToBool($enableTabs);
11
+
12
+ if($enableTabs == false){
13
+ GlobalsUGGallery::$gallery->updateParam("enable_category_tabs", "true");
14
+ }
15
+
16
+ require GlobalsUG::$pathHelpersSettings."categorytab_main.php";
17
+ require GlobalsUG::$pathHelpersSettings."categorytab_params.php";
18
+
19
+ $outputMain = new UniteSettingsProductUG();
20
+ $outputParams = new UniteSettingsProductSidebarUG();
21
+
22
+ $galleryTitle = GlobalsUGGallery::$gallery->getTitle();
23
+
24
+ $headerTitle = $galleryTitle . __(" - [settings]",UNITEGALLERY_TEXTDOMAIN);
25
+
26
+ $arrValues = GlobalsUGGallery::$gallery->getParams();
27
+
28
+ //set setting values from the slider
29
+ $settingsMain->setStoredValues($arrValues);
30
+ $settingsParams->setStoredValues($arrValues);
31
+
32
+ $outputMain->init($settingsMain);
33
+ $outputParams->init($settingsParams);
34
+ require HelperGalleryUG::getPathHelperTemplate("gallery_categorytabs");
35
+ ?>
helpers/views/index.html ADDED
File without changes
helpers/views/settings_common.php ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ defined('UNITEGALLERY_INC') or die('Restricted access');
4
+
5
+
6
+ //require settings
7
+ $galleryID = GlobalsUGGallery::$galleryID;
8
+ $isNewGallery = empty($galleryID);
9
+
10
+ require HelperGalleryUG::getFilepathSettings("gallery_settings");
11
+
12
+ $outputMain = new UniteSettingsProductUG();
13
+ $outputParams = new UniteSettingsProductSidebarUG();
14
+
15
+ $filepathBeforeDraw = HelperGalleryUG::getPathView("settings_before_draw", false);
16
+
17
+ if($isNewGallery){
18
+ $galleryTitle = GlobalsUGGallery::$galleryTypeTitle;
19
+ $headerTitle = $galleryTitle . __(" - [settings]",UNITEGALLERY_TEXTDOMAIN);
20
+
21
+ if(file_exists($filepathBeforeDraw))
22
+ require_once $filepathBeforeDraw;
23
+
24
+ $outputMain->init($settingsMain);
25
+ $outputParams->init($settingsParams);
26
+
27
+ require HelperGalleryUG::getPathHelperTemplate("gallery_new");
28
+
29
+ }else{
30
+
31
+ $objGalleries = new UniteGalleryGalleries();
32
+ $arrGalleryTypes = $objGalleries->getArrGalleryTypesShort();
33
+
34
+ $galleryTitle = GlobalsUGGallery::$gallery->getTitle();
35
+ $headerTitle = $galleryTitle . __(" - [settings]",UNITEGALLERY_TEXTDOMAIN);
36
+
37
+ $galleryType = GlobalsUGGallery::$gallery->getTypeName();
38
+
39
+ $arrValues = GlobalsUGGallery::$gallery->getParamsForSettings();
40
+
41
+ //get categories select dialog
42
+ $objCategories = new UniteGalleryCategories();
43
+ $arrCats = $objCategories->getCatsShort("component");
44
+ $htmlSelectCats = UniteFunctionsUG::getHTMLSelect($arrCats, "", "id='ds_select_cats'", true);
45
+
46
+ //set setting values from the slider
47
+ $settingsMain->setStoredValues($arrValues);
48
+ $settingsParams->setStoredValues($arrValues);
49
+
50
+ if(isset($filepathBeforeDraw) && file_exists($filepathBeforeDraw))
51
+ require_once $filepathBeforeDraw;
52
+
53
+ $outputMain->init($settingsMain);
54
+ $outputParams->init($settingsParams);
55
+
56
+ require HelperGalleryUG::getPathHelperTemplate("gallery_edit");
57
+ }
58
+
59
+ ?>
images/close.png ADDED
Binary file
images/delete.png ADDED
Binary file
images/duplicate.png ADDED
Binary file
images/edit.png ADDED
Binary file
images/eye.png ADDED
Binary file
images/eyes.png ADDED
Binary file
images/grain.png ADDED
Binary file
images/icon-16-unitegallery.png ADDED
Binary file
images/icon-general.png ADDED
Binary file
images/icon-jump-disabled.png ADDED
Binary file
images/icon-jump.png ADDED
Binary file
images/icon-position.png ADDED
Binary file
images/icon-preview.png ADDED
Binary file
images/icon-published.png ADDED
Binary file
images/icon-unpublished.png ADDED
Binary file
images/icon_drag.png ADDED
Binary file
images/icon_html5video_32.png ADDED
Binary file
images/icon_notdrag.png ADDED
Binary file
images/icon_vimeo.png ADDED
Binary file
images/icon_vimeo_32.png ADDED
Binary file
images/icon_wistia_32.png ADDED
Binary file
images/icon_youtube.png ADDED
Binary file
images/icon_youtube_32.png ADDED
Binary file
images/index.html ADDED
File without changes
images/loader-status.gif ADDED
Binary file
images/loader.gif ADDED
Binary file
images/preview.png ADDED
Binary file
images/red-grad.png ADDED
Binary file
images/timeline.png ADDED
Binary file
images/timerdot.png ADDED
Binary file
images/tipsy.gif ADDED
Binary file
images/trans_tile.png ADDED
Binary file
images/trans_tile2.png ADDED
Binary file
images/transparent.jpg ADDED
Binary file
images/transparent.png ADDED
Binary file
images/transtiled.png ADDED
Binary file
images/update.png ADDED
Binary file
images/white-grad.png ADDED
Binary file
images/wp-arrows.png ADDED
Binary file
inc_php/framework/base_admin.class.php ADDED
@@ -0,0 +1,165 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @package Unite Gallery
4
+ * @author Valiano
5
+ * @copyright (C) 2012 Unite CMS, All Rights Reserved.
6
+ * @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
7
+ * */
8
+ defined('UNITEGALLERY_INC') or die('Restricted access');
9
+
10
+
11
+ class UniteBaseAdminClassUG{
12
+
13
+ protected static $master_view;
14
+ public static $view;
15
+
16
+ private static $arrSettings = array();
17
+ private static $tempVars = array();
18
+
19
+
20
+ /**
21
+ *
22
+ * main constructor
23
+ */
24
+ public function __construct(){
25
+
26
+ $this->initView();
27
+
28
+ //self::addCommonScripts();
29
+ }
30
+
31
+ /**
32
+ *
33
+ * get path to settings file
34
+ * @param $settingsFile
35
+ */
36
+ protected static function getSettingsFilePath($settingsFile){
37
+
38
+ $filepath = self::$path_plugin."settings/$settingsFile.php";
39
+ return($filepath);
40
+ }
41
+
42
+
43
+ /**
44
+ *
45
+ * set the view from GET variables
46
+ */
47
+ private function initView(){
48
+
49
+ $defaultView = GlobalsUG::VIEW_DEFAULT;
50
+
51
+ //set view
52
+ $viewInput = UniteFunctionsUG::getGetVar("view");
53
+ $page = UniteFunctionsUG::getGetVar("page");
54
+
55
+ //get the view out of the page
56
+ if(strpos($page,"_") !== false){
57
+ $parts = explode("_", $page);
58
+ $view = $parts[1];
59
+ $page = $parts[0];
60
+ }
61
+
62
+ if(!empty($page) && $page != GlobalsUG::PLUGIN_NAME)
63
+ return(false);
64
+
65
+ if(!empty($viewInput))
66
+ $view = $viewInput;
67
+
68
+ if(empty($view)){
69
+ $view = $defaultView;
70
+ }
71
+
72
+ self::$view = $view;
73
+
74
+ }
75
+
76
+
77
+ /**
78
+ *
79
+ * add common used scripts
80
+ */
81
+ public static function addCommonScripts(){
82
+
83
+ UniteProviderFunctionsUG::addScriptsFramework();
84
+
85
+
86
+ HelperUG::addScriptCommon("settings","unite_settings");
87
+ HelperUG::addScriptCommon("admin","unite_admin");
88
+ HelperUG::addScriptCommon("jquery.tipsy","tipsy");
89
+ HelperUG::addScriptCommon("media_dialog","media_dialog");
90
+
91
+ HelperUG::addStyleCommon("admin","unite_admin");
92
+ HelperUG::addStyleCommon("tipsy","tipsy");
93
+ HelperUG::addStyleCommon("media_dialog","media_dialog");
94
+
95
+ //include farbtastic
96
+ HelperUG::addScriptCommon("farbtastic","farbtastic","js/farbtastic");
97
+ HelperUG::addStyleCommon("farbtastic","farbtastic","js/farbtastic");
98
+
99
+ //include fancybox
100
+ HelperUG::addScriptCommon("jquery.fancybox-1.3.4.pack","fancybox","js/fancybox");
101
+ HelperUG::addStyleCommon("jquery.fancybox-1.3.4","fancybox","js/fancybox");
102
+ }
103
+
104
+
105
+ /**
106
+ *
107
+ * set view that will be the master
108
+ */
109
+ protected static function setMasterView($masterView){
110
+ self::$master_view = $masterView;
111
+ }
112
+
113
+ /**
114
+ *
115
+ * inlcude some view file
116
+ */
117
+ protected static function requireView($view){
118
+ try{
119
+
120
+
121
+ //require master view file, and
122
+ if(!empty(self::$master_view) && !isset(self::$tempVars["is_masterView"]) ){
123
+ $masterViewFilepath = GlobalsUG::$pathViews.self::$master_view.".php";
124
+ UniteFunctionsUG::validateFilepath($masterViewFilepath,"Master View");
125
+
126
+ self::$tempVars["is_masterView"] = true;
127
+
128
+ require $masterViewFilepath;
129
+
130
+ }
131
+ else{ //simple require the view file.
132
+ $viewFilepath = GlobalsUG::$pathViews.$view.".php";
133
+
134
+ UniteFunctionsUG::validateFilepath($viewFilepath,"View");
135
+ require $viewFilepath;
136
+ }
137
+
138
+ }catch (Exception $e){
139
+ echo "<br><br>View ($view) Error: <b>".$e->getMessage()."</b>";
140
+
141
+ if(GlobalsUG::SHOW_TRACE == true)
142
+ dmp($e->getTraceAsString());
143
+ }
144
+ }
145
+
146
+
147
+ /**
148
+ *
149
+ * require settings file, the filename without .php
150
+ */
151
+ protected static function requireSettings($settingsFile){
152
+
153
+ try{
154
+ require self::$path_plugin."settings/$settingsFile.php";
155
+ }catch (Exception $e){
156
+ echo "<br><br>Settings ($settingsFile) Error: <b>".$e->getMessage()."</b>";
157
+ dmp($e->getTraceAsString());
158
+ }
159
+ }
160
+
161
+
162
+
163
+ }
164
+
165
+ ?>
inc_php/framework/base_output.class.php ADDED
@@ -0,0 +1,311 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @package Unite Gallery
4
+ * @author Valiano
5
+ * @copyright (C) 2012 Unite CMS, All Rights Reserved.
6
+ * @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
7
+ * */
8
+ defined('UNITEGALLERY_INC') or die('Restricted access');
9
+
10
+
11
+ class UniteOutputBaseUG{
12
+
13
+ protected $arrParams;
14
+ protected $arrOriginalParams; //params as they came originally from the database
15
+
16
+ protected $skipJsOptions = array();
17
+
18
+ const TYPE_NUMBER = "number";
19
+ const TYPE_BOOLEAN = "boolean";
20
+ const TYPE_OBJECT = "object";
21
+ const TYPE_SIZE = "size";
22
+
23
+ const VALIDATE_EXISTS = "validate";
24
+ const VALIDATE_NUMERIC = "numeric";
25
+ const VALIDATE_SIZE = "size";
26
+ const FORCE_NUMERIC = "force_numeric";
27
+ const FORCE_BOOLEAN = "force_boolean";
28
+ const FORCE_SIZE = "force_size";
29
+ const TRIM = "trim";
30
+
31
+ const LINE_PREFIX1 = "\n ";
32
+ const LINE_PREFIX2 = "\n ";
33
+ const LINE_PREFIX3 = "\n ";
34
+ const LINE_PREFIX4 = "\n ";
35
+ const BR = "\n";
36
+
37
+
38
+ /**
39
+ * add js option to skip
40
+ */
41
+ protected function addSkipJsOption($name){
42
+
43
+ $this->skipJsOptions[$name] = true;
44
+
45
+ }
46
+
47
+
48
+ /**
49
+ * check if some param exists in params array
50
+ */
51
+ protected function isParamExists($name){
52
+ $exists = array_key_exists($name, $this->arrParams);
53
+ return $exists;
54
+ }
55
+
56
+
57
+ /**
58
+ * return true if the param exists and not empty
59
+ */
60
+ protected function isParamExistsAndNotEmpty($name){
61
+ $exists = array_key_exists($name, $this->arrParams);
62
+
63
+ if($exists && $this->arrParams[$name] !== "")
64
+ return(true);
65
+
66
+ return false;
67
+ }
68
+
69
+
70
+ /**
71
+ * add some param to style array, if not exists and not emtpy
72
+ */
73
+ protected function addParamToStyleArray($arrStyle, $name, $attr, $suffix = "", $valiateMode = ""){
74
+
75
+ if($this->isParamExists($name) == false)
76
+ return($arrStyle);
77
+
78
+ $value = $this->getParam($name, $valiateMode);
79
+
80
+ $arrStyle[$attr] = $value.$suffix;
81
+
82
+ return($arrStyle);
83
+ }
84
+
85
+ /**
86
+ * add some param to style array, if not exists and not emtpy
87
+ */
88
+ protected function addParamToStyleArrayForce($arrStyle, $name, $attr, $suffix = "", $valiateMode = ""){
89
+
90
+ $value = $this->getParam($name, $valiateMode);
91
+
92
+ if(!empty($value))
93
+ $arrStyle[$attr] = $value.$suffix;
94
+
95
+ return($arrStyle);
96
+ }
97
+
98
+
99
+ /**
100
+ *
101
+ * get some param
102
+ */
103
+ protected function getParam($name, $validateMode = null){
104
+
105
+ if(is_array($this->arrParams) == false)
106
+ $this->arrParams = array();
107
+
108
+ if(array_key_exists($name, $this->arrParams)){
109
+ $arrParams = $this->arrParams;
110
+ $value = $this->arrParams[$name];
111
+ }
112
+ else{
113
+ if(is_array($this->arrOriginalParams) == false)
114
+ $this->arrOriginalParams = array();
115
+
116
+ $arrParams = $this->arrOriginalParams;
117
+ $value = UniteFunctionsUG::getVal($this->arrOriginalParams, $name);
118
+ }
119
+
120
+ switch ($validateMode) {
121
+ case self::VALIDATE_EXISTS:
122
+ if (array_key_exists($name, $arrParams) == false)
123
+ UniteFunctionsUG::throwError("The param: {$name} don't exists");
124
+ break;
125
+ case self::VALIDATE_NUMERIC:
126
+ if (is_numeric($value) == false)
127
+ UniteFunctionsUG::throwError("The param: {$name} is not numeric");
128
+ break;
129
+ case self::VALIDATE_SIZE:
130
+ if(strpos($value, "%") === false && is_numeric($value) == false)
131
+ UniteFunctionsUG::throwError("The param: {$name} is not size");
132
+ break;
133
+ case self::FORCE_SIZE:
134
+ $isPercent = (strpos($value, "%") !== false);
135
+ if($isPercent == false && is_numeric($value) == false)
136
+ UniteFunctionsUG::throwError("The param: {$name} is not size");
137
+
138
+ if($isPercent == false)
139
+ $value .= "px";
140
+ break;
141
+ case self::FORCE_NUMERIC:
142
+ $value = floatval($value);
143
+ $value = (double) $value;
144
+ break;
145
+ case self::FORCE_BOOLEAN:
146
+ $value = UniteFunctionsUG::strToBool($value);
147
+ break;
148
+ case self::TRIM:
149
+ $value = trim($value);
150
+ break;
151
+ }
152
+
153
+ return($value);
154
+ }
155
+
156
+
157
+ /**
158
+ * rename option (if source exists)
159
+ */
160
+ protected function renameOption($keySource, $keyDest, $deleteDestFirst = false){
161
+
162
+ if($deleteDestFirst == true){
163
+ if(array_key_exists($keyDest, $this->arrParams))
164
+ unset($this->arrParams[$keyDest]);
165
+ }
166
+
167
+ if(array_key_exists($keySource, $this->arrParams)){
168
+
169
+ $this->arrParams[$keyDest] = $this->arrParams[$keySource];
170
+ unset($this->arrParams[$keySource]);
171
+ }
172
+
173
+ }
174
+
175
+
176
+
177
+ /**
178
+ * delete options from keys array
179
+ */
180
+ protected function deleteOptions($arrKeys){
181
+
182
+ foreach($arrKeys as $key){
183
+ $this->deleteOption($key);
184
+ }
185
+
186
+ }
187
+
188
+
189
+ /**
190
+ * delete some option if exists
191
+ */
192
+ protected function deleteOption($key){
193
+
194
+ if(array_key_exists($key, $this->arrParams))
195
+ unset($this->arrParams[$key]);
196
+ }
197
+
198
+
199
+ /**
200
+ * build javascript param
201
+ */
202
+ protected function buildJsParam($paramName, $validate = null, $type = null){
203
+
204
+ if(array_key_exists($paramName, $this->arrJsParamsAssoc))
205
+ UniteFunctionsUG::throwError("Unable to biuld js param: <b>$paramName</b> already exists");
206
+
207
+ $output = array("name"=>$paramName, "validate"=>$validate, "type"=>$type);
208
+
209
+ $this->arrJsParamsAssoc[$paramName] = true;
210
+
211
+ return($output);
212
+ }
213
+
214
+
215
+ /**
216
+ * build and get js settings
217
+ */
218
+ protected function buildJsParams(){
219
+
220
+ $arrJsParams = $this->getArrJsOptions();
221
+ $jsOutput = "";
222
+ $counter = 0;
223
+ $tabs = " ";
224
+
225
+ foreach($arrJsParams as $arrParam){
226
+ $name = $arrParam["name"];
227
+ $validate = $arrParam["validate"];
228
+ $type = $arrParam["type"];
229
+
230
+ if(array_key_exists($name, $this->skipJsOptions) == true)
231
+ continue;
232
+
233
+ if($this->isParamExists($name)){
234
+ $value = $this->getParam($name, $validate);
235
+
236
+ $putInBrackets = false;
237
+ switch($type){
238
+ case self::TYPE_NUMBER:
239
+ case self::TYPE_BOOLEAN:
240
+ case self::TYPE_OBJECT:
241
+ break;
242
+ case self::TYPE_SIZE:
243
+ if(strpos($value, "%") !== 0)
244
+ $putInBrackets = true;
245
+ break;
246
+ default: //string
247
+ $putInBrackets = true;
248
+ break;
249
+ }
250
+
251
+ if($putInBrackets == true){
252
+ $value = str_replace('"','\\"', $value);
253
+ $value = '"'.$value.'"';
254
+ }
255
+
256
+ if($counter > 0)
257
+ $jsOutput .= ",\n".$tabs;
258
+ $jsOutput .= "{$name}:{$value}";
259
+
260
+ $counter++;
261
+ }
262
+ }
263
+
264
+ $jsOutput .= "\n";
265
+
266
+ return($jsOutput);
267
+ }
268
+
269
+
270
+ /**
271
+ * get string from position options
272
+ */
273
+ protected function getPositionString(){
274
+
275
+ $position = $this->getParam("position");
276
+
277
+ $wrapperStyle = "";
278
+
279
+ if($position == "center")
280
+ $wrapperStyle .= "margin:0px auto;";
281
+
282
+
283
+ //add left / right margin
284
+ if($position != "center"){
285
+ $marginLeft = $this->getParam("margin_left", self::FORCE_NUMERIC);
286
+ $marginRight = $this->getParam("margin_right", self::FORCE_NUMERIC);
287
+
288
+ if($marginLeft != 0)
289
+ $wrapperStyle .= "margin-left:{$marginLeft}px;";
290
+
291
+ if($marginRight != 0)
292
+ $wrapperStyle .= "margin-right:{$marginRight}px;";
293
+
294
+ }
295
+
296
+ //add top / bottom margin
297
+ $marginTop = $this->getParam("margin_top", self::FORCE_NUMERIC);
298
+ $marginBottom = $this->getParam("margin_bottom", self::FORCE_NUMERIC);
299
+
300
+ if($marginTop != 0)
301
+ $wrapperStyle .= "margin-top:{$marginTop}px;";
302
+
303
+ if($marginBottom != 0)
304
+ $wrapperStyle .= "margin-bottom:{$marginBottom}px;";
305
+
306
+ return($wrapperStyle);
307
+ }
308
+
309
+
310
+ }
311
+ ?>
inc_php/framework/cssparser.class.php ADDED
@@ -0,0 +1,270 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @package Unite Gallery
4
+ * @author Valiano
5
+ * @copyright (C) 2012 Unite CMS, All Rights Reserved.
6
+ * @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
7
+ * */
8
+ defined('UNITEGALLERY_INC') or die('Restricted access');
9
+
10
+
11
+ class UniteCssParserUG{
12
+
13
+ private $cssContent;
14
+
15
+ public function __construct(){
16
+
17
+ }
18
+
19
+ /**
20
+ *
21
+ * init the parser, set css content
22
+ */
23
+ public function initContent($cssContent){
24
+ $this->cssContent = $cssContent;
25
+ }
26
+
27
+
28
+ /**
29
+ *
30
+ * get array of slide classes, between two sections.
31
+ */
32
+ public function getArrClasses($startText = "",$endText=""){
33
+
34
+ $content = $this->cssContent;
35
+
36
+ //trim from top
37
+ if(!empty($startText)){
38
+ $posStart = strpos($content, $startText);
39
+ if($posStart !== false)
40
+ $content = substr($content, $posStart,strlen($content)-$posStart);
41
+ }
42
+
43
+ //trim from bottom
44
+ if(!empty($endText)){
45
+ $posEnd = strpos($content, $endText);
46
+ if($posEnd !== false)
47
+ $content = substr($content,0,$posEnd);
48
+ }
49
+
50
+ //get styles
51
+ $lines = explode("\n",$content);
52
+ $arrClasses = array();
53
+ foreach($lines as $key=>$line){
54
+ $line = trim($line);
55
+
56
+ if(strpos($line, "{") === false)
57
+ continue;
58
+
59
+ //skip unnessasary links
60
+ if(strpos($line, ".caption a") !== false)
61
+ continue;
62
+
63
+ if(strpos($line, ".tp-caption a") !== false)
64
+ continue;
65
+
66
+ //get style out of the line
67
+ $class = str_replace("{", "", $line);
68
+ $class = trim($class);
69
+
70
+ //skip captions like this: .tp-caption.imageclass img
71
+ if(strpos($class," ") !== false)
72
+ continue;
73
+
74
+ //skip captions like this: .tp-caption.imageclass:hover, :before, :after
75
+ if(strpos($class,":") !== false)
76
+ continue;
77
+
78
+ $class = str_replace(".caption.", ".", $class);
79
+ $class = str_replace(".tp-caption.", ".", $class);
80
+
81
+ $class = str_replace(".", "", $class);
82
+ $class = trim($class);
83
+ $arrWords = explode(" ", $class);
84
+ $class = $arrWords[count($arrWords)-1];
85
+ $class = trim($class);
86
+
87
+ $arrClasses[] = $class;
88
+ }
89
+
90
+ sort($arrClasses);
91
+
92
+ return($arrClasses);
93
+ }
94
+
95
+ public static function parseCssToArray($css){
96
+
97
+ while(strpos($css, '/*') !== false){
98
+ if(strpos($css, '*/') === false) return false;
99
+ $start = strpos($css, '/*');
100
+ $end = strpos($css, '*/') + 2;
101
+ $css = str_replace(substr($css, $start, $end - $start), '', $css);
102
+ }
103
+
104
+ preg_match_all( '/(?ims)([a-z0-9\s\.\:#_\-@]+)\{([^\}]*)\}/', $css, $arr);
105
+
106
+ $result = array();
107
+ foreach ($arr[0] as $i => $x){
108
+ $selector = trim($arr[1][$i]);
109
+ if(strpos($selector, '{') !== false || strpos($selector, '}') !== false) return false;
110
+ $rules = explode(';', trim($arr[2][$i]));
111
+ $result[$selector] = array();
112
+ foreach ($rules as $strRule){
113
+ if (!empty($strRule)){
114
+ $rule = explode(":", $strRule);
115
+ if(strpos($rule[0], '{') !== false || strpos($rule[0], '}') !== false || strpos($rule[1], '{') !== false || strpos($rule[1], '}') !== false) return false;
116
+
117
+ //put back everything but not $rule[0];
118
+ $key = trim($rule[0]);
119
+ unset($rule[0]);
120
+ $values = implode(':', $rule);
121
+
122
+ $result[$selector][trim($key)] = trim(str_replace("'", '"', $values));
123
+ }
124
+ }
125
+ }
126
+ return($result);
127
+ }
128
+
129
+ public static function parseDbArrayToCss($cssArray, $nl = "\n\r"){
130
+
131
+ //dmp($cssArray);exit();
132
+
133
+ $css = '';
134
+ foreach($cssArray as $id => $attr){
135
+
136
+ $params = $attr['params'];
137
+
138
+ $styles = json_decode($params);
139
+
140
+ if(empty($styles))
141
+ $styles = json_decode($params);
142
+
143
+ if(!empty($styles))
144
+ $styles = (array)$styles;
145
+
146
+ //$styles = json_decode(str_replace("'", '"', $attr['params']), true);
147
+ $css.= $attr['handle']." {".$nl;
148
+ if(is_array($styles)){
149
+ foreach($styles as $name => $style){
150
+ $css.= $name.':'.$style.";".$nl;
151
+ }
152
+ }
153
+ $css.= "}".$nl.$nl;
154
+
155
+ //add hover
156
+ $setting = json_decode($attr['settings'], true);
157
+ if(@$setting['hover'] == 'true'){
158
+ $hover = json_decode($attr['hover'], true);
159
+ if(is_array($hover)){
160
+ $css.= $attr['handle'].":hover {".$nl;
161
+ foreach($hover as $name => $style){
162
+ $css.= $name.':'.$style.";".$nl;
163
+ }
164
+ $css.= "}".$nl.$nl;
165
+ }
166
+ }
167
+ }
168
+ return $css;
169
+ }
170
+
171
+ public static function parseArrayToCss($cssArray, $nl = "\n\r"){
172
+ $css = '';
173
+ foreach($cssArray as $id => $attr){
174
+ $styles = (array)$attr['params'];
175
+ $css.= $attr['handle']." {".$nl;
176
+ if(is_array($styles) && !empty($styles)){
177
+ foreach($styles as $name => $style){
178
+ if($name == 'background-color' && strpos($style, 'rgba') !== false){ //rgb && rgba
179
+ $rgb = explode(',', str_replace('rgba', 'rgb', $style));
180
+ unset($rgb[count($rgb)-1]);
181
+ $rgb = implode(',', $rgb).')';
182
+ $css.= $name.':'.$rgb.";".$nl;
183
+ }
184
+ $css.= $name.':'.$style.";".$nl;
185
+ }
186
+ }
187
+ $css.= "}".$nl.$nl;
188
+
189
+ //add hover
190
+ $setting = (array)$attr['settings'];
191
+ if(@$setting['hover'] == 'true'){
192
+ $hover = (array)$attr['hover'];
193
+ if(is_array($hover)){
194
+ $css.= $attr['handle'].":hover {".$nl;
195
+ foreach($hover as $name => $style){
196
+ if($name == 'background-color' && strpos($style, 'rgba') !== false){ //rgb && rgba
197
+ $rgb = explode(',', str_replace('rgba', 'rgb', $style));
198
+ unset($rgb[count($rgb)-1]);
199
+ $rgb = implode(',', $rgb).')';
200
+ $css.= $name.':'.$rgb.";".$nl;
201
+ }
202
+ $css.= $name.':'.$style.";".$nl;
203
+ }
204
+ $css.= "}".$nl.$nl;
205
+ }
206
+ }
207
+ }
208
+ return $css;
209
+ }
210
+
211
+
212
+ public static function parseStaticArrayToCss($cssArray, $nl = "\n"){
213
+ $css = '';
214
+ foreach($cssArray as $class => $styles){
215
+ $css.= $class." {".$nl;
216
+ if(is_array($styles) && !empty($styles)){
217
+ foreach($styles as $name => $style){
218
+ $css.= $name.':'.$style.";".$nl;
219
+ }
220
+ }
221
+ $css.= "}".$nl.$nl;
222
+ }
223
+ return $css;
224
+ }
225
+
226
+ public static function parseDbArrayToArray($cssArray, $handle = false){
227
+
228
+ if(!is_array($cssArray) || empty($cssArray)) return false;
229
+
230
+ foreach($cssArray as $key => $css){
231
+ if($handle != false){
232
+ if($cssArray[$key]['handle'] == '.tp-caption.'.$handle){
233
+ $cssArray[$key]['params'] = json_decode($css['params']);
234
+ $cssArray[$key]['hover'] = json_decode($css['hover']);
235
+ $cssArray[$key]['settings'] = json_decode($css['settings']);
236
+ return $cssArray[$key];
237
+ }else{
238
+ unset($cssArray[$key]);
239
+ }
240
+ }else{
241
+ $cssArray[$key]['params'] = json_decode($css['params']);
242
+ $cssArray[$key]['hover'] = json_decode($css['hover']);
243
+ $cssArray[$key]['settings'] = json_decode($css['settings']);
244
+ }
245
+ }
246
+
247
+
248
+ return $cssArray;
249
+ }
250
+
251
+
252
+ public static function compress_css($buffer){
253
+ /* remove comments */
254
+ $buffer = preg_replace("!/\*[^*]*\*+([^/][^*]*\*+)*/!", "", $buffer) ;
255
+ /* remove tabs, spaces, newlines, etc. */
256
+ $arr = array("\r\n", "\r", "\n", "\t", " ", " ", " ");
257
+ $rep = array("", "", "", "", " ", " ", " ");
258
+ $buffer = str_replace($arr, $rep, $buffer);
259
+ /* remove whitespaces around {}:, */
260
+ $buffer = preg_replace("/\s*([\{\}:,])\s*/", "$1", $buffer);
261
+ /* remove last ; */
262
+ $buffer = str_replace(';}', "}", $buffer);
263
+
264
+ return $buffer;
265
+ }
266
+
267
+
268
+ }
269
+
270
+ ?>
inc_php/framework/db.class.php ADDED
@@ -0,0 +1,437 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+
4
+ defined('UNITEGALLERY_INC') or die('Restricted access');
5
+
6
+
7
+ class UniteGalleryDB{
8
+
9
+ const ISNULL = "dbisnull";
10
+
11
+ private $pdb;
12
+ private $lastRowID;
13
+
14
+
15
+ /**
16
+ *
17
+ * constructor - set database object
18
+ */
19
+ public function __construct(){
20
+ $this->pdb = new UniteProviderDBUG();
21
+ }
22
+
23
+ /**
24
+ *
25
+ * throw error
26
+ */
27
+ private function throwError($message,$code=-1){
28
+ UniteFunctionsUG::throwError($message,$code);
29
+ }
30
+
31
+
32
+ /**
33
+ * validate for errors
34
+ * @param unknown_type $prefix
35
+ */
36
+ private function checkForErrors($prefix = ""){
37
+
38
+ $message = $this->pdb->getErrorMsg();
39
+
40
+ if(empty($message))
41
+ return(false);
42
+
43
+ if(!empty($prefix))
44
+ $message = $prefix." ".$message;
45
+
46
+ $errorNum = $this->pdb->getErrorNum();
47
+
48
+ $this->throwError($message, $errorNum);
49
+ }
50
+
51
+
52
+ /**
53
+ *
54
+ * insert variables to some table
55
+ */
56
+ public function insert($tableName, $arrItems){
57
+
58
+ if(method_exists($this->pdb, "insert")){
59
+ $this->lastRowID = $this->pdb->insert($tableName, $arrItems);
60
+ return($this->lastRowID);
61
+ }
62
+
63
+
64
+ $strFields = "";
65
+ $strValues = "";
66
+ foreach($arrItems as $field=>$value){
67
+ $value = "'".$this->escape($value)."'";
68
+ if($field == "id") continue;
69
+ if($strFields != "") $strFields .= ",";
70
+ if($strValues != "") $strValues .= ",";
71
+ $strFields .= $field;
72
+ $strValues .= $value;
73
+ }
74
+
75
+ $insertQuery = "insert into $tableName($strFields) values($strValues)";
76
+
77
+ $this->runSql($insertQuery,"insert");
78
+ $this->lastRowID = $this->pdb->insertid();
79
+
80
+ return($this->lastRowID);
81
+ }
82
+
83
+
84
+ /**
85
+ *
86
+ * get last insert id
87
+ */
88
+ public function getLastInsertID(){
89
+ $this->lastRowID = $this->pdb->insertid();
90
+ return($this->lastRowID);
91
+ }
92
+
93
+
94
+ /**
95
+ *
96
+ * delete rows
97
+ */
98
+ public function delete($table,$where){
99
+
100
+ UniteFunctionsUG::validateNotEmpty($table,"table name");
101
+ UniteFunctionsUG::validateNotEmpty($where,"where");
102
+
103
+ if(method_exists($this->pdb, "delete")){
104
+ $numRows = $this->pdb->delete($table, $where);
105
+ return($numRows);
106
+ }
107
+
108
+ if(is_array($where))
109
+ $where = $this->getWhereString($where);
110
+
111
+ $query = "delete from $table where $where";
112
+
113
+ $success = $this->runSql($query, "delete error");
114
+ return($success);
115
+ }
116
+
117
+
118
+ /**
119
+ * get "where" query part
120
+ */
121
+ private function getQueryPart_where($where = ""){
122
+
123
+ if($where){
124
+
125
+ if(is_array($where))
126
+ $where = $this->getWhereString($where);
127
+
128
+ $where = " where $where";
129
+ }
130
+
131
+ return($where);
132
+ }
133
+
134
+
135
+ /**
136
+ *
137
+ * get where string from where array
138
+ */
139
+ private function getWhereString($where){
140
+ $where_format = null;
141
+
142
+ foreach ( $where as $key=>$value ) {
143
+
144
+ if($value == self::ISNULL){
145
+ $wheres[] = "($key = '' or $key is null)";
146
+ continue;
147
+ }
148
+
149
+ if(is_numeric($value) == false){
150
+ $value = $this->escape($value);
151
+ $value = "'$value'";
152
+ }
153
+
154
+ $wheres[] = "$key = {$value}";
155
+ }
156
+
157
+ $strWhere = implode( ' AND ', $wheres );
158
+
159
+ return($strWhere);
160
+ }
161
+
162
+
163
+ /**
164
+ *
165
+ * insert variables to some table
166
+ */
167
+ public function update($tableName,$arrData,$where){
168
+
169
+ if(method_exists($this->pdb, "update")){
170
+
171
+ $numRows = $this->pdb->update($tableName, $arrData, $where);
172
+
173
+ return($numRows);
174
+ }
175
+
176
+ UniteFunctionsUG::validateNotEmpty($tableName,"table cannot be empty");
177
+ UniteFunctionsUG::validateNotEmpty($where,"where cannot be empty");
178
+
179
+ if(is_array($where))
180
+ $where = $this->getWhereString($where);
181
+
182
+ $strFields = "";
183
+ foreach($arrData as $field=>$value){
184
+ $value = "'".$this->escape($value)."'";
185
+ if($strFields != "") $strFields .= ",";
186
+ $strFields .= "$field=$value";
187
+ }
188
+
189
+ $updateQuery = "update $tableName set $strFields where $where";
190
+
191
+ //$updateQuery = "update #__revslider_css set params='{\"font-size\":\"50px\",\"line-height\":\"67px\",\"font-weight\":\"700\",\"font-family\":\"\'Roboto\', sans-serif\",\"color\":\"#ffffff\",\"text-decoration\":\"none\",\"background-color\":\"rgba(141, 68, 173, 0.65)\",\"padding\":\"0px 15px 5px 15px\",\"border-width\":\"0px\",\"border-color\":\"rgb(34, 34, 34)\",\"border-style\":\"none\"}',hover='\"\"',settings='{\"hover\":\"false\"}' where handle = '.tp-caption.roboto'";
192
+
193
+ $numRows = $this->runSql($updateQuery, "update error");
194
+
195
+ //dmp($updateQuery);dmp($numRows);exit();
196
+
197
+ return($numRows);
198
+ }
199
+
200
+
201
+ /**
202
+ *
203
+ * run some sql query
204
+ */
205
+ public function runSql($query){
206
+
207
+ $response = $this->pdb->query($query);
208
+
209
+ $this->checkForErrors("Regular query error");
210
+
211
+ return($response);
212
+ }
213
+
214
+
215
+
216
+ /**
217
+ *
218
+ * escape data to avoid sql errors and injections.
219
+ */
220
+ public function escape($string){
221
+ $newString = $this->pdb->escape($string);
222
+ return($newString);
223
+ }
224
+
225
+
226
+ public function a______________FETCH_____________(){}
227
+
228
+
229
+ /**
230
+ * create fetch query
231
+ */
232
+ private function createFetchQuery($tableName, $fields=null, $where="", $orderField="", $groupByField="", $sqlAddon=""){
233
+
234
+ if(empty($fields)){
235
+ $fields = "*";
236
+ }else{
237
+ if(is_array($fields))
238
+ $fields = implode(",", $fields);
239
+ }
240
+
241
+ $query = "select $fields from $tableName";
242
+
243
+ $where = $this->getQueryPart_where($where);
244
+
245
+ if(!empty($where))
246
+ $query .= $where;
247
+
248
+ if($orderField){
249
+ $orderField = $this->escape($orderField);
250
+ $query .= " order by $orderField";
251
+ }
252
+
253
+ if($groupByField){
254
+ $groupByField = $this->escape($groupByField);
255
+ $query .= " group by $groupByField";
256
+ }
257
+
258
+ if($sqlAddon)
259
+ $query .= " ".$sqlAddon;
260
+
261
+ return($query);
262
+ }
263
+
264
+
265
+
266
+ /**
267
+ *
268
+ * fetch rows from sql query
269
+ */
270
+ public function fetchSql($query){
271
+
272
+ $rows = $this->pdb->fetchSql($query);
273
+
274
+ $this->checkForErrors("fetch");
275
+
276
+ $rows = UniteFunctionsUG::convertStdClassToArray($rows);
277
+
278
+ return($rows);
279
+ }
280
+
281
+
282
+ /**
283
+ *
284
+ * get row wp emulator
285
+ */
286
+ public function get_row($query = null){
287
+
288
+ $rows = $this->pdb->fetchSql($query);
289
+
290
+ $this->checkForErrors("get_row");
291
+
292
+ if(count($rows) == 1)
293
+ $result = $rows[0];
294
+ else
295
+ $result = $rows;
296
+
297
+ return($result);
298
+ }
299
+
300
+
301
+ /**
302
+ * get total rows
303
+ */
304
+ public function getTotalRows($tableName, $where=""){
305
+
306
+ $where = $this->getQueryPart_where($where);
307
+
308
+ $query = "select count(*) as numrows from $tableName".$where;
309
+
310
+ $response = $this->fetchSql($query);
311
+
312
+ $totalRows = $response[0]["numrows"];
313
+
314
+ return($totalRows);
315
+ }
316
+
317
+
318
+ /**
319
+ *
320
+ * fetch only one item. if not found - throw error
321
+ */
322
+ public function fetchSingle($tableName,$where="",$orderField="",$groupByField="",$sqlAddon=""){
323
+ $response = $this->fetch($tableName, $where, $orderField, $groupByField, $sqlAddon);
324
+ if(empty($response))
325
+ $this->throwError("Record not found");
326
+ $record = $response[0];
327
+ return($record);
328
+ }
329
+
330
+
331
+
332
+
333
+ /**
334
+ *
335
+ * get data array from the database
336
+ * pagingOptions - page, inpage
337
+ */
338
+ public function fetchPage($tableName, $pagingOptions, $where="", $orderField="", $groupByField="", $sqlAddon=""){
339
+
340
+ $page = UniteFunctionsUG::getVal($pagingOptions, "page");
341
+ $rowsInPage = UniteFunctionsUG::getVal($pagingOptions, "inpage");
342
+
343
+
344
+ //valdiate and sanitize
345
+ UniteFunctionsUG::validateNumeric($page);
346
+ UniteFunctionsUG::validateNumeric($rowsInPage);
347
+ UniteFunctionsUG::validateNotEmpty($rowsInPage);
348
+ if($page < 1)
349
+ $page = 1;
350
+
351
+ //get total
352
+ $totalRows = $this->getTotalRows($tableName);
353
+ $numPages = $pages = ceil($totalRows / $rowsInPage);
354
+
355
+ //build query
356
+ $offset = ($page - 1) * $rowsInPage;
357
+
358
+ $query = $this->createFetchQuery($tableName, null, $where, $orderField, $groupByField, $sqlAddon);
359
+
360
+ $query .= " limit $rowsInPage offset $offset";
361
+
362
+ $rows = $this->fetchSql($query);
363
+
364
+ //output response
365
+ $response = array();
366
+ $response["total"] = $totalRows;
367
+ $response["page"] = $page;
368
+ $response["num_pages"] = $numPages;
369
+ $response["inpage"] = $rowsInPage;
370
+
371
+ $response["rows"] = $rows;
372
+
373
+ return($response);
374
+ }
375
+
376
+
377
+ /**
378
+ *
379
+ * get data array from the database
380
+ * pagingOptions - page, inpage
381
+ */
382
+ public function fetchOffset($tableName, $offset, $numRecords, $where="", $orderField="", $groupByField="", $sqlAddon=""){
383
+
384
+ //valdiate and sanitize
385
+ UniteFunctionsUG::validateNumeric($offset);
386
+ UniteFunctionsUG::validateNumeric($numRecords);
387
+ UniteFunctionsUG::validateNotEmpty($numRecords);
388
+
389
+ if($offset < 0)
390
+ UniteFunctionsUG::throwError("The offset can't be negative");
391
+
392
+ if($numRecords < 0)
393
+ UniteFunctionsUG::throwError("The number of records can't be negative");
394
+
395
+
396
+ $query = $this->createFetchQuery($tableName, null, $where, $orderField, $groupByField, $sqlAddon);
397
+
398
+ $query .= " limit $numRecords offset $offset";
399
+
400
+ $rows = $this->fetchSql($query);
401
+
402
+ return($rows);
403
+ }
404
+
405
+ /**
406
+ *
407
+ * get data array from the database
408
+ *
409
+ */
410
+ public function fetch($tableName, $where="", $orderField="", $groupByField="", $sqlAddon=""){
411
+
412
+ $query = $this->createFetchQuery($tableName, null, $where, $orderField, $groupByField, $sqlAddon);
413
+
414
+ $rows = $this->fetchSql($query);
415
+
416
+ return($rows);
417
+ }
418
+
419
+
420
+ /**
421
+ * fields could be array or string comma saparated
422
+ */
423
+ public function fetchFields($tableName, $fields, $where="", $orderField="", $groupByField="", $sqlAddon=""){
424
+
425
+ $query = $this->createFetchQuery($tableName, $fields, $where, $orderField, $groupByField, $sqlAddon);
426
+
427
+ $rows = $this->fetchSql($query);
428
+
429
+ return($rows);
430
+ }
431
+
432
+
433
+
434
+
435
+ }
436
+
437
+ ?>
inc_php/framework/elements_base.class.php ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @package Unite Gallery
4
+ * @author Valiano
5
+ * @copyright (C) 2012 Unite CMS, All Rights Reserved.
6
+ * @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
7
+ * */
8
+ defined('UNITEGALLERY_INC') or die('Restricted access');
9
+
10
+
11
+ class UniteElementsBaseUG{
12
+
13
+ protected $db;
14
+ protected $imageView;
15
+
16
+ public function __construct(){
17
+
18
+ $this->db = new UniteGalleryDB();
19
+ $this->imageView = new UniteImageViewUG();
20
+
21
+ }
22
+
23
+ }
24
+
25
+ ?>
inc_php/framework/functions.class.php ADDED
@@ -0,0 +1,1026 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @package Unite Gallery
4
+ * @author Valiano
5
+ * @copyright (C) 2012 Unite CMS, All Rights Reserved.
6
+ * @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
7
+ * */
8
+ defined('UNITEGALLERY_INC') or die('Restricted access');
9
+
10
+
11
+ class UniteFunctionsUG{
12
+
13
+ const VALIDATE_NUMERIC = "numeric";
14
+ const VALIDATE_NUMERIC_OR_EMPTY = "numeric_orempty";
15
+ const VALIDATE_NOT_EMPTY = "notempty";
16
+ const VALIDATE_ALPHANUMERIC = "alphanumeric";
17
+ const FORCE_NUMERIC = "force_numeric";
18
+
19
+ const SANITIZE_ID = "sanitize_id"; //positive number or empty
20
+ const SANITIZE_TEXT_FIELD = "sanitize_text_field";
21
+ const SANITIZE_KEY = "sanitize_key";
22
+ const SANITIZE_NOTHING = "sanitize_nothing";
23
+
24
+
25
+
26
+ public static function throwError($message,$code=null){
27
+ if(!empty($code))
28
+ throw new Exception($message);
29
+ else
30
+ throw new Exception($message);
31
+ }
32
+
33
+
34
+ /**
35
+ * get variable from post or from get. get wins
36
+ */
37
+ public static function getPostGetVariable($name, $initVar = "", $sanitizeType = null){
38
+
39
+ $var = $initVar;
40
+
41
+ if(isset($_POST[$name]))
42
+ $var = $_POST[$name];
43
+ else
44
+ if(isset($_GET[$name])) $var = $_GET[$name];
45
+
46
+ $var = UniteProviderFunctionsUG::sanitizeVar($var, $sanitizeType);
47
+
48
+ return($var);
49
+ }
50
+
51
+
52
+ /**
53
+ * get post variable
54
+ */
55
+ public static function getPostVariable($name, $initVar = "", $sanitizeType = null){
56
+
57
+ $var = $initVar;
58
+
59
+ if(isset($_POST[$name]))
60
+ $var = $_POST[$name];
61
+
62
+ $var = UniteProviderFunctionsUG::sanitizeVar($var, $sanitizeType);
63
+
64
+ return($var);
65
+ }
66
+
67
+
68
+ /**
69
+ * get get variable
70
+ */
71
+ public static function getGetVar($name, $initVar = "", $sanitizeType = null){
72
+
73
+ $var = $initVar;
74
+
75
+ if(isset($_GET[$name]))
76
+ $var = $_GET[$name];
77
+
78
+ $var = UniteProviderFunctionsUG::sanitizeVar($var, $sanitizeType);
79
+
80
+
81
+ return($var);
82
+ }
83
+
84
+
85
+ public static function z________________ARRAYS_______________(){}
86
+
87
+
88
+ /**
89
+ * get value from array. if not - return alternative
90
+ */
91
+ public static function getVal($arr, $key, $altVal="", $validateType = null){
92
+
93
+ $var = "";
94
+
95
+ if(isset($arr[$key])){
96
+
97
+ $var = $arr[$key];
98
+
99
+ if(!empty($validateType))
100
+ $var = self::validateVar($var, $name, $validateType);
101
+
102
+ return($var);
103
+ }
104
+
105
+ return($altVal);
106
+ }
107
+
108
+
109
+ /**
110
+ * get first not empty key from array
111
+ */
112
+ public static function getFirstNotEmptyKey($arr){
113
+
114
+ foreach($arr as $key=>$item){
115
+ if(!empty($key) && is_numeric($key))
116
+ return($key);
117
+ }
118
+
119
+ return("");
120
+ }
121
+
122
+
123
+ /**
124
+ * filter array, leaving only needed fields - also array
125
+ *
126
+ */
127
+ public static function filterArrFields($arr, $fields, $isFieldsAssoc = false){
128
+ $arrNew = array();
129
+
130
+ if($isFieldsAssoc == false){
131
+ foreach($fields as $field){
132
+ if(array_key_exists($field, $arr))
133
+ $arrNew[$field] = $arr[$field];
134
+ }
135
+ }else{
136
+ foreach($fields as $field=>$value){
137
+ if(array_key_exists($field, $arr))
138
+ $arrNew[$field] = $arr[$field];
139
+ }
140
+ }
141
+
142
+ return($arrNew);
143
+ }
144
+
145
+ /**
146
+ * Convert std class to array, with all sons
147
+ */
148
+ public static function convertStdClassToArray($d){
149
+
150
+ if (is_object($d)) {
151
+ $d = get_object_vars($d);
152
+ }
153
+ if (is_array($d)){
154
+
155
+ return array_map(array("UniteFunctionsUG","convertStdClassToArray"), $d);
156
+ } else {
157
+ return $d;
158
+ }
159
+ }
160
+
161
+ /**
162
+ *
163
+ * get random array item
164
+ */
165
+ public static function getRandomArrayItem($arr){
166
+ $numItems = count($arr);
167
+ $rand = rand(0, $numItems-1);
168
+ $item = $arr[$rand];
169
+ return($item);
170
+ }
171
+
172
+ /**
173
+ * get different values in $arr from the default $arrDefault
174
+ * $arrMustKeys - keys that must be in the output
175
+ *
176
+ */
177
+ public static function getDiffArrItems($arr, $arrDefault, $arrMustKeys = array()){
178
+
179
+ if(gettype($arrDefault) != "array")
180
+ return($arr);
181
+
182
+ if(!empty($arrMustKeys))
183
+ $arrMustKeys = UniteFunctionsUG::arrayToAssoc($arrMustKeys);
184
+
185
+ $arrValues = array();
186
+ foreach($arr as $key => $value){
187
+
188
+ //treat must value
189
+ if(array_key_exists($key, $arrMustKeys) == true){
190
+ $arrValues[$key] = self::getVal($arrDefault, $key);
191
+ if(array_key_exists($key, $arr) == true)
192
+ $arrValues[$key] = $arr[$key];
193
+ continue;
194
+ }
195
+
196
+ if(array_key_exists($key, $arrDefault) == false){
197
+ $arrValues[$key] = $value;
198
+ continue;
199
+ }
200
+
201
+ $defaultValue = $arrDefault[$key];
202
+ if($defaultValue != $value){
203
+ $arrValues[$key] = $value;
204
+ continue;
205
+ }
206
+
207
+ }
208
+
209
+ return($arrValues);
210
+ }
211
+
212
+ /**
213
+ *
214
+ * Convert array to assoc array by some field
215
+ */
216
+ public static function arrayToAssoc($arr,$field=null){
217
+ $arrAssoc = array();
218
+
219
+ foreach($arr as $item){
220
+ if(empty($field))
221
+ $arrAssoc[$item] = $item;
222
+ else
223
+ $arrAssoc[$item[$field]] = $item;
224
+ }
225
+
226
+ return($arrAssoc);
227
+ }
228
+
229
+
230
+ /**
231
+ *
232
+ * convert assoc array to array
233
+ */
234
+ public static function assocToArray($assoc){
235
+ $arr = array();
236
+ foreach($assoc as $item)
237
+ $arr[] = $item;
238
+
239
+ return($arr);
240
+ }
241
+
242
+ /**
243
+ *
244
+ * do "trim" operation on all array items.
245
+ */
246
+ public static function trimArrayItems($arr){
247
+ if(gettype($arr) != "array")
248
+ UniteFunctionsUG::throwError("trimArrayItems error: The type must be array");
249
+
250
+ foreach ($arr as $key=>$item)
251
+ $arr[$key] = trim($item);
252
+
253
+ return($arr);
254
+ }
255
+
256
+ /**
257
+ *
258
+ * encode array into json for client side
259
+ */
260
+ public static function jsonEncodeForClientSide($arr){
261
+ $json = "";
262
+ if(!empty($arr)){
263
+ $json = json_encode($arr);
264
+ $json = addslashes($json);
265
+ }
266
+
267
+ $json = "'".$json."'";
268
+
269
+ return($json);
270
+ }
271
+
272
+ public static function z______________STRINGS_____________(){}
273
+
274
+ /**
275
+ * get random string
276
+ */
277
+ public static function getRandomString($length = 10){
278
+
279
+ $characters = '0123456789abcdefghijklmnopqrstuvwxyz';
280
+ $randomString = '';
281
+
282
+ for ($i = 0; $i < $length; $i++) {
283
+ $randomString .= $characters[rand(0, strlen($characters) - 1)];
284
+ }
285
+
286
+ return $randomString;
287
+ }
288
+
289
+ /**
290
+ * limit string chars to max size
291
+ */
292
+ public static function limitStringSize($str, $numChars, $addDots = true){
293
+
294
+ $encoding = "UTF-8";
295
+
296
+ if(function_exists("mb_strlen") == false)
297
+ return($str);
298
+
299
+ if(mb_strlen($str, $encoding) <= $numChars)
300
+ return($str);
301
+
302
+ if($addDots)
303
+ $str = mb_substr($str, 0, $numChars-3, $encoding)."...";
304
+ else
305
+ $str = mb_substr($str, 0, $numChars, $encoding);
306
+
307
+
308
+ return($str);
309
+ }
310
+
311
+
312
+ /**
313
+ * print string as chars - compare strings
314
+ */
315
+ public static function printStringChars($str, $str2 = ""){
316
+ $len = strlen($str);
317
+ for($i=0;$i<$len;$i++){
318
+ $chr = $str[$i];
319
+ $num = ord($chr);
320
+ $output = "$chr $num";
321
+ if(!empty($str2)){
322
+ if(!isset($str2[$i]))
323
+ $output .= " -- not exists";
324
+ else{
325
+ $chr = $str2[$i];
326
+ $num = ord($chr);
327
+ $output .= " -- $chr $num";
328
+ }
329
+ }
330
+ dmp($output);
331
+ }
332
+ }
333
+ /**
334
+ * add prefix to each line in string
335
+ */
336
+ public static function addPrefixToEachLine($str, $prefix){
337
+
338
+ if(empty($str))
339
+ return($str);
340
+
341
+ $arr = explode("\n", $str);
342
+ foreach($arr as $key=>$line){
343
+ $trimmed = trim($line);
344
+ if(empty($trimmed))
345
+ continue;
346
+ $arr[$key] = $prefix.$line;
347
+ }
348
+
349
+ $str = implode("\n", $arr);
350
+ return($str);
351
+ }
352
+
353
+ public static function z______________VALIDATIONS_____________(){}
354
+
355
+ /**
356
+ *
357
+ * validate that some file exists, if not - throw error
358
+ */
359
+ public static function validateFilepath($filepath,$errorPrefix=null){
360
+ if(file_exists($filepath) == true)
361
+ return(false);
362
+ if($errorPrefix == null)
363
+ $errorPrefix = "File";
364
+ $message = $errorPrefix." $filepath not exists!";
365
+ self::throwError($message);
366
+ }
367
+
368
+ /**
369
+ *
370
+ * validate that some directory exists, if not - throw error
371
+ */
372
+ public static function validateDir($pathDir, $errorPrefix=null){
373
+ if(is_dir($pathDir) == true)
374
+ return(false);
375
+
376
+ if($errorPrefix == null)
377
+ $errorPrefix = "Directory";
378
+ $message = $errorPrefix." $pathDir not exists!";
379
+ self::throwError($message);
380
+ }
381
+
382
+
383
+ /**
384
+ *
385
+ * validate if some directory is writable, if not - throw a exception
386
+ */
387
+ private static function validateWritable($name,$path,$strList,$validateExists = true){
388
+
389
+ if($validateExists == true){
390
+ //if the file/directory doesn't exists - throw an error.
391
+ if(file_exists($path) == false)
392
+ throw new Exception("$name doesn't exists");
393
+ }
394
+ else{
395
+ //if the file not exists - don't check. it will be created.
396
+ if(file_exists($path) == false) return(false);
397
+ }
398
+
399
+ if(is_writable($path) == false){
400
+ chmod($path,0755); //try to change the permissions
401
+ if(is_writable($path) == false){
402
+ $strType = "Folder";
403
+ if(is_file($path)) $strType = "File";
404
+ $message = "$strType $name is doesn't have a write permissions. Those folders/files must have a write permissions in order that this application will work properly: $strList";
405
+ throw new Exception($message);
406
+ }
407
+ }
408
+ }
409
+
410
+
411
+ /**
412
+ * validate some variable
413
+ */
414
+ public static function validateVar($val, $fieldName, $validateType){
415
+
416
+ switch($validateType){
417
+ case self::VALIDATE_NOT_EMPTY:
418
+ self::validateNotEmpty($val, $fieldName);
419
+ break;
420
+ case self::VALIDATE_NUMERIC:
421
+ self::validateNumeric($val, $fieldName);
422
+ break;
423
+ case self::VALIDATE_NUMERIC_OR_EMPTY:
424
+ if(!empty($val))
425
+ self::validateNumeric($val, $fieldName);
426
+ break;
427
+ case self::FORCE_NUMERIC:
428
+ $val = (float)$val;
429
+ break;
430
+ case self::VALIDATE_ALPHANUMERIC:
431
+ self::validateAlphaNumeric($val, $fieldName);
432
+ break;
433
+ }
434
+
435
+ return($val);
436
+ }
437
+
438
+
439
+ /**
440
+ *
441
+ * validate that some value is numeric
442
+ */
443
+ public static function validateNumeric($val,$fieldName=""){
444
+ self::validateNotEmpty($val,$fieldName);
445
+
446
+ if(empty($fieldName))
447
+ $fieldName = "Field";
448
+
449
+ if(!is_numeric($val))
450
+ self::throwError("$fieldName should be numeric ");
451
+ }
452
+
453
+ /**
454
+ *
455
+ * validate that some variable not empty
456
+ */
457
+ public static function validateNotEmpty($val, $fieldName=""){
458
+
459
+ if(empty($fieldName))
460
+ $fieldName = "Field";
461
+
462
+ if(empty($val) && is_numeric($val) == false)
463
+ self::throwError("Field <b>$fieldName</b> should not be empty");
464
+ }
465
+
466
+
467
+ /**
468
+ * validate that the variable is alphanumeric
469
+ */
470
+ public static function validateAlphaNumeric($val, $fieldName=""){
471
+
472
+ if(empty($val))
473
+ return(true);
474
+
475
+ if(empty($fieldName))
476
+ $fieldName = "Field";
477
+
478
+ if(ctype_alnum($val) == false)
479
+ self::throwError("Field <b>$fieldName</b> has wrong characters");
480
+ }
481
+
482
+ /**
483
+ * check the php version. throw exception if the version beneath 5
484
+ */
485
+ private static function validatePHPVersion(){
486
+ $strVersion = phpversion();
487
+ $version = (float)$strVersion;
488
+ if($version < 5)
489
+ self::throwError("You must have php5 and higher in order to run the application. Your php version is: $version");
490
+ }
491
+
492
+
493
+ //--------------------------------------------------------------
494
+ // valiadte if gd exists. if not - throw exception
495
+ public static function validateGD(){
496
+ if(function_exists('gd_info') == false)
497
+ throw new Exception("You need GD library to be available in order to run this application. Please turn it on in php.ini");
498
+ }
499
+
500
+
501
+
502
+ /**
503
+ *
504
+ * convert php array to js array text
505
+ * like item:"value"
506
+ */
507
+ public static function phpArrayToJsArrayText($arr){
508
+ $str = "";
509
+ $length = count($arr);
510
+
511
+ $counter = 0;
512
+ foreach($arr as $key=>$value){
513
+ $str .= "{$key}:\"{$value}\"";
514
+ $counter ++;
515
+ if($counter != $length)
516
+ $str .= ",\n";
517
+ }
518
+
519
+ return($str);
520
+ }
521
+
522
+
523
+ /**
524
+ * convert array with styles in each item to items string
525
+ */
526
+ public static function arrStyleToStrStyle($arrStyle, $styleName = "", $addCss = ""){
527
+
528
+ if(empty($arrStyle) && empty($addCss))
529
+ return("");
530
+
531
+ $br = "\n";
532
+ $tab = " ";
533
+
534
+ $output = $br;
535
+
536
+ if(!empty($styleName))
537
+ $output .= $styleName."{".$br;
538
+
539
+ foreach($arrStyle as $key=>$value){
540
+ $output .= $tab.$key.":".$value.";".$br;
541
+ }
542
+
543
+ //add additional css
544
+ if(!empty($addCss)){
545
+ $arrAddCss = explode($br, $addCss);
546
+ $output .= $br;
547
+ foreach($arrAddCss as $str){
548
+ $output .= $tab.$str.$br;
549
+ }
550
+ }
551
+
552
+ if(!empty($styleName))
553
+ $output .= "}".$br;
554
+
555
+ return($output);
556
+ }
557
+
558
+
559
+ public static function z______________FILE_SYSTEM_____________(){}
560
+
561
+ /**
562
+ *
563
+ * if directory not exists - create it
564
+ * @param $dir
565
+ */
566
+ public static function checkCreateDir($dir){
567
+ if(!is_dir($dir))
568
+ mkdir($dir);
569
+ }
570
+
571
+
572
+ //------------------------------------------------------------
573
+ //get path info of certain path with all needed fields
574
+ public static function getPathInfo($filepath){
575
+ $info = pathinfo($filepath);
576
+
577
+ //fix the filename problem
578
+ if(!isset($info["filename"])){
579
+ $filename = $info["basename"];
580
+ if(isset($info["extension"]))
581
+ $filename = substr($info["basename"],0,(-strlen($info["extension"])-1));
582
+ $info["filename"] = $filename;
583
+ }
584
+
585
+ return($info);
586
+ }
587
+
588
+
589
+
590
+ //------------------------------------------------------------
591
+ //save some file to the filesystem with some text
592
+ public static function writeFile($str,$filepath){
593
+ $fp = fopen($filepath,"w+");
594
+ fwrite($fp,$str);
595
+ fclose($fp);
596
+ }
597
+
598
+ /**
599
+ *
600
+ * get list of all files in the directory
601
+ */
602
+ public static function getFileList($path){
603
+ $dir = scandir($path);
604
+ $arrFiles = array();
605
+ foreach($dir as $file){
606
+ if($file == "." || $file == "..") continue;
607
+ $filepath = $path . "/" . $file;
608
+ if(is_file($filepath)) $arrFiles[] = $file;
609
+ }
610
+ return($arrFiles);
611
+ }
612
+
613
+ /**
614
+ *
615
+ * get list of all directories in the directory
616
+ */
617
+ public static function getDirList($path){
618
+ $arrDirs = scandir($path);
619
+
620
+ $arrFiles = array();
621
+ foreach($arrDirs as $dir){
622
+ if($dir == "." || $dir == "..")
623
+ continue;
624
+ $dirpath = $path . "/" . $dir;
625
+
626
+ if(is_dir($dirpath))
627
+ $arrFiles[] = $dir;
628
+ }
629
+
630
+ return($arrFiles);
631
+ }
632
+
633
+
634
+ /**
635
+ *
636
+ * clear debug file
637
+ */
638
+ public static function clearDebug($filepath = "debug.txt"){
639
+
640
+ if(file_exists($filepath))
641
+ unlink($filepath);
642
+ }
643
+
644
+ /**
645
+ *
646
+ * save to filesystem the error
647
+ */
648
+ public static function writeDebugError(Exception $e,$filepath = "debug.txt"){
649
+ $message = $e->getMessage();
650
+ $trace = $e->getTraceAsString();
651
+
652
+ $output = $message."\n";
653
+ $output .= $trace."\n";
654
+
655
+ $fp = fopen($filepath,"a+");
656
+ fwrite($fp,$output);
657
+ fclose($fp);
658
+ }
659
+
660
+
661
+ //------------------------------------------------------------
662
+ //save some file to the filesystem with some text
663
+ public static function addToFile($str,$filepath){
664
+ $fp = fopen($filepath,"a+");
665
+ fwrite($fp,"---------------------\n");
666
+ fwrite($fp,$str."\n");
667
+ fclose($fp);
668
+ }
669
+
670
+
671
+ /**
672
+ *
673
+ * recursive delete directory or file
674
+ */
675
+ public static function deleteDir($path,$deleteOriginal = true, $arrNotDeleted = array(),$originalPath = ""){
676
+
677
+ if(empty($originalPath))
678
+ $originalPath = $path;
679
+
680
+ //in case of paths array
681
+ if(getType($path) == "array"){
682
+ $arrPaths = $path;
683
+ foreach($path as $singlePath)
684
+ $arrNotDeleted = self::deleteDir($singlePath,$deleteOriginal,$arrNotDeleted,$originalPath);
685
+ return($arrNotDeleted);
686
+ }
687
+
688
+ if(!file_exists($path))
689
+ return($arrNotDeleted);
690
+
691
+ if(is_file($path)){ // delete file
692
+ $deleted = unlink($path);
693
+ if(!$deleted)
694
+ $arrNotDeleted[] = $path;
695
+ }
696
+ else{ //delete directory
697
+ $arrPaths = scandir($path);
698
+ foreach($arrPaths as $file){
699
+ if($file == "." || $file == "..")
700
+ continue;
701
+ $filepath = realpath($path."/".$file);
702
+ $arrNotDeleted = self::deleteDir($filepath,$deleteOriginal,$arrNotDeleted,$originalPath);
703
+ }
704
+
705
+ if($deleteOriginal == true || $originalPath != $path){
706
+ $deleted = @rmdir($path);
707
+ if(!$deleted)
708
+ $arrNotDeleted[] = $path;
709
+ }
710
+
711
+ }
712
+
713
+ return($arrNotDeleted);
714
+ }
715
+
716
+ /**
717
+ * copy folder to another location.
718
+ *
719
+ */
720
+ public static function copyDir($source,$dest,$rel_path = "",$blackList = null){
721
+
722
+ $full_source = $source;
723
+ if(!empty($rel_path))
724
+ $full_source = $source."/".$rel_path;
725
+
726
+ $full_dest = $dest;
727
+ if(!empty($full_dest))
728
+ $full_dest = $dest."/".$rel_path;
729
+
730
+ if(!is_dir($full_source))
731
+ self::throwError("The source directroy: '$full_source' not exists.");
732
+
733
+ if(!is_dir($full_dest))
734
+ mkdir($full_dest);
735
+
736
+ $files = scandir($full_source);
737
+ foreach($files as $file){
738
+ if($file == "." || $file == "..")
739
+ continue;
740
+
741
+ $path_source = $full_source."/".$file;
742
+ $path_dest = $full_dest."/".$file;
743
+
744
+ //validate black list
745
+ $rel_path_file = $file;
746
+ if(!empty($rel_path))
747
+ $rel_path_file = $rel_path."/".$file;
748
+
749
+ //if the file or folder is in black list - pass it
750
+ if(array_search($rel_path_file, $blackList) !== false)
751
+ continue;
752
+
753
+ //if file - copy file
754
+ if(is_file($path_source)){
755
+ copy($path_source,$path_dest);
756
+ }
757
+ else{ //if directory - recursive copy directory
758
+ if(empty($rel_path))
759
+ $rel_path_new = $file;
760
+ else
761
+ $rel_path_new = $rel_path."/".$file;
762
+
763
+ self::copyDir($source,$dest,$rel_path_new,$blackList);
764
+ }
765
+ }
766
+ }
767
+
768
+
769
+ public static function z______________OTHERS_____________(){}
770
+
771
+
772
+ /**
773
+ * check if the string is json, then convert to css, if not return original
774
+ */
775
+ public static function jsonToCss($strCss, $wrappers = ""){
776
+
777
+ //check if json
778
+ $arrayDecoded = @json_decode($strCss);
779
+ if(empty($arrayDecoded)){
780
+
781
+ return($strCss);
782
+ }
783
+
784
+ $strCss = "";
785
+
786
+ $arrayDecoded = (array)$arrayDecoded;
787
+ foreach($arrayDecoded as $key=>$item){
788
+ $strCss .= $key . ":" . $item."; ";
789
+ }
790
+
791
+ return($strCss);
792
+ }
793
+
794
+
795
+ /**
796
+ * convert timestamp to time string
797
+ * @param unknown_type $stamp
798
+ */
799
+ public static function timestamp2Time($stamp){
800
+ $strTime = date("H:i",$stamp);
801
+ return($strTime);
802
+ }
803
+
804
+ //---------------------------------------------------------------------------------------------------
805
+ // convert timestamp to date and time string
806
+ public static function timestamp2DateTime($stamp){
807
+ $strDateTime = date("d M Y, H:i",$stamp);
808
+ return($strDateTime);
809
+ }
810
+
811
+ //---------------------------------------------------------------------------------------------------
812
+ // convert timestamp to date string
813
+ public static function timestamp2Date($stamp){
814
+ $strDate = date("d M Y",$stamp); //27 Jun 2009
815
+ return($strDate);
816
+ }
817
+
818
+
819
+
820
+ /**
821
+ *
822
+ * get link html
823
+ */
824
+ public static function getHtmlLink($link,$text,$id="",$class="", $isNewWindow = false){
825
+
826
+ if(!empty($class))
827
+ $class = " class='$class'";
828
+
829
+ if(!empty($id))
830
+ $id = " id='$id'";
831
+
832
+ $htmlAdd = "";
833
+ if($isNewWindow == true)
834
+ $htmlAdd = ' target="_blank"';
835
+
836
+ $html = "<a href=\"$link\"".$id.$class.$htmlAdd.">$text</a>";
837
+ return($html);
838
+ }
839
+
840
+ /**
841
+ *
842
+ * get select from array
843
+ */
844
+ public static function getHTMLSelect($arr,$default="",$htmlParams="",$assoc = false){
845
+
846
+ $html = "<select $htmlParams>";
847
+ foreach($arr as $key=>$item){
848
+ $selected = "";
849
+
850
+ if($assoc == false){
851
+ if($item == $default) $selected = " selected ";
852
+ }
853
+ else{
854
+ if(trim($key) == trim($default))
855
+ $selected = " selected ";
856
+ }
857
+
858
+
859
+ if($assoc == true)
860
+ $html .= "<option $selected value='$key'>$item</option>";
861
+ else
862
+ $html .= "<option $selected value='$item'>$item</option>";
863
+ }
864
+ $html.= "</select>";
865
+ return($html);
866
+ }
867
+
868
+
869
+ /**
870
+ *
871
+ * strip slashes from textarea content after ajax request to server
872
+ */
873
+ public static function normalizeTextareaContent($content){
874
+ if(empty($content))
875
+ return($content);
876
+ $content = stripslashes($content);
877
+ $content = trim($content);
878
+ return($content);
879
+ }
880
+
881
+ /**
882
+ * normalize link - switch first & for ?, if no ? found
883
+ */
884
+ public static function normalizeLink($link){
885
+
886
+ //if there is no "?" - fix first appearance of & to ?
887
+ $pos = strpos($link, "?");
888
+ if($pos === false){
889
+ $link = preg_replace('/\&/', '?', $link, 1);
890
+ }
891
+
892
+
893
+ //if found more then one ?, convert the rest to &
894
+ $pos = strpos($link, "?");
895
+ if($pos !== false){
896
+ $pos2 = strpos($link, "?", $pos+1);
897
+ if($pos2 !== false){
898
+ $stringEnd = substr($link, $pos+1);
899
+ $stringEnd = str_replace("?","&",$stringEnd);
900
+ $link = substr_replace($link,$stringEnd,$pos+1);
901
+ }
902
+ }
903
+
904
+
905
+ return($link);
906
+ }
907
+
908
+
909
+ /**
910
+ * Download Image
911
+ */
912
+ public static function downloadImage($filepath, $filename, $mimeType=""){
913
+ $contents = file_get_contents($filepath);
914
+ $filesize = strlen($contents);
915
+
916
+ if($mimeType == ""){
917
+ $info = UniteFunctionsUG::getPathInfo($filepath);
918
+ $ext = $info["extension"];
919
+ $mimeType = "image/$ext";
920
+ }
921
+
922
+ header("Content-Type: $mimeType");
923
+ header("Content-Disposition: attachment; filename=\"$filename\"");
924
+ header("Content-Length: $filesize");
925
+ echo $contents;
926
+ exit();
927
+ }
928
+
929
+
930
+ /**
931
+ * Download file from content
932
+ */
933
+ public static function downloadFileFromContent($content, $filename, $mimeType="text/plain"){
934
+
935
+ $filesize = strlen($content);
936
+
937
+ header("Content-Type: $mimeType");
938
+ header("Content-Disposition: attachment; filename=\"{$filename}\"");
939
+ header("Content-Length: {$filesize}");
940
+ echo $content;
941
+ exit();
942
+ }
943
+
944
+
945
+ /**
946
+ *
947
+ * convert string to boolean
948
+ */
949
+ public static function strToBool($str){
950
+ if(is_bool($str))
951
+ return($str);
952
+
953
+ if(empty($str))
954
+ return(false);
955
+
956
+ if(is_numeric($str))
957
+ return($str != 0);
958
+
959
+ $str = strtolower($str);
960
+ if($str == "true")
961
+ return(true);
962
+
963
+ return(false);
964
+ }
965
+
966
+
967
+ //------------------------------------------------------------
968
+ // get black value from rgb value
969
+ public static function yiq($r,$g,$b){
970
+ return (($r*0.299)+($g*0.587)+($b*0.114));
971
+ }
972
+
973
+ //------------------------------------------------------------
974
+ // convert colors to rgb
975
+ public static function html2rgb($color){
976
+ if ($color[0] == '#')
977
+ $color = substr($color, 1);
978
+ if (strlen($color) == 6)
979
+ list($r, $g, $b) = array($color[0].$color[1],
980
+ $color[2].$color[3],
981
+ $color[4].$color[5]);
982
+ elseif (strlen($color) == 3)
983
+ list($r, $g, $b) = array($color[0].$color[0], $color[1].$color[1], $color[2].$color[2]);
984
+ else
985
+ return false;
986
+ $r = hexdec($r); $g = hexdec($g); $b = hexdec($b);
987
+ return array($r, $g, $b);
988
+ }
989
+
990
+ /**
991
+ *
992
+ *turn some object to string
993
+ */
994
+ public static function toString($obj){
995
+ return(trim((string)$obj));
996
+ }
997
+
998
+
999
+ /**
1000
+ *
1001
+ * remove utf8 bom sign
1002
+ * @return string
1003
+ */
1004
+ public static function remove_utf8_bom($content){
1005
+ $content = str_replace(chr(239),"",$content);
1006
+ $content = str_replace(chr(187),"",$content);
1007
+ $content = str_replace(chr(191),"",$content);
1008
+ $content = trim($content);
1009
+ return($content);
1010
+ }
1011
+
1012
+ /**
1013
+ * put javascript redirection script
1014
+ */
1015
+ public static function putRedirectJS($url){
1016
+
1017
+ $html = "<script type='text/javascript'>
1018
+ location.href='{$url}';
1019
+ </script>";
1020
+
1021
+ echo $html;
1022
+ }
1023
+
1024
+ }
1025
+
1026
+ ?>
inc_php/framework/functions.php ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @package Unite Gallery
4
+ * @author Valiano
5
+ * @copyright (C) 2012 Unite CMS, All Rights Reserved.
6
+ * @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
7
+ * */
8
+ defined('UNITEGALLERY_INC') or die('Restricted access');
9
+
10
+ //---------------------------------------------------------------------------------------------------------------------
11
+
12
+ if(!function_exists("dmp")){
13
+ function dmp($str){
14
+ echo "<div align='left'>";
15
+ echo "<pre>";
16
+ print_r($str);
17
+ echo "</pre>";
18
+ echo "</div>";
19
+ }
20
+ }
21
+
22
+
23
+
24
+
25
+ ?>
inc_php/framework/helper_base.class.php ADDED
@@ -0,0 +1,79 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @package Unite Gallery
4
+ * @author Valiano
5
+ * @copyright (C) 2012 Unite CMS, All Rights Reserved.
6
+ * @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
7
+ * */
8
+ defined('UNITEGALLERY_INC') or die('Restricted access');
9
+
10
+
11
+ class UniteHelperBaseUG{
12
+
13
+
14
+ /**
15
+ *
16
+ * echo json ajax response
17
+ */
18
+ public static function ajaxResponse($success,$message,$arrData = null){
19
+
20
+ $response = array();
21
+ $response["success"] = $success;
22
+ $response["message"] = $message;
23
+
24
+ if(!empty($arrData)){
25
+
26
+ if(gettype($arrData) == "string")
27
+ $arrData = array("data"=>$arrData);
28
+
29
+ $response = array_merge($response,$arrData);
30
+ }
31
+
32
+ $json = json_encode($response);
33
+
34
+ echo $json;
35
+ exit();
36
+ }
37
+
38
+ /**
39
+ *
40
+ * echo json ajax response, without message, only data
41
+ */
42
+ public static function ajaxResponseData($arrData){
43
+ if(gettype($arrData) == "string")
44
+ $arrData = array("data"=>$arrData);
45
+
46
+ self::ajaxResponse(true,"",$arrData);
47
+ }
48
+
49
+ /**
50
+ *
51
+ * echo json ajax response
52
+ */
53
+ public static function ajaxResponseError($message,$arrData = null){
54
+
55
+ self::ajaxResponse(false,$message,$arrData,true);
56
+ }
57
+
58
+ /**
59
+ * echo ajax success response
60
+ */
61
+ public static function ajaxResponseSuccess($message,$arrData = null){
62
+
63
+ self::ajaxResponse(true,$message,$arrData,true);
64
+
65
+ }
66
+
67
+ /**
68
+ * echo ajax success response
69
+ */
70
+ public static function ajaxResponseSuccessRedirect($message,$url){
71
+ $arrData = array("is_redirect"=>true,"redirect_url"=>$url);
72
+
73
+ self::ajaxResponse(true,$message,$arrData,true);
74
+ }
75
+
76
+
77
+ }
78
+
79
+ ?>
inc_php/framework/image_view.class.php ADDED
@@ -0,0 +1,534 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @package Unite Gallery
4
+ * @author Valiano
5
+ * @copyright (C) 2012 Unite CMS, All Rights Reserved.
6
+ * @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
7
+ * */
8
+ defined('UNITEGALLERY_INC') or die('Restricted access');
9
+
10
+
11
+ class UniteImageViewUG{
12
+
13
+ private $pathCache;
14
+ private $pathImages;
15
+ private $urlImages;
16
+
17
+ private $filename = null;
18
+ private $maxWidth = null;
19
+ private $maxHeight = null;
20
+ private $type = null;
21
+ private $effect = null;
22
+ private $effect_arg1 = null;
23
+ private $effect_arg2 = null;
24
+
25
+ const EFFECT_BW = "bw";
26
+ const EFFECT_BRIGHTNESS = "bright";
27
+ const EFFECT_CONTRAST = "contrast";
28
+ const EFFECT_EDGE = "edge";
29
+ const EFFECT_EMBOSS = "emboss";
30
+ const EFFECT_BLUR = "blur";
31
+ const EFFECT_BLUR3 = "blur3";
32
+ const EFFECT_MEAN = "mean";
33
+ const EFFECT_SMOOTH = "smooth";
34
+ const EFFECT_DARK = "dark";
35
+
36
+ const TYPE_EXACT = "exact";
37
+ const TYPE_EXACT_TOP = "exacttop";
38
+
39
+ private $jpg_quality;
40
+
41
+ public function __construct(){
42
+
43
+ $this->jpg_quality = GlobalsUG::DEFAULT_JPG_QUALITY;
44
+
45
+ }
46
+
47
+
48
+ /**
49
+ *
50
+ * throw error
51
+ */
52
+ private function throwError($message,$code=null){
53
+ UniteFunctionsUG::throwError($message,$code);
54
+ }
55
+
56
+ /**
57
+ *
58
+ * validate type
59
+ * @param unknown_type $type
60
+ */
61
+ private function validateType($type){
62
+ switch($type){
63
+ case self::TYPE_EXACT:
64
+ case self::TYPE_EXACT_TOP:
65
+ break;
66
+ default:
67
+ $this->throwError("Wrong image type: ".$type);
68
+ break;
69
+ }
70
+ }
71
+
72
+
73
+ /**
74
+ *
75
+ * get filename for thumbnail save / retrieve
76
+ */
77
+ private function getThumbFilename(){
78
+ $info = pathInfo($this->filename);
79
+
80
+ //add dirname as postfix (if exists)
81
+ $postfix = "";
82
+
83
+ $dirname = UniteFunctionsUG::getVal($info, "dirname");
84
+ if($dirname == ".")
85
+ $dirname = null;
86
+
87
+ if(!empty($dirname))
88
+ $postfix = str_replace("/", "-", $dirname);
89
+
90
+ $ext = $info["extension"];
91
+ $name = $info["filename"];
92
+ $width = ceil($this->maxWidth);
93
+ $height = ceil($this->maxHeight);
94
+ $thumbFilename = $name."_".$width."x".$height;
95
+ $this->type = trim($this->type);
96
+
97
+
98
+ if(!empty($this->type))
99
+ $thumbFilename .= "_" . $this->type;
100
+
101
+ if(!empty($this->effect)){
102
+ $thumbFilename .= "_e" . $this->effect;
103
+ if(!empty($this->effect_arg1)){
104
+ $thumbFilename .= "x" . $this->effect_arg1;
105
+ }
106
+ }
107
+
108
+ //add postfix
109
+ if(!empty($postfix))
110
+ $thumbFilename .= "_".$postfix;
111
+
112
+ $thumbFilename .= ".".$ext;
113
+
114
+ return($thumbFilename);
115
+ }
116
+
117
+
118
+ //------------------------------------------------------------------------------------------
119
+ // get thumbnail fielpath by parameters.
120
+ private function getThumbFilepath(){
121
+ $filename = $this->getThumbFilename();
122
+ $filepath = $this->pathCache .$filename;
123
+ return($filepath);
124
+ }
125
+
126
+ //------------------------------------------------------------------------------------------
127
+ // ouptput emtpy image code.
128
+ private function outputEmptyImageCode(){
129
+ echo "empty image";
130
+ exit();
131
+ }
132
+
133
+ //------------------------------------------------------------------------------------------
134
+ // outputs image and exit.
135
+ private function outputImage($filepath){
136
+
137
+ $info = UniteFunctionsUG::getPathInfo($filepath);
138
+ $ext = $info["extension"];
139
+ //$filetime = filemtime($filepath);
140
+
141
+ $ext = strtolower($ext);
142
+ if($ext == "jpg")
143
+ $ext = "jpeg";
144
+
145
+ $numExpires = 31536000; //one year
146
+ $strExpires = @date('D, d M Y H:i:s',time()+$numExpires);
147
+ //$strModified = @date('D, d M Y H:i:s',$filetime);
148
+
149
+ $contents = file_get_contents($filepath);
150
+ $filesize = strlen($contents);
151
+ /*header("Last-Modified: $strModified GMT");*/
152
+ header("Expires: $strExpires GMT");
153
+ header("Cache-Control: public");
154
+ header("Content-Type: image/$ext");
155
+ header("Content-Length: $filesize");
156
+
157
+ echo $contents;
158
+ exit();
159
+ }
160
+
161
+
162
+ //------------------------------------------------------------------------------------------
163
+ // get src image from filepath according the image type
164
+ private function getGdSrcImage($filepath,$type){
165
+ // create the image
166
+ $src_img = false;
167
+ switch($type){
168
+ case IMAGETYPE_JPEG:
169
+ $src_img = @imagecreatefromjpeg($filepath);
170
+ break;
171
+ case IMAGETYPE_PNG:
172
+ $src_img = @imagecreatefrompng($filepath);
173
+ break;
174
+ case IMAGETYPE_GIF:
175
+ $src_img = @imagecreatefromgif($filepath);
176
+ break;
177
+ case IMAGETYPE_BMP:
178
+ $src_img = @imagecreatefromwbmp($filepath);
179
+ break;
180
+ default:
181
+ $this->throwError("wrong image format, can't resize");
182
+ break;
183
+ }
184
+
185
+ if($src_img == false){
186
+ $this->throwError("Can't resize image");
187
+ }
188
+
189
+ return($src_img);
190
+ }
191
+
192
+ //------------------------------------------------------------------------------------------
193
+ // save gd image to some filepath. return if success or not
194
+ private function saveGdImage($dst_img,$filepath,$type){
195
+ $successSaving = false;
196
+ switch($type){
197
+ case IMAGETYPE_JPEG:
198
+ $successSaving = imagejpeg($dst_img,$filepath,$this->jpg_quality);
199
+ break;
200
+ case IMAGETYPE_PNG:
201
+ $successSaving = imagepng($dst_img,$filepath);
202
+ break;
203
+ case IMAGETYPE_GIF:
204
+ $successSaving = imagegif($dst_img,$filepath);
205
+ break;
206
+ case IMAGETYPE_BMP:
207
+ $successSaving = imagewbmp($dst_img,$filepath);
208
+ break;
209
+ }
210
+
211
+ return($successSaving);
212
+ }
213
+
214
+ //------------------------------------------------------------------------------------------
215
+ // crop image to specifix height and width , and save it to new path
216
+ private function cropImageSaveNew($filepath,$filepathNew){
217
+
218
+ $imgInfo = getimagesize($filepath);
219
+ $imgType = $imgInfo[2];
220
+
221
+ $src_img = $this->getGdSrcImage($filepath,$imgType);
222
+
223
+ $width = imageSX($src_img);
224
+ $height = imageSY($src_img);
225
+
226
+ //crop the image from the top
227
+ $startx = 0;
228
+ $starty = 0;
229
+
230
+ //find precrop width and height:
231
+ $percent = $this->maxWidth / $width;
232
+ $newWidth = $this->maxWidth;
233
+ $newHeight = ceil($percent * $height);
234
+
235
+ if($this->type == "exact"){ //crop the image from the middle
236
+ $startx = 0;
237
+ $starty = ($newHeight-$this->maxHeight)/2 / $percent;
238
+ }
239
+
240
+ if($newHeight < $this->maxHeight){ //by width
241
+ $percent = $this->maxHeight / $height;
242
+ $newHeight = $this->maxHeight;
243
+ $newWidth = ceil($percent * $width);
244
+
245
+ if($this->type == "exact"){ //crop the image from the middle
246
+ $startx = ($newWidth - $this->maxWidth) /2 / $percent; //the startx is related to big image
247
+ $starty = 0;
248
+ }
249
+ }
250
+
251
+ //resize the picture:
252
+ $tmp_img = ImageCreateTrueColor($newWidth,$newHeight);
253
+
254
+ $this->handleTransparency($tmp_img,$imgType,$newWidth,$newHeight);
255
+
256
+ imagecopyresampled($tmp_img,$src_img,0,0,$startx,$starty,$newWidth,$newHeight,$width,$height);
257
+
258
+ $this->handleImageEffects($tmp_img);
259
+
260
+ //crop the picture:
261
+ $dst_img = ImageCreateTrueColor($this->maxWidth,$this->maxHeight);
262
+
263
+ $this->handleTransparency($dst_img,$imgType,$this->maxWidth,$this->maxHeight);
264
+
265
+ imagecopy($dst_img, $tmp_img, 0, 0, 0, 0, $newWidth, $newHeight);
266
+
267
+ //save the picture
268
+ $is_saved = $this->saveGdImage($dst_img,$filepathNew,$imgType);
269
+
270
+ imagedestroy($dst_img);
271
+ imagedestroy($src_img);
272
+ imagedestroy($tmp_img);
273
+
274
+ return($is_saved);
275
+ }
276
+
277
+ //------------------------------------------------------------------------------------------
278
+ // if the images are png or gif - handle image transparency
279
+ private function handleTransparency(&$dst_img,$imgType,$newWidth,$newHeight){
280
+ //handle transparency:
281
+ if($imgType == IMAGETYPE_PNG || $imgType == IMAGETYPE_GIF){
282
+ imagealphablending($dst_img, false);
283
+ imagesavealpha($dst_img,true);
284
+ $transparent = imagecolorallocatealpha($dst_img, 255, 255, 255, 127);
285
+ imagefilledrectangle($dst_img, 0, 0, $newWidth, $newHeight, $transparent);
286
+ }
287
+ }
288
+
289
+ //------------------------------------------------------------------------------------------
290
+ // handle image effects
291
+ private function handleImageEffects(&$imgHandle){
292
+ if(empty($this->effect))
293
+ return(false);
294
+
295
+ switch($this->effect){
296
+ case self::EFFECT_BW:
297
+ if(defined("IMG_FILTER_GRAYSCALE"))
298
+ imagefilter($imgHandle,IMG_FILTER_GRAYSCALE);
299
+ break;
300
+ case self::EFFECT_BRIGHTNESS:
301
+ if(defined("IMG_FILTER_BRIGHTNESS")){
302
+ if(!is_numeric($this->effect_arg1))
303
+ $this->effect_arg1 = 50; //set default value
304
+ UniteFunctionsUG::validateNumeric($this->effect_arg1,"'ea1' argument");
305
+ imagefilter($imgHandle,IMG_FILTER_BRIGHTNESS,$this->effect_arg1);
306
+ }
307
+ break;
308
+ case self::EFFECT_DARK:
309
+ if(defined("IMG_FILTER_BRIGHTNESS")){
310
+ if(!is_numeric($this->effect_arg1))
311
+ $this->effect_arg1 = -50; //set default value
312
+ UniteFunctionsUG::validateNumeric($this->effect_arg1,"'ea1' argument");
313
+ imagefilter($imgHandle,IMG_FILTER_BRIGHTNESS,$this->effect_arg1);
314
+ }
315
+ break;
316
+ case self::EFFECT_CONTRAST:
317
+ if(defined("IMG_FILTER_CONTRAST")){
318
+ if(!is_numeric($this->effect_arg1))
319
+ $this->effect_arg1 = -5; //set default value
320
+ imagefilter($imgHandle,IMG_FILTER_CONTRAST,$this->effect_arg1);
321
+ }
322
+ break;
323
+ case self::EFFECT_EDGE:
324
+ if(defined("IMG_FILTER_EDGEDETECT"))
325
+ imagefilter($imgHandle,IMG_FILTER_EDGEDETECT);
326
+ break;
327
+ case self::EFFECT_EMBOSS:
328
+ if(defined("IMG_FILTER_EMBOSS"))
329
+ imagefilter($imgHandle,IMG_FILTER_EMBOSS);
330
+ break;
331
+ case self::EFFECT_BLUR:
332
+ $this->effect_Blur($imgHandle,5);
333
+ /*
334
+ if(defined("IMG_FILTER_GAUSSIAN_BLUR"))
335
+ imagefilter($imgHandle,IMG_FILTER_GAUSSIAN_BLUR);
336
+ */
337
+ break;
338
+ case self::EFFECT_MEAN:
339
+ if(defined("IMG_FILTER_MEAN_REMOVAL"))
340
+ imagefilter($imgHandle,IMG_FILTER_MEAN_REMOVAL);
341
+ break;
342
+ case self::EFFECT_SMOOTH:
343
+ if(defined("IMG_FILTER_SMOOTH")){
344
+ if(!is_numeric($this->effect_arg1))
345
+ $this->effect_arg1 = 15; //set default value
346
+ imagefilter($imgHandle,IMG_FILTER_SMOOTH,$this->effect_arg1);
347
+ }
348
+ break;
349
+ case self::EFFECT_BLUR3:
350
+ $this->effect_Blur($imgHandle,5);
351
+ break;
352
+ default:
353
+ $this->throwError("Effect not supported: <b>".$this->effect."</b>");
354
+ break;
355
+ }
356
+
357
+ }
358
+
359
+ private function effect_Blur(&$gdimg, $radius=0.5) {
360
+ // Taken from Torstein Hרnsi's phpUnsharpMask (see phpthumb.unsharp.php)
361
+
362
+ $radius = round(max(0, min($radius, 50)) * 2);
363
+ if (!$radius) {
364
+ return false;
365
+ }
366
+
367
+ $w = ImageSX($gdimg);
368
+ $h = ImageSY($gdimg);
369
+ if ($imgBlur = ImageCreateTrueColor($w, $h)) {
370
+ // Gaussian blur matrix:
371
+ // 1 2 1
372
+ // 2 4 2
373
+ // 1 2 1
374
+
375
+ // Move copies of the image around one pixel at the time and merge them with weight
376
+ // according to the matrix. The same matrix is simply repeated for higher radii.
377
+ for ($i = 0; $i < $radius; $i++) {
378
+ ImageCopy ($imgBlur, $gdimg, 0, 0, 1, 1, $w - 1, $h - 1); // up left
379
+ ImageCopyMerge($imgBlur, $gdimg, 1, 1, 0, 0, $w, $h, 50.00000); // down right
380
+ ImageCopyMerge($imgBlur, $gdimg, 0, 1, 1, 0, $w - 1, $h, 33.33333); // down left
381
+ ImageCopyMerge($imgBlur, $gdimg, 1, 0, 0, 1, $w, $h - 1, 25.00000); // up right
382
+ ImageCopyMerge($imgBlur, $gdimg, 0, 0, 1, 0, $w - 1, $h, 33.33333); // left
383
+ ImageCopyMerge($imgBlur, $gdimg, 1, 0, 0, 0, $w, $h, 25.00000); // right
384
+ ImageCopyMerge($imgBlur, $gdimg, 0, 0, 0, 1, $w, $h - 1, 20.00000); // up
385
+ ImageCopyMerge($imgBlur, $gdimg, 0, 1, 0, 0, $w, $h, 16.666667); // down
386
+ ImageCopyMerge($imgBlur, $gdimg, 0, 0, 0, 0, $w, $h, 50.000000); // center
387
+ ImageCopy ($gdimg, $imgBlur, 0, 0, 0, 0, $w, $h);
388
+ }
389
+ return true;
390
+ }
391
+ return false;
392
+ }
393
+
394
+
395
+ //------------------------------------------------------------------------------------------
396
+ // resize image and save it to new path
397
+ private function resizeImageSaveNew($filepath,$filepathNew){
398
+
399
+ $imgInfo = getimagesize($filepath);
400
+ $imgType = $imgInfo[2];
401
+
402
+ $src_img = $this->getGdSrcImage($filepath,$imgType);
403
+
404
+ $width = imageSX($src_img);
405
+ $height = imageSY($src_img);
406
+
407
+ $newWidth = $width;
408
+ $newHeight = $height;
409
+
410
+ //find new width
411
+ if($height > $this->maxHeight){
412
+ $procent = $this->maxHeight / $height;
413
+ $newWidth = ceil($width * $procent);
414
+ $newHeight = $this->maxHeight;
415
+ }
416
+
417
+ //if the new width is grater than max width, find new height, and remain the width.
418
+ if($newWidth > $this->maxWidth){
419
+ $procent = $this->maxWidth / $newWidth;
420
+ $newHeight = ceil($newHeight * $procent);
421
+ $newWidth = $this->maxWidth;
422
+ }
423
+
424
+ //if the image don't need to be resized, just copy it from source to destanation.
425
+ if($newWidth == $width && $newHeight == $height && empty($this->effect)){
426
+ $success = copy($filepath,$filepathNew);
427
+ if($success == false)
428
+ $this->throwError("can't copy the image from one path to another");
429
+ }
430
+ else{ //else create the resized image, and save it to new path:
431
+ $dst_img = ImageCreateTrueColor($newWidth,$newHeight);
432
+
433
+ $this->handleTransparency($dst_img,$imgType,$newWidth,$newHeight);
434
+
435
+ //copy the new resampled image:
436
+ imagecopyresampled($dst_img,$src_img,0,0,0,0,$newWidth,$newHeight,$width,$height);
437
+
438
+ $this->handleImageEffects($dst_img);
439
+
440
+ $is_saved = $this->saveGdImage($dst_img,$filepathNew,$imgType);
441
+ imagedestroy($dst_img);
442
+ }
443
+
444
+ imagedestroy($src_img);
445
+
446
+ return(true);
447
+ }
448
+
449
+
450
+
451
+
452
+ /**
453
+ *
454
+ * set image effect
455
+ */
456
+ public function setEffect($effect,$arg1 = ""){
457
+ $this->effect = $effect;
458
+ $this->effect_arg1 = $arg1;
459
+ }
460
+
461
+ /**
462
+ *
463
+ * set jpg quality output
464
+ */
465
+ public function setJPGQuality($quality){
466
+ $this->jpg_quality = $quality;
467
+ }
468
+
469
+
470
+ /**
471
+ * make thumbnail from the image, and save to some path
472
+ * return new path
473
+ */
474
+ public function makeThumb($filepathImage, $pathThumbs, $maxWidth=-1, $maxHeight=-1, $type=""){
475
+
476
+ //validate input
477
+ UniteFunctionsUG::validateFilepath($filepathImage, "image not found");
478
+
479
+ UniteFunctionsUG::validateDir($pathThumbs, "Thumbs folder don't exists.");
480
+
481
+ if($type == self::TYPE_EXACT || $type == self::TYPE_EXACT_TOP){
482
+ if($maxHeight == -1)
483
+ $this->throwError("image with exact type must have height!");
484
+ if($maxWidth == -1)
485
+ $this->throwError("image with exact type must have width!");
486
+ }
487
+
488
+ //get filename
489
+ $info = UniteFunctionsUG::getPathInfo($filepathImage);
490
+ $filename = UniteFunctionsUG::getVal($info, "basename");
491
+
492
+ UniteFunctionsUG::validateNotEmpty($filename, "image filename not given");
493
+
494
+ //if gd library doesn't exists - output normal image without resizing.
495
+ if(function_exists("gd_info") == false)
496
+ $this->throwError("php must support GD Library");
497
+
498
+ if($maxWidth == -1 && $maxHeight == -1)
499
+ $this->throwError("Wrong thumb size");
500
+
501
+ if($maxWidth == -1)
502
+ $maxWidth = 1000000;
503
+
504
+ if($maxHeight == -1)
505
+ $maxHeight = 100000;
506
+
507
+ $this->filename = $filename;
508
+ $this->maxWidth = $maxWidth;
509
+ $this->maxHeight = $maxHeight;
510
+ $this->type = $type;
511
+ $this->pathCache = $pathThumbs;
512
+
513
+ $filenameThumb = $this->getThumbFilename();
514
+ $filepathNew = $this->pathCache.$filenameThumb;
515
+
516
+ if(file_exists($filepathNew))
517
+ return($filenameThumb);
518
+
519
+ if($type == self::TYPE_EXACT || $type == self::TYPE_EXACT_TOP){
520
+ $isSaved = $this->cropImageSaveNew($filepathImage, $filepathNew);
521
+ }
522
+ else
523
+ $isSaved = $this->resizeImageSaveNew($filepathImage, $filepathNew);
524
+
525
+ if($isSaved)
526
+ return($filenameThumb);
527
+ else
528
+ return("");
529
+ }
530
+
531
+
532
+ }
533
+
534
+ ?>
inc_php/framework/include_framework.php ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @package Unite Gallery for Joomla 1.7-3.5
4
+ * @author Valiano
5
+ * @copyright (C) 2012 Unite CMS, All Rights Reserved.
6
+ * @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
7
+ * */
8
+ defined('UNITEGALLERY_INC') or die('Restricted access');
9
+
10
+
11
+ $folderIncludes = dirname(__FILE__)."/";
12
+
13
+ //include provider classes
14
+ require_once $folderIncludes . 'provider/provider_db.class.php';
15
+ require_once $folderIncludes . 'provider/provider_functions.class.php';
16
+
17
+ require_once $folderIncludes . 'functions.php';
18
+ require_once $folderIncludes . 'functions.class.php';
19
+ require_once $folderIncludes . 'provider/functions_wordpress.class.php';
20
+
21
+ require_once $folderIncludes . 'db.class.php';
22
+ require_once $folderIncludes . 'settings.class.php';
23
+ require_once $folderIncludes . 'cssparser.class.php';
24
+ require_once $folderIncludes . 'settings_advances.class.php';
25
+ require_once $folderIncludes . 'settings_output.class.php';
26
+ require_once $folderIncludes . 'settings_product.class.php';
27
+ require_once $folderIncludes . 'settings_product_sidebar.class.php';
28
+ require_once $folderIncludes . 'image_view.class.php';
29
+ require_once $folderIncludes . 'zip.class.php';
30
+
31
+ require_once $folderIncludes . 'base_admin.class.php';
32
+
33
+ require_once $folderIncludes . 'elements_base.class.php';
34
+ require_once $folderIncludes . 'base_output.class.php';
35
+ require_once $folderIncludes . 'helper_base.class.php';
36
+
37
+ ?>
inc_php/framework/index.html ADDED
File without changes
inc_php/framework/provider/assets/provider_admin.css ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ @CHARSET "ISO-8859-1";
2
+
3
+ .unite-view-wrapper{
4
+ padding-top:20px;
5
+ padding-right:20px;
6
+ }
7
+
8
+ table.unite_table_settings_wide input[type="text"]{
9
+ height:31px;
10
+ }
11
+
12
+ .unite_table_settings_wide input[type="radio"],
13
+ .unite-view-wrapper .setting_input input[type="radio"]{
14
+ -webkit-appearance:radio !important;
15
+ }
16
+
17
+ /* --------- Items View ------------ */
18
+
19
+ .list_items li .item_title{
20
+ paddibng-top:1px;
21
+ padding-bottom:3px;
22
+ }
23
+
24
+ /* --------- Video Dialog ------------ */
25
+
26
+ .dialog-video .video-title{
27
+ margin-top:0px !importrant;
28
+ margin-bottom:1px !important;
29
+ }
30
+
31
+ .dialog-video input[type="text"]{
32
+ padding:3px;
33
+ }
34
+
35
+ .dialog-video .input-url-long{
36
+ width:419px;
37
+ }
38
+
39
+ .dialog-video .input-url{
40
+ width:261px;
41
+ }
42
+
43
+ .dialog-video .input-title {
44
+ width: 361px;
45
+ }
46
+
47
+ .dialog-video .input-description{
48
+ width: 363px;
49
+ }
50
+
51
+ #dv_error_message_bottom {
52
+ top: 438px;
53
+ }
54
+
55
+
56
+ .ug-update-plugin-wrapper{
57
+ text-align:right;
58
+ padding-top:10px;
59
+ }
60
+
61
+
62
+
63
+
inc_php/framework/provider/assets/provider_admin.js ADDED
@@ -0,0 +1,128 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+
3
+ /**
4
+ * provider admin class
5
+ */
6
+ function UniteProviderAdminUG(){
7
+
8
+
9
+ /**
10
+ * open new add image dialog
11
+ */
12
+ function openNewImageDialog(title,onInsert,isMultiple){
13
+
14
+ if(isMultiple == undefined)
15
+ isMultiple = false;
16
+
17
+ // Media Library params
18
+ var frame = wp.media({
19
+ //frame: 'post',
20
+ //state: 'insert',
21
+ title : title,
22
+ multiple : isMultiple,
23
+ library : { type : 'image'},
24
+ button : { text : 'Insert' }
25
+ });
26
+
27
+ // Runs on select
28
+ frame.on('select',function(){
29
+ var objSettings = frame.state().get('selection').first().toJSON();
30
+
31
+ var selection = frame.state().get('selection');
32
+ var arrImages = [];
33
+
34
+ if(isMultiple == true){ //return image object when multiple
35
+ selection.map( function( attachment ) {
36
+ var objImage = attachment.toJSON();
37
+ var obj = {};
38
+ obj.url = objImage.url;
39
+ obj.id = objImage.id;
40
+ arrImages.push(obj);
41
+ });
42
+ onInsert(arrImages);
43
+ }else{ //return image url and id - when single
44
+ onInsert(objSettings.url, objSettings.id);
45
+ }
46
+
47
+ });
48
+
49
+ // Open ML
50
+ frame.open();
51
+ }
52
+
53
+
54
+ /**
55
+ * open old add image dialog
56
+ */
57
+ function openOldImageDialog(title,onInsert){
58
+ var params = "type=image&post_id=0&TB_iframe=true";
59
+
60
+ params = encodeURI(params);
61
+
62
+ tb_show(title,'media-upload.php?'+params);
63
+
64
+ window.send_to_editor = function(html) {
65
+ tb_remove();
66
+ var urlImage = jQuery(html).attr('src');
67
+ if(!urlImage || urlImage == undefined || urlImage == "")
68
+ var urlImage = jQuery('img',html).attr('src');
69
+
70
+ onInsert(urlImage,""); //return empty id, it can be changed
71
+ }
72
+ }
73
+
74
+
75
+
76
+ /**
77
+ * open "add image" dialog
78
+ */
79
+ this.openAddImageDialog = function(title, onInsert, isMultiple){
80
+
81
+ if(typeof wp != "undefined" && typeof wp.media != "undefined")
82
+ openNewImageDialog(title,onInsert,isMultiple);
83
+ else{
84
+ openOldImageDialog(title,onInsert);
85
+ }
86
+
87
+
88
+ };
89
+
90
+
91
+ /**
92
+ * get shortcode
93
+ */
94
+ this.getShortcode = function(alias, catid){
95
+
96
+ var addhtml = "";
97
+ if(catid)
98
+ addhtml = " catid="+catid;
99
+
100
+ var shortcode = "[unitegallery "+alias + addhtml + "]";
101
+
102
+ if(alias == "")
103
+ shortcode = "";
104
+
105
+ return(shortcode);
106
+ };
107
+
108
+
109
+ /**
110
+ * init galleries view provider related functionality
111
+ */
112
+ this.initGalleriesView = function(){
113
+
114
+ //init update plugin button
115
+ jQuery("#ug_button_update_plugin").click(function(){
116
+
117
+ jQuery("#dialog_update_plugin").dialog({
118
+ minWidth:600,
119
+ minHeight:400,
120
+ modal:true,
121
+ });
122
+
123
+ });
124
+
125
+ }
126
+
127
+ }
128
+
inc_php/framework/provider/assets/unitegallery_post_page.js ADDED
@@ -0,0 +1,83 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ function UniteGalleryWPPostPage(){
2
+
3
+ function trace(str){
4
+ console.log(str);
5
+ }
6
+
7
+ var t = this;
8
+
9
+
10
+
11
+ /**
12
+ * add media dialog item
13
+ */
14
+ function addMediaDialogItem(){
15
+
16
+ var media = wp.media;
17
+
18
+ // Wrap the render() function to append controls.
19
+ media.view.Settings.Gallery = media.view.Settings.Gallery.extend({
20
+ render: function() {
21
+ var $el = this.$el;
22
+
23
+ media.view.Settings.prototype.render.apply( this, arguments );
24
+
25
+ // Append the type template and update the settings.
26
+ $el.append( media.template( 'jetpack-gallery-settings' ) );
27
+
28
+ media.gallery.defaults.type = 'default'; // lil hack that lets media know there's a type attribute.
29
+ this.update.apply( this, ['type'] );
30
+
31
+ // Hide the Columns setting for all types except Default
32
+ $el.find( 'select[name=type]' ).on( 'change', function () {
33
+ var columnSetting = $el.find( 'select[name=columns]' ).closest( 'label.setting' );
34
+
35
+ if ( 'default' === jQuery( this ).val() || 'thumbnails' === jQuery( this ).val() ) {
36
+ columnSetting.show();
37
+ } else {
38
+ columnSetting.hide();
39
+ }
40
+ } ).change();
41
+
42
+ return this;
43
+ }
44
+ });
45
+
46
+
47
+ /*
48
+ jQuery(document).on( 'click', '.insert-media', function( event ) {
49
+ var workflow = wp.media.editor.get();
50
+ var options = workflow.options;
51
+
52
+ trace(wp.media.view.l10n);
53
+ trace(workflow);
54
+
55
+ //var NewMenuItem = new wp.media.view.RouterItem( _.extend( options, { text: 'New Item!' } ) );
56
+ //workflow.menu.view.views.set( '.media-menu', NewMenuItem, _.extend( options, { add: true } ) );
57
+
58
+ //trace(workflow.menu.view.views);
59
+
60
+ });
61
+ */
62
+
63
+ }
64
+
65
+
66
+ /**
67
+ * init the post page
68
+ */
69
+ this.init = function(){
70
+
71
+ //addMediaDialogItem();
72
+
73
+ }
74
+
75
+ }
76
+
77
+
78
+ jQuery(document).ready(function(){
79
+
80
+ var objUGPostPage = new UniteGalleryWPPostPage();
81
+ objUGPostPage.init();
82
+ });
83
+
inc_php/framework/provider/functions_wordpress.class.php ADDED
@@ -0,0 +1,1316 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+
4
+ defined('UNITEGALLERY_INC') or die('Restricted access');
5
+
6
+
7
+ class UniteFunctionsWPUG{
8
+
9
+ public static $urlSite;
10
+ public static $urlAdmin;
11
+
12
+ const SORTBY_NONE = "none";
13
+ const SORTBY_ID = "ID";
14
+ const SORTBY_AUTHOR = "author";
15
+ const SORTBY_TITLE = "title";
16
+ const SORTBY_SLUG = "name";
17
+ const SORTBY_DATE = "date";
18
+ const SORTBY_LAST_MODIFIED = "modified";
19
+ const SORTBY_RAND = "rand";
20
+ const SORTBY_COMMENT_COUNT = "comment_count";
21
+ const SORTBY_MENU_ORDER = "menu_order";
22
+
23
+ const ORDER_DIRECTION_ASC = "ASC";
24
+ const ORDER_DIRECTION_DESC = "DESC";
25
+
26
+ const THUMB_SMALL = "thumbnail";
27
+ const THUMB_MEDIUM = "medium";
28
+ const THUMB_LARGE = "large";
29
+ const THUMB_FULL = "full";
30
+
31
+ const STATE_PUBLISHED = "publish";
32
+ const STATE_DRAFT = "draft";
33
+
34
+
35
+ /**
36
+ *
37
+ * init the static variables
38
+ */
39
+ public static function initStaticVars(){
40
+ //UniteFunctionsUG::printDefinedConstants();
41
+
42
+ self::$urlSite = site_url();
43
+
44
+ if(substr(self::$urlSite, -1) != "/")
45
+ self::$urlSite .= "/";
46
+
47
+ self::$urlAdmin = admin_url();
48
+ if(substr(self::$urlAdmin, -1) != "/")
49
+ self::$urlAdmin .= "/";
50
+
51
+
52
+ }
53
+
54
+
55
+ /**
56
+ *
57
+ * get sort by with the names
58
+ */
59
+ public static function getArrSortBy(){
60
+ $arr = array();
61
+ $arr[self::SORTBY_ID] = "Post ID";
62
+ $arr[self::SORTBY_DATE] = "Date";
63
+ $arr[self::SORTBY_TITLE] = "Title";
64
+ $arr[self::SORTBY_SLUG] = "Slug";
65
+ $arr[self::SORTBY_AUTHOR] = "Author";
66
+ $arr[self::SORTBY_LAST_MODIFIED] = "Last Modified";
67
+ $arr[self::SORTBY_COMMENT_COUNT] = "Number Of Comments";
68
+ $arr[self::SORTBY_RAND] = "Random";
69
+ $arr[self::SORTBY_NONE] = "Unsorted";
70
+ $arr[self::SORTBY_MENU_ORDER] = "Custom Order";
71
+ return($arr);
72
+ }
73
+
74
+
75
+ /**
76
+ *
77
+ * get array of sort direction
78
+ */
79
+ public static function getArrSortDirection(){
80
+ $arr = array();
81
+ $arr[self::ORDER_DIRECTION_DESC] = "Descending";
82
+ $arr[self::ORDER_DIRECTION_ASC] = "Ascending";
83
+ return($arr);
84
+ }
85
+
86
+
87
+ /**
88
+ * get blog id
89
+ */
90
+ public static function getBlogID(){
91
+ global $blog_id;
92
+ return($blog_id);
93
+ }
94
+
95
+
96
+ /**
97
+ *
98
+ * get blog id
99
+ */
100
+ public static function isMultisite(){
101
+
102
+ return(false);
103
+ }
104
+
105
+
106
+ /**
107
+ *
108
+ * check if some db table exists
109
+ */
110
+ public static function isDBTableExists($tableName){
111
+ global $wpdb;
112
+
113
+ if(empty($tableName))
114
+ UniteFunctionsUG::throwError("Empty table name!!!");
115
+
116
+ $sql = "show tables like '$tableName'";
117
+
118
+ $table = $wpdb->get_var($sql);
119
+
120
+ if($table == $tableName)
121
+ return(true);
122
+
123
+ return(false);
124
+ }
125
+
126
+
127
+ /**
128
+ *
129
+ * get WordPress base path
130
+ */
131
+ public static function getPathBase(){
132
+ return ABSPATH;
133
+ }
134
+
135
+
136
+ /**
137
+ *
138
+ * get content url
139
+ */
140
+ public static function getUrlUploads(){
141
+
142
+ if(self::isMultisite() == false){ //without multisite
143
+ $baseUrl = content_url()."/";
144
+ }
145
+ else{ //for multisite
146
+ $arrUploadData = wp_upload_dir();
147
+ $baseUrl = $arrUploadData["baseurl"]."/";
148
+ }
149
+
150
+ return($baseUrl);
151
+
152
+ }
153
+
154
+
155
+
156
+ /* Import media from url
157
+ *
158
+ * @param string $file_url URL of the existing file from the original site
159
+ * @param int $folder_name The slidername will be used as folder name in import
160
+ *
161
+ * @return boolean True on success, false on failure
162
+ */
163
+
164
+ public static function import_media($file_url, $folder_name) {
165
+
166
+ //skip this function
167
+ return(false);
168
+
169
+ require_once(ABSPATH . 'wp-admin/includes/image.php');
170
+
171
+ $ul_dir = wp_upload_dir();
172
+ $artDir = 'revslider/';
173
+
174
+ $filename = basename($file_url);
175
+
176
+ if(@fclose(@fopen($file_url, "r"))){ //make sure the file actually exists
177
+
178
+ $saveDir = $ul_dir['basedir'].'/'.$artDir.$folder_name.$filename;
179
+
180
+ copy($file_url, $saveDir);
181
+
182
+ $file_info = getimagesize($saveDir);
183
+
184
+ //create an array of attachment data to insert into wp_posts table
185
+ $artdata = array(
186
+ 'post_author' => 1,
187
+ 'post_date' => current_time('mysql'),
188
+ 'post_date_gmt' => current_time('mysql'),
189
+ 'post_title' => $filename,
190
+ 'post_status' => 'inherit',
191
+ 'comment_status' => 'closed',
192
+ 'ping_status' => 'closed',
193
+ 'post_name' => sanitize_title_with_dashes(str_replace("_", "-", $filename)),
194
+ 'post_modified' => current_time('mysql'),
195
+ 'post_modified_gmt' => current_time('mysql'),
196
+ 'post_parent' => '',
197
+ 'post_type' => 'attachment',
198
+ 'guid' => $ul_dir['baseurl'].'/'.$artDir.$folder_name.$filename,
199
+ 'post_mime_type' => $file_info['mime'],
200
+ 'post_excerpt' => '',
201
+ 'post_content' => ''
202
+ );
203
+
204
+ //insert the database record
205
+ $attach_id = wp_insert_attachment($artdata, $artDir.$folder_name.$filename);
206
+
207
+ //generate metadata and thumbnails
208
+ if($attach_data = wp_generate_attachment_metadata($attach_id, $saveDir)) wp_update_attachment_metadata($attach_id, $attach_data);
209
+ if(!self::isMultisite()) $artDir = 'uploads/'.$artDir;
210
+ return array("id" => $attach_id, "path" => $artDir.$folder_name.$filename);
211
+ }else{
212
+ return false;
213
+ }
214
+ }
215
+
216
+ /**
217
+ * get image relative path from image url (from upload)
218
+ */
219
+ public static function getImagePathFromURL($urlImage){
220
+
221
+ $pathImage = UniteFunctionJoomlaUG::getPathImageFromUrl($urlImage);
222
+
223
+ return($pathImage);
224
+ }
225
+
226
+ /**
227
+ * get image real path physical on disk from url
228
+ */
229
+ public static function getImageRealPathFromUrl($urlImage){
230
+
231
+ $realPath = UniteFunctionJoomlaUG::getImageFilepathFromUrl($urlImage);
232
+
233
+ return($realPath);
234
+ }
235
+
236
+
237
+ /**
238
+ *
239
+ * get image url from image path.
240
+ */
241
+ public static function getImageUrlFromPath($pathImage){
242
+ //protect from absolute url
243
+ $pathLower = strtolower($pathImage);
244
+ if(strpos($pathLower, "http://") !== false || strpos($pathLower, "www.") === 0)
245
+ return($pathImage);
246
+
247
+ $urlImage = self::getUrlUploads().$pathImage;
248
+ return($urlImage);
249
+ }
250
+
251
+
252
+ /**
253
+ *
254
+ * get post categories list assoc - id / title
255
+ */
256
+ public static function getCategoriesAssoc($taxonomy = "category"){
257
+
258
+ if(strpos($taxonomy,",") !== false){
259
+ $arrTax = explode(",", $taxonomy);
260
+ $arrCats = array();
261
+ foreach($arrTax as $tax){
262
+ $cats = self::getCategoriesAssoc($tax);
263
+ $arrCats = array_merge($arrCats,$cats);
264
+ }
265
+
266
+ return($arrCats);
267
+ }
268
+
269
+ //$cats = get_terms("category");
270
+ $args = array("taxonomy"=>$taxonomy);
271
+ $cats = get_categories($args);
272
+
273
+ $arrCats = array();
274
+ foreach($cats as $cat){
275
+ $numItems = $cat->count;
276
+ $itemsName = "items";
277
+ if($numItems == 1)
278
+ $itemsName = "item";
279
+
280
+ $title = $cat->name . " ($numItems $itemsName)";
281
+
282
+ $id = $cat->cat_ID;
283
+ $arrCats[$id] = $title;
284
+ }
285
+ return($arrCats);
286
+ }
287
+
288
+
289
+ /**
290
+ *
291
+ * return post type title from the post type
292
+ */
293
+ public static function getPostTypeTitle($postType){
294
+
295
+ $objType = get_post_type_object($postType);
296
+
297
+ if(empty($objType))
298
+ return($postType);
299
+
300
+ $title = $objType->labels->singular_name;
301
+
302
+ return($title);
303
+ }
304
+
305
+
306
+ /**
307
+ *
308
+ * get post type taxomonies
309
+ */
310
+ public static function getPostTypeTaxomonies($postType){
311
+ $arrTaxonomies = get_object_taxonomies(array( 'post_type' => $postType ), 'objects');
312
+
313
+ $arrNames = array();
314
+ foreach($arrTaxonomies as $key=>$objTax){
315
+ $arrNames[$objTax->name] = $objTax->labels->name;
316
+ }
317
+
318
+ return($arrNames);
319
+ }
320
+
321
+ /**
322
+ *
323
+ * get post types taxonomies as string
324
+ */
325
+ public static function getPostTypeTaxonomiesString($postType){
326
+ $arrTax = self::getPostTypeTaxomonies($postType);
327
+ $strTax = "";
328
+ foreach($arrTax as $name=>$title){
329
+ if(!empty($strTax))
330
+ $strTax .= ",";
331
+ $strTax .= $name;
332
+ }
333
+
334
+ return($strTax);
335
+ }
336
+
337
+
338
+ /**
339
+ *
340
+ * get all the post types including custom ones
341
+ * the put to top items will be always in top (they must be in the list)
342
+ */
343
+ public static function getPostTypesAssoc($arrPutToTop = array()){
344
+ $arrBuiltIn = array(
345
+ "post"=>"post",
346
+ "page"=>"page",
347
+ );
348
+
349
+ $arrCustomTypes = get_post_types(array('_builtin' => false));
350
+
351
+ //top items validation - add only items that in the customtypes list
352
+ $arrPutToTopUpdated = array();
353
+ foreach($arrPutToTop as $topItem){
354
+ if(in_array($topItem, $arrCustomTypes) == true){
355
+ $arrPutToTopUpdated[$topItem] = $topItem;
356
+ unset($arrCustomTypes[$topItem]);
357
+ }
358
+ }
359
+
360
+ $arrPostTypes = array_merge($arrPutToTopUpdated,$arrBuiltIn,$arrCustomTypes);
361
+
362
+ //update label
363
+ foreach($arrPostTypes as $key=>$type){
364
+ $arrPostTypes[$key] = self::getPostTypeTitle($type);
365
+ }
366
+
367
+ return($arrPostTypes);
368
+ }
369
+
370
+
371
+ /**
372
+ *
373
+ * get the category data
374
+ */
375
+ public static function getCategoryData($catID){
376
+ $catData = get_category($catID);
377
+ if(empty($catData))
378
+ return($catData);
379
+
380
+ $catData = (array)$catData;
381
+ return($catData);
382
+ }
383
+
384
+
385
+ /**
386
+ *
387
+ * get posts by coma saparated posts
388
+ */
389
+ public static function getPostsByIDs($strIDs){
390
+
391
+ if(is_string($strIDs)){
392
+ $arr = explode(",",$strIDs);
393
+ }
394
+
395
+ $query = array(
396
+ 'post_type'=>"any",
397
+ 'post__in' => $arr
398
+ );
399
+
400
+ $objQuery = new WP_Query($query);
401
+
402
+ $arrPosts = $objQuery->posts;
403
+
404
+ //dmp($query);dmp("num posts: ".count($arrPosts));exit();
405
+
406
+ foreach($arrPosts as $key=>$post){
407
+
408
+ if(method_exists($post, "to_array"))
409
+ $arrPosts[$key] = $post->to_array();
410
+ else
411
+ $arrPosts[$key] = (array)$post;
412
+ }
413
+
414
+ return($arrPosts);
415
+ }
416
+
417
+
418
+ /**
419
+ *
420
+ * get posts by some category
421
+ * could be multiple
422
+ */
423
+ public static function getPostsByCategory($catID,$sortBy = self::SORTBY_ID,$direction = self::ORDER_DIRECTION_DESC,$numPosts=-1,$postTypes="any",$taxonomies="category",$arrAddition = array()){
424
+
425
+ //get post types
426
+ if(strpos($postTypes,",") !== false){
427
+ $postTypes = explode(",", $postTypes);
428
+ if(array_search("any", $postTypes) !== false)
429
+ $postTypes = "any";
430
+ }
431
+
432
+ if(empty($postTypes))
433
+ $postTypes = "any";
434
+
435
+ if(strpos($catID,",") !== false)
436
+ $catID = explode(",",$catID);
437
+ else
438
+ $catID = array($catID);
439
+
440
+ $query = array(
441
+ 'order'=>$direction,
442
+ 'posts_per_page'=>$numPosts,
443
+ 'showposts'=>$numPosts,
444
+ 'post_type'=>$postTypes
445
+ );
446
+
447
+ //add sort by (could be by meta)
448
+ if(strpos($sortBy, "meta_num_") === 0){
449
+ $metaKey = str_replace("meta_num_", "", $sortBy);
450
+ $query["orderby"] = "meta_value_num";
451
+ $query["meta_key"] = $metaKey;
452
+ }else
453
+ if(strpos($sortBy, "meta_") === 0){
454
+ $metaKey = str_replace("meta_", "", $sortBy);
455
+ $query["orderby"] = "meta_value";
456
+ $query["meta_key"] = $metaKey;
457
+ }else
458
+ $query["orderby"] = $sortBy;
459
+
460
+ //get taxonomies array
461
+ $arrTax = array();
462
+ if(!empty($taxonomies)){
463
+ $arrTax = explode(",", $taxonomies);
464
+ }
465
+
466
+ if(!empty($taxonomies)){
467
+
468
+ $taxQuery = array();
469
+
470
+ //add taxomonies to the query
471
+ if(strpos($taxonomies,",") !== false){ //multiple taxomonies
472
+ $taxonomies = explode(",",$taxonomies);
473
+ foreach($taxonomies as $taxomony){
474
+ $taxArray = array(
475
+ 'taxonomy' => $taxomony,
476
+ 'field' => 'id',
477
+ 'terms' => $catID
478
+ );
479
+ $taxQuery[] = $taxArray;
480
+ }
481
+ }else{ //single taxomony
482
+ $taxArray = array(
483
+ 'taxonomy' => $taxonomies,
484
+ 'field' => 'id',
485
+ 'terms' => $catID
486
+ );
487
+ $taxQuery[] = $taxArray;
488
+ }
489
+
490
+ $taxQuery['relation'] = 'OR';
491
+
492
+ $query['tax_query'] = $taxQuery;
493
+ } //if exists taxanomies
494
+
495
+
496
+ if(!empty($arrAddition))
497
+ $query = array_merge($query, $arrAddition);
498
+
499
+ //unset($query["meta_query"]);
500
+ //dmp($query);exit();
501
+
502
+ $objQuery = new WP_Query($query);
503
+
504
+ $arrPosts = $objQuery->posts;
505
+
506
+ //dmp($query);dmp("num posts: ".count($arrPosts));exit();
507
+ //dmp($arrPost);
508
+
509
+ foreach($arrPosts as $key=>$post){
510
+
511
+ if(method_exists($post, "to_array"))
512
+ $arrPost = $post->to_array();
513
+ else
514
+ $arrPost = (array)$post;
515
+
516
+ $arrPostCats = self::getPostCategories($post, $arrTax);
517
+ $arrPost["categories"] = $arrPostCats;
518
+
519
+ $arrPosts[$key] = $arrPost;
520
+ }
521
+
522
+ return($arrPosts);
523
+ }
524
+
525
+ /**
526
+ *
527
+ * get post categories by postID and taxonomies
528
+ * the postID can be post object or array too
529
+ */
530
+ public static function getPostCategories($postID,$arrTax){
531
+
532
+ if(!is_numeric($postID)){
533
+ $postID = (array)$postID;
534
+ $postID = $postID["ID"];
535
+ }
536
+
537
+ $arrCats = wp_get_post_terms( $postID, $arrTax);
538
+ $arrCats = UniteFunctionsUG::convertStdClassToArray($arrCats);
539
+ return($arrCats);
540
+ }
541
+
542
+
543
+ /**
544
+ *
545
+ * get single post
546
+ */
547
+ public static function getPost($postID){
548
+ $post = get_post($postID);
549
+ if(empty($post))
550
+ UniteFunctionsUG::throwError("Post with id: $postID not found");
551
+
552
+ $arrPost = $post->to_array();
553
+ return($arrPost);
554
+ }
555
+
556
+
557
+ /**
558
+ *
559
+ * update post state
560
+ */
561
+ public static function updatePostState($postID,$state){
562
+ $arrUpdate = array();
563
+ $arrUpdate["ID"] = $postID;
564
+ $arrUpdate["post_status"] = $state;
565
+
566
+ wp_update_post($arrUpdate);
567
+ }
568
+
569
+ /**
570
+ *
571
+ * update post menu order
572
+ */
573
+ public static function updatePostOrder($postID,$order){
574
+ $arrUpdate = array();
575
+ $arrUpdate["ID"] = $postID;
576
+ $arrUpdate["menu_order"] = $order;
577
+
578
+ wp_update_post($arrUpdate);
579
+ }
580
+
581
+
582
+ /**
583
+ *
584
+ * get url of post thumbnail
585
+ */
586
+ public static function getUrlPostImage($postID,$size = self::THUMB_FULL){
587
+
588
+ $post_thumbnail_id = get_post_thumbnail_id( $postID );
589
+ if(empty($post_thumbnail_id))
590
+ return("");
591
+
592
+ $arrImage = wp_get_attachment_image_src($post_thumbnail_id,$size);
593
+ if(empty($arrImage))
594
+ return("");
595
+
596
+ $urlImage = $arrImage[0];
597
+ return($urlImage);
598
+ }
599
+
600
+ /**
601
+ *
602
+ * get post thumb id from post id
603
+ */
604
+ public static function getPostThumbID($postID){
605
+ $thumbID = get_post_thumbnail_id( $postID );
606
+ return($thumbID);
607
+ }
608
+
609
+
610
+ /**
611
+ *
612
+ * get attachment image array by id and size
613
+ */
614
+ public static function getAttachmentImage($thumbID,$size = self::THUMB_FULL){
615
+
616
+ $arrImage = wp_get_attachment_image_src($thumbID,$size);
617
+ if(empty($arrImage))
618
+ return(false);
619
+
620
+ $output = array();
621
+ $output["url"] = UniteFunctionsUG::getVal($arrImage, 0);
622
+ $output["width"] = UniteFunctionsUG::getVal($arrImage, 1);
623
+ $output["height"] = UniteFunctionsUG::getVal($arrImage, 2);
624
+
625
+ return($output);
626
+ }
627
+
628
+
629
+ /**
630
+ *
631
+ * get attachment image url
632
+ */
633
+ public static function getUrlAttachmentImage($thumbID, $size = self::THUMB_FULL){
634
+
635
+ $arrImage = wp_get_attachment_image_src($thumbID, $size);
636
+ if(empty($arrImage))
637
+ return(false);
638
+
639
+ $url = UniteFunctionsUG::getVal($arrImage, 0);
640
+ return($url);
641
+ }
642
+
643
+
644
+ /**
645
+ * get unitegallery items array from attachment id's
646
+ */
647
+ public static function getArrItemsFromAttachments($arrIDs){
648
+
649
+ $arrPosts = get_posts( array('include' => $arrIDs, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'orderby'=>"none") );
650
+
651
+ $arrItems = array();
652
+ foreach($arrPosts as $post){
653
+
654
+ $altText = get_post_meta($post->ID, '_wp_attachment_image_alt', true);
655
+
656
+ $item = array();
657
+ $item["id"] = $post->ID;
658
+ $item["image_id"] = $post->ID;
659
+ $item["url_image"] = $post->guid;
660
+
661
+ $item["title"] = $post->post_title;
662
+ $item["description"] = $post->post_content;
663
+ $item["alt"] = $altText;
664
+
665
+ $arrThumb = self::getAttachmentImage($post->ID, self::THUMB_MEDIUM);
666
+
667
+ $item["url_thumb"] = UniteFunctionsUG::getVal($arrThumb, "url");
668
+ $item["thumb_width"] = UniteFunctionsUG::getVal($arrThumb, "width");
669
+ $item["thumb_height"] = UniteFunctionsUG::getVal($arrThumb, "height");
670
+ $arrItems[] = $item;
671
+ }
672
+
673
+ $arrItems = UniteFunctionsUG::arrayToAssoc($arrItems, "id");
674
+
675
+ $arrItemsOrdered = array();
676
+ foreach($arrIDs as $id){
677
+ $arrItemsOrdered[] = $arrItems[$id];
678
+ }
679
+
680
+ return($arrItemsOrdered);
681
+ }
682
+
683
+ /**
684
+ * get attachment data
685
+ */
686
+ public static function getAttachmentData($attachmentID){
687
+ $arr = array($attachmentID);
688
+
689
+ $arrData = self::getArrItemsFromAttachments(array($attachmentID));
690
+ if(empty($arrData))
691
+ return(null);
692
+
693
+ $data = $arrData[0];
694
+
695
+ return($data);
696
+ }
697
+
698
+
699
+ /**
700
+ *
701
+ * get link of edit slides by category id
702
+ */
703
+ public static function getUrlSlidesEditByCatID($catID){
704
+
705
+ $url = self::$urlAdmin;
706
+ $url .= "edit.php?s&post_status=all&post_type=post&action=-1&m=0&cat=".$catID."&paged=1&mode=list&action2=-1";
707
+
708
+ return($url);
709
+ }
710
+
711
+ /**
712
+ *
713
+ * get edit post url
714
+ */
715
+ public static function getUrlEditPost($postID){
716
+ $url = self::$urlAdmin;
717
+ $url .= "post.php?post=".$postID."&action=edit";
718
+
719
+ return($url);
720
+ }
721
+
722
+
723
+ /**
724
+ *
725
+ * get new post url
726
+ */
727
+ public static function getUrlNewPost(){
728
+ $url = self::$urlAdmin;
729
+ $url .= "post-new.php";
730
+ return($url);
731
+ }
732
+
733
+
734
+ /**
735
+ *
736
+ * delete post
737
+ */
738
+ public static function deletePost($postID){
739
+ $success = wp_delete_post($postID,false);
740
+ if($success == false)
741
+ UniteFunctionsUG::throwError("Could not delete post: $postID");
742
+ }
743
+
744
+ /**
745
+ *
746
+ * update post thumbnail
747
+ */
748
+ public static function updatePostThumbnail($postID,$thumbID){
749
+ set_post_thumbnail($postID, $thumbID);
750
+ }
751
+
752
+
753
+ /**
754
+ *
755
+ * get intro from content
756
+ */
757
+ public static function getIntroFromContent($text){
758
+ $intro = "";
759
+ if(!empty($text)){
760
+ $arrExtended = get_extended($text);
761
+ $intro = UniteFunctionsUG::getVal($arrExtended, "main");
762
+
763
+ /*
764
+ if(strlen($text) != strlen($intro))
765
+ $intro .= "...";
766
+ */
767
+ }
768
+
769
+ return($intro);
770
+ }
771
+
772
+
773
+ /**
774
+ *
775
+ * get excerpt from post id
776
+ */
777
+ public static function getExcerptById($postID, $limit=55){
778
+
779
+ $post = get_post($postID);
780
+
781
+ $excerpt = $post->post_excerpt;
782
+ $excerpt = trim($excerpt);
783
+
784
+ $excerpt = trim($excerpt);
785
+ if(empty($excerpt))
786
+ $excerpt = $post->post_content;
787
+
788
+ $excerpt = strip_tags($excerpt,"<b><br><br/><i><strong><small>");
789
+
790
+ $excerpt = UniteFunctionsUG::getTextIntro($excerpt, $limit);
791
+
792
+ return $excerpt;
793
+ }
794
+
795
+
796
+ /**
797
+ *
798
+ * get user display name from user id
799
+ */
800
+ public static function getUserDisplayName($userID){
801
+
802
+ $displayName = get_the_author_meta('display_name', $userID);
803
+
804
+ return($displayName);
805
+ }
806
+
807
+
808
+ /**
809
+ *
810
+ * get categories by id's
811
+ */
812
+ public static function getCategoriesByIDs($arrIDs,$strTax = null){
813
+
814
+ if(empty($arrIDs))
815
+ return(array());
816
+
817
+ if(is_string($arrIDs))
818
+ $strIDs = $arrIDs;
819
+ else
820
+ $strIDs = implode(",", $arrIDs);
821
+
822
+ $args = array();
823
+ $args["include"] = $strIDs;
824
+
825
+ if(!empty($strTax)){
826
+ if(is_string($strTax))
827
+ $strTax = explode(",",$strTax);
828
+
829
+ $args["taxonomy"] = $strTax;
830
+ }
831
+
832
+ $arrCats = get_categories( $args );
833
+
834
+ if(!empty($arrCats))
835
+ $arrCats = UniteFunctionsUG::convertStdClassToArray($arrCats);
836
+
837
+ return($arrCats);
838
+ }
839
+
840
+
841
+ /**
842
+ *
843
+ * get categories short
844
+ */
845
+ public static function getCategoriesByIDsShort($arrIDs,$strTax = null){
846
+ $arrCats = self::getCategoriesByIDs($arrIDs,$strTax);
847
+ $arrNew = array();
848
+ foreach($arrCats as $cat){
849
+ $catID = $cat["term_id"];
850
+ $catName = $cat["name"];
851
+ $arrNew[$catID] = $catName;
852
+ }
853
+
854
+ return($arrNew);
855
+ }
856
+
857
+
858
+ /**
859
+ * get categories list, copy the code from default wp functions
860
+ */
861
+ public static function getCategoriesHtmlList($catIDs,$strTax = null){
862
+ global $wp_rewrite;
863
+
864
+ //$catList = get_the_category_list( ",", "", $postID );
865
+
866
+ $categories = self::getCategoriesByIDs($catIDs,$strTax);
867
+
868
+ $arrErrors = UniteFunctionsUG::getVal($categories, "errors");
869
+
870
+ if(!empty($arrErrors)){
871
+ foreach($arrErrors as $key=>$arr){
872
+ $strErrors = implode($arr,",");
873
+ }
874
+
875
+ UniteFunctionsUG::throwError("getCategoriesHtmlList error: ".$strErrors);
876
+ }
877
+
878
+ $rel = ( is_object( $wp_rewrite ) && $wp_rewrite->using_permalinks() ) ? 'rel="category tag"' : 'rel="category"';
879
+
880
+ $separator = ',';
881
+
882
+ $thelist = '';
883
+
884
+ $i = 0;
885
+ foreach ( $categories as $category ) {
886
+
887
+ if(is_object($category))
888
+ $category = (array)$category;
889
+
890
+ if ( 0 < $i )
891
+ $thelist .= $separator;
892
+
893
+ $catID = $category["term_id"];
894
+ $link = get_category_link($catID);
895
+ $catName = $category["name"];
896
+
897
+ if(!empty($link))
898
+ $thelist .= '<a href="' . esc_url( $link ) . '" title="' . esc_attr( sprintf( __( "View all posts in %s", UNITEGALLERY_TEXTDOMAIN), $category["name"] ) ) . '" ' . $rel . '>' . $catName.'</a>';
899
+ else
900
+ $thelist .= $catName;
901
+
902
+ ++$i;
903
+ }
904
+
905
+
906
+ return $thelist;
907
+ }
908
+
909
+
910
+ /**
911
+ *
912
+ * get post tags html list
913
+ */
914
+ public static function getTagsHtmlList($postID){
915
+ $tagList = get_the_tag_list("",",","",$postID);
916
+ return($tagList);
917
+ }
918
+
919
+ /**
920
+ *
921
+ * convert date to the date format that the user chose.
922
+ */
923
+ public static function convertPostDate($date){
924
+ if(empty($date))
925
+ return($date);
926
+ $date = date_i18n(get_option('date_format'), strtotime($date));
927
+ return($date);
928
+ }
929
+
930
+ /**
931
+ *
932
+ * get assoc list of the taxonomies
933
+ */
934
+ public static function getTaxonomiesAssoc(){
935
+ $arr = get_taxonomies();
936
+ unset($arr["post_tag"]);
937
+ unset($arr["nav_menu"]);
938
+ unset($arr["link_category"]);
939
+ unset($arr["post_format"]);
940
+
941
+ return($arr);
942
+ }
943
+
944
+
945
+ /**
946
+ *
947
+ * get post types array with taxomonies
948
+ */
949
+ public static function getPostTypesWithTaxomonies(){
950
+ $arrPostTypes = self::getPostTypesAssoc();
951
+
952
+ foreach($arrPostTypes as $postType=>$title){
953
+ $arrTaxomonies = self::getPostTypeTaxomonies($postType);
954
+ $arrPostTypes[$postType] = $arrTaxomonies;
955
+ }
956
+
957
+ return($arrPostTypes);
958
+ }
959
+
960
+
961
+ /**
962
+ *
963
+ * get array of post types with categories (the taxonomies is between).
964
+ * get only those taxomonies that have some categories in it.
965
+ */
966
+ public static function getPostTypesWithCats(){
967
+ $arrPostTypes = self::getPostTypesWithTaxomonies();
968
+
969
+ $arrPostTypesOutput = array();
970
+ foreach($arrPostTypes as $name=>$arrTax){
971
+
972
+ $arrTaxOutput = array();
973
+ foreach($arrTax as $taxName=>$taxTitle){
974
+ $cats = self::getCategoriesAssoc($taxName);
975
+ if(!empty($cats))
976
+ $arrTaxOutput[] = array(
977
+ "name"=>$taxName,
978
+ "title"=>$taxTitle,
979
+ "cats"=>$cats);
980
+ }
981
+
982
+ $arrPostTypesOutput[$name] = $arrTaxOutput;
983
+
984
+ }
985
+
986
+ return($arrPostTypesOutput);
987
+ }
988
+
989
+
990
+ /**
991
+ *
992
+ * get array of all taxonomies with categories.
993
+ */
994
+ public static function getTaxonomiesWithCats(){
995
+
996
+ $arrTax = self::getTaxonomiesAssoc();
997
+ $arrTaxNew = array();
998
+ foreach($arrTax as $key=>$value){
999
+ $arrItem = array();
1000
+ $arrItem["name"] = $key;
1001
+ $arrItem["title"] = $value;
1002
+ $arrItem["cats"] = self::getCategoriesAssoc($key);
1003
+ $arrTaxNew[$key] = $arrItem;
1004
+ }
1005
+
1006
+ return($arrTaxNew);
1007
+ }
1008
+
1009
+
1010
+ /**
1011
+ *
1012
+ * get content url
1013
+ */
1014
+ public static function getUrlContent(){
1015
+
1016
+ if(self::isMultisite() == false){ //without multisite
1017
+ $baseUrl = content_url()."/";
1018
+ }
1019
+ else{ //for multisite
1020
+ $arrUploadData = wp_upload_dir();
1021
+ $baseUrl = $arrUploadData["baseurl"]."/";
1022
+ }
1023
+
1024
+ if(is_ssl()){
1025
+ $baseUrl = str_replace("http://", "https://", $baseUrl);
1026
+ }
1027
+
1028
+ return($baseUrl);
1029
+ }
1030
+
1031
+
1032
+
1033
+ /**
1034
+ *
1035
+ * get cats and taxanomies data from the category id's
1036
+ */
1037
+ public static function getCatAndTaxData($catIDs){
1038
+
1039
+ if(is_string($catIDs)){
1040
+ $catIDs = trim($catIDs);
1041
+ if(empty($catIDs))
1042
+ return(array("tax"=>"","cats"=>""));
1043
+
1044
+ $catIDs = explode(",", $catIDs);
1045
+ }
1046
+
1047
+ $strCats = "";
1048
+ $arrTax = array();
1049
+ foreach($catIDs as $cat){
1050
+ if(strpos($cat,"option_disabled") === 0)
1051
+ continue;
1052
+
1053
+ $pos = strrpos($cat,"_");
1054
+ if($pos === false)
1055
+ UniteFunctionsUG::throwError("The category is in wrong format");
1056
+
1057
+ $taxName = substr($cat,0,$pos);
1058
+ $catID = substr($cat,$pos+1,strlen($cat)-$pos-1);
1059
+
1060
+ $arrTax[$taxName] = $taxName;
1061
+ if(!empty($strCats))
1062
+ $strCats .= ",";
1063
+
1064
+ $strCats .= $catID;
1065
+ }
1066
+
1067
+ $strTax = "";
1068
+ foreach($arrTax as $taxName){
1069
+ if(!empty($strTax))
1070
+ $strTax .= ",";
1071
+
1072
+ $strTax .= $taxName;
1073
+ }
1074
+
1075
+ $output = array("tax"=>$strTax,"cats"=>$strCats);
1076
+
1077
+ return($output);
1078
+ }
1079
+
1080
+
1081
+ /**
1082
+ *
1083
+ * get current language code
1084
+ */
1085
+ public static function getCurrentLangCode(){
1086
+ $langTag = ICL_LANGUAGE_CODE;
1087
+
1088
+ return($langTag);
1089
+ }
1090
+
1091
+ /**
1092
+ *
1093
+ * write settings language file for wp automatic scanning
1094
+ */
1095
+ public static function writeSettingLanguageFile($filepath){
1096
+ $info = pathinfo($filepath);
1097
+ $path = UniteFunctionsUG::getVal($info, "dirname")."/";
1098
+ $filename = UniteFunctionsUG::getVal($info, "filename");
1099
+ $ext = UniteFunctionsUG::getVal($info, "extension");
1100
+ $filenameOutput = "{$filename}_{$ext}_lang.php";
1101
+ $filepathOutput = $path.$filenameOutput;
1102
+
1103
+ //load settings
1104
+ $settings = new UniteSettingsAdvancedUG();
1105
+ $settings->loadXMLFile($filepath);
1106
+ $arrText = $settings->getArrTextFromAllSettings();
1107
+
1108
+ $str = "";
1109
+ $str .= "<?php \n";
1110
+ foreach($arrText as $text){
1111
+ $text = str_replace('"', '\\"', $text);
1112
+ $str .= "_e(\"$text\",\"".UNITEGALLERY_TEXTDOMAIN."\"); \n";
1113
+ }
1114
+ $str .= "?>";
1115
+
1116
+ UniteFunctionsUG::writeFile($str, $filepathOutput);
1117
+ }
1118
+
1119
+
1120
+ /**
1121
+ *
1122
+ * check the current post for the existence of a short code
1123
+ */
1124
+ public static function hasShortcode($shortcode = '') {
1125
+
1126
+ $post = get_post(get_the_ID());
1127
+
1128
+ if (empty($shortcode))
1129
+ return $found;
1130
+
1131
+ $found = false;
1132
+
1133
+ if (stripos($post->post_content, '[' . $shortcode) !== false )
1134
+ $found = true;
1135
+
1136
+ return $found;
1137
+ }
1138
+
1139
+ /**
1140
+ *
1141
+ * simple enqueue script
1142
+ */
1143
+ public static function addWPScript($scriptName){
1144
+ wp_enqueue_script($scriptName);
1145
+ }
1146
+
1147
+ /**
1148
+ *
1149
+ * simple enqueue style
1150
+ */
1151
+ public static function addWPStyle($styleName){
1152
+ wp_enqueue_style($styleName);
1153
+ }
1154
+
1155
+ /**
1156
+ *
1157
+ * add all js and css needed for media upload
1158
+ */
1159
+ public static function addMediaUploadIncludes(){
1160
+
1161
+ self::addWPScript("thickbox");
1162
+ self::addWPStyle("thickbox");
1163
+ self::addWPScript("media-upload");
1164
+
1165
+ }
1166
+
1167
+
1168
+ /**
1169
+ *
1170
+ * validate permission that the user is admin, and can manage options.
1171
+ */
1172
+ public static function isAdminPermissions($capability = "manage_options"){
1173
+
1174
+ if( is_admin() && current_user_can($capability) )
1175
+ return(true);
1176
+
1177
+ return(false);
1178
+ }
1179
+
1180
+ /**
1181
+ * get thumbnail sizes array
1182
+ * mode: null, "small_only", "big_only"
1183
+ */
1184
+ public static function getArrThumbSizes($mode = null){
1185
+ global $_wp_additional_image_sizes;
1186
+
1187
+ $arrWPSizes = get_intermediate_image_sizes();
1188
+
1189
+ $arrSizes = array();
1190
+
1191
+ if($mode != "big_only"){
1192
+ $arrSizes[self::THUMB_SMALL] = "Thumbnail (150x150)";
1193
+ $arrSizes[self::THUMB_MEDIUM] = "Medium (max width 300)";
1194
+ }
1195
+
1196
+ if($mode == "small_only")
1197
+ return($arrSizes);
1198
+
1199
+ foreach($arrWPSizes as $size){
1200
+ $title = ucfirst($size);
1201
+ switch($size){
1202
+ case self::THUMB_LARGE:
1203
+ case self::THUMB_MEDIUM:
1204
+ case self::THUMB_FULL:
1205
+ case self::THUMB_SMALL:
1206
+ continue(2);
1207
+ break;
1208
+ case "ug_big":
1209
+ $title = __("Big", UNITEGALLERY_TEXTDOMAIN);
1210
+ break;
1211
+ }
1212
+
1213
+ $arrSize = UniteFunctionsUG::getVal($_wp_additional_image_sizes, $size);
1214
+ $maxWidth = UniteFunctionsUG::getVal($arrSize, "width");
1215
+
1216
+ if(!empty($maxWidth))
1217
+ $title .= " (max width $maxWidth)";
1218
+
1219
+ $arrSizes[$size] = $title;
1220
+ }
1221
+
1222
+ $arrSizes[self::THUMB_LARGE] = __("Large (max width 1024)", UNITEGALLERY_TEXTDOMAIN);
1223
+ $arrSizes[self::THUMB_FULL] = __("Full", UNITEGALLERY_TEXTDOMAIN);
1224
+
1225
+ return($arrSizes);
1226
+ }
1227
+
1228
+ /**
1229
+ *
1230
+ * check the put in string
1231
+ * return true / false if the put in string match the current page.
1232
+ */
1233
+ public static function isPutInStringMatch($putIn, $emptyIsFalse = false){
1234
+
1235
+ $putIn = strtolower($putIn);
1236
+ $putIn = trim($putIn);
1237
+
1238
+ if($emptyIsFalse && empty($putIn))
1239
+ return(false);
1240
+
1241
+ if($putIn == "homepage"){ //filter by homepage
1242
+ if(is_front_page() == false)
1243
+ return(false);
1244
+ }
1245
+ else //case filter by pages
1246
+ if(!empty($putIn)){
1247
+ $arrPutInPages = array();
1248
+ $arrPagesTemp = explode(",", $putIn);
1249
+ foreach($arrPagesTemp as $page){
1250
+ $page = trim($page);
1251
+ if(is_numeric($page) || $page == "homepage")
1252
+ $arrPutInPages[] = $page;
1253
+ }
1254
+ if(!empty($arrPutInPages)){
1255
+
1256
+ //get current page id
1257
+ $currentPageID = "";
1258
+ if(is_front_page() == true)
1259
+ $currentPageID = "homepage";
1260
+ else{
1261
+ global $post;
1262
+ if(isset($post->ID))
1263
+ $currentPageID = $post->ID;
1264
+ }
1265
+
1266
+ //do the filter by pages
1267
+ if(array_search($currentPageID, $arrPutInPages) === false)
1268
+ return(false);
1269
+ }
1270
+ }
1271
+
1272
+ return(true);
1273
+ }
1274
+
1275
+
1276
+ /**
1277
+ * do plugin activation without including plugin files
1278
+ *
1279
+ */
1280
+ public static function activatePlugin($pluginFile){
1281
+
1282
+ if(file_exists($pluginFile) == false)
1283
+ return(false);
1284
+
1285
+ $plugin = plugin_basename( trim( $pluginFile ) );
1286
+
1287
+ $current = get_option( 'active_plugins', array() );
1288
+ $current[] = $plugin;
1289
+ sort($current);
1290
+ update_option('active_plugins', $current);
1291
+
1292
+ return(true);
1293
+ }
1294
+
1295
+ /**
1296
+ * check if current page is post page
1297
+ */
1298
+ public static function isInsidePostPage(){
1299
+ $screen = get_current_screen();
1300
+ if(empty($screen))
1301
+ return(false);
1302
+
1303
+ $screenBase = $screen->base;
1304
+ if($screenBase == "post")
1305
+ return(true);
1306
+
1307
+ return(false);
1308
+ }
1309
+
1310
+
1311
+ } //end of the class
1312
+
1313
+ //init the static vars
1314
+ UniteFunctionsWPUG::initStaticVars();
1315
+
1316
+ ?>
inc_php/framework/provider/provider_admin.class.php ADDED
@@ -0,0 +1,375 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class UniteProviderAdminUG extends UniteGalleryAdmin{
4
+
5
+ private static $arrMenuPages = array();
6
+ private static $arrSubMenuPages = array();
7
+ private static $capability = "manage_options";
8
+
9
+ private $mainFilepath;
10
+
11
+ private static $t;
12
+
13
+ const ACTION_ADMIN_MENU = "admin_menu";
14
+ const ACTION_ADMIN_INIT = "admin_init";
15
+ const ACTION_ADD_SCRIPTS = "admin_enqueue_scripts";
16
+ const ACTION_PRINT_SCRIPT = "admin_print_footer_scripts";
17
+
18
+
19
+ /**
20
+ *
21
+ * the constructor
22
+ */
23
+ public function __construct($mainFilepath){
24
+ self::$t = $this;
25
+
26
+ $this->mainFilepath = $mainFilepath;
27
+
28
+ $permission = HelperUG::getGeneralSetting("edit_permission");
29
+ if($permission == "editor")
30
+ self::$capability = "edit_posts";
31
+
32
+ parent::__construct();
33
+
34
+ $this->init();
35
+ }
36
+
37
+
38
+ /**
39
+ * process activate event - install the db (with delta).
40
+ */
41
+ public static function onActivate(){
42
+
43
+ self::createTables();
44
+ }
45
+
46
+
47
+ /**
48
+ *
49
+ * create the tables if not exists
50
+ */
51
+ public static function createTables(){
52
+ self::createTable(GlobalsUG::TABLE_GALLERIES_NAME);
53
+ self::createTable(GlobalsUG::TABLE_ITEMS_NAME);
54
+ self::createTable(GlobalsUG::TABLE_CATEGORIES_NAME);
55
+ }
56
+
57
+
58
+ /**
59
+ *
60
+ * craete tables
61
+ */
62
+ public static function createTable($tableName){
63
+
64
+ global $wpdb;
65
+
66
+ //if table exists - don't create it.
67
+ $tableRealName = $wpdb->prefix.$tableName;
68
+
69
+ if(UniteFunctionsWPUG::isDBTableExists($tableRealName))
70
+ return(false);
71
+
72
+ $charset_collate = $wpdb->get_charset_collate();
73
+
74
+ switch($tableName){
75
+ case GlobalsUG::TABLE_CATEGORIES_NAME:
76
+ $sql = "CREATE TABLE " .$tableRealName ." (
77
+ id int(9) NOT NULL AUTO_INCREMENT,
78
+ title varchar(255) NOT NULL,
79
+ alias varchar(255),
80
+ ordering int not NULL,
81
+ params text NOT NULL,
82
+ type tinytext,
83
+ parent_id int(9),
84
+ PRIMARY KEY (id)
85
+ )$charset_collate;";
86
+ break;
87
+ case GlobalsUG::TABLE_ITEMS_NAME:
88
+ $sql = "CREATE TABLE " .$tableRealName ." (
89
+ id int(9) NOT NULL AUTO_INCREMENT,
90
+ published int(2) NOT NULL,
91
+ title tinytext NOT NULL,
92
+ alias tinytext,
93
+ type varchar(60),
94
+ url_image tinytext,
95
+ url_thumb tinytext,
96
+ ordering int not NULL,
97
+ catid int(9) NOT NULL,
98
+ imageid int(9),
99
+ params text,
100
+ content text,
101
+ contentid varchar(60),
102
+ parent_id int(9),
103
+ PRIMARY KEY (id)
104
+ )$charset_collate;";
105
+ break;
106
+ case GlobalsUG::TABLE_GALLERIES_NAME:
107
+ $sql = "CREATE TABLE " .$tableRealName ." (
108
+ id int(9) NOT NULL AUTO_INCREMENT,
109
+ type varchar(60) NOT NULL,
110
+ title tinytext NOT NULL,
111
+ alias tinytext,
112
+ ordering int not NULL,
113
+ params text,
114
+ PRIMARY KEY (id)
115
+ )$charset_collate;";
116
+ break;
117
+ default:
118
+ UniteFunctionsMeg::throwError("table: $tableName not found");
119
+ break;
120
+ }
121
+
122
+ require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
123
+ dbDelta($sql);
124
+ }
125
+
126
+ /**
127
+ *
128
+ * add ajax back end callback, on some action to some function.
129
+ */
130
+ protected static function addActionAjax($ajaxAction, $eventFunction){
131
+ self::addAction('wp_ajax_'.GlobalsUG::PLUGIN_NAME."_".$ajaxAction, $eventFunction);
132
+ self::addAction('wp_ajax_nopriv_'.GlobalsUG::PLUGIN_NAME."_".$ajaxAction, $eventFunction);
133
+ }
134
+
135
+
136
+ /**
137
+ *
138
+ * register the "onActivate" event
139
+ */
140
+ protected function addEvent_onActivate($eventFunc = "onActivate"){
141
+
142
+ register_activation_hook( $this->mainFilepath, array(self::$t, $eventFunc) );
143
+ }
144
+
145
+
146
+ /**
147
+ *
148
+ * add menu page
149
+ */
150
+ protected static function addMenuPage($title,$pageFunctionName){
151
+ self::$arrMenuPages[] = array("title"=>$title,"pageFunction"=>$pageFunctionName);
152
+ }
153
+
154
+ /**
155
+ *
156
+ * add sub menu page
157
+ */
158
+ protected static function addSubMenuPage($slug,$title,$pageFunctionName){
159
+ self::$arrSubMenuPages[] = array("slug"=>$slug,"title"=>$title,"pageFunction"=>$pageFunctionName);
160
+ }
161
+
162
+
163
+ /**
164
+ * add admin menus from the list.
165
+ */
166
+ public static function addAdminMenu(){
167
+
168
+
169
+ //return(false);
170
+ foreach(self::$arrMenuPages as $menu){
171
+ $title = $menu["title"];
172
+ $pageFunctionName = $menu["pageFunction"];
173
+
174
+ add_menu_page( $title, $title, self::$capability, GlobalsUG::PLUGIN_NAME, array(self::$t, $pageFunctionName) );
175
+ }
176
+
177
+ foreach(self::$arrSubMenuPages as $key=>$submenu){
178
+
179
+ $title = $submenu["title"];
180
+ $pageFunctionName = $submenu["pageFunction"];
181
+
182
+ $slug = GlobalsUG::PLUGIN_NAME."_".$submenu["slug"];
183
+
184
+ if($key == 0)
185
+ $slug = GlobalsUG::PLUGIN_NAME;
186
+
187
+ add_submenu_page(GlobalsUG::PLUGIN_NAME, $title, $title, self::$capability, $slug, array(self::$t, $pageFunctionName) );
188
+ }
189
+
190
+ }
191
+
192
+
193
+ /**
194
+ *
195
+ * tells if the the current plugin opened is this plugin or not
196
+ * in the admin side.
197
+ */
198
+ private function isInsidePlugin(){
199
+ $page = UniteFunctionsUG::getGetVar("page");
200
+
201
+ if($page == GlobalsUG::PLUGIN_NAME || strpos($page, GlobalsUG::PLUGIN_NAME."_") !== false)
202
+ return(true);
203
+
204
+ return(false);
205
+ }
206
+
207
+
208
+ /**
209
+ *
210
+ * add some WordPress action
211
+ */
212
+ protected static function addAction($action,$eventFunction){
213
+
214
+ add_action( $action, array(self::$t, $eventFunction) );
215
+ }
216
+
217
+
218
+ /**
219
+ *
220
+ * validate admin permissions, if no pemissions - exit
221
+ */
222
+ protected static function validateAdminPermissions(){
223
+
224
+ if(UniteFunctionsWPUG::isAdminPermissions(self::$capability) == false){
225
+ echo "access denied, no ".GlobalsUG::PERMISSION." permissions";
226
+ return(false);
227
+ }
228
+
229
+ }
230
+
231
+
232
+ /**
233
+ *
234
+ * admin main page function.
235
+ */
236
+ public static function adminPages(){
237
+
238
+ self::createTables();
239
+
240
+ parent::adminPages();
241
+
242
+ }
243
+
244
+
245
+ /**
246
+ * print custom scripts
247
+ */
248
+ public static function onPrintFooterScripts(){
249
+
250
+ $arrScrips = UniteProviderFunctionsUG::getCustomScripts();
251
+
252
+ echo "<script type='text/javascript'>\n";
253
+ foreach ($arrScrips as $script){
254
+ echo $script."\n";
255
+ }
256
+ echo "</script>";
257
+
258
+ UniteProviderFunctionsUG::printInlineStyles();
259
+
260
+ }
261
+
262
+
263
+ /**
264
+ * on ajax actions
265
+ */
266
+ public static function onAjaxAction(){
267
+
268
+ $arrFrontActions = array("front_get_cat_items","front_loadmore");
269
+
270
+ $clientAction = UniteFunctionsUG::getPostVariable("client_action");
271
+
272
+ $isFrontAction = in_array($clientAction, $arrFrontActions);
273
+
274
+ if($isFrontAction == true){ //front end action
275
+
276
+ $operations = new UGOperations();
277
+ $operations->onClientAjaxActions();
278
+
279
+ }else{ //backend actions
280
+
281
+ //verify nonce
282
+ $nonce = UniteFunctionsUG::getPostGetVariable("nonce");
283
+ $verified = wp_verify_nonce($nonce, "unitegallery_actions");
284
+ if($verified == false){
285
+ _e("Unauthorised access!, if you updated the gallery recently, please do ctrl+f5 - refresh the page and try again.", UNITEGALLERY_TEXTDOMAIN);
286
+ exit();
287
+ }
288
+
289
+ parent::onAjaxAction();
290
+ }
291
+
292
+ }
293
+
294
+
295
+ public function custom_media_upload_tab_name( $tabs ) {
296
+
297
+ $newtab = array( 'tab_slug' => 'Your Tab Name' );
298
+ return array_merge( $tabs, $newtab );
299
+ }
300
+
301
+ public function custom_media_upload_tab_content() {
302
+ echo "contnet!!!";
303
+ // Add you content here.
304
+ }
305
+
306
+ private function test(){
307
+
308
+ add_filter( 'media_upload_tabs', array($this,'custom_media_upload_tab_name') );
309
+ add_action( 'media_upload_tab_slug', array($this,'custom_media_upload_tab_content') );
310
+
311
+ }
312
+
313
+ /**
314
+ * add admin global scripts
315
+ */
316
+ public function addWPGlobalScripts(){
317
+
318
+ $isInsidePost = UniteFunctionsWPUG::isInsidePostPage();
319
+
320
+ //load scripts for post page
321
+ if($isInsidePost == true){
322
+ HelperGalleryUG::addScriptAbsoluteUrl(GlobalsUG::$url_provider."assets/unitegallery_post_page.js", "unitegallery_post_page");
323
+ }
324
+
325
+ }
326
+
327
+
328
+ /**
329
+ * register widgets
330
+ */
331
+ public static function registerWidgets(){
332
+
333
+ register_widget( 'UniteGallery_Widget' );
334
+
335
+ }
336
+
337
+
338
+ /**
339
+ *
340
+ * init function
341
+ */
342
+ public function init(){
343
+
344
+ parent::init();
345
+
346
+ self::addMenuPage('Unite Gallery', "adminPages");
347
+ self::addSubMenuPage("galleries", __('Galleries',UNITEGALLERY_TEXTDOMAIN), "adminPages");
348
+ self::addSubMenuPage("items", __('Items', UNITEGALLERY_TEXTDOMAIN), "adminPages");
349
+ self::addSubMenuPage("settings", __('Settings', UNITEGALLERY_TEXTDOMAIN), "adminPages");
350
+
351
+ //add internal hook for adding a menu in arrMenus
352
+ self::addAction(self::ACTION_ADMIN_MENU, "addAdminMenu");
353
+
354
+ //if not inside plugin don't continue
355
+ if($this->isInsidePlugin() == true){
356
+ self::addAction(self::ACTION_ADD_SCRIPTS, "onAddScripts");
357
+ self::addAction(self::ACTION_PRINT_SCRIPT, "onPrintFooterScripts");
358
+ }else{
359
+ //self::addAction(self::ACTION_ADD_SCRIPTS, "addWPGlobalScripts");
360
+ }
361
+
362
+ $this->addEvent_onActivate();
363
+
364
+ self::addActionAjax("ajax_action", "onAjaxAction");
365
+
366
+ self::addAction( 'widgets_init', 'registerWidgets' );
367
+
368
+ //$this->test();
369
+ }
370
+
371
+
372
+
373
+ }
374
+
375
+ ?>
inc_php/framework/provider/provider_db.class.php ADDED
@@ -0,0 +1,83 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ defined('UNITEGALLERY_INC') or die('Restricted access');
4
+
5
+ class UniteProviderDBUG{
6
+
7
+ private $wpdb;
8
+
9
+ /**
10
+ *
11
+ * constructor - set database object
12
+ */
13
+ public function __construct(){
14
+ global $wpdb;
15
+ $this->wpdb = $wpdb;
16
+ }
17
+
18
+ /**
19
+ * get error number - no function from wp
20
+ */
21
+ public function getErrorNum(){
22
+ return(false);
23
+ }
24
+
25
+
26
+ /**
27
+ * get error message
28
+ */
29
+ public function getErrorMsg(){
30
+ return $this->wpdb->last_error;
31
+ }
32
+
33
+ /**
34
+ * get last row insert id
35
+ */
36
+ public function insertid(){
37
+ return $this->wpdb->insert_id;
38
+ }
39
+
40
+
41
+ /**
42
+ * do sql query, return success
43
+ */
44
+ public function query($query){
45
+
46
+ $this->wpdb->suppress_errors(false);
47
+
48
+ $success = $this->wpdb->query($query);
49
+ return($success);
50
+ }
51
+
52
+
53
+ /**
54
+ * get affected rows after operation
55
+ */
56
+ public function getAffectedRows(){
57
+ return $this->wpdb->num_rows;
58
+ }
59
+
60
+ /**
61
+ * fetch objects from some sql
62
+ */
63
+ public function fetchSql($query){
64
+
65
+ $this->wpdb->suppress_errors(false);
66
+
67
+ $rows = $this->wpdb->get_results($query, ARRAY_A);
68
+
69
+ return($rows);
70
+ }
71
+
72
+ /**
73
+ * escape some string
74
+ */
75
+ public function escape($string){
76
+ return $this->wpdb->_escape($string);
77
+ }
78
+
79
+ }
80
+
81
+
82
+
83
+ ?>
inc_php/framework/provider/provider_front.class.php ADDED
@@ -0,0 +1,236 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class UniteProviderFrontUG{
4
+
5
+ private static $t;
6
+ private static $replaceDone = false;
7
+ const OPTION_PROTECTION = "unitegallery_front_protection";
8
+
9
+ const ACTION_ADD_SCRIPTS = "wp_enqueue_scripts";
10
+
11
+
12
+ /**
13
+ *
14
+ * add some WordPress action
15
+ */
16
+ protected static function addAction($action,$eventFunction){
17
+
18
+ add_action( $action, array(self::$t, $eventFunction) );
19
+ }
20
+
21
+
22
+
23
+
24
+
25
+ /**
26
+ * get first priority of the filter function
27
+ */
28
+ public static function searchFilterFirstPriority($tag, $function){
29
+ global $wp_filter;
30
+
31
+ $arrPriority = (array) array_keys($wp_filter[$tag]);
32
+ asort($arrPriority);
33
+
34
+ foreach ($arrPriority as $priority ) {
35
+ if ( isset($wp_filter[$tag][$priority][$function]) )
36
+ return $priority;
37
+ }
38
+
39
+ return(false);
40
+ }
41
+
42
+
43
+ /**
44
+ * check unite gallery output
45
+ */
46
+ public static function process_shortcode($content){
47
+
48
+ //clear all other tags
49
+ global $shortcode_tags;
50
+ $current_shortcodes = $shortcode_tags;
51
+ $shortcode_tags = array();
52
+
53
+ //process unite gallery shortcode
54
+ add_shortcode( 'unitegalleryprocess', 'unitegallery_shortcode' );
55
+ $content = do_shortcode($content);
56
+
57
+ //return all other tags
58
+ $shortcode_tags = $current_shortcodes;
59
+
60
+ return($content);
61
+ }
62
+
63
+ /**
64
+ * print message
65
+ */
66
+ public static function printErrorMessage($type = "full"){
67
+
68
+ if($type == "half")
69
+ $message = "Unite Gallery Error: hmm, the gallery still not show :( but, the gallery will now remove the filters protection. should will work on next run. Please refresh the page again.";
70
+ else
71
+ $message = "Unite Gallery Error: some plugin of yours changing the output, something like this: <font color='#0B752E'>apply_filters('the_content', get_the_content())</font> and the gallery is not shown. However, the gallery will try to adopt to this on the next run. Please refresh the page.";
72
+
73
+ $output = "<div style='border:1px solid red;font-size:18px;color:red;padding:10px;'>{$message}</div>";
74
+
75
+ echo $output;
76
+ }
77
+
78
+
79
+ /**
80
+ * process shortcode full way (999)
81
+ */
82
+ public static function process_shortcode_full($content){
83
+
84
+ //if problem exists, reduce protection level to half
85
+ if(self::$replaceDone == true){
86
+
87
+ if(strpos($content, "[unitegalleryprocess") === false){
88
+ update_option(self::OPTION_PROTECTION, "half");
89
+ self::printErrorMessage("full");
90
+ }
91
+
92
+ self::$replaceDone = false; //check only once
93
+ }
94
+
95
+ return self::process_shortcode($content);
96
+ }
97
+
98
+
99
+ /**
100
+ * process shortcode half way (11)
101
+ */
102
+ public static function process_shortcode_half($content){
103
+
104
+ if(self::$replaceDone == true){
105
+
106
+ if(strpos($content, "[unitegalleryprocess") === false){
107
+ update_option(self::OPTION_PROTECTION, "nothing");
108
+ self::printErrorMessage("half");
109
+ }
110
+
111
+ self::$replaceDone = false; //check only once
112
+ }
113
+
114
+
115
+ return self::process_shortcode($content);
116
+ }
117
+
118
+
119
+
120
+ /**
121
+ * rename shortcode to another shortcode, don't let filters in between to touch it.
122
+ * process it in 999 position. don't touch the unitegallery original shortcode
123
+ */
124
+ public static function rename_shortcode($content){
125
+
126
+ $content = str_replace("[unitegallery ", "[unitegalleryprocess ", $content);
127
+
128
+ if(strpos($content, "[unitegalleryprocess") !== false)
129
+ self::$replaceDone = true;
130
+
131
+ return($content);
132
+ }
133
+
134
+
135
+ /**
136
+ * print all the filters
137
+ */
138
+ public static function printFilters(){
139
+
140
+ global $wp_filter;
141
+ $filterContent = $wp_filter["the_content"];
142
+
143
+ $keys = array_keys($filterContent);
144
+
145
+ dmp($keys); exit();
146
+ }
147
+
148
+
149
+ /**
150
+ * function for testing
151
+ */
152
+ /*
153
+ public static function makeProblems($content){
154
+
155
+ $content = "the gallery is not here";
156
+
157
+ return($content);
158
+ }
159
+ */
160
+
161
+
162
+ /**
163
+ * on after theme setup - fix the wpautop after do_shortcode (if exists)
164
+ */
165
+ public static function onAfterThemeSetup(){
166
+
167
+ //code for testing
168
+ //update_option(self::OPTION_PROTECTION, "full");
169
+ //add_filter("the_content", array(self::$t, "makeProblems"), 11);
170
+
171
+ $protectionLevel = get_option(self::OPTION_PROTECTION, "full");
172
+
173
+ switch($protectionLevel){
174
+ case "full":
175
+ default:
176
+ add_filter("the_content", array(self::$t, "rename_shortcode"), 1);
177
+ add_filter("the_content", array(self::$t, "process_shortcode_full"), 9999);
178
+ break;
179
+ case "half":
180
+ add_filter("the_content", array(self::$t, "rename_shortcode"), 1);
181
+ add_filter("the_content", array(self::$t, "process_shortcode_half"), 11);
182
+ break;
183
+ case "nothing": //don't protect, do_shortcode will do the job
184
+ break;
185
+ }
186
+
187
+ }
188
+
189
+
190
+ /**
191
+ * print footer scripts
192
+ */
193
+ public static function onPrintFooterScripts(){
194
+
195
+ $arrScrips = UniteProviderFunctionsUG::getCustomScripts();
196
+
197
+ if(empty($arrScrips))
198
+ return(true);
199
+
200
+
201
+ echo "<script type='text/javascript'>\n";
202
+ foreach ($arrScrips as $script){
203
+ echo $script."\n";
204
+ }
205
+ echo "</script>";
206
+
207
+ }
208
+
209
+
210
+ /**
211
+ * register widgets
212
+ */
213
+ public static function registerWidgets(){
214
+
215
+ register_widget( 'UniteGallery_Widget' );
216
+
217
+ }
218
+
219
+
220
+ /**
221
+ *
222
+ * the constructor
223
+ */
224
+ public function __construct(){
225
+ self::$t = $this;
226
+
227
+ $this->addAction("after_setup_theme", "onAfterThemeSetup");
228
+
229
+ $this->addAction("wp_print_footer_scripts", "onPrintFooterScripts");
230
+
231
+ $this->addAction("widgets_init", "registerWidgets");
232
+ }
233
+
234
+ }
235
+
236
+ ?>
inc_php/framework/provider/provider_functions.class.php ADDED
@@ -0,0 +1,742 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ defined('UNITEGALLERY_INC') or die('Restricted access');
4
+
5
+ define("UNITEGALLERY_TEXTDOMAIN","unitegallery");
6
+
7
+ class UniteProviderFunctionsUG{
8
+
9
+ private static $arrScripts = array();
10
+ private static $arrStylesInline = array();
11
+
12
+
13
+ /**
14
+ * init base variables of the globals
15
+ */
16
+ public static function initGlobalsBase($pluginFolder){
17
+ global $wpdb;
18
+
19
+ GlobalsUG::$isScriptsInFooter = true;
20
+ $tablePrefix = $wpdb->prefix;
21
+
22
+ GlobalsUG::$table_galleries = $tablePrefix.GlobalsUG::TABLE_GALLERIES_NAME;
23
+ GlobalsUG::$table_categories = $tablePrefix.GlobalsUG::TABLE_CATEGORIES_NAME;
24
+ GlobalsUG::$table_items = $tablePrefix.GlobalsUG::TABLE_ITEMS_NAME;
25
+
26
+ $pluginName = "unitegallery";
27
+
28
+ GlobalsUG::$pathPlugin = realpath($pluginFolder)."/";
29
+
30
+ GlobalsUG::$path_media_ug = GlobalsUG::$pathPlugin."unitegallery-plugin/";
31
+
32
+ GlobalsUG::$path_base = ABSPATH;
33
+
34
+ $arrUploadDir = wp_upload_dir();
35
+ $pathImages = $arrUploadDir["basedir"];
36
+
37
+ GlobalsUG::$path_images = realpath($pathImages)."/";
38
+
39
+ GlobalsUG::$path_cache = GlobalsUG::$pathPlugin."cache/";
40
+
41
+ GlobalsUG::$urlPlugin = plugin_dir_url( $pluginFolder."/unitegallery.php" );
42
+
43
+ GlobalsUG::$url_component_client = "";
44
+ GlobalsUG::$url_component_admin = admin_url()."admin.php?page=$pluginName";
45
+
46
+ GlobalsUG::$url_base = site_url()."/";
47
+
48
+ GlobalsUG::$url_media_ug = GlobalsUG::$urlPlugin."unitegallery-plugin/";
49
+
50
+ GlobalsUG::$url_images = content_url()."/";
51
+
52
+ GlobalsUG::$url_ajax = admin_url()."admin-ajax.php";
53
+
54
+ GlobalsUG::$url_ajax_front = GlobalsUG::$url_ajax;
55
+
56
+ }
57
+
58
+ public static function a_____________SANITIZE___________(){}
59
+
60
+
61
+ /**
62
+ * filter variable
63
+ */
64
+ public static function sanitizeVar($var, $type = null){
65
+
66
+ if($type == null)
67
+ $type = UniteFunctionsUG::SANITIZE_TEXT_FIELD;
68
+
69
+
70
+ switch($type){
71
+ case UniteFunctionsUG::SANITIZE_ID:
72
+ if(empty($var))
73
+ return("");
74
+
75
+ $var = (int)$var;
76
+ $var = abs($var);
77
+
78
+ if($var == 0)
79
+ return("");
80
+
81
+ break;
82
+ case UniteFunctionsUG::SANITIZE_KEY:
83
+ $var = sanitize_key($var);
84
+ break;
85
+ case UniteFunctionsUG::SANITIZE_TEXT_FIELD:
86
+ $var = sanitize_text_field($var);
87
+ break;
88
+ case UniteFunctionsUG::SANITIZE_NOTHING:
89
+ break;
90
+ default:
91
+ UniteFunctionsUG::throwError("Wrong sanitize type: " . $type);
92
+ break;
93
+ }
94
+
95
+ return($var);
96
+ }
97
+
98
+
99
+ /**
100
+ * add scripts and styles framework
101
+ */
102
+ public static function addScriptsFramework(){
103
+
104
+ UniteFunctionsWPUG::addMediaUploadIncludes();
105
+
106
+ wp_enqueue_script( 'jquery' );
107
+
108
+ //add jquery ui
109
+ wp_enqueue_script("jquery-ui");
110
+ wp_enqueue_script("jquery-ui-dialog");
111
+
112
+
113
+ HelperUG::addStyle("jquery-ui.structure.min","jui-smoothness-structure","css/jui/new");
114
+ HelperUG::addStyle("jquery-ui.theme.min","jui-smoothness-theme","css/jui/new");
115
+
116
+ if(function_exists("wp_enqueue_media"))
117
+ wp_enqueue_media();
118
+
119
+ }
120
+
121
+
122
+ /**
123
+ *
124
+ * register script
125
+ */
126
+ public static function addScript($handle, $url){
127
+
128
+ if(empty($url))
129
+ UniteFunctionsUG::throwError("empty script url, handle: $handle");
130
+
131
+ wp_register_script($handle , $url);
132
+ wp_enqueue_script($handle);
133
+ }
134
+
135
+
136
+ /**
137
+ *
138
+ * register script
139
+ */
140
+ public static function addStyle($handle, $url){
141
+
142
+ if(empty($url))
143
+ UniteFunctionsUG::throwError("empty style url, handle: $handle");
144
+
145
+ wp_register_style($handle , $url);
146
+ wp_enqueue_style($handle);
147
+
148
+ }
149
+
150
+ /**
151
+ * get image url from image id
152
+ */
153
+ public static function getImageUrlFromImageID($imageID){
154
+
155
+ $urlImage = UniteFunctionsWPUG::getUrlAttachmentImage($imageID);
156
+
157
+ return($urlImage);
158
+ }
159
+
160
+ /**
161
+ * get image data from image id
162
+ */
163
+ public static function getImageDataFromImageID($imageID){
164
+ if(empty($imageID))
165
+ return(null);
166
+ $data = UniteFunctionsWPUG::getAttachmentData($imageID);
167
+ return($data);
168
+ }
169
+ /**
170
+ * get image url from image id
171
+ */
172
+ public static function getThumbUrlFromImageID($imageID, $size = null){
173
+ if($size == null)
174
+ $size = UniteFunctionsWPUG::THUMB_MEDIUM;
175
+
176
+ $urlThumb = UniteFunctionsWPUG::getUrlAttachmentImage($imageID, $size);
177
+
178
+
179
+ return($urlThumb);
180
+ }
181
+
182
+
183
+
184
+ /**
185
+ * strip slashes from ajax input data
186
+ */
187
+ public static function normalizeAjaxInputData($arrData){
188
+
189
+ if(!is_array($arrData))
190
+ return($arrData);
191
+
192
+ foreach($arrData as $key=>$item){
193
+
194
+ if(is_string($item))
195
+ $arrData[$key] = stripslashes($item);
196
+
197
+ //second level
198
+ if(is_array($item)){
199
+
200
+ foreach($item as $subkey=>$subitem){
201
+ if(is_string($subitem))
202
+ $arrData[$key][$subkey] = stripslashes($subitem);
203
+
204
+ //third level
205
+ if(is_array($subitem)){
206
+
207
+ foreach($subitem as $thirdkey=>$thirdItem){
208
+ if(is_string($thirdItem))
209
+ $arrData[$key][$subkey][$thirdkey] = stripslashes($thirdItem);
210
+ }
211
+
212
+ }
213
+
214
+ }
215
+ }
216
+
217
+ }
218
+
219
+ return($arrData);
220
+ }
221
+
222
+
223
+ /**
224
+ * put footer text line
225
+ */
226
+ public static function putFooterTextLine(){
227
+ ?>
228
+ &copy; <?php _e("All rights reserved",UNITEGALLERY_TEXTDOMAIN)?>, <a href="http://codecanyon.net/user/valiano" target="_blank">Valiano</a>. &nbsp;&nbsp;
229
+ <?php
230
+ }
231
+
232
+
233
+ /**
234
+ * add jquery include
235
+ */
236
+ public static function addjQueryInclude($app, $urljQuery = null){
237
+
238
+ wp_enqueue_script("jquery");
239
+
240
+ }
241
+
242
+
243
+ /**
244
+ * add position settings (like shortcode) based on the platform
245
+ */
246
+ public static function addPositionToMainSettings($settingsMain){
247
+
248
+ $textGenerate = __("Generate Shortcode",UNITEGALLERY_TEXTDOMAIN);
249
+ $descShortcode = __("Copy this shortcode into article text",UNITEGALLERY_TEXTDOMAIN);
250
+ $settingsMain->addTextBox("shortcode", "",__("Gallery Shortcode",UNITEGALLERY_TEXTDOMAIN),array("description"=>$descShortcode, "readonly"=>true, "class"=>"input-alias input-readonly", "addtext"=>"&nbsp;&nbsp; <a id='button_generate_shortcode' class='unite-button-secondary' >{$textGenerate}</a>"));
251
+
252
+
253
+ return($settingsMain);
254
+ }
255
+
256
+ /**
257
+ * modify default values of troubleshooter settings
258
+ */
259
+ public static function modifyTroubleshooterSettings($settings){
260
+
261
+
262
+ return($settings);
263
+ }
264
+
265
+
266
+ /**
267
+ * print some script at some place in the page
268
+ */
269
+ public static function printCustomScript($script, $hardCoded = false){
270
+
271
+ if($hardCoded == false)
272
+ self::$arrScripts[] = $script;
273
+ else
274
+ echo "<script type='text/javascript'>{$script}</script>";
275
+
276
+ }
277
+
278
+
279
+ /**
280
+ * get all custom scrips
281
+ */
282
+ public static function getCustomScripts(){
283
+
284
+ return(self::$arrScripts);
285
+ }
286
+
287
+
288
+ /**
289
+ * get inline styles
290
+ * init the styles after each get
291
+ */
292
+ public static function getStylesInline(){
293
+
294
+ $styles = "";
295
+
296
+ if(!empty(self::$arrStylesInline))
297
+ $styles = implode("\n", self::$arrStylesInline);
298
+
299
+ self::$arrStylesInline = array();
300
+
301
+ return($styles);
302
+ }
303
+
304
+
305
+ /**
306
+ * add inline style
307
+ */
308
+ public static function addStyleInline($style){
309
+
310
+ //for front end
311
+ wp_add_inline_style("unite-gallery-css", $style);
312
+
313
+ //for backend
314
+ self::$arrStylesInline[] = $style;
315
+ }
316
+
317
+
318
+ /**
319
+ * print inline styles
320
+ */
321
+ public static function printInlineStyles(){
322
+
323
+ $styles = self::getStylesInline();
324
+
325
+ if(!empty($styles))
326
+ echo "\n<style type='text/css'>{$styles}</style>";
327
+
328
+ }
329
+
330
+
331
+ /**
332
+ * add tiles size settings
333
+ */
334
+ public static function addTilesSizeSettings($settings){
335
+
336
+ $settings->addHr();
337
+
338
+ $arrItems = UniteFunctionsWPUG::getArrThumbSizes();
339
+ $params = array(
340
+ "description"=>__("Tiles thumbs resolution. If you choose custom resolution like: 'Big', and you use it with existing images, you need to recreate the thumbnails. You can use 'Regenerate Thumbnails' WordPress plugin for that", UNITEGALLERY_TEXTDOMAIN)
341
+ );
342
+ $settings->addSelect("thumb_resolution", $arrItems, __("Tile Image Resolution",UNITEGALLERY_TEXTDOMAIN), UniteFunctionsWPUG::THUMB_MEDIUM, $params);
343
+
344
+ //add mobile thumb resolution
345
+ $params = array(
346
+ "description"=>__("Mobile tiles thumbs image resolution. Will be active in devices less then 480 in width", UNITEGALLERY_TEXTDOMAIN),
347
+ "rowclass"=>"ug-setting-mobile"
348
+ );
349
+ $arrItemsMobile = array_merge(array(""=>"No Change"), $arrItems);
350
+ $settings->addSelect("thumb_resolution_mobile", $arrItemsMobile, __("Tile Image Resolution - Mobile",UNITEGALLERY_TEXTDOMAIN), "", $params);
351
+ return($settings);
352
+ }
353
+
354
+
355
+ /**
356
+ *
357
+ * @param $settings
358
+ */
359
+ public static function addBigImageSizeSettings($settings, $isLightbox = false, $addAfter = null){
360
+ $arrItems = UniteFunctionsWPUG::getArrThumbSizes("big_only");
361
+ $params = array(
362
+ "description"=>__("Big image resolution. If you choose custom resolution like: 'Big', and you use it with existing images, you need to recreate the thumbnails. You can use 'Regenerate Thumbnails' WordPress plugin for that", UNITEGALLERY_TEXTDOMAIN)
363
+ );
364
+ if(!empty($addAfter)){
365
+ $params[UniteSettingsUG::PARAM_ADD_SETTING_AFTER] = $addAfter;
366
+ }
367
+ //for slider, add hr before
368
+ if($isLightbox == false){
369
+ $hrName = "hr_big_image_resolution";
370
+ $hrParams = array();
371
+ $hrParams[UniteSettingsUG::PARAM_ADD_SETTING_AFTER] = $addAfter;
372
+ $params[UniteSettingsUG::PARAM_ADD_SETTING_AFTER] = $hrName;
373
+ $settings->addHr($hrName, $hrParams);
374
+ }
375
+ $optionTitle = ($isLightbox == true)? "Lightbox Image Resolution" : "Slider Image Resolution";
376
+ $settings->addSelect("big_image_resolution", $arrItems, $optionTitle, UniteFunctionsWPUG::THUMB_FULL, $params);
377
+ //add mobile settings
378
+ $optionTitleMobile = ($isLightbox == true)? __("Lightbox Image Resolution Mobile", UNITEGALLERY_TEXTDOMAIN) : __("Slider Image Resolution Mobile", UNITEGALLERY_TEXTDOMAIN);
379
+ $paramsMobile = array(
380
+ "description"=>__("Big image resolution in Mobile mode. Will be active in devices less then 480 in width", UNITEGALLERY_TEXTDOMAIN)
381
+ );
382
+ $paramsMobile[UniteSettingsUG::PARAM_ADD_SETTING_AFTER] = "big_image_resolution";
383
+ $arrItemsMobile = UniteFunctionsWPUG::getArrThumbSizes();
384
+ $arrItemsMobile = array_merge(array(""=>"No Change"), $arrItemsMobile);
385
+ $settings->addSelect("big_image_resolution_mobile", $arrItemsMobile, $optionTitleMobile, "", $paramsMobile);
386
+ return($settings);
387
+ }
388
+
389
+
390
+
391
+ /**
392
+ * get "small" thumb sizes (medium / thumbnail)
393
+ */
394
+ public static function getThumbSizesSmall(){
395
+ $arrItems = UniteFunctionsWPUG::getArrThumbSizes("small_only");
396
+ return($arrItems);
397
+ }
398
+ /**
399
+ * put galleries view text
400
+ */
401
+ public static function putGalleriesViewText(){
402
+
403
+ ?>
404
+
405
+ <div class="galleries-view-box">
406
+
407
+ This is a <b>Lite Version </b> of the gallery that has some limitations like <i>"limited number of items per gallery"</i>.
408
+ <br> For removing the limitations, get the <b>"Unite Gallery Full Version"</b> and update plugin (button of the bottom).
409
+ No worry, every gallery you have made will remain.
410
+ <a href="https://codecanyon.net/item/unite-gallery-wordpress-gallery-plugin/10458750?ref=valiano" target="_blank">Get It Now!</a>
411
+
412
+ </div>
413
+
414
+ <div class="galleries-view-box" style="">
415
+
416
+ <div class="view-box-title">How to use the gallery</div>
417
+
418
+ <p>
419
+ * From the <b>page and/or post editor</b> insert the shortcode from the gallery view. Example: <b>[unitegallery gallery1]</b>
420
+ </p>
421
+
422
+ <p>
423
+ * For <b>similar galleries</b> on multiple pages with different item on each you can use "Generate Shortcode" button. Example: <b>[unitegallery gallery1 catid=7]</b>
424
+ </p>
425
+
426
+ <p>
427
+ * Also you can use <b>native gallery shortcode</b> for generating galleries. Example: <b>[gallery unitegallery="gallery1" ids="1,2,3"]</b>
428
+ </p>
429
+
430
+ <p>
431
+ * From the <b>widgets panel</b> drag the "Unite Gallery" widget to the desired sidebar<br/>
432
+ </p>
433
+
434
+ <p>
435
+ * From the <b>theme php files</b> use: <code>&lt;?php putUniteGallery("alias", catid) ?&gt;</code>
436
+ example: <code>putUniteGallery("gallery1")</code> or: <code>putUniteGallery("gallery1", 2)</code>
437
+
438
+ <a href="javascript:void(0)" onclick="jQuery('#div_phpput_moreinfo').show();jQuery(this).hide()">more info</a>
439
+ <br/>
440
+
441
+ <div id="div_phpput_moreinfo" style="padding-left:50px;padding-top:10px;display:none">
442
+ For show only on homepage use: <code>&lt;?php putUniteGallery("alias", "", "homepage") ?&gt;</code> <br>
443
+ For show on certain pages use: <code>&lt;?php putUniteGallery("gallery1", "", "4,6,12") ?&gt;</code>
444
+ </div>
445
+
446
+ </p>
447
+
448
+ </div>
449
+
450
+ <?php
451
+ }
452
+
453
+
454
+ /**
455
+ * put update plugin button
456
+ */
457
+ public static function putUpdatePluginHtml(){
458
+ ?>
459
+
460
+ <!-- update gallery button -->
461
+
462
+ <div class="ug-update-plugin-wrapper">
463
+ <a id="ug_button_update_plugin" class="unite-button-primary" href="javascript:void(0)" ><?php _e("Update Plugin", UNITEGALLERY_TEXTDOMAIN)?></a>
464
+ </div>
465
+
466
+ <!-- dialog update -->
467
+
468
+ <div id="dialog_update_plugin" title="<?php _e("Update Gallery Plugin",UNITEGALLERY_TEXTDOMAIN)?>" style="display:none;">
469
+
470
+ <div class="unite-dialog-title"><?php _e("Update Unite Gallery Plugin",UNITEGALLERY_TEXTDOMAIN)?>:</div>
471
+ <div class="unite-dialog-desc">
472
+ <?php _e("To update the gallery please select the gallery install package.",UNITEGALLERY_TEXTDOMAIN) ?>
473
+
474
+ <br>
475
+
476
+ <?php _e("The files will be overwriten", UNITEGALLERY_TEXTDOMAIN)?>
477
+
478
+
479
+ <br> <?php _e("File example: unitegallery1.5.zip",UNITEGALLERY_TEXTDOMAIN)?> </div>
480
+
481
+ <br>
482
+
483
+ <form action="<?php echo GlobalsUG::$url_ajax?>" enctype="multipart/form-data" method="post">
484
+
485
+ <input type="hidden" name="action" value="unitegallery_ajax_action">
486
+ <input type="hidden" name="client_action" value="update_plugin">
487
+ <input type="hidden" name="nonce" value="<?php echo wp_create_nonce("unitegallery_actions"); ?>">
488
+ <?php _e("Choose the update file:",UNITEGALLERY_TEXTDOMAIN)?>
489
+ <br><br>
490
+
491
+ <input type="file" name="update_file" class="unite-dialog-fileinput">
492
+
493
+ <br><br>
494
+
495
+ <input type="submit" class='unite-button-primary' value="<?php _e("Update Gallery Plugin",UNITEGALLERY_TEXTDOMAIN)?>">
496
+ </form>
497
+
498
+ </div>
499
+
500
+
501
+ <?php
502
+ }
503
+
504
+ /**
505
+ * check that inner zip exists, and unpack it if do
506
+ */
507
+ private static function updatePlugin_checkUnpackInnerZip($pathUpdate, $zipFilename){
508
+ $arrFiles = UniteFunctionsUG::getFileList($pathUpdate);
509
+ if(empty($arrFiles))
510
+ return(false);
511
+ //get inner file
512
+ $filenameInner = null;
513
+ foreach($arrFiles as $innerFile){
514
+ if($innerFile != $zipFilename)
515
+ $filenameInner = $innerFile;
516
+ }
517
+ if(empty($filenameInner))
518
+ return(false);
519
+ //check if internal file is zip
520
+ $info = pathinfo($filenameInner);
521
+ $ext = UniteFunctionsUG::getVal($info, "extension");
522
+ if($ext != "zip")
523
+ return(false);
524
+ $filepathInner = $pathUpdate.$filenameInner;
525
+ if(file_exists($filepathInner) == false)
526
+ return(false);
527
+ dmp("detected inner zip file. unpacking...");
528
+ //check if zip exists
529
+ $zip = new UniteZipUG();
530
+ if(function_exists("unzip_file") == true){
531
+ WP_Filesystem();
532
+ $response = unzip_file($filepathInner, $pathUpdate);
533
+ }
534
+ else
535
+ $zip->extract($filepathInner, $pathUpdate);
536
+ }
537
+
538
+
539
+ /**
540
+ *
541
+ * Update Plugin
542
+ */
543
+ public static function updatePlugin(){
544
+
545
+ try{
546
+
547
+ //verify nonce:
548
+ $nonce = UniteFunctionsUG::getPostVariable("nonce");
549
+ $isVerified = wp_verify_nonce($nonce, "unitegallery_actions");
550
+
551
+ if($isVerified == false)
552
+ UniteFunctionsUG::throwError("Security error");
553
+
554
+
555
+ $linkBack = HelperUG::getGalleriesView();
556
+ $htmlLinkBack = UniteFunctionsUG::getHtmlLink($linkBack, "Go Back");
557
+
558
+ //check if zip exists
559
+ $zip = new UniteZipUG();
560
+
561
+ if(function_exists("unzip_file") == false){
562
+
563
+ if( UniteZipUG::isZipExists() == false)
564
+ UniteFunctionsUG::throwError("The ZipArchive php extension not exists, can't extract the update file. Please turn it on in php ini.");
565
+ }
566
+
567
+ dmp("Update in progress...");
568
+
569
+ $arrFiles = UniteFunctionsUG::getVal($_FILES, "update_file");
570
+
571
+ if(empty($arrFiles))
572
+ UniteFunctionsUG::throwError("Update file don't found.");
573
+
574
+ $filename = UniteFunctionsUG::getVal($arrFiles, "name");
575
+
576
+ if(empty($filename))
577
+ UniteFunctionsIG::throwError("Update filename not found.");
578
+
579
+ $fileType = UniteFunctionsUG::getVal($arrFiles, "type");
580
+
581
+ $fileType = strtolower($fileType);
582
+
583
+ $arrMimeTypes = array();
584
+ $arrMimeTypes[] = "application/zip";
585
+ $arrMimeTypes[] = "application/x-zip";
586
+ $arrMimeTypes[] = "application/x-zip-compressed";
587
+ $arrMimeTypes[] = "application/octet-stream";
588
+ $arrMimeTypes[] = "application/x-compress";
589
+ $arrMimeTypes[] = "application/x-compressed";
590
+ $arrMimeTypes[] = "multipart/x-zip";
591
+
592
+ if(in_array($fileType, $arrMimeTypes) == false)
593
+ UniteFunctionsUG::throwError("The file uploaded is not zip.");
594
+
595
+ $filepathTemp = UniteFunctionsUG::getVal($arrFiles, "tmp_name");
596
+ if(file_exists($filepathTemp) == false)
597
+ UniteFunctionsUG::throwError("Can't find the uploaded file.");
598
+
599
+ //crate temp folder
600
+ $pathTemp = GlobalsUG::$pathPlugin."temp/";
601
+ UniteFunctionsUG::checkCreateDir($pathTemp);
602
+
603
+ //create the update folder
604
+ $pathUpdate = $pathTemp."update_extract/";
605
+ UniteFunctionsUG::checkCreateDir($pathUpdate);
606
+
607
+ if(!is_dir($pathUpdate))
608
+ UniteFunctionsUG::throwError("Could not create temp extract path");
609
+
610
+ //remove all files in the update folder
611
+ $arrNotDeleted = UniteFunctionsUG::deleteDir($pathUpdate, false);
612
+
613
+ if(!empty($arrNotDeleted)){
614
+ $strNotDeleted = print_r($arrNotDeleted,true);
615
+ UniteFunctionsUG::throwError("Could not delete those files from the update folder: $strNotDeleted");
616
+ }
617
+
618
+ //copy the zip file.
619
+ $filepathZip = $pathUpdate.$filename;
620
+
621
+ $success = move_uploaded_file($filepathTemp, $filepathZip);
622
+ if($success == false)
623
+ UniteFunctionsUG::throwError("Can't move the uploaded file here: ".$filepathZip.".");
624
+
625
+ //extract files:
626
+ if(function_exists("unzip_file") == true){
627
+ WP_Filesystem();
628
+ $response = unzip_file($filepathZip, $pathUpdate);
629
+ }
630
+ else
631
+ $zip->extract($filepathZip, $pathUpdate);
632
+
633
+ //check for internal zip in case that cocecanyon original zip was uploaded
634
+ self::updatePlugin_checkUnpackInnerZip($pathUpdate, $filename);
635
+ //get extracted folder
636
+ $arrFolders = UniteFunctionsUG::getDirList($pathUpdate);
637
+ if(empty($arrFolders))
638
+ UniteFunctionsUG::throwError("The update folder is not extracted");
639
+
640
+
641
+ //get product folder
642
+ $productFolder = null;
643
+ if(count($arrFolders) == 1)
644
+ $productFolder = $arrFolders[0];
645
+ else{
646
+ foreach($arrFolders as $folder){
647
+ if($folder != "documentation")
648
+ $productFolder = $folder;
649
+ }
650
+ }
651
+
652
+ if(empty($productFolder))
653
+ UniteFunctionsUG::throwError("Wrong product folder.");
654
+
655
+ $pathUpdateProduct = $pathUpdate.$productFolder."/";
656
+
657
+ //check some file in folder to validate it's the real one:
658
+ $checkFilepath = $pathUpdateProduct."unitegallery.php";
659
+
660
+ if(file_exists($checkFilepath) == false)
661
+ UniteFunctionsUG::throwError("Wrong update extracted folder. The file: ".$checkFilepath." not found.");
662
+
663
+ //copy the plugin without the captions file.
664
+ $pathOriginalPlugin = GlobalsUG::$pathPlugin;
665
+
666
+ $arrBlackList = array();
667
+ UniteFunctionsUG::copyDir($pathUpdateProduct, $pathOriginalPlugin,"",$arrBlackList);
668
+
669
+ //delete the update
670
+ UniteFunctionsUG::deleteDir($pathUpdate);
671
+
672
+ //change folder to original (if updated to full version)
673
+ if($productFolder == "unitegallery"){
674
+ $pathRename = str_replace("unite-gallery-lite", "unitegallery", $pathOriginalPlugin);
675
+ if($pathRename != $pathOriginalPlugin){
676
+ $success = @rename($pathOriginalPlugin, $pathRename);
677
+ if($success == true){ //activate plugin
678
+ $pluginFile = $pathRename."unitegallery.php";
679
+ if(file_exists($pluginFile)){
680
+ $activateSuccess = UniteFunctionsWPUG::activatePlugin($pluginFile);
681
+ if ( $activateSuccess == false )
682
+ $linkBack = admin_url("plugins.php"); //link to plugin activate
683
+ }
684
+ }
685
+ }
686
+ }
687
+ dmp("Updated Successfully, redirecting...");
688
+ echo "<script>location.href='$linkBack'</script>";
689
+
690
+ }catch(Exception $e){
691
+ //remove all files in the update folder
692
+ UniteFunctionsUG::deleteDir($pathUpdate);
693
+ $message = $e->getMessage();
694
+ $message .= " <br> Please update the plugin manually via the ftp";
695
+ echo "<div style='color:#B80A0A;font-size:18px;'><b>Update Error: </b> $message</div><br>";
696
+ echo $htmlLinkBack;
697
+ exit();
698
+ }
699
+
700
+ }
701
+
702
+
703
+ /**
704
+ * get nonce (for protection)
705
+ */
706
+ public static function getNonce(){
707
+
708
+ $nonce = wp_create_nonce("unitegallery_actions");
709
+
710
+ return($nonce);
711
+ }
712
+
713
+
714
+ /**
715
+ * get js not included message
716
+ */
717
+ public static function getJsNotIncludedErrorMessage(){
718
+ $message = "Unite Gallery Error - gallery js and css files not included in the footer. Please make sure that wp_footer() function is added to your theme.";
719
+ return($message);
720
+ }
721
+
722
+ /**
723
+ * get option
724
+ */
725
+ public static function getOption($option, $default = false, $supportMultisite = false){
726
+ if($supportMultisite == true && is_multisite())
727
+ return(get_site_option($option, $default));
728
+ else
729
+ return get_option($option, $default);
730
+ }
731
+
732
+ /**
733
+ * update option
734
+ */
735
+ public static function updateOption($option, $value, $supportMultisite = false){
736
+ if($supportMultisite == true && is_multisite()){
737
+ update_site_option($option, $value);
738
+ }else
739
+ update_option($option, $value);
740
+ }
741
+ }
742
+ ?>
inc_php/framework/provider/provider_main_file.php ADDED
@@ -0,0 +1,94 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ require_once $currentFolder."/inc_php/framework/provider/unitegallery_widget.class.php";
4
+
5
+ try{
6
+
7
+
8
+ /**
9
+ * put unite gallery function
10
+ */
11
+ function putUniteGallery($galleryAlias, $catID = null, $putIn = null){
12
+
13
+ if(!empty($putIn)){
14
+ $isPutInMatch = UniteFunctionsWPUG::isPutInStringMatch($putIn);
15
+ if($isPutInMatch == false)
16
+ return(false);
17
+ }
18
+
19
+ $content = HelperUG::outputGallery($galleryAlias, $catID);
20
+ echo $content;
21
+ }
22
+
23
+ //add shortcode
24
+ function unitegallery_shortcode($args){
25
+ $galleryAlias = UniteFunctionsUG::getVal($args,0);
26
+ $catID = UniteFunctionsUG::getVal($args,"catid");
27
+
28
+ $content = HelperUG::outputGallery($galleryAlias, $catID);
29
+
30
+ return($content);
31
+ }
32
+
33
+ add_shortcode( 'unitegallery', 'unitegallery_shortcode' );
34
+ add_shortcode( 'unitegallery_force', 'unitegallery_shortcode' );
35
+
36
+ /**
37
+ * replace the post gallery with unite gallery
38
+ */
39
+ function unitegallery_postgallery( $output = '', $atts, $content = false, $tag = false){
40
+
41
+ $alias = UniteFunctionsUG::getVal($atts, "unitegallery");
42
+ if(empty($alias))
43
+ return $output;
44
+
45
+ $ids = UniteFunctionsUG::getVal($atts, "ids");
46
+
47
+ if(empty($ids))
48
+ return $output;
49
+
50
+ //get items
51
+ $arrIDs = explode(",", $ids);
52
+ $arrItems = UniteFunctionsWPUG::getArrItemsFromAttachments($arrIDs);
53
+
54
+ //output gallery
55
+ $objItems = new UniteGalleryItems();
56
+ $arrUniteItems = $objItems->getItemsFromArray($arrItems);
57
+
58
+ $content = HelperUG::outputGallery($alias, null, "alias", $arrUniteItems);
59
+
60
+ return $content;
61
+ }
62
+
63
+ add_filter( 'post_gallery', 'unitegallery_postgallery', 60, 4 );
64
+
65
+ //-------------------------------------------------------------
66
+
67
+ // add another size
68
+ add_image_size( "ug_big", 768, 768);
69
+
70
+ //-------------------------------------------------------------
71
+
72
+ if(is_admin()){ //load admin part
73
+ require_once $currentFolder."/unitegallery_admin.php";
74
+ require_once $currentFolder . "/inc_php/framework/provider/provider_admin.class.php";
75
+
76
+ $UGproductAdmin = new UniteProviderAdminUG($mainFilepath);
77
+
78
+ }else{ //load front part
79
+ require_once $currentFolder . "/inc_php/framework/provider/provider_front.class.php";
80
+ $UGproductFront = new UniteProviderFrontUG($mainFilepath);
81
+ }
82
+
83
+
84
+ }catch(Exception $e){
85
+ $message = $e->getMessage();
86
+ $trace = $e->getTraceAsString();
87
+ echo "Unite Gallery Error: <b>".$message."</b>";
88
+
89
+ if(GlobalsUG::SHOW_TRACE == true)
90
+ dmp($trace);
91
+ }
92
+
93
+
94
+ ?>
inc_php/framework/provider/settings/general_settings_provider.xml ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+
3
+ <fields>
4
+ <fieldset name="general" label="General Settings">
5
+
6
+ <field name="edit_permission"
7
+ type="list"
8
+ default="admin"
9
+ label="Edit Permission"
10
+ description="The addon/assets edit will be visible to the selected user categories">
11
+ <option value="admin" text="Admin"></option>
12
+ <option value="editor" text="Editor"></option>
13
+ </field>
14
+
15
+ </fieldset>
16
+ </fields>
inc_php/framework/provider/unitegallery_widget.class.php ADDED
@@ -0,0 +1,116 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class UniteGallery_Widget extends WP_Widget {
4
+
5
+ public function __construct(){
6
+
7
+ // widget actual processes
8
+ $widget_ops = array('classname' => 'widget_unitegallery', 'description' => __('Show the Unite Gallery') );
9
+ parent::__construct('unitegallery-widget', __('Unite Gallery', UNITEGALLERY_TEXTDOMAIN), $widget_ops);
10
+ }
11
+
12
+
13
+ /**
14
+ *
15
+ * the form
16
+ */
17
+ public function form($instance) {
18
+
19
+ $galleries = new UniteGalleryGalleries();
20
+ $arrGalleries = $galleries->getArrGalleriesShort();
21
+
22
+ $galleryID = UniteFunctionsUG::getVal($instance, "unitegallery");
23
+
24
+ if(empty($arrGalleries))
25
+ echo __("No galleries found, Please create a gallery", UNITEGALLERY_TEXTDOMAIN);
26
+ else{
27
+ $fieldCat = "unitegallery_cat";
28
+ $fieldIDCat = $this->get_field_id( $fieldCat );
29
+ $fieldNameCat = $this->get_field_name( $fieldCat );
30
+
31
+ $categoryID = UniteFunctionsUG::getVal($instance, "unitegallery_cat");
32
+
33
+ $objCategories = new UniteGalleryCategories();
34
+ $arrCats = $objCategories->getCatsShort("component");
35
+ $selectCats = UniteFunctionsUG::getHTMLSelect($arrCats, $categoryID, 'name="'.$fieldNameCat.'" id="'.$fieldIDCat.'"', true);
36
+
37
+ //output gallries select
38
+ $field = "unitegallery";
39
+ $fieldID = $this->get_field_id( $field );
40
+ $fieldName = $this->get_field_name( $field );
41
+
42
+ $selectGalleries = UniteFunctionsUG::getHTMLSelect($arrGalleries, $galleryID,'name="'.$fieldName.'" id="'.$fieldID.'"',true);
43
+
44
+ ?>
45
+ <div style="padding-top:10px;padding-bottom:10px;">
46
+
47
+ <?php _e("Title", UNITEGALLERY_TEXTDOMAIN)?>:
48
+ <input type="text" id="<?php echo $this->get_field_id( "title" );?>" name="<?php echo $this->get_field_name( "title" )?>" value="<?php echo UniteFunctionsUG::getVal($instance, 'title')?>" />
49
+
50
+ <br><br>
51
+
52
+ <?php _e("Choose Gallery", UNITEGALLERY_TEXTDOMAIN)?>:
53
+ <?php echo $selectGalleries?>
54
+
55
+ <br><br>
56
+ <?php _e("Choose Category", UNITEGALLERY_TEXTDOMAIN)?>:
57
+
58
+ <?php echo $selectCats?>
59
+
60
+ </div>
61
+
62
+ <br>
63
+ <?php
64
+
65
+ }
66
+
67
+ }
68
+
69
+
70
+ /**
71
+ *
72
+ * update
73
+ */
74
+ public function update($new_instance, $old_instance) {
75
+
76
+ return($new_instance);
77
+ }
78
+
79
+
80
+ /**
81
+ *
82
+ * widget output
83
+ */
84
+ public function widget($args, $instance) {
85
+
86
+ $title = UniteFunctionsUG::getVal($instance, "title");
87
+
88
+ $galleryID = UniteFunctionsUG::getVal($instance, "unitegallery");
89
+ $categoryID = UniteFunctionsUG::getVal($instance, "unitegallery_cat");
90
+
91
+ if(empty($galleryID))
92
+ return(false);
93
+
94
+ //widget output
95
+ $beforeWidget = UniteFunctionsUG::getVal($args, "before_widget");
96
+ $afterWidget = UniteFunctionsUG::getVal($args, "after_widget");
97
+ $beforeTitle = UniteFunctionsUG::getVal($args, "before_title");
98
+ $afterTitle = UniteFunctionsUG::getVal($args, "after_title");
99
+
100
+ echo $beforeWidget;
101
+
102
+ if(!empty($title))
103
+ echo $beforeTitle.$title.$afterTitle;
104
+
105
+ $content = HelperUG::outputGallery($galleryID, $categoryID, "id");
106
+ echo $content;
107
+
108
+ echo $afterWidget;
109
+
110
+ }
111
+
112
+
113
+ }
114
+
115
+
116
+ ?>
inc_php/framework/settings.class.php ADDED
@@ -0,0 +1,1396 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @package Unite Gallery
4
+ * @author Valiano
5
+ * @copyright (C) 2012 Unite CMS, All Rights Reserved.
6
+ * @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
7
+ * */
8
+ defined('UNITEGALLERY_INC') or die('Restricted access');
9
+
10
+
11
+ /**
12
+ *
13
+ * unite settings class.
14
+ * @version 1.1
15
+ *
16
+ */
17
+
18
+ class UniteSettingsUG{
19
+
20
+ const COLOR_OUTPUT_FLASH = "flash";
21
+ const COLOR_OUTPUT_HTML = "html";
22
+
23
+ //------------------------------------------------------------
24
+
25
+ const RELATED_NONE = "";
26
+ const TYPE_TEXT = "text";
27
+ const TYPE_COLOR = "color";
28
+ const TYPE_DATE = "date";
29
+ const TYPE_SELECT = "list";
30
+ const TYPE_CHECKBOX = "checkbox";
31
+ const TYPE_RADIO = "radio";
32
+ const TYPE_TEXTAREA = "textarea";
33
+ const TYPE_STATIC_TEXT = "statictext";
34
+ const TYPE_HR = "hr";
35
+ const TYPE_CUSTOM = "custom";
36
+ const ID_PREFIX = "";
37
+ const TYPE_CONTROL = "control";
38
+ const TYPE_BUTTON = "button";
39
+ const TYPE_MULTIPLE_TEXT = "multitext";
40
+ const TYPE_IMAGE = "image";
41
+ const TYPE_CHECKLIST = "checklist";
42
+ const TYPE_BOOLEAN = "boolean";
43
+ const TYPE_HIDDEN = "hidden";
44
+
45
+ //------------------------------------------------------------
46
+ //set data types
47
+ const DATATYPE_NUMBER = "number";
48
+ const DATATYPE_NUMBEROREMTY = "number_empty";
49
+ const DATATYPE_STRING = "string";
50
+ const DATATYPE_FREE = "free";
51
+
52
+ const CONTROL_TYPE_ENABLE = "enable";
53
+ const CONTROL_TYPE_DISABLE = "disable";
54
+ const CONTROL_TYPE_SHOW = "show";
55
+ const CONTROL_TYPE_HIDE = "hide";
56
+
57
+ //additional parameters that can be added to settings.
58
+ const PARAM_TEXTSTYLE = "textStyle";
59
+ const PARAM_ADDPARAMS = "addparams"; //additional text after the field
60
+ const PARAM_ADDTEXT = "addtext"; //additional text after the field
61
+ const PARAM_ADDTEXT_BEFORE_ELEMENT = "addtext_before_element"; //additional text after the field
62
+ const PARAM_CELLSTYLE = "cellStyle"; //additional text after the field
63
+ const PARAM_NODRAW = "nodraw"; //don't draw the setting row
64
+ const PARAM_ADDFIELD = "addfield"; //add field to draw
65
+ const PARAM_ADD_SETTING_AFTER = "add_setting_after"; //add setting after another existing setting, and not to the end
66
+ const PARAM_NOSETVAL = "nosetval";
67
+
68
+
69
+ //view defaults:
70
+ protected $defaultText = "Enter value";
71
+ protected $sap_size = 5;
72
+
73
+ //other variables:
74
+ protected $HRIdCounter = 0; //counter of hr id
75
+
76
+ protected $arrSettings = array();
77
+ protected $arrSections = array();
78
+ protected $arrIndex = array(); //index of name->index of the settings.
79
+ protected $arrSaps = array();
80
+
81
+ //controls:
82
+ protected $arrControls = array(); //array of items that controlling others (hide/show or enabled/disabled)
83
+ protected $arrBulkControl = array(); //bulk cotnrol array. if not empty, every settings will be connected with control.
84
+
85
+ //custom functions:
86
+ protected $customFunction_afterSections = null;
87
+ protected $colorOutputType = self::COLOR_OUTPUT_HTML;
88
+
89
+
90
+ /**
91
+ * constructor
92
+ */
93
+ public function __construct(){
94
+
95
+ }
96
+
97
+ //-----------------------------------------------------------------------------------------------
98
+ // get where query according relatedTo and relatedID.
99
+ private function getWhereQuery(){
100
+ $where = "relatedTo='".$this->relatedTo."' and relatedID='".$this->relatedID."'";
101
+ return($where);
102
+ }
103
+
104
+
105
+ //-----------------------------------------------------------------------------------------------
106
+ //set type of color output
107
+ public function setColorOutputType($type){
108
+ $this->colorOutputType = $type;
109
+ }
110
+
111
+ //-----------------------------------------------------------------------------------------------
112
+ //set the related to/id for saving/restoring settings.
113
+ public function setRelated($relatedTo,$relatedID){
114
+ $this->relatedTo = $relatedTo;
115
+ $this->relatedID = $relatedID;
116
+ }
117
+
118
+
119
+ //-----------------------------------------------------------------------------------------------
120
+ //modify the data before save
121
+ private function modifySettingsData($arrSettings){
122
+
123
+ foreach($arrSettings as $key=>$content){
124
+ switch(getType($content)){
125
+ case "string":
126
+ //replace the unicode line break (sometimes left after json)
127
+ $content = str_replace("u000a","\n",$content);
128
+ $content = str_replace("u000d","",$content);
129
+ break;
130
+ case "object":
131
+ case "array":
132
+ $content = UniteFunctionsUG::convertStdClassToArray($content);
133
+ break;
134
+ }
135
+
136
+ $arrSettings[$key] = $content;
137
+ }
138
+
139
+ return($arrSettings);
140
+ }
141
+
142
+ //-----------------------------------------------------------------------------------------------
143
+ // add the section value to the setting
144
+ private function checkAndAddSectionAndSap($setting){
145
+ //add section
146
+ if(!empty($this->arrSections)){
147
+ $sectionKey = count($this->arrSections)-1;
148
+ $setting["section"] = $sectionKey;
149
+ $section = $this->arrSections[$sectionKey];
150
+ $sapKey = count($section["arrSaps"])-1;
151
+ $setting["sap"] = $sapKey;
152
+ }
153
+ else{
154
+ //please impliment add sap normal!!! - without sections
155
+ }
156
+ return($setting);
157
+ }
158
+
159
+
160
+ /**
161
+ *
162
+ * validate items parameter. throw exception on error
163
+ * @throws Exception
164
+ */
165
+ private function validateParamItems($arrParams){
166
+ if(!isset($arrParams["items"])) throw new Exception("no select items presented");
167
+ if(!is_array($arrParams["items"])) throw new Exception("the items parameter should be array");
168
+ //if(empty($arrParams["items"])) throw new Exception("the items array should not be empty");
169
+ }
170
+
171
+
172
+ /**
173
+ * add this setting to index
174
+ * @param $name
175
+ */
176
+ private function addSettingToIndex($name){
177
+ $this->arrIndex[$name] = count($this->arrSettings)-1;
178
+ }
179
+
180
+ /**
181
+ * regenerate index array from the existing settings
182
+ */
183
+ private function regenerateIndex(){
184
+
185
+ $this->arrIndex = array();
186
+ foreach($this->arrSettings as $index=>$setting){
187
+ $name = UniteFunctionsUG::getVal($setting, "name");
188
+ if(empty($name))
189
+ continue;
190
+ $this->arrIndex[$name] = $index;
191
+ }
192
+ }
193
+
194
+ private function a________________GETTERS________________(){}
195
+
196
+ //-----------------------------------------------------------------------------------------------
197
+ //get types array from all the settings:
198
+ protected function getArrTypes(){
199
+ $arrTypesAssoc = array();
200
+ $arrTypes = array();
201
+ foreach($this->arrSettings as $setting){
202
+ $type = $setting["type"];
203
+ if(!isset($arrTypesAssoc[$type])) $arrTypes[] = $type;
204
+ $arrTypesAssoc[$type] = "";
205
+ }
206
+ return($arrTypes);
207
+ }
208
+
209
+
210
+ /**
211
+ *
212
+ * get settings array
213
+ */
214
+ public function getArrSettings(){
215
+ return($this->arrSettings);
216
+ }
217
+
218
+
219
+ /**
220
+ *
221
+ * get the keys of the settings
222
+ */
223
+ public function getArrSettingNames(){
224
+ $arrKeys = array();
225
+ $arrNames = array();
226
+ foreach($this->arrSettings as $setting){
227
+ $name = UniteFunctionsUG::getVal($setting, "name");
228
+ if(!empty($name))
229
+ $arrNames[] = $name;
230
+ }
231
+
232
+ return($arrNames);
233
+ }
234
+
235
+ /**
236
+ *
237
+ * get the keys of the settings
238
+ */
239
+ public function getArrSettingNamesAndTitles(){
240
+ $arrKeys = array();
241
+ $arrNames = array();
242
+ foreach($this->arrSettings as $setting){
243
+ $name = UniteFunctionsUG::getVal($setting, "name");
244
+ $title = UniteFunctionsUG::getVal($setting, "text");
245
+ if(!empty($name))
246
+ $arrNames[$name] = $title;
247
+ }
248
+
249
+ return($arrNames);
250
+ }
251
+
252
+
253
+ /**
254
+ *
255
+ * get sections
256
+ */
257
+ public function getArrSections(){
258
+ return($this->arrSections);
259
+ }
260
+
261
+
262
+ /**
263
+ *
264
+ * get controls
265
+ */
266
+ public function getArrControls(){
267
+ return($this->arrControls);
268
+ }
269
+
270
+
271
+ /**
272
+ *
273
+ * set settings array
274
+ */
275
+ public function setArrSettings($arrSettings){
276
+ $this->arrSettings = $arrSettings;
277
+ }
278
+
279
+
280
+ //-----------------------------------------------------------------------------------------------
281
+ //get number of settings
282
+ public function getNumSettings(){
283
+ $counter = 0;
284
+ foreach($this->arrSettings as $setting){
285
+ switch($setting["type"]){
286
+ case self::TYPE_HR:
287
+ case self::TYPE_STATIC_TEXT:
288
+ break;
289
+ default:
290
+ $counter++;
291
+ break;
292
+ }
293
+ }
294
+ return($counter);
295
+ }
296
+
297
+ private function a______________________ADD________________(){}
298
+
299
+ //private function
300
+ //-----------------------------------------------------------------------------------------------
301
+ // add radio group
302
+ public function addRadio($name,$arrItems,$text = "",$defaultItem="",$arrParams = array()){
303
+ $params = array("items"=>$arrItems);
304
+ $params = array_merge($params,$arrParams);
305
+ $this->add($name,$defaultItem,$text,self::TYPE_RADIO,$params);
306
+ }
307
+
308
+ //-----------------------------------------------------------------------------------------------
309
+ //add text area control
310
+ public function addTextArea($name,$defaultValue,$text,$arrParams = array()){
311
+ $this->add($name,$defaultValue,$text,self::TYPE_TEXTAREA,$arrParams);
312
+ }
313
+
314
+ //-----------------------------------------------------------------------------------------------
315
+ //add button control
316
+ public function addButton($name, $value, $text, $arrParams = array()){
317
+ $this->add($name,$value,$text,self::TYPE_BUTTON,$arrParams);
318
+ }
319
+
320
+
321
+ //-----------------------------------------------------------------------------------------------
322
+ // add checkbox element
323
+ public function addCheckbox($name,$defaultValue = false,$text = "",$arrParams = array()){
324
+ $this->add($name,$defaultValue,$text,self::TYPE_CHECKBOX,$arrParams);
325
+ }
326
+
327
+ //-----------------------------------------------------------------------------------------------
328
+ //add text box element
329
+ public function addTextBox($name,$defaultValue = "",$text = "",$arrParams = array()){
330
+ $this->add($name,$defaultValue,$text,self::TYPE_TEXT,$arrParams);
331
+ }
332
+
333
+ //-----------------------------------------------------------------------------------------------
334
+ //add multiple text box element
335
+ public function addMultipleTextBox($name,$defaultValue = "",$text = "",$arrParams = array()){
336
+ $this->add($name,$defaultValue,$text,self::TYPE_MULTIPLE_TEXT,$arrParams);
337
+ }
338
+
339
+ //-----------------------------------------------------------------------------------------------
340
+ //add image selector
341
+ public function addImage($name,$defaultValue = "",$text = "",$arrParams = array()){
342
+ $this->add($name,$defaultValue,$text,self::TYPE_IMAGE,$arrParams);
343
+ }
344
+
345
+ //-----------------------------------------------------------------------------------------------
346
+ //add color picker setting
347
+ public function addColorPicker($name,$defaultValue = "",$text = "",$arrParams = array()){
348
+ $this->add($name,$defaultValue,$text,self::TYPE_COLOR,$arrParams);
349
+ }
350
+
351
+ //-----------------------------------------------------------------------------------------------
352
+ //add date picker setting
353
+ public function addDatePicker($name,$defaultValue = "",$text = "",$arrParams = array()){
354
+ $this->add($name,$defaultValue,$text,self::TYPE_DATE,$arrParams);
355
+ }
356
+
357
+ //-----------------------------------------------------------------------------------------------
358
+ //add code mirror editor
359
+ public function addCodemirror($name,$defaultValue = "",$text = "",$arrParams = array()){
360
+ $this->add($name,$defaultValue,$text,'codemirror',$arrParams);
361
+ }
362
+
363
+ /**
364
+ *
365
+ * add custom setting
366
+ */
367
+ public function addCustom($customType,$name,$defaultValue = "",$text = "",$arrParams = array()){
368
+ $params = array();
369
+ $params["custom_type"] = $customType;
370
+ $params = array_merge($params,$arrParams);
371
+
372
+ $this->add($name,$defaultValue,$text,self::TYPE_CUSTOM,$params);
373
+ }
374
+
375
+
376
+ /**
377
+ * add horezontal sap
378
+ */
379
+ public function addHr($name="",$params=array()){
380
+
381
+ $setting = array();
382
+ $setting["type"] = self::TYPE_HR;
383
+
384
+
385
+ //set item name
386
+ $itemName = "";
387
+ if($name != "")
388
+ $itemName = $name;
389
+ else{ //generate hr id
390
+ $this->HRIdCounter++;
391
+ $itemName = "hr_".UniteFunctionsUG::getRandomString();
392
+
393
+ if(array_key_exists($itemName, $this->arrIndex))
394
+ $itemName = "hr_".UniteFunctionsUG::getRandomString();
395
+
396
+ if(array_key_exists($itemName, $this->arrIndex))
397
+ $itemName = "hr_".UniteFunctionsUG::getRandomString();
398
+ }
399
+
400
+ $setting["id"] = self::ID_PREFIX.$itemName;
401
+ $setting["id_row"] = $setting["id"]."_row";
402
+ $setting["name"] = $itemName;
403
+
404
+ //addsection and sap keys
405
+ $setting = $this->checkAndAddSectionAndSap($setting);
406
+
407
+ $this->checkAddBulkControl($itemName);
408
+
409
+ $setting = array_merge($params,$setting);
410
+
411
+ //add after another setting
412
+ if(array_key_exists(self::PARAM_ADD_SETTING_AFTER, $setting)){
413
+
414
+ $this->addSettingAfter($setting);
415
+
416
+ }else{
417
+ $this->arrSettings[] = $setting;
418
+
419
+ //add to settings index
420
+ $this->addSettingToIndex($itemName);
421
+ }
422
+
423
+ }
424
+
425
+
426
+ /**
427
+ * add static text
428
+ */
429
+ public function addStaticText($text,$name="",$params=array()){
430
+ $setting = array();
431
+ $setting["type"] = self::TYPE_STATIC_TEXT;
432
+
433
+ //set item name
434
+ $itemName = "";
435
+ if($name != "") $itemName = $name;
436
+ else{ //generate hr id
437
+ $this->HRIdCounter++;
438
+ $itemName = "textitem".$this->HRIdCounter;
439
+ }
440
+
441
+ $setting["id"] = self::ID_PREFIX.$itemName;
442
+ $setting["name"] = $itemName;
443
+ $setting["id_row"] = $setting["id"]."_row";
444
+ $setting["text"] = $text;
445
+
446
+ $this->checkAddBulkControl($itemName);
447
+
448
+ $params = array_merge($params,$setting);
449
+
450
+ //addsection and sap keys
451
+ $setting = $this->checkAndAddSectionAndSap($setting);
452
+
453
+ $this->arrSettings[] = $setting;
454
+
455
+ //add to settings index
456
+ $this->addSettingToIndex($itemName);
457
+ }
458
+
459
+ /**
460
+ * add select setting
461
+ */
462
+ public function addSelect($name,$arrItems,$text,$defaultItem="",$arrParams=array()){
463
+ $params = array("items"=>$arrItems);
464
+ $params = array_merge($params,$arrParams);
465
+ $this->add($name,$defaultItem,$text,self::TYPE_SELECT,$params);
466
+ }
467
+
468
+
469
+ /**
470
+ * add select setting
471
+ */
472
+ public function addChecklist($name,$arrItems,$text,$defaultItem="",$arrParams=array()){
473
+ $params = array("items"=>$arrItems);
474
+ $params = array_merge($params,$arrParams);
475
+ $this->add($name,$defaultItem,$text,self::TYPE_CHECKLIST,$params);
476
+ }
477
+
478
+
479
+ /**
480
+ *
481
+ * add saporator
482
+ */
483
+ public function addSap($text, $name="", $opened = false, $icon=""){
484
+
485
+ if(empty($text))
486
+ UniteFunctionsUG::throwError("sap $name must have a text");
487
+
488
+ //create sap array
489
+ $sap = array();
490
+ $sap["name"] = $name;
491
+ $sap["text"] = $text;
492
+ $sap["icon"] = $icon;
493
+
494
+ if($opened == true) $sap["opened"] = true;
495
+
496
+ //add sap to current section
497
+ if(!empty($this->arrSections)){
498
+ $lastSection = end($this->arrSections);
499
+ $section_keys = array_keys($this->arrSections);
500
+ $lastSectionKey = end($section_keys);
501
+ $arrSaps = $lastSection["arrSaps"];
502
+ $arrSaps[] = $sap;
503
+ $this->arrSections[$lastSectionKey]["arrSaps"] = $arrSaps;
504
+ $sap_keys = array_keys($arrSaps);
505
+ $sapKey = end($sap_keys);
506
+ }
507
+ else{
508
+ $this->arrSaps[] = $sap;
509
+ }
510
+ }
511
+
512
+ //-----------------------------------------------------------------------------------------------
513
+ //get sap data:
514
+ public function getSap($sapKey,$sectionKey=-1){
515
+ //get sap without sections:
516
+ if($sectionKey == -1) return($this->arrSaps[$sapKey]);
517
+ if(!isset($this->arrSections[$sectionKey])) throw new Exception("Sap on section:".$sectionKey." doesn't exists");
518
+ $arrSaps = $this->arrSections[$sectionKey]["arrSaps"];
519
+ if(!isset($arrSaps[$sapKey])) throw new Exception("Sap with key:".$sapKey." doesn't exists");
520
+ $sap = $arrSaps[$sapKey];
521
+ return($sap);
522
+ }
523
+
524
+ //-----------------------------------------------------------------------------------------------
525
+ // add a new section. Every settings from now on will be related to this section
526
+ public function addSection($label,$name=""){
527
+
528
+ if(!empty($this->arrSettings) && empty($this->arrSections))
529
+ UniteFunctionsUG::throwError("You should add first section before begin to add settings. (section: $text)");
530
+
531
+ if(empty($label))
532
+ UniteFunctionsUG::throwError("You have some section without text");
533
+
534
+ $arrSection = array(
535
+ "text"=>$label,
536
+ "arrSaps"=>array(),
537
+ "name"=>$name
538
+ );
539
+
540
+ $this->arrSections[] = $arrSection;
541
+ }
542
+
543
+ /**
544
+ * add some setting after another setting
545
+ */
546
+ private function addSettingAfter($setting){
547
+
548
+ $addAfter = $setting[self::PARAM_ADD_SETTING_AFTER];
549
+
550
+ if(array_key_exists($addAfter, $this->arrIndex) == false)
551
+ UniteFunctionsUG::throwError("The setting with key: {$addAfter} don't exists");
552
+
553
+ unset($setting[self::PARAM_ADD_SETTING_AFTER]);
554
+
555
+ $insertPos = $this->arrIndex[$addAfter];
556
+
557
+ //duplicate sap and section
558
+ $settingBefore = $this->arrSettings[$insertPos];
559
+
560
+ $setting["sap"] = $settingBefore["sap"];
561
+ $setting["section"] = $settingBefore["section"];
562
+
563
+ //insert after pos
564
+ array_splice($this->arrSettings, $insertPos+1, 0, array($setting));
565
+
566
+ //regenerate index array
567
+ $this->regenerateIndex();
568
+
569
+ }
570
+
571
+ /**
572
+ * add setting, may be in different type, of values
573
+ */
574
+ protected function add($name,$defaultValue = "",$text = "",$type = self::TYPE_TEXT,$arrParams = array()){
575
+
576
+ //validation:
577
+ if(empty($name)) throw new Exception("Every setting should have a name!");
578
+
579
+ switch($type){
580
+ case self::TYPE_RADIO:
581
+ case self::TYPE_SELECT:
582
+ $this->validateParamItems($arrParams);
583
+ break;
584
+ case self::TYPE_CHECKBOX:
585
+ if(!is_bool($defaultValue))
586
+ throw new Exception("The checkbox value should be boolean");
587
+ break;
588
+ }
589
+
590
+ //validate name:
591
+ if(isset($this->arrIndex[$name]))
592
+ throw new Exception("Duplicate setting name:".$name);
593
+
594
+ $this->checkAddBulkControl($name);
595
+
596
+ //set defaults:
597
+ if($text == "")
598
+ $text = $this->defaultText;
599
+
600
+ $setting = array();
601
+ $setting["name"] = $name;
602
+ $setting["id"] = self::ID_PREFIX.$name;
603
+ $setting["id_service"] = $setting["id"]."_service";
604
+ $setting["id_row"] = $setting["id"]."_row";
605
+ $setting["type"] = $type;
606
+ $setting["text"] = $text;
607
+ $setting["value"] = $defaultValue;
608
+
609
+ $setting = array_merge($setting,$arrParams);
610
+
611
+ //set datatype
612
+ if(!isset($setting["datatype"])){
613
+ $datatype = self::DATATYPE_STRING;
614
+ switch ($type){
615
+ case self::TYPE_TEXTAREA:
616
+ $datatype = self::DATATYPE_FREE;
617
+ break;
618
+ default:
619
+ $datatype = self::DATATYPE_STRING;
620
+ break;
621
+ }
622
+
623
+ $setting["datatype"] = $datatype;
624
+ }
625
+
626
+ //addsection and sap keys
627
+ $setting = $this->checkAndAddSectionAndSap($setting);
628
+
629
+ //add after another setting
630
+ if(array_key_exists(self::PARAM_ADD_SETTING_AFTER, $setting)){
631
+
632
+ $this->addSettingAfter($setting);
633
+
634
+ }else{
635
+ $this->arrSettings[] = $setting;
636
+
637
+ //add to settings index
638
+ $this->addSettingToIndex($name);
639
+ }
640
+
641
+ }
642
+
643
+
644
+ private function a______________________CONTROLS________________(){}
645
+
646
+
647
+ /**
648
+ * add a item that controlling visibility of enabled/disabled of other.
649
+ */
650
+ public function addControl($control_item_name,$controlled_item_name,$control_type,$value){
651
+
652
+ UniteFunctionsUG::validateNotEmpty($control_item_name,"control parent");
653
+ UniteFunctionsUG::validateNotEmpty($controlled_item_name,"control child");
654
+ UniteFunctionsUG::validateNotEmpty($control_type,"control type");
655
+ UniteFunctionsUG::validateNotEmpty($value,"control value");
656
+
657
+ //check for multiple control items
658
+ if(strpos($controlled_item_name, ",") !== false){
659
+ $controlled_item_name = explode(",", $controlled_item_name);
660
+
661
+ foreach($controlled_item_name as $key=>$cvalue)
662
+ $controlled_item_name[$key] = trim($cvalue);
663
+ }
664
+
665
+ //modify for multiple values
666
+ $arrValues = array();
667
+ if(strpos($value, ",") !== false){
668
+
669
+ $arrValues = explode(",", $value);
670
+
671
+ foreach($arrValues as $key=>$value)
672
+ $arrValues[$key] = trim($value);
673
+
674
+ $value = $arrValues;
675
+ }
676
+
677
+ //get the control by parent, or create new
678
+ $arrControl = array();
679
+ if(isset($this->arrControls[$control_item_name]))
680
+ $arrControl = $this->arrControls[$control_item_name];
681
+
682
+ if(is_array($controlled_item_name)){
683
+ foreach($controlled_item_name as $cname)
684
+ $arrControl[] = array("name"=>$cname, "type"=>$control_type, "value"=>$value);
685
+
686
+ }else
687
+ $arrControl[] = array("name"=>$controlled_item_name, "type"=>$control_type, "value"=>$value);
688
+
689
+ $this->arrControls[$control_item_name] = $arrControl;
690
+ }
691
+
692
+
693
+ /**
694
+ * start control of all settings that comes after this function (between startBulkControl and endBulkControl)
695
+ */
696
+ public function startBulkControl($control_item_name,$control_type,$value){
697
+ $this->arrBulkControl = array("control_name"=>$control_item_name,"type"=>$control_type,"value"=>$value);
698
+ }
699
+
700
+
701
+ /**
702
+ * end bulk control
703
+ */
704
+ public function endBulkControl(){
705
+ $this->arrBulkControl = array();
706
+ }
707
+
708
+
709
+ /**
710
+ * compare if the control values are equal
711
+ */
712
+ private function isControlValuesEqual($parentValue, $value){
713
+
714
+ if(is_array($value))
715
+ return (in_array($parentValue, $value) === true);
716
+ else {
717
+ $value = strtolower($value);
718
+ return ($parentValue === $value);
719
+ }
720
+
721
+ }
722
+
723
+
724
+ /**
725
+ * set sattes of the settings (enabled/disabled, visible/invisible) by controls
726
+ */
727
+ public function setSettingsStateByControls(){
728
+
729
+ //dmp($this->arrControls);
730
+ //exit();
731
+
732
+ foreach($this->arrControls as $control_name => $arrControlled){
733
+ //take the control value
734
+ if(!isset($this->arrIndex[$control_name])) throw new Exception("There is not sutch control setting: '$control_name'");
735
+ $index = $this->arrIndex[$control_name];
736
+ $parentValue = strtolower($this->arrSettings[$index]["value"]);
737
+
738
+ //set child (controlled) attributes
739
+ foreach($arrControlled as $controlled){
740
+ if(!isset($this->arrIndex[$controlled["name"]])) throw new Exception("There is not sutch controlled setting: '".$controlled["name"]."'");
741
+ $indexChild = $this->arrIndex[$controlled["name"]];
742
+ $child = $this->arrSettings[$indexChild];
743
+ $value = $controlled["value"];
744
+
745
+ switch($controlled["type"]){
746
+ case self::CONTROL_TYPE_ENABLE:
747
+ if($this->isControlValuesEqual($parentValue, $value) == false)
748
+ $child["disabled"] = true;
749
+ break;
750
+ case self::CONTROL_TYPE_DISABLE:
751
+ if($this->isControlValuesEqual($parentValue, $value) == true)
752
+ $child["disabled"] = true;
753
+ break;
754
+ case self::CONTROL_TYPE_SHOW:
755
+ if($this->isControlValuesEqual($parentValue, $value) == false)
756
+ $child["hidden"] = true;
757
+ break;
758
+ case self::CONTROL_TYPE_HIDE:
759
+ if($this->isControlValuesEqual($parentValue, $value) == true)
760
+ $child["hidden"] = true;
761
+ break;
762
+ }
763
+ $this->arrSettings[$indexChild] = $child;
764
+ }
765
+ }//end foreach
766
+ }
767
+
768
+
769
+ //-----------------------------------------------------------------------------------------------
770
+ //check that bulk control is available , and add some element to it.
771
+ private function checkAddBulkControl($name){
772
+ //add control
773
+ if(!empty($this->arrBulkControl))
774
+ $this->addControl($this->arrBulkControl["control_name"],$name,$this->arrBulkControl["type"],$this->arrBulkControl["value"]);
775
+ }
776
+
777
+
778
+ private function a________________OTHERS____________(){}
779
+
780
+
781
+ //-----------------------------------------------------------------------------------------------
782
+ //build name->(array index) of the settings.
783
+ private function buildArrSettingsIndex(){
784
+ $this->arrIndex = array();
785
+ foreach($this->arrSettings as $key=>$value)
786
+ if(isset($value["name"])) $this->arrIndex[$value["name"]] = $key;
787
+ }
788
+
789
+
790
+ //-----------------------------------------------------------------------------------------------
791
+ //set custom function that will be run after sections will be drawen
792
+ public function setCustomDrawFunction_afterSections($func){
793
+ $this->customFunction_afterSections = $func;
794
+ }
795
+
796
+
797
+ /**
798
+ *
799
+ * parse options from xml field
800
+ * @param $field
801
+ */
802
+ private function getOptionsFromXMLField($field,$fieldName){
803
+ $arrOptions = array();
804
+
805
+ $arrField = (array)$field;
806
+ $options = UniteFunctionsUG::getVal($arrField, "option");
807
+
808
+ if(empty($options))
809
+ return($arrOptions);
810
+
811
+ foreach($options as $option){
812
+
813
+ if(gettype($option) == "string")
814
+ UniteFunctionsUG::throwError("Wrong options type: ".$option." in field: $fieldName");
815
+
816
+ $attribs = $option->attributes();
817
+
818
+ $optionValue = (string)UniteFunctionsUG::getVal($attribs, "value");
819
+ $optionText = (string)UniteFunctionsUG::getVal($attribs, "text");
820
+
821
+ //validate options:
822
+ UniteFunctionsUG::validateNotEmpty($optionValue,"option value");
823
+ UniteFunctionsUG::validateNotEmpty($optionText,"option text");
824
+
825
+ $arrOptions[$optionValue] = $optionText;
826
+ }
827
+
828
+ return($arrOptions);
829
+ }
830
+
831
+
832
+ /**
833
+ *
834
+ * merge settings with another settings object
835
+ */
836
+ public function mergeSettings(UniteSettingsUG $settings){
837
+
838
+ $arrSectionsNew = $settings->getArrSections();
839
+ if(empty($arrSectionsNew))
840
+ UniteFunctionsUG::throwError("the section should not be empty");
841
+
842
+ $arrSapsNew = $arrSectionsNew[0]["arrSaps"];
843
+
844
+ //old and new saps array
845
+ $arrNewSapKeys = array();
846
+ $arrSapsCurrent = $this->arrSections[0]["arrSaps"];
847
+
848
+ //add new saps to saps array and remember keys
849
+ foreach($arrSapsNew as $key => $sap){
850
+ $arrSapsCurrent[] = $sap;
851
+ $arrNewSapKeys[$key] = count($arrSapsCurrent)-1;
852
+ }
853
+
854
+ $this->arrSections[0]["arrSaps"] = $arrSapsCurrent;
855
+
856
+ //add settings
857
+ $arrSettingsNew = $settings->getArrSettings();
858
+ foreach($arrSettingsNew as $setting){
859
+ $name = $setting["name"];
860
+ $sapOld = $setting["sap"];
861
+ if(array_key_exists($sapOld, $arrNewSapKeys) == false)
862
+ UniteFunctionsUG::throwError("sap {$sapOld} should be exists in sap keys array");
863
+
864
+ $sapNew = $arrNewSapKeys[$sapOld];
865
+
866
+ $setting["sap"] = $sapNew;
867
+ $this->arrSettings[] = $setting;
868
+
869
+ if(array_key_exists($name, $this->arrIndex))
870
+ UniteFunctionsUG::throwError("The setting <b>{$name} </b> already exists. ");
871
+
872
+ $this->arrIndex[$name] = count($this->arrSettings)-1;
873
+
874
+ }
875
+
876
+ //add controls
877
+ $arrControlsNew = $settings->getArrControls();
878
+
879
+ $this->arrControls = array_merge($this->arrControls, $arrControlsNew);
880
+
881
+ }
882
+
883
+
884
+ /**
885
+ * add settings from external file
886
+ */
887
+ private function addExternalSettings($filename, $loadfrom){
888
+
889
+ switch($loadfrom){
890
+ case "helper":
891
+ $filepathSettings = GlobalsUG::$pathHelpersSettings.$filename.".php";
892
+ break;
893
+ case "current":
894
+ $filepathSettings = GlobalsUGGallery::$pathSettings.$filename.".php";
895
+ break;
896
+ default:
897
+ UniteFunctionsUG::throwError("addExternalSettings error: unknown helper foldername: {$loadfrom}");
898
+ break;
899
+ }
900
+
901
+
902
+ require $filepathSettings;
903
+
904
+ if(!isset($settings))
905
+ UniteFunctionsUG::throwError("The settings include file: {$filepathSettings} must include '\$settings' object.");
906
+
907
+ $this->mergeSettings($settings);
908
+
909
+ }
910
+
911
+
912
+ /**
913
+ *
914
+ * load settings from xml file
915
+ */
916
+ public function loadXMLFile($filepath){
917
+
918
+ if(!file_exists($filepath))
919
+ UniteFunctionsUG::throwError("File: '$filepath' not exists!!!");
920
+
921
+ $obj = simplexml_load_file($filepath);
922
+
923
+ if(empty($obj))
924
+ UniteFunctionsUG::throwError("Wrong xml file format: $filepath");
925
+
926
+ $fieldsets = $obj->fieldset;
927
+ if(!@count($obj->fieldset)){
928
+ $fieldsets = array($fieldsets);
929
+ }
930
+
931
+ $this->addSection("Xml Settings");
932
+
933
+
934
+ foreach($fieldsets as $fieldset){
935
+
936
+ //Add Section
937
+ $attribs = $fieldset->attributes();
938
+
939
+ $sapName = (string)UniteFunctionsUG::getVal($attribs, "name");
940
+ $sapLabel = (string)UniteFunctionsUG::getVal($attribs, "label");
941
+ $sapIcon = (string)UniteFunctionsUG::getVal($attribs, "icon");
942
+ $loadFrom = (string)UniteFunctionsUG::getVal($attribs, "loadfrom");
943
+
944
+ UniteFunctionsUG::validateNotEmpty($sapName,"sapName");
945
+
946
+ if(!empty($loadFrom)){
947
+ $this->addExternalSettings($sapName, $loadFrom);
948
+ continue;
949
+ }
950
+
951
+
952
+ UniteFunctionsUG::validateNotEmpty($sapLabel,"sapLabel");
953
+
954
+ $this->addSap($sapLabel,$sapName,false,$sapIcon);
955
+
956
+ //--- add fields
957
+ $fieldset = (array)$fieldset;
958
+
959
+ $fields = UniteFunctionsUG::getVal($fieldset, "field");
960
+
961
+ if(empty($fields))
962
+ $fields = array();
963
+ else
964
+ if(is_array($fields) == false)
965
+ $fields = array($fields);
966
+
967
+ foreach($fields as $field){
968
+ $attribs = $field->attributes();
969
+ $fieldType = (string)UniteFunctionsUG::getVal($attribs, "type");
970
+ $fieldName = (string)UniteFunctionsUG::getVal($attribs, "name");
971
+ $fieldLabel = (string)UniteFunctionsUG::getVal($attribs, "label");
972
+ $fieldDefaultValue = (string)UniteFunctionsUG::getVal($attribs, "default");
973
+
974
+ //all other params will be added to "params array".
975
+ $arrMustParams = array("type","name","label","default");
976
+
977
+ $arrParams = array();
978
+
979
+ foreach($attribs as $key=>$value){
980
+ $key = (string)$key;
981
+ $value = (string)$value;
982
+
983
+ //skip must params:
984
+ if(in_array($key, $arrMustParams))
985
+ continue;
986
+
987
+ $arrParams[$key] = $value;
988
+ }
989
+
990
+ $options = $this->getOptionsFromXMLField($field,$fieldName);
991
+
992
+ //validate must fields:
993
+ UniteFunctionsUG::validateNotEmpty($fieldType,"type");
994
+
995
+ //validate name
996
+ if($fieldType != self::TYPE_HR && $fieldType != self::TYPE_CONTROL &&
997
+ $fieldType != "bulk_control_start" && $fieldType != "bulk_control_end")
998
+ UniteFunctionsUG::validateNotEmpty($fieldName,"name");
999
+ switch ($fieldType){
1000
+ case self::TYPE_CHECKBOX:
1001
+ $fieldDefaultValue = UniteFunctionsUG::strToBool($fieldDefaultValue);
1002
+ $this->addCheckbox($fieldName,$fieldDefaultValue,$fieldLabel,$arrParams);
1003
+ break;
1004
+ case self::TYPE_COLOR:
1005
+ $this->addColorPicker($fieldName,$fieldDefaultValue,$fieldLabel,$arrParams);
1006
+ break;
1007
+ case self::TYPE_HR:
1008
+ $this->addHr($fieldName);
1009
+ break;
1010
+ case self::TYPE_TEXT:
1011
+ $this->addTextBox($fieldName,$fieldDefaultValue,$fieldLabel,$arrParams);
1012
+ break;
1013
+ case self::TYPE_MULTIPLE_TEXT:
1014
+ $this->addMultipleTextBox($fieldName,$fieldDefaultValue,$fieldLabel,$arrParams);
1015
+ break;
1016
+ case self::TYPE_STATIC_TEXT:
1017
+ $this->addStaticText($fieldLabel, $fieldName, $arrParams);
1018
+ break;
1019
+ case self::TYPE_IMAGE:
1020
+ $this->addImage($fieldName,$fieldDefaultValue,$fieldLabel,$arrParams);
1021
+ break;
1022
+ case self::TYPE_SELECT:
1023
+ $this->addSelect($fieldName, $options, $fieldLabel,$fieldDefaultValue,$arrParams);
1024
+ break;
1025
+ case self::TYPE_CHECKBOX:
1026
+ $this->addChecklist($fieldName, $options, $fieldLabel,$fieldDefaultValue,$arrParams);
1027
+ break;
1028
+ case self::TYPE_RADIO:
1029
+ $this->addRadio($fieldName, $options, $fieldLabel,$fieldDefaultValue,$arrParams);
1030
+ break;
1031
+ case self::TYPE_BOOLEAN:
1032
+ $options = array("true"=>"Yes","false"=>"No");
1033
+ $this->addRadio($fieldName, $options, $fieldLabel,$fieldDefaultValue,$arrParams);
1034
+ break;
1035
+ case self::TYPE_TEXTAREA:
1036
+ $this->addTextArea($fieldName, $fieldDefaultValue, $fieldLabel, $arrParams);
1037
+ break;
1038
+ case self::TYPE_CUSTOM:
1039
+ $this->add($fieldName, $fieldDefaultValue, $fieldLabel, self::TYPE_CUSTOM, $arrParams);
1040
+ break;
1041
+ case self::TYPE_BUTTON:
1042
+ $this->addButton($fieldName, $fieldDefaultValue, $fieldLabel, $arrParams);
1043
+ break;
1044
+ case self::TYPE_CONTROL:
1045
+ $parent = UniteFunctionsUG::getVal($arrParams, "parent");
1046
+ $child = UniteFunctionsUG::getVal($arrParams, "child");
1047
+ $ctype = UniteFunctionsUG::getVal($arrParams, "ctype");
1048
+ $value = UniteFunctionsUG::getVal($arrParams, "value");
1049
+ $this->addControl($parent, $child, $ctype, $value);
1050
+ break;
1051
+ case "bulk_control_start":
1052
+ $parent = UniteFunctionsUG::getVal($arrParams, "parent");
1053
+ $ctype = UniteFunctionsUG::getVal($arrParams, "ctype");
1054
+ $value = UniteFunctionsUG::getVal($arrParams, "value");
1055
+
1056
+ $this->startBulkControl($parent, $ctype, $value);
1057
+ break;
1058
+ case "bulk_control_end":
1059
+ $this->endBulkControl();
1060
+ break;
1061
+ case "codemirror":
1062
+ $this->addCodemirror($fieldName,$fieldDefaultValue,$fieldLabel,$arrParams);
1063
+ break;
1064
+ default:
1065
+ UniteFunctionsUG::throwError("wrong type: $fieldType");
1066
+ break;
1067
+ }
1068
+
1069
+ }
1070
+ }
1071
+ }
1072
+
1073
+
1074
+ /**
1075
+ *
1076
+ * get titles and descriptions array
1077
+ */
1078
+ public function getArrTextFromAllSettings(){
1079
+ $arr = array();
1080
+ $arrUnits = array();
1081
+
1082
+ //get saps array:
1083
+ foreach($this->arrSections as $section){
1084
+ $arrSaps = UniteFunctionsUG::getVal($section, "arrSaps");
1085
+ if(empty($arrSaps))
1086
+ continue;
1087
+ foreach($arrSaps as $sap){
1088
+ $text = $sap["text"];
1089
+ if(!empty($text))
1090
+ $arr[] = $text;
1091
+ }
1092
+ }
1093
+
1094
+ foreach($this->arrSettings as $setting){
1095
+
1096
+ $text = UniteFunctionsUG::getVal($setting, "text");
1097
+ $desc = UniteFunctionsUG::getVal($setting, "description");
1098
+ $unit = UniteFunctionsUG::getVal($setting, "unit");
1099
+
1100
+ if(!empty($text))
1101
+ $arr[] = $text;
1102
+
1103
+ if(!empty($desc))
1104
+ $arr[] = $desc;
1105
+
1106
+ if(!empty($unit)){
1107
+ if(!isset($arrUnits[$unit]))
1108
+ $arr[] = $unit;
1109
+ $arrUnits[$unit] = true;
1110
+ }
1111
+
1112
+ $items = UniteFunctionsUG::getVal($setting, "items");
1113
+ if(!empty($items)){
1114
+ foreach($items as $item){
1115
+ if(!isset($arrUnits[$item]))
1116
+ $arr[] = $item;
1117
+ $arrUnits[$item] = true;
1118
+ }
1119
+ }
1120
+ }
1121
+
1122
+ return($arr);
1123
+ }
1124
+
1125
+
1126
+ /**
1127
+ *
1128
+ * get setting array by name
1129
+ */
1130
+ public function getSettingByName($name){
1131
+
1132
+ //if index present
1133
+ if(!empty($this->arrIndex)){
1134
+ if(array_key_exists($name, $this->arrIndex) == false)
1135
+ UniteFunctionsUG::throwError("setting $name not found");
1136
+ $index = $this->arrIndex[$name];
1137
+ $setting = $this->arrSettings[$index];
1138
+ return($setting);
1139
+ }
1140
+
1141
+ //if no index
1142
+ foreach($this->arrSettings as $setting){
1143
+ $settingName = UniteFunctionsUG::getVal($setting, "name");
1144
+ if($settingName == $name)
1145
+ return($setting);
1146
+ }
1147
+
1148
+ UniteFunctionsUG::throwError("Setting with name: $name don't exists");
1149
+ }
1150
+
1151
+
1152
+ /**
1153
+ *
1154
+ * get value of some setting
1155
+ * @param $name
1156
+ */
1157
+ public function getSettingValue($name,$default=""){
1158
+ $setting = $this->getSettingByName($name);
1159
+ $value = UniteFunctionsUG::getVal($setting, "value",$default);
1160
+
1161
+ return($value);
1162
+ }
1163
+
1164
+
1165
+ /**
1166
+ *
1167
+ * update setting array by name
1168
+ */
1169
+ public function updateArrSettingByName($name,$setting){
1170
+
1171
+ foreach($this->arrSettings as $key => $settingExisting){
1172
+ $settingName = UniteFunctionsUG::getVal($settingExisting,"name");
1173
+ if($settingName == $name){
1174
+ $this->arrSettings[$key] = $setting;
1175
+ return(false);
1176
+ }
1177
+ }
1178
+
1179
+ UniteFunctionsUG::throwError("Setting with name: $name don't exists");
1180
+ }
1181
+
1182
+ /**
1183
+ * hide some setting
1184
+ * @param unknown_type $name
1185
+ */
1186
+ public function hideSetting($name){
1187
+ $this->updateSettingProperty($name, "hidden", "true");
1188
+ }
1189
+
1190
+ /**
1191
+ * hide multiple settings from array
1192
+ *
1193
+ */
1194
+ public function hideSettings($arrSettings){
1195
+
1196
+ foreach($arrSettings as $settingName)
1197
+ $this->hideSetting($settingName);
1198
+ }
1199
+
1200
+ /**
1201
+ *
1202
+ * modify some value by it's datatype
1203
+ */
1204
+ public function modifyValueByDatatype($value,$datatype){
1205
+ if(is_array($value)){
1206
+ foreach($value as $key => $val){
1207
+ $value[$key] = $this->modifyValueByDatatypeFunc($val,$datatype);
1208
+ }
1209
+ }else{
1210
+ $value = $this->modifyValueByDatatypeFunc($value,$datatype);
1211
+ }
1212
+ return($value);
1213
+ }
1214
+
1215
+ /**
1216
+ *
1217
+ * modify some value by it's datatype
1218
+ */
1219
+ public function modifyValueByDatatypeFunc($value,$datatype){
1220
+ switch($datatype){
1221
+ case self::DATATYPE_STRING:
1222
+ $value = strip_tags($value, '<link>');
1223
+ break;
1224
+ case self::DATATYPE_NUMBER:
1225
+ $value = floatval($value); //turn every string to float
1226
+ if(!is_numeric($value))
1227
+ $value = 0;
1228
+ break;
1229
+ case self::DATATYPE_NUMBEROREMTY:
1230
+ $value = trim($value);
1231
+ if($value !== "")
1232
+ $value = floatval($value); //turn every string to float
1233
+ break;
1234
+ }
1235
+
1236
+ return $value;
1237
+ }
1238
+
1239
+ /**
1240
+ *
1241
+ * set values from array of stored settings elsewhere.
1242
+ */
1243
+ public function setStoredValues($arrValues){
1244
+
1245
+ foreach($this->arrSettings as $key=>$setting){
1246
+
1247
+ $name = UniteFunctionsUG::getVal($setting, "name");
1248
+
1249
+ //type consolidation
1250
+ $type = UniteFunctionsUG::getVal($setting, "type");
1251
+
1252
+ $datatype = UniteFunctionsUG::getVal($setting, "datatype");
1253
+
1254
+ //skip custom type
1255
+ $customType = UniteFunctionsUG::getVal($setting, "custom_type");
1256
+
1257
+ if(!empty($customType))
1258
+ continue;
1259
+
1260
+ $noSetVal = UniteFunctionsUG::getVal($setting, self::PARAM_NOSETVAL);
1261
+ if($noSetVal === true)
1262
+ continue;
1263
+
1264
+ if(array_key_exists($name, $arrValues)){
1265
+ $value = $arrValues[$name];
1266
+ $value = $this->modifyValueByDatatype($value, $datatype);
1267
+ $this->arrSettings[$key]["value"] = $value;
1268
+ $arrValues[$name] = $value;
1269
+ }
1270
+
1271
+ }//end foreach
1272
+
1273
+ return($arrValues);
1274
+ }
1275
+
1276
+
1277
+ /**
1278
+ * get setting values. replace from stored ones if given
1279
+ */
1280
+ public function getArrValues(){
1281
+
1282
+ $arrSettingsOutput = array();
1283
+
1284
+ //modify settings by type
1285
+ foreach($this->arrSettings as $setting){
1286
+ if($setting["type"] == self::TYPE_HR
1287
+ ||$setting["type"] == self::TYPE_STATIC_TEXT)
1288
+ continue;
1289
+
1290
+ $value = $setting["value"];
1291
+
1292
+ //modify value by type
1293
+ switch($setting["type"]){
1294
+ case self::TYPE_COLOR:
1295
+ $value = strtolower($value);
1296
+ //set color output type
1297
+ if($this->colorOutputType == self::COLOR_OUTPUT_FLASH)
1298
+ $value = str_replace("#","0x",$value);
1299
+ break;
1300
+ case self::TYPE_CHECKBOX:
1301
+ if($value == true) $value = "true";
1302
+ else $value = "false";
1303
+ break;
1304
+ }
1305
+
1306
+ //remove lf
1307
+ if(isset($setting["remove_lf"])){
1308
+ $value = str_replace("\n","",$value);
1309
+ $value = str_replace("\r\n","",$value);
1310
+ }
1311
+
1312
+ $arrSettingsOutput[$setting["name"]] = $value;
1313
+ }
1314
+
1315
+ return($arrSettingsOutput);
1316
+ }
1317
+
1318
+
1319
+ /**
1320
+ * Update values from post meta
1321
+ * WordPress only
1322
+ */
1323
+ public function updateValuesFromPostMeta($postID){
1324
+
1325
+ //update setting values array from meta
1326
+ $arrNames = $this->getArrSettingNames();
1327
+ $arrValues = array();
1328
+ $arrMeta = get_post_meta($postID);
1329
+
1330
+ if(!empty($arrMeta) && is_array($arrMeta)){
1331
+ foreach($arrNames as $name){
1332
+ if(array_key_exists($name, $arrMeta) == false)
1333
+ continue;
1334
+
1335
+ $value = get_post_meta($postID, $name,true);
1336
+ $arrValues[$name] = $value;
1337
+ }
1338
+ }
1339
+
1340
+ //dmp($postID);dmp($arrValues);exit();
1341
+
1342
+ $this->setStoredValues($arrValues);
1343
+
1344
+ }
1345
+
1346
+
1347
+ private function a______________UPDATE_________(){}
1348
+
1349
+ /**
1350
+ * set addtext to the setting
1351
+ */
1352
+ public function updateSettingAddHTML($name, $html){
1353
+ $this->updateSettingProperty($name, self::PARAM_ADDTEXT, $html);
1354
+ }
1355
+
1356
+ /**
1357
+ * update setting property
1358
+ */
1359
+ public function updateSettingProperty($settingName, $propertyName, $value){
1360
+
1361
+ $setting = $this->getSettingByName($settingName);
1362
+ $setting[$propertyName] = $value;
1363
+
1364
+ $this->updateArrSettingByName($settingName, $setting);
1365
+ }
1366
+
1367
+
1368
+ /**
1369
+ *
1370
+ * update default value in the setting
1371
+ */
1372
+ public function updateSettingValue($name,$value){
1373
+ $setting = $this->getSettingByName($name);
1374
+ $setting["value"] = $value;
1375
+
1376
+ $this->updateArrSettingByName($name, $setting);
1377
+ }
1378
+
1379
+ /**
1380
+ *
1381
+ * update default value in the setting
1382
+ */
1383
+ public function updateSettingItems($name, $items, $default = null){
1384
+ $setting = $this->getSettingByName($name);
1385
+ $setting["items"] = $items;
1386
+ if($default !== null)
1387
+ $setting["value"] = $default;
1388
+
1389
+ $this->updateArrSettingByName($name, $setting);
1390
+ }
1391
+
1392
+
1393
+
1394
+ }
1395
+
1396
+ ?>
inc_php/framework/settings_advances.class.php ADDED
@@ -0,0 +1,231 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @package Unite Gallery
4
+ * @author Valiano
5
+ * @copyright (C) 2012 Unite CMS, All Rights Reserved.
6
+ * @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
7
+ * */
8
+ defined('UNITEGALLERY_INC') or die('Restricted access');
9
+
10
+
11
+ // advanced settings class. adds some advanced features
12
+ class UniteSettingsAdvancedUG extends UniteSettingsUG{
13
+
14
+ /**
15
+ * add boolean true/false select with custom names
16
+ */
17
+ public function addSelect_boolean($name,$text,$bValue=true,$firstItem="Enable",$secondItem="Disable",$arrParams=array()){
18
+ $arrItems = array("true"=>$firstItem,"false"=>$secondItem);
19
+ $defaultText = "true";
20
+ if($bValue == false)
21
+ $defaultText = "false";
22
+ $this->addSelect($name,$arrItems,$text,$defaultText,$arrParams);
23
+ }
24
+
25
+ /**
26
+ * add radio item boolean true / false
27
+ */
28
+ public function addRadioBoolean($name,$text,$bValue=true,$firstItem="Yes",$secondItem="No",$arrParams=array()){
29
+ $arrItems = array("true"=>$firstItem,"false"=>$secondItem);
30
+ $defaultText = "true";
31
+ if($bValue == false)
32
+ $defaultText = "false";
33
+
34
+ $this->addRadio($name,$arrItems,$text,$defaultText,$arrParams);
35
+ }
36
+
37
+ //------------------------------------------------------------------------------
38
+ //add float select
39
+ public function addSelect_float($name,$defaultValue,$text,$arrParams=array()){
40
+ $this->addSelect($name,array("left"=>"Left","right"=>"Right"),$text,$defaultValue,$arrParams);
41
+ }
42
+
43
+ //------------------------------------------------------------------------------
44
+ //add align select
45
+ public function addSelect_alignX($name,$defaultValue,$text,$arrParams=array()){
46
+ $this->addSelect($name,array("left"=>"Left","center"=>"Center","right"=>"Right"),$text,$defaultValue,$arrParams);
47
+ }
48
+
49
+ //------------------------------------------------------------------------------
50
+ //add align select
51
+ public function addSelect_alignY($name,$defaultValue,$text,$arrParams=array()){
52
+ $this->addSelect($name,array("top"=>"Top","middle"=>"Middle","bottom"=>"Bottom"),$text,$defaultValue,$arrParams);
53
+ }
54
+
55
+ //------------------------------------------------------------------------------
56
+ //add transitions select
57
+ public function addSelect_border($name,$defaultValue,$text,$arrParams=array()){
58
+ $arrItems = array();
59
+ $arrItems["solid"] = "Solid";
60
+ $arrItems["dashed"] = "Dashed";
61
+ $arrItems["dotted"] = "Dotted";
62
+ $arrItems["double"] = "Double";
63
+ $arrItems["groove"] = "Groove";
64
+ $arrItems["ridge"] = "Ridge";
65
+ $arrItems["inset"] = "Inset";
66
+ $arrItems["outset"] = "Outset";
67
+ $this->addSelect($name,$arrItems,$text,$defaultValue,$arrParams);
68
+ }
69
+
70
+ //------------------------------------------------------------------------------
71
+ //add transitions select
72
+ public function addSelect_textDecoration($name,$defaultValue,$text,$arrParams=array()){
73
+ $arrItems = array();
74
+ $arrItems["none"] = "None";
75
+ $arrItems["underline"] = "Underline";
76
+ $arrItems["overline"] = "Overline";
77
+ $arrItems["line-through"] = "Line-through";
78
+ $this->addSelect($name,$arrItems,$text,$defaultValue,$arrParams);
79
+ }
80
+
81
+ //------------------------------------------------------------------------------
82
+ //add transitions select - arrExtensions may be string, and lower case
83
+ public function addSelect_filescan($name,$path,$arrExtensions,$defaultValue,$text,$arrParams=array()){
84
+
85
+ if(getType($arrExtensions) == "string")
86
+ $arrExtensions = array($arrExtensions);
87
+ elseif(getType($arrExtensions) != "array")
88
+ $this->throwError("The extensions array is not array and not string in setting: $name, please check.");
89
+
90
+ //make items array
91
+ if(!is_dir($path))
92
+ $this->throwError("path: $path not found");
93
+
94
+ $arrItems = array();
95
+ $files = scandir($path);
96
+ foreach($files as $file){
97
+ //general filter
98
+ if($file == ".." || $file == "." || $file == ".svn")
99
+ continue;
100
+
101
+ $info = pathinfo($file);
102
+ $ext = UniteFunctionsUG::getVal($info,"extension");
103
+ $ext = strtolower($ext);
104
+
105
+ if(array_search($ext,$arrExtensions) === FALSE)
106
+ continue;
107
+
108
+ $arrItems[$file] = $file;
109
+ }
110
+
111
+ //handle add data array
112
+ if(isset($arrParams["addData"])){
113
+ foreach($arrParams["addData"] as $key=>$value)
114
+ $arrItems[$key] = $value;
115
+ }
116
+
117
+ if(empty($defaultValue) && !empty($arrItems))
118
+ $defaultValue = current($arrItems);
119
+
120
+ $this->addSelect($name,$arrItems,$text,$defaultValue,$arrParams);
121
+ }
122
+
123
+
124
+ /**
125
+ * get transitions array
126
+ */
127
+ private function getArrEasing(){
128
+
129
+ $arrItems = array();
130
+ $arrItems["linear"] = "Linear";
131
+ $arrItems["swing"] = "Swing";
132
+
133
+ $arrItems["easeOutQuad"] = "EaseOut - Quad";
134
+ $arrItems["easeOutQuint"] = "EaseOut - Quint";
135
+ $arrItems["easeOutBounce"] = "EaseOut - Bounce";
136
+ $arrItems["easeOutElastic"] = "EaseOut - Elastic";
137
+ $arrItems["easeOutBack"] = "EaseOut - Back";
138
+ $arrItems["easeOutQuart"] = "EaseOut - Quart";
139
+ $arrItems["easeOutExpo"] = "EaseOut - Expo";
140
+ $arrItems["easeOutCubic"] = "EaseOut - Cubic";
141
+ $arrItems["easeOutSine"] = "EaseOut - Sine";
142
+ $arrItems["easeOutCirc"] = "EaseOut - Circ";
143
+
144
+
145
+ $arrItems["easeInQuad"] = "EaseIn - Quad";
146
+ $arrItems["easeInQuint"] = "EaseIn - Quint";
147
+ $arrItems["easeInBounce"] = "EaseIn - Bounce";
148
+ $arrItems["easeInElastic"] = "EaseIn - Elastic";
149
+ $arrItems["easeInBack"] = "EaseIn - Back";
150
+ $arrItems["easeInQuart"] = "EaseIn - Quart";
151
+ $arrItems["easeInExpo"] = "EaseIn - Expo";
152
+ $arrItems["easeInCubic"] = "EaseIn - Cubic";
153
+ $arrItems["easeInSine"] = "EaseIn - Sine";
154
+ $arrItems["easeInCirc"] = "EaseIn - Circ";
155
+
156
+
157
+ $arrItems["easeInOutQuad"] = "EaseInOut - Quad";
158
+ $arrItems["easeInQuint"] = "EaseInOut - Quint";
159
+ $arrItems["easeInOutBounce"] = "EaseInOut - Bounce";
160
+ $arrItems["easeInOutElastic"] = "EaseInOut - Elastic";
161
+ $arrItems["easeInOutBack"] = "EaseInOut - Back";
162
+ $arrItems["easeInOutQuart"] = "EaseInOut - Quart";
163
+ $arrItems["easeInOutExpo"] = "EaseInOut - Expo";
164
+ $arrItems["easeInOutCubic"] = "EaseInOut - Cubic";
165
+ $arrItems["easeInOutSine"] = "EaseInOut - Sine";
166
+ $arrItems["easeInOutCirc"] = "EaseInOut - Circ";
167
+
168
+ return($arrItems);
169
+ }
170
+
171
+
172
+ /**
173
+ * add transitions array item to some select
174
+ */
175
+ public function updateSelectToEasing($name){
176
+
177
+ $arrItems = $this->getArrEasing();
178
+ $this->updateSettingItems($name, $arrItems);
179
+
180
+ }
181
+
182
+ /**
183
+ * add transitions array item to some select
184
+ */
185
+ public function updateSelectToAlignHor($name, $default = null){
186
+
187
+ $arrItems = array(
188
+ "left"=>__("Left",UNITEGALLERY_TEXTDOMAIN),
189
+ "center"=>__("Center", UNITEGALLERY_TEXTDOMAIN),
190
+ "right"=>__("Right", UNITEGALLERY_TEXTDOMAIN)
191
+ );
192
+
193
+ $this->updateSettingItems($name, $arrItems, $default);
194
+ }
195
+
196
+ /**
197
+ * add transitions array item to some select
198
+ */
199
+ public function updateSelectToAlignVert($name, $default = null){
200
+
201
+ $arrItems = array(
202
+ "top"=>__("Top",UNITEGALLERY_TEXTDOMAIN),
203
+ "middle"=>__("Middle", UNITEGALLERY_TEXTDOMAIN),
204
+ "bottom"=>__("Bottom", UNITEGALLERY_TEXTDOMAIN)
205
+ );
206
+
207
+ $this->updateSettingItems($name, $arrItems, $default);
208
+ }
209
+
210
+
211
+ /**
212
+ * add transitions array item to some select
213
+ */
214
+ public function updateSelectToAlignCombo($name, $default = null){
215
+
216
+ $arrItems = array(
217
+ "left"=>__("Left",UNITEGALLERY_TEXTDOMAIN),
218
+ "center"=>__("Center", UNITEGALLERY_TEXTDOMAIN),
219
+ "right"=>__("Right", UNITEGALLERY_TEXTDOMAIN),
220
+ "top"=>__("Top",UNITEGALLERY_TEXTDOMAIN),
221
+ "middle"=>__("Middle", UNITEGALLERY_TEXTDOMAIN),
222
+ "bottom"=>__("Bottom", UNITEGALLERY_TEXTDOMAIN)
223
+ );
224
+
225
+ $this->updateSettingItems($name, $arrItems, $default);
226
+ }
227
+
228
+
229
+ }
230
+
231
+ ?>
inc_php/framework/settings_output.class.php ADDED
@@ -0,0 +1,254 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @package Unite Gallery Lite
4
+ * @author Valiano
5
+ * @copyright (C) 2012 Unite CMS, All Rights Reserved.
6
+ * @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
7
+ * */
8
+ defined('UNITEGALLERY_INC') or die('Restricted access');
9
+
10
+
11
+ class UniteSettingsOutputUG{
12
+
13
+ protected $arrSettings = array();
14
+ protected $settings;
15
+ protected $formID;
16
+
17
+
18
+ /**
19
+ *
20
+ * init the output settings
21
+ */
22
+ public function init(UniteSettingsUG $settings){
23
+ $this->settings = new UniteSettingsUG();
24
+ $this->settings = $settings;
25
+ }
26
+
27
+
28
+ /**
29
+ *
30
+ * draw order box
31
+ * @param $setting
32
+ */
33
+ protected function drawOrderbox($setting){
34
+
35
+ $items = $setting["items"];
36
+
37
+ //get arrItems by saved value
38
+ $arrItems = array();
39
+
40
+ if(!empty($setting["value"]) &&
41
+ getType($setting["value"]) == "array" &&
42
+ count($setting["value"]) == count($items)){
43
+
44
+ $savedItems = $setting["value"];
45
+
46
+ foreach($savedItems as $value){
47
+ $text = $value;
48
+ if(isset($items[$value]))
49
+ $text = $items[$value];
50
+ $arrItems[] = array("value"=>$value,"text"=>$text);
51
+ }
52
+ } //get arrItems only from original items
53
+ else{
54
+ foreach($items as $value=>$text)
55
+ $arrItems[] = array("value"=>$value,"text"=>$text);
56
+ }
57
+
58
+
59
+ ?>
60
+ <ul class="orderbox" id="<?php echo $setting["id"]?>">
61
+ <?php
62
+ foreach($arrItems as $item){
63
+ $itemKey = $item["value"];
64
+ $itemText = $item["text"];
65
+
66
+ $value = (getType($itemKey) == "string")?$itemKey:$itemText;
67
+ ?>
68
+ <li>
69
+ <div class="div_value"><?php echo $value?></div>
70
+ <div class="div_text"><?php echo $itemText?></div>
71
+ </li>
72
+ <?php
73
+ }
74
+ ?>
75
+ </ul>
76
+ <?php
77
+ }
78
+
79
+
80
+ //-----------------------------------------------------------------------------------------------
81
+ //draw advanced order box
82
+ protected function drawOrderbox_advanced($setting){
83
+
84
+ $items = $setting["items"];
85
+ if(!is_array($items))
86
+ $this->throwError("Orderbox error - the items option must be array (items)");
87
+
88
+ //get arrItems modify items by saved value
89
+
90
+ if(!empty($setting["value"]) &&
91
+ getType($setting["value"]) == "array" &&
92
+ count($setting["value"]) == count($items)):
93
+
94
+ $savedItems = $setting["value"];
95
+
96
+ //make assoc array by id:
97
+ $arrAssoc = array();
98
+ foreach($items as $item)
99
+ $arrAssoc[$item[0]] = $item[1];
100
+
101
+ foreach($savedItems as $item){
102
+ $value = $item["id"];
103
+ $text = $value;
104
+ if(isset($arrAssoc[$value]))
105
+ $text = $arrAssoc[$value];
106
+ $arrItems[] = array($value,$text,$item["enabled"]);
107
+ }
108
+ else:
109
+ $arrItems = $items;
110
+ endif;
111
+
112
+ ?>
113
+ <ul class="orderbox_advanced" id="<?php echo $setting["id"]?>">
114
+ <?php
115
+ foreach($arrItems as $arrItem){
116
+ switch(getType($arrItem)){
117
+ case "string":
118
+ $value = $arrItem;
119
+ $text = $arrItem;
120
+ $enabled = true;
121
+ break;
122
+ case "array":
123
+ $value = $arrItem[0];
124
+ $text = (count($arrItem)>1)?$arrItem[1]:$arrItem[0];
125
+ $enabled = (count($arrItem)>2)?$arrItem[2]:true;
126
+ break;
127
+ default:
128
+ $this->throwError("Error in setting:".$setting.". unknown item type.");
129
+ break;
130
+ }
131
+
132
+ $checkboxClass = $enabled ? "div_checkbox_on" : "div_checkbox_off";
133
+
134
+ ?>
135
+ <li>
136
+ <div class="div_value"><?php echo $value?></div>
137
+ <div class="div_checkbox <?php echo $checkboxClass?>"></div>
138
+ <div class="div_text"><?php echo $text?></div>
139
+ <div class="div_handle"></div>
140
+ </li>
141
+ <?php
142
+ }
143
+
144
+ ?>
145
+ </ul>
146
+ <?php
147
+ }
148
+
149
+
150
+ /**
151
+ * draw hidden setting
152
+ * @param $setting
153
+ */
154
+ protected function drawHiddenInput($setting) {
155
+ ?>
156
+ <input type="hidden" id="<?php echo $setting["id"]?>" name="<?php echo $setting["name"]?>" value="<?php echo $setting["value"]?>" />
157
+ <?php
158
+ }
159
+
160
+
161
+ /**
162
+ *
163
+ * draw includes of the settings.
164
+ */
165
+ public function drawHeaderIncludes(){
166
+
167
+ $arrSections = $this->settings->getArrSections();
168
+ $arrControls = $this->settings->getArrControls();
169
+
170
+ $formID = $this->formID;
171
+
172
+ $arrOnReady = array();
173
+ $arrJs = array();
174
+
175
+ //$arrJs[] = "obj.jsonSettingTypes = '$jsonString'";
176
+ //$arrJs[] = "obj.objSettingTypes = JSON.parse(obj.jsonSettingTypes);";
177
+
178
+ //put sections vars
179
+ /*
180
+ if(!empty($arrSections)){
181
+ $arrJs[] = "obj.sectionsEnabled = true;";
182
+ $arrJs[] = "obj.numSections = ".count($arrSections).";";
183
+ }
184
+ else
185
+ $arrJs[] = "obj.sectionsEnabled = false;";
186
+ */
187
+
188
+ //put the settings into form id
189
+ $arrJs[] = "if(typeof(g_settingsObj) == 'undefined') var g_settingsObj={};";
190
+ $arrJs[] = "g_settingsObj['$formID'] = {}";
191
+
192
+ //dmp($arrControls);
193
+
194
+ //put controls json object:
195
+ if(!empty($arrControls)){
196
+
197
+ //dmp($arrControls); exit();
198
+
199
+ $strControls = json_encode($arrControls);
200
+ $arrJs[] = "g_settingsObj['$formID'].jsonControls = '".$strControls."'";
201
+ $arrJs[] = "g_settingsObj['$formID'].controls = JSON.parse(g_settingsObj['$formID'].jsonControls);";
202
+ }
203
+
204
+ $strJs = "";
205
+
206
+ //put js
207
+ foreach($arrJs as $line){
208
+ $strJs .= $line."\n";
209
+ }
210
+
211
+ if(!empty($arrOnReady)):
212
+ //put onready
213
+ $strJs .= "$(document).ready(function(){\n";
214
+ foreach($arrOnReady as $line){
215
+ $strJs .= $line."\n";
216
+ }
217
+ $strJs .= "});";
218
+ endif;
219
+
220
+ UniteProviderFunctionsUG::printCustomScript($strJs, true);
221
+
222
+ }
223
+
224
+
225
+ //-----------------------------------------------------------------------------------------------
226
+ // draw after body additional settings accesories
227
+ public function drawAfterBody(){
228
+ $arrTypes = $this->settings->getArrTypes();
229
+ foreach($arrTypes as $type){
230
+ switch($type){
231
+ case self::TYPE_COLOR:
232
+ ?>
233
+ <div id='divPickerWrapper' style='position:absolute;display:none;'><div id='divColorPicker'></div></div>
234
+ <?php
235
+ break;
236
+ }
237
+ }
238
+ }
239
+
240
+
241
+ /**
242
+ *
243
+ * do some operation before drawing the settings.
244
+ */
245
+ protected function prepareToDraw(){
246
+
247
+ $this->settings->setSettingsStateByControls();
248
+
249
+ }
250
+
251
+
252
+ }
253
+
254
+ ?>
inc_php/framework/settings_product.class.php ADDED
@@ -0,0 +1,793 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @package Unite Gallery
4
+ * @author Valiano
5
+ * @copyright (C) 2012 Unite CMS, All Rights Reserved.
6
+ * @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
7
+ * */
8
+ defined('UNITEGALLERY_INC') or die('Restricted access');
9
+
10
+
11
+ class UniteSettingsProductUG extends UniteSettingsOutputUG{
12
+
13
+ private $showDescAsTips = false;
14
+ private $showSaps = true;
15
+
16
+
17
+ /**
18
+ *
19
+ * set show descriptions as tips true / false
20
+ */
21
+ public function setShowDescAsTips($show){
22
+ $this->showDescAsTips = $show;
23
+ }
24
+
25
+
26
+ /**
27
+ *
28
+ * show saps true / false
29
+ */
30
+ public function setShowSaps($show){
31
+ $this->showSaps = $show;
32
+ }
33
+
34
+
35
+ /**
36
+ * draw text as input
37
+ * @param $setting
38
+ */
39
+ protected function drawTextInput($setting) {
40
+ $disabled = "";
41
+ $style="";
42
+ $readonly = "";
43
+
44
+ if(isset($setting["style"]))
45
+ $style = "style='".$setting["style"]."'";
46
+ if(isset($setting["disabled"]))
47
+ $disabled = 'disabled="disabled"';
48
+
49
+ if(isset($setting["readonly"])){
50
+ $readonly = "readonly='readonly'";
51
+ }
52
+
53
+ $class = UniteFunctionsUG::getVal($setting, "class", "input-regular");
54
+
55
+ if(!empty($class))
56
+ $class = "class='$class'";
57
+
58
+ $settingValue = htmlspecialchars($setting["value"]);
59
+
60
+ ?>
61
+ <input type="text" <?php echo $class?> <?php echo $style?> <?php echo $disabled?><?php echo $readonly?> id="<?php echo $setting["id"]?>" name="<?php echo $setting["name"]?>" value="<?php echo $settingValue?>" />
62
+ <?php
63
+ }
64
+
65
+
66
+
67
+ /**
68
+ *
69
+ * draw imaeg input:
70
+ * @param $setting
71
+ */
72
+ protected function drawImageInput($setting){
73
+
74
+ $class = UniteFunctionsUG::getVal($setting, "class");
75
+
76
+ if(!empty($class))
77
+ $class = "class='$class'";
78
+
79
+ $settingsID = $setting["id"];
80
+
81
+ $buttonID = $settingsID."_button";
82
+ $buttonRemoveID = $settingsID."_button_remove";
83
+
84
+ $spanPreviewID = $buttonID."_preview";
85
+
86
+ $img = "";
87
+ $value = UniteFunctionsUG::getVal($setting, "value");
88
+
89
+ if(!empty($value)){
90
+ $urlImage = $value;
91
+ $imagePath = UniteFunctionsWPUG::getImageRealPathFromUrl($urlImage);
92
+ $img = '<div style="width:100px;height:70px;background:url('.$urlImage.'); background-position:center center; background-size:contain;background-repeat:no-repeat;"></div>';
93
+ }
94
+
95
+ ?>
96
+ <span id='<?php echo $spanPreviewID?>' class='setting-image-preview'><?php echo $img?></span>
97
+
98
+ <input type="hidden" id="<?php echo $setting["id"]?>" name="<?php echo $setting["name"]?>" value="<?php echo $setting["value"]?>" />
99
+
100
+ <input type="button" id="<?php echo $buttonID?>" style="width: 110px !important; float: left;" class='button-image-select button-primary revblue<?php echo $class?>' value="<?php _e('Choose Image',UNITEGALLERY_TEXTDOMAIN); ?>"></input>
101
+ <input type="button" class="button-image-remove button-primary revred" style="width: 110px !important;" id="<?php echo $buttonRemoveID; ?>" value="<?php _e('Remove',UNITEGALLERY_TEXTDOMAIN); ?>" />
102
+ <div class="unite-clear"></div>
103
+ <?php
104
+ }
105
+
106
+
107
+ //-----------------------------------------------------------------------------------------------
108
+ //draw a color picker
109
+ protected function drawColorPickerInput($setting){
110
+ $bgcolor = $setting["value"];
111
+ $bgcolor = str_replace("0x","#",$bgcolor);
112
+ // set the forent color (by black and white value)
113
+ $rgb = UniteFunctionsUG::html2rgb($bgcolor);
114
+ $bw = UniteFunctionsUG::yiq($rgb[0],$rgb[1],$rgb[2]);
115
+ $color = "#000000";
116
+ if($bw<128) $color = "#ffffff";
117
+
118
+
119
+ $disabled = "";
120
+ if(isset($setting["disabled"])){
121
+ $color = "";
122
+ $disabled = 'disabled="disabled"';
123
+ }
124
+
125
+ $style="style='background-color:$bgcolor;color:$color'";
126
+
127
+ ?>
128
+ <input type="text" class="inputColorPicker" id="<?php echo $setting["id"]?>" <?php echo $style?> name="<?php echo $setting["name"]?>" value="<?php echo $bgcolor?>" <?php echo $disabled?>></input>
129
+ <?php
130
+ }
131
+
132
+ //-----------------------------------------------------------------------------------------------
133
+ //draw a date picker
134
+ protected function drawDatePickerInput($setting){
135
+ $date = $setting["value"];
136
+ //$date = str_replace("0x","#",$date);
137
+
138
+ //$rgb = UniteFunctionsUG::html2rgb($date);
139
+ //$bw = UniteFunctionsUG::yiq($rgb[0],$rgb[1],$rgb[2]);
140
+
141
+
142
+
143
+ ?>
144
+ <input type="text" class="inputDatePicker" id="<?php echo $setting["id"]?>" name="<?php echo $setting["name"]?>" value="<?php echo $date?>"></input>
145
+ <?php
146
+ }
147
+
148
+
149
+ /**
150
+ * draw setting input by type
151
+ */
152
+ protected function drawInputs($setting){
153
+ switch($setting["type"]){
154
+ case UniteSettingsUG::TYPE_TEXT:
155
+ $this->drawTextInput($setting);
156
+ break;
157
+ case UniteSettingsUG::TYPE_COLOR:
158
+ $this->drawColorPickerInput($setting);
159
+ break;
160
+ case UniteSettingsUG::TYPE_DATE:
161
+ $this->drawDatePickerInput($setting);
162
+ break;
163
+ case UniteSettingsUG::TYPE_SELECT:
164
+ $this->drawSelectInput($setting);
165
+ break;
166
+ case UniteSettingsUG::TYPE_CHECKLIST:
167
+ $this->drawChecklistInput($setting);
168
+ break;
169
+ case UniteSettingsUG::TYPE_CHECKBOX:
170
+ $this->drawCheckboxInput($setting);
171
+ break;
172
+ case UniteSettingsUG::TYPE_RADIO:
173
+ $this->drawRadioInput($setting);
174
+ break;
175
+ case UniteSettingsUG::TYPE_TEXTAREA:
176
+ $this->drawTextAreaInput($setting);
177
+ break;
178
+ case UniteSettingsUG::TYPE_IMAGE:
179
+ $this->drawImageInput($setting);
180
+ break;
181
+ case UniteSettingsUG::TYPE_CUSTOM:
182
+ if(method_exists($this,"drawCustomInputs") == false){
183
+ UniteFunctionsUG::throwError("Method don't exists: drawCustomInputs, please override the class");
184
+ }
185
+ $this->drawCustomInputs($setting);
186
+ break;
187
+ default:
188
+ throw new Exception("wrong setting type - ".$setting["type"]);
189
+ break;
190
+ }
191
+
192
+
193
+ }
194
+
195
+
196
+
197
+ //-----------------------------------------------------------------------------------------------
198
+ // draw text area input
199
+
200
+ protected function drawTextAreaInput($setting){
201
+
202
+ $disabled = "";
203
+ if (isset($setting["disabled"])) $disabled = 'disabled="disabled"';
204
+
205
+ $style = "";
206
+ if(isset($setting["style"]))
207
+ $style = "style='".$setting["style"]."'";
208
+
209
+ $rows = UniteFunctionsUG::getVal($setting, "rows");
210
+ if(!empty($rows))
211
+ $rows = "rows='$rows'";
212
+
213
+ $cols = UniteFunctionsUG::getVal($setting, "cols");
214
+ if(!empty($cols))
215
+ $cols = "cols='$cols'";
216
+
217
+ $settingValue = $setting["value"];
218
+ $settingValue = htmlspecialchars($settingValue);
219
+
220
+ ?>
221
+ <textarea id="<?php echo $setting["id"]?>" name="<?php echo $setting["name"]?>" <?php echo $style?> <?php echo $disabled?> <?php echo $rows?> <?php echo $cols?> ><?php echo $settingValue?></textarea>
222
+ <?php
223
+ if(!empty($cols))
224
+ echo "<br>"; //break line on big textareas.
225
+ }
226
+
227
+
228
+ /**
229
+ * draw radio input
230
+ */
231
+ protected function drawRadioInput($setting){
232
+ $items = $setting["items"];
233
+ $counter = 0;
234
+ $settingID = $setting["id"];
235
+ $isDisabled = UniteFunctionsUG::getVal($setting, "disabled");
236
+ $isDisabled = UniteFunctionsUG::strToBool($isDisabled);
237
+ $settingName = $setting["name"];
238
+
239
+ ?>
240
+ <span id="<?php echo $settingID ?>" class="radio_wrapper">
241
+ <?php
242
+ foreach($items as $value=>$text):
243
+ $counter++;
244
+ $radioID = $settingID."_".$counter;
245
+
246
+ $strChecked = "";
247
+ if($value == $setting["value"])
248
+ $strChecked = " checked";
249
+
250
+ $strDisabled = "";
251
+ if($isDisabled)
252
+ $strDisabled = 'disabled = "disabled"';
253
+
254
+ $props = "style=\"cursor:pointer;\" {$strChecked} $strDisabled";
255
+
256
+ ?>
257
+ <input type="radio" id="<?php echo $radioID?>" value="<?php echo $value?>" name="<?php echo $settingName?>" <?php echo $props?>/>
258
+ <label for="<?php echo $radioID?>" ><?php echo $text?></label>
259
+ &nbsp; &nbsp;
260
+ <?php
261
+ endforeach;
262
+
263
+ ?>
264
+ </span>
265
+ <?php
266
+ }
267
+
268
+
269
+
270
+ /**
271
+ * draw checkbox
272
+ */
273
+ protected function drawCheckboxInput($setting){
274
+ $checked = "";
275
+ if($setting["value"] == true) $checked = 'checked="checked"';
276
+ ?>
277
+ <input type="checkbox" id="<?php echo $setting["id"]?>" class="inputCheckbox" name="<?php echo $setting["name"]?>" <?php echo $checked?>/>
278
+ <?php
279
+ }
280
+
281
+ /**
282
+ * draw select input
283
+ */
284
+ protected function drawSelectInput($setting){
285
+
286
+ $className = "";
287
+ if(isset($this->arrControls[$setting["name"]]))
288
+ $className = "control";
289
+
290
+ $class = "";
291
+ if($className != "") $class = "class='".$className."'";
292
+
293
+ $disabled = "";
294
+ if(isset($setting["disabled"])) $disabled = 'disabled="disabled"';
295
+
296
+ $args = UniteFunctionsUG::getVal($setting, "args");
297
+
298
+ $settingValue = $setting["value"];
299
+
300
+ if(strpos($settingValue,",") !== false)
301
+ $settingValue = explode(",", $settingValue);
302
+
303
+ ?>
304
+ <select id="<?php echo $setting["id"]?>" name="<?php echo $setting["name"]?>" <?php echo $disabled?> <?php echo $class?> <?php echo $args?>>
305
+ <?php
306
+ foreach($setting["items"] as $value=>$text):
307
+ //set selected
308
+ $selected = "";
309
+ $addition = "";
310
+ if(strpos($value,"option_disabled") === 0){
311
+ $addition = "disabled";
312
+ }else{
313
+ if(is_array($settingValue)){
314
+ if(array_search($value, $settingValue) !== false)
315
+ $selected = 'selected="selected"';
316
+ }else{
317
+ if($value == $settingValue)
318
+ $selected = 'selected="selected"';
319
+ }
320
+ }
321
+
322
+
323
+ ?>
324
+ <option <?php echo $addition?> value="<?php echo $value?>" <?php echo $selected?>><?php echo $text?></option>
325
+ <?php
326
+ endforeach
327
+ ?>
328
+ </select>
329
+ <?php
330
+ }
331
+
332
+
333
+ /**
334
+ *
335
+ * draw checklist input
336
+ * @param $setting
337
+ */
338
+ protected function drawChecklistInput($setting){
339
+
340
+ $className = "input_checklist";
341
+ if(isset($this->arrControls[$setting["name"]]))
342
+ $className .= " control";
343
+
344
+ $class = "";
345
+ if($className != "") $class = "class='".$className."'";
346
+
347
+ $disabled = "";
348
+ if(isset($setting["disabled"])) $disabled = 'disabled="disabled"';
349
+
350
+ $args = UniteFunctionsUG::getVal($setting, "args");
351
+
352
+ $settingValue = $setting["value"];
353
+
354
+ if(strpos($settingValue,",") !== false)
355
+ $settingValue = explode(",", $settingValue);
356
+
357
+ $style = "z-index:1000;";
358
+ $minWidth = UniteFunctionsUG::getVal($setting, "minwidth");
359
+
360
+ if(!empty($minWidth)){
361
+ $style .= "min-width:".$minWidth."px;";
362
+ $args .= " data-minwidth='".$minWidth."'";
363
+ }
364
+
365
+ ?>
366
+ <select id="<?php echo $setting["id"]?>" name="<?php echo $setting["name"]?>" <?php echo $disabled?> multiple <?php echo $class?> <?php echo $args?> size="1" style="<?php echo $style?>">
367
+ <?php
368
+ foreach($setting["items"] as $value=>$text):
369
+ //set selected
370
+ $selected = "";
371
+ $addition = "";
372
+ if(strpos($value,"option_disabled") === 0){
373
+ $addition = "disabled";
374
+ }else{
375
+ if(is_array($settingValue)){
376
+ if(array_search($value, $settingValue) !== false)
377
+ $selected = 'selected="selected"';
378
+ }else{
379
+ if($value == $settingValue)
380
+ $selected = 'selected="selected"';
381
+ }
382
+ }
383
+
384
+
385
+ ?>
386
+ <option <?php echo $addition?> value="<?php echo $value?>" <?php echo $selected?>><?php echo $text?></option>
387
+ <?php
388
+ endforeach
389
+ ?>
390
+ </select>
391
+ <?php
392
+ }
393
+
394
+
395
+
396
+ //-----------------------------------------------------------------------------------------------
397
+ //draw hr row
398
+ protected function drawTextRow($setting){
399
+
400
+ //set cell style
401
+ $cellStyle = "";
402
+ if(isset($setting["padding"]))
403
+ $cellStyle .= "padding-left:".$setting["padding"].";";
404
+
405
+ if(!empty($cellStyle))
406
+ $cellStyle="style='$cellStyle'";
407
+
408
+ //set style
409
+ $rowStyle = "";
410
+ if(isset($setting["hidden"]))
411
+ $rowStyle .= "display:none;";
412
+
413
+ if(!empty($rowStyle))
414
+ $rowStyle = "style='$rowStyle'";
415
+
416
+ ?>
417
+ <tr id="<?php echo $setting["id_row"]?>" <?php echo $rowStyle ?> valign="top">
418
+ <td colspan="4" align="right" <?php echo $cellStyle?>>
419
+ <span class="spanSettingsStaticText"><?php echo $setting["text"]?></span>
420
+ </td>
421
+ </tr>
422
+ <?php
423
+ }
424
+
425
+ //-----------------------------------------------------------------------------------------------
426
+ //draw hr row
427
+ protected function drawHrRow($setting){
428
+ //set hidden
429
+ $rowStyle = "";
430
+ if(isset($setting["hidden"])) $rowStyle = "style='display:none;'";
431
+
432
+ $class = UniteFunctionsUG::getVal($setting, "class");
433
+ if(!empty($class))
434
+ $class = "class='$class'";
435
+
436
+ ?>
437
+ <tr id="<?php echo $setting["id_row"]?>" <?php echo $rowStyle ?>>
438
+ <td colspan="4" align="left" style="text-align:left;">
439
+ <hr <?php echo $class; ?> />
440
+ </td>
441
+ </tr>
442
+ <?php
443
+ }
444
+
445
+ /**
446
+ * draw input additinos like unit / description etc
447
+ */
448
+ private function drawInputAdditions($setting){
449
+
450
+ $description = UniteFunctionsUG::getVal($setting, "description");
451
+ $unit = UniteFunctionsUG::getVal($setting, "unit");
452
+ $required = UniteFunctionsUG::getVal($setting, "required");
453
+ $addHtml = UniteFunctionsUG::getVal($setting, UniteSettingsUG::PARAM_ADDTEXT);
454
+
455
+ ?>
456
+
457
+ <?php if(!empty($unit)):?>
458
+ <span class='setting_unit'><?php echo $unit?></span>
459
+ <?php endif?>
460
+ <?php if(!empty($required)):?>
461
+ <span class='setting_required'>*</span>
462
+ <?php endif?>
463
+ <?php if(!empty($addHtml)):?>
464
+ <span class="settings_addhtml"><?php echo $addHtml?></span>
465
+ <?php endif?>
466
+ <?php if(!empty($description) && $this->showDescAsTips == false):?>
467
+ <span class="description"><?php echo $description?></span>
468
+ <?php endif?>
469
+
470
+ <?php
471
+ }
472
+
473
+
474
+ /**
475
+ * draw settings row
476
+ * @param $setting
477
+ */
478
+ protected function drawSettingRow($setting){
479
+
480
+ //set cellstyle:
481
+ $cellStyle = "";
482
+ if(isset($setting[UniteSettingsUG::PARAM_CELLSTYLE])){
483
+ $cellStyle .= $setting[UniteSettingsUG::PARAM_CELLSTYLE];
484
+ }
485
+
486
+ //set text style:
487
+ $textStyle = $cellStyle;
488
+ if(isset($setting[UniteSettingsUG::PARAM_TEXTSTYLE])){
489
+ $textStyle .= $setting[UniteSettingsUG::PARAM_TEXTSTYLE];
490
+ }
491
+
492
+ if($textStyle != "")
493
+ $textStyle = "style='".$textStyle."'";
494
+
495
+ if($cellStyle != "")
496
+ $cellStyle = "style='".$cellStyle."'";
497
+
498
+ //set hidden
499
+ $rowStyle = "";
500
+ if(isset($setting["hidden"]))
501
+ $rowStyle = "display:none;";
502
+
503
+ if(!empty($rowStyle))
504
+ $rowStyle = "style='$rowStyle'";
505
+
506
+ //set text class:
507
+ $class = "";
508
+ if(isset($setting["disabled"]))
509
+ $class = "class='setting-disabled'";
510
+
511
+ //modify text:
512
+ $text = UniteFunctionsUG::getVal($setting,"text","");
513
+ // prevent line break (convert spaces to nbsp)
514
+ $text = str_replace(" ","&nbsp;",$text);
515
+ switch($setting["type"]){
516
+ case UniteSettingsUG::TYPE_CHECKBOX:
517
+ $text = "<label for='".$setting["id"]."' style='cursor:pointer;'>$text</label>";
518
+ break;
519
+ }
520
+
521
+ $description = UniteFunctionsUG::getVal($setting,"description");
522
+
523
+
524
+ //set settings text width:
525
+ $textWidth = "";
526
+ if(isset($setting["textWidth"]))
527
+ $textWidth = 'width="'.$setting["textWidth"].'"';
528
+
529
+ $addField = UniteFunctionsUG::getVal($setting, UniteSettingsUG::PARAM_ADDFIELD);
530
+
531
+ ?>
532
+
533
+ <?php
534
+ if(!empty($addField)):
535
+
536
+ $addSetting = $this->settings->getSettingByName($addField);
537
+ UniteFunctionsUG::validateNotEmpty($addSetting,"AddSetting {$addField}");
538
+
539
+ //set hidden
540
+ $rowStyleAdd = "";
541
+ if(isset($addSetting["hidden"]))
542
+ $rowStyleAdd = "display:none;";
543
+
544
+ if(!empty($rowStyleAdd))
545
+ $rowStyleAdd = "style='$rowStyleAdd'";
546
+
547
+ $addSettingText = UniteFunctionsUG::getVal($addSetting,"text","");
548
+ $addSettingText = str_replace(" ","&nbsp;", $addSettingText);
549
+
550
+ ?>
551
+ <tr <?php echo $class?> valign="top">
552
+
553
+ <td <?php echo $cellStyle?> class="unite-settings-onecell" colspan="2">
554
+ <span id="<?php echo $setting["id_row"]?>" <?php echo $rowStyle ?>>
555
+ <span class='setting_onecell_text'><?php echo $text?></span>
556
+ <?php
557
+ $this->drawInputs($setting);
558
+ $this->drawInputAdditions($setting);
559
+ ?>
560
+ <span class="setting_onecell_horsap"></span>
561
+ </span>
562
+
563
+ <span id="<?php echo $addSetting["id_row"]?>" <?php echo $rowStyleAdd ?>>
564
+ <span class='setting_onecell_text'><?php echo $addSettingText?></span>
565
+ <?php
566
+ $this->drawInputs($addSetting);
567
+ $this->drawInputAdditions($addSetting);
568
+ ?>
569
+ </span>
570
+ </td>
571
+ </tr>
572
+ <?php
573
+ ?>
574
+ <?php else: ?>
575
+ <tr id="<?php echo $setting["id_row"]?>" <?php echo $rowStyle ?> <?php echo $class?> valign="top">
576
+
577
+ <th <?php echo $textStyle?> scope="row" <?php echo $textWidth ?>>
578
+ <?php if($this->showDescAsTips == true): ?>
579
+ <span class='setting_text' title="<?php echo $description?>"><?php echo $text?></span>
580
+ <?php else:?>
581
+ <?php echo $text?>
582
+ <?php endif?>
583
+ </th>
584
+ <td <?php echo $cellStyle?>>
585
+ <?php
586
+ $this->drawInputs($setting);
587
+ $this->drawInputAdditions($setting);
588
+ ?>
589
+ </td>
590
+ </tr>
591
+ <?php
592
+ endif;
593
+ }
594
+
595
+
596
+
597
+ /**
598
+ * draw all settings
599
+ */
600
+ public function drawSettings(){
601
+ $this->drawHeaderIncludes();
602
+ $this->prepareToDraw();
603
+
604
+ //draw main div
605
+ $lastSectionKey = -1;
606
+ $visibleSectionKey = 0;
607
+ $lastSapKey = -1;
608
+
609
+ $arrSections = $this->settings->getArrSections();
610
+ $arrSettings = $this->settings->getArrSettings();
611
+
612
+ $this->arrSettings = $arrSettings;
613
+
614
+ //draw settings - simple
615
+ if(empty($arrSections)):
616
+ ?><table class='unite_table_settings_wide'><?php
617
+ foreach($arrSettings as $key=>$setting){
618
+
619
+ if(isset($setting[UniteSettingsUG::PARAM_NODRAW]))
620
+ continue;
621
+
622
+ switch($setting["type"]){
623
+ case UniteSettingsUG::TYPE_HR:
624
+ $this->drawHrRow($setting);
625
+ break;
626
+ case UniteSettingsUG::TYPE_STATIC_TEXT:
627
+ $this->drawTextRow($setting);
628
+ break;
629
+ default:
630
+ $this->drawSettingRow($setting);
631
+ break;
632
+ }
633
+
634
+ }
635
+ ?></table><?php
636
+ else:
637
+
638
+ //draw settings - advanced - with sections
639
+ foreach($arrSettings as $key=>$setting):
640
+
641
+ //dmp($setting);
642
+
643
+ //operate sections:
644
+ if(!empty($arrSections) && isset($setting["section"])){
645
+ $sectionKey = $setting["section"];
646
+
647
+ if($sectionKey != $lastSectionKey): //new section
648
+ $arrSaps = $arrSections[$sectionKey]["arrSaps"];
649
+
650
+ if(!empty($arrSaps)){
651
+ //close sap
652
+ if($lastSapKey != -1):
653
+ ?>
654
+ </table>
655
+ </div>
656
+ <?php
657
+ endif;
658
+ $lastSapKey = -1;
659
+ }
660
+
661
+ $style = ($visibleSectionKey == $sectionKey)?"":"style='display:none'";
662
+
663
+ //close section
664
+ if($sectionKey != 0):
665
+ if(empty($arrSaps))
666
+ echo "</table>";
667
+ echo "</div>\n";
668
+ endif;
669
+
670
+ //if no saps - add table
671
+ if(empty($arrSaps)):
672
+ ?><table class="unite_settings_table"><?php
673
+ endif;
674
+ endif;
675
+ $lastSectionKey = $sectionKey;
676
+ }//end section manage
677
+
678
+ //operate saps
679
+ if(!empty($arrSaps) && isset($setting["sap"])){
680
+ $sapKey = $setting["sap"];
681
+ if($sapKey != $lastSapKey){
682
+ $sap = $this->settings->getSap($sapKey,$sectionKey);
683
+
684
+ //draw sap end
685
+ if($sapKey != 0): ?>
686
+ </table>
687
+ <?php endif;
688
+
689
+ //set opened/closed states:
690
+ //$style = "style='display:none;'";
691
+ $style = "";
692
+
693
+ $class = "divSapControl";
694
+
695
+ if($sapKey == 0 || isset($sap["opened"]) && $sap["opened"] == true){
696
+ $style = "";
697
+ $class = "divSapControl opened";
698
+ }
699
+
700
+ //set hide / show sap controls
701
+ $sapControlStyle = "";
702
+ if($this->showSaps == false)
703
+ $sapControlStyle = "style='display:none'";
704
+
705
+ ?>
706
+ <div id="divSapControl_<?php echo $sectionKey."_".$sapKey?>" class="<?php echo $class?>" <?php echo $sapControlStyle?>>
707
+
708
+ <h3><?php echo $sap["text"]?></h3>
709
+ </div>
710
+ <div id="divSap_<?php echo $sectionKey."_".$sapKey?>" class="divSap" <?php echo $style ?>>
711
+ <table class="unite_table_settings_wide">
712
+ <?php
713
+ $lastSapKey = $sapKey;
714
+ }
715
+ }//saps manage
716
+
717
+ //draw row:
718
+ switch($setting["type"]){
719
+ case UniteSettingsUG::TYPE_HR:
720
+ $this->drawHrRow($setting);
721
+ break;
722
+ case UniteSettingsUG::TYPE_STATIC_TEXT:
723
+ $this->drawTextRow($setting);
724
+ break;
725
+ default:
726
+ $this->drawSettingRow($setting);
727
+ break;
728
+ }
729
+ endforeach;
730
+ endif;
731
+ ?>
732
+ </table>
733
+
734
+ <?php
735
+ if(!empty($arrSections)):
736
+ if(empty($arrSaps)) //close table settings if no saps
737
+ echo "</table>";
738
+ echo "</div>\n"; //close last section div
739
+ endif;
740
+
741
+ }
742
+
743
+
744
+
745
+ //-----------------------------------------------------------------------------------------------
746
+ // draw sections menu
747
+ public function drawSections($activeSection=0){
748
+ if(!empty($this->arrSections)):
749
+ echo "<ul class='listSections' >";
750
+ for($i=0;$i<count($this->arrSections);$i++):
751
+ $class = "";
752
+ if($activeSection == $i) $class="class='selected'";
753
+ $text = $this->arrSections[$i]["text"];
754
+ echo '<li '.$class.'><a onfocus="this.blur()" href="#'.($i+1).'"><div>'.$text.'</div></a></li>';
755
+ endfor;
756
+ echo "</ul>";
757
+ endif;
758
+
759
+ //call custom draw function:
760
+ if($this->customFunction_afterSections) call_user_func($this->customFunction_afterSections);
761
+ }
762
+
763
+ /**
764
+ *
765
+ * draw settings function
766
+ * @param $drawForm draw the form yes / no
767
+ */
768
+ public function draw($formID=null,$drawForm = false){
769
+ if(empty($formID))
770
+ UniteFunctionsUG::throwError("The form ID can't be empty. you must provide it");
771
+
772
+ $this->formID = $formID;
773
+
774
+ ?>
775
+ <div class="settings_wrapper unite_settings_wide">
776
+ <?php
777
+
778
+ if($drawForm == true){
779
+ ?>
780
+ <form name="<?php echo $formID?>" id="<?php echo $formID?>">
781
+ <?php $this->drawSettings() ?>
782
+ </form>
783
+ <?php
784
+ }else
785
+ $this->drawSettings();
786
+
787
+ ?>
788
+ </div>
789
+ <?php
790
+ }
791
+
792
+ }
793
+ ?>
inc_php/framework/settings_product_sidebar.class.php ADDED
@@ -0,0 +1,900 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @package Unite Gallery
4
+ * @author Valiano
5
+ * @copyright (C) 2012 Unite CMS, All Rights Reserved.
6
+ * @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
7
+ * */
8
+ defined('UNITEGALLERY_INC') or die('Restricted access');
9
+
10
+ class UniteSettingsProductSidebarUG extends UniteSettingsOutputUG{
11
+
12
+ private $addClass = ""; //add class to the main div
13
+ private $arrButtons = array();
14
+ private $isAccordion = true;
15
+ private $defaultTextClass;
16
+
17
+ const INPUT_CLASS_SHORT = "text-sidebar";
18
+ const INPUT_CLASS_NORMAL = "text-sidebar-normal";
19
+ const INPUT_CLASS_LONG = "text-sidebar-long";
20
+ const INPUT_CLASS_LINK = "text-sidebar-link";
21
+
22
+
23
+ /**
24
+ *
25
+ * construction
26
+ */
27
+ public function __construct(){
28
+ $this->defaultTextClass = self::INPUT_CLASS_SHORT;
29
+ }
30
+
31
+
32
+ /**
33
+ *
34
+ * set default text class
35
+ */
36
+ public function setDefaultInputClass($defaultClass){
37
+ $this->defaultTextClass = $defaultClass;
38
+ }
39
+
40
+
41
+ /**
42
+ *
43
+ * add buggon
44
+ */
45
+ public function addButton($title,$id,$class = "unite-button-secondary"){
46
+
47
+ $button = array(
48
+ "title"=>$title,
49
+ "id"=>$id,
50
+ "class"=>$class
51
+ );
52
+
53
+ $this->arrButtons[] = $button;
54
+ }
55
+
56
+
57
+
58
+ /**
59
+ *
60
+ * set add class for the main div
61
+ */
62
+ public function setAddClass($addClass){
63
+ $this->addClass = $addClass;
64
+ }
65
+
66
+
67
+ //-----------------------------------------------------------------------------------------------
68
+ //draw text as input
69
+ protected function drawTextInput($setting) {
70
+
71
+ $disabled = "";
72
+ $style="";
73
+ if(isset($setting["style"]))
74
+ $style = "style='".$setting["style"]."'";
75
+ if(isset($setting["disabled"]))
76
+ $disabled = 'disabled="disabled"';
77
+
78
+ $class = UniteFunctionsUG::getVal($setting, "class");
79
+
80
+ if(empty($class)){
81
+ $unit = UniteFunctionsUG::getVal($setting, "unit");
82
+ if(!empty($unit))
83
+ $class = $this->defaultTextClass;
84
+ else
85
+ $class = self::INPUT_CLASS_NORMAL;
86
+ }
87
+
88
+ //modify class:
89
+ switch($class){
90
+ case "normal":
91
+ case "regular":
92
+ $class = self::INPUT_CLASS_NORMAL;
93
+ break;
94
+ case "long":
95
+ $class = self::INPUT_CLASS_LONG;
96
+ break;
97
+ case "link":
98
+ $class = self::INPUT_CLASS_LINK;
99
+ break;
100
+ }
101
+
102
+ if(!empty($class))
103
+ $class = "class='$class'";
104
+
105
+ $attribs = UniteFunctionsUG::getVal($setting, "attribs");
106
+
107
+ ?>
108
+ <input type="text" <?php echo $attribs?> <?php echo $class?> <?php echo $style?> <?php echo $disabled?> id="<?php echo $setting["id"]?>" name="<?php echo $setting["name"]?>" value="<?php echo $setting["value"]?>" />
109
+ <?php
110
+ }
111
+
112
+ //-----------------------------------------------------------------------------------------------
113
+ //draw multiple text boxes as input
114
+ protected function drawMultipleText($setting) {
115
+ $disabled = "";
116
+ $style="";
117
+ if(isset($setting["style"]))
118
+ $style = "style='".$setting["style"]."'";
119
+ if(isset($setting["disabled"]))
120
+ $disabled = 'disabled="disabled"';
121
+
122
+ $class = UniteFunctionsUG::getVal($setting, "class",$this->defaultTextClass);
123
+
124
+ //modify class:
125
+ switch($class){
126
+ case "normal":
127
+ case "regular":
128
+ $class = self::INPUT_CLASS_NORMAL;
129
+ break;
130
+ case "long":
131
+ $class = self::INPUT_CLASS_LONG;
132
+ break;
133
+ case "link":
134
+ $class = self::INPUT_CLASS_LINK;
135
+ break;
136
+ }
137
+
138
+ if(!empty($class))
139
+ $class = "class='$class'";
140
+
141
+ $attribs = UniteFunctionsUG::getVal($setting, "attribs");
142
+ $values = $setting["value"];
143
+ if(!empty($values) && is_array($values)){
144
+ foreach($values as $key => $value){
145
+
146
+ $value = stripslashes($value);
147
+ $value = htmlspecialchars($value);
148
+
149
+ ?>
150
+ <div class="fontinput_wrapper">
151
+ <input type="text" <?php echo $attribs?> <?php echo $class?> <?php echo $style?> <?php echo $disabled?> id="<?php echo $setting["id"].'_'.$key?>" name="<?php echo $setting["name"]?>[]" value="<?php echo $value?>" /> <a href="javascript:void(0);" data-remove="<?php echo $setting["id"].'_'.$key?>" class="remove_multiple_text"><i class="revicon-trash redicon withhover"></i></a>
152
+ </div>
153
+ <?php
154
+ }
155
+ }else{ //fallback to old version
156
+ $key = 0;
157
+ $value = $setting["value"];
158
+ $value = stripslashes($value);
159
+ $value = htmlspecialchars($value);
160
+
161
+ ?>
162
+ <div class="fontinput_wrapper">
163
+ <input type="text" <?php echo $attribs?> <?php echo $class?> <?php echo $style?> <?php echo $disabled?> id="<?php echo $setting["id"].'_'.$key?>" name="<?php echo $setting["name"]?>[]" value="<?php echo $value?>" /> <a href="javascript:void(0);" data-remove="<?php echo $setting["id"].'_'.$key?>" class="remove_multiple_text"><i class="revicon-trash redicon withhover"></i></a>
164
+ </div>
165
+ <?php
166
+ }
167
+ ?>
168
+
169
+ <div class="<?php echo $setting["id"]?>_TEMPLATE" style="display: none;">
170
+ <div class="fontinput_wrapper">
171
+ <input type="text" <?php echo $attribs?> <?php echo $class?> <?php echo $style?> id="##ID##" name="##NAME##[]" value="" /> <a href="javascript:void(0);" data-remove="##ID##" class="remove_multiple_text"><i class="revicon-trash redicon withhover"></i></a>
172
+ </div>
173
+ </div>
174
+
175
+ <script type="text/javascript">
176
+ UniteAdminRev.setMultipleTextKey('<?php echo $setting["id"]?>', <?php echo $key?>);
177
+ </script>
178
+ <?php
179
+ }
180
+
181
+ //-----------------------------------------------------------------------------------------------
182
+ //draw a color picker
183
+ protected function drawColorPickerInput($setting){
184
+
185
+ $bgcolor = $setting["value"];
186
+
187
+ $bgcolor = str_replace("0x","#",$bgcolor);
188
+
189
+ // set the forent color (by black and white value)
190
+ $color = "#000000";
191
+ if(!empty($bgcolor)){
192
+ $rgb = UniteFunctionsUG::html2rgb($bgcolor);
193
+ $bw = UniteFunctionsUG::yiq($rgb[0],$rgb[1],$rgb[2]);
194
+ if($bw<128)
195
+ $color = "#ffffff";
196
+ }
197
+
198
+
199
+ $disabled = "";
200
+ if(isset($setting["disabled"])){
201
+ $color = "";
202
+ $disabled = 'disabled="disabled"';
203
+ }
204
+
205
+ $style="style='background-color:$bgcolor;color:$color'";
206
+
207
+ ?>
208
+ <input type="text" class="inputColorPicker" id="<?php echo $setting["id"]?>" <?php echo $style?> name="<?php echo $setting["name"]?>" value="<?php echo $bgcolor?>" <?php echo $disabled?>></input>
209
+ <?php
210
+ }
211
+
212
+
213
+ //-----------------------------------------------------------------------------------------------
214
+ //draw code mirror input
215
+ protected function drawCodeMirror($setting){
216
+ ?>
217
+ <textarea name="<?php echo $setting['name']; ?>" id="<?php echo $setting['id']; ?>"><?php echo $setting["value"]; ?></textarea>
218
+
219
+ <script type="text/javascript">
220
+
221
+ rev_cm_<?php echo $setting['id']; ?> = null;
222
+ jQuery(document).ready(function(){
223
+ rev_cm_<?php echo $setting['id']; ?> = CodeMirror.fromTextArea(document.getElementById("<?php echo $setting['id']; ?>"), {
224
+ onChange: function(){ },
225
+ lineNumbers: true
226
+ });
227
+
228
+ jQuery('.postbox.unite-postbox').click(function(){
229
+ rev_cm_<?php echo $setting['id']; ?>.refresh();
230
+ });
231
+ });
232
+
233
+ </script>
234
+ <?php
235
+ }
236
+
237
+
238
+
239
+ //-----------------------------------------------------------------------------------------------
240
+ // draw setting input by type
241
+ protected function drawInputs($setting){
242
+ switch($setting["type"]){
243
+ case UniteSettingsUG::TYPE_TEXT:
244
+ $this->drawTextInput($setting);
245
+ break;
246
+ case UniteSettingsUG::TYPE_HIDDEN:
247
+ $this->drawHiddenInput($setting);
248
+ break;
249
+ case UniteSettingsUG::TYPE_COLOR:
250
+ $this->drawColorPickerInput($setting);
251
+ break;
252
+ case UniteSettingsUG::TYPE_SELECT:
253
+ $this->drawSelectInput($setting);
254
+ break;
255
+ case UniteSettingsUG::TYPE_CHECKBOX:
256
+ $this->drawCheckboxInput($setting);
257
+ break;
258
+ case UniteSettingsUG::TYPE_RADIO:
259
+ $this->drawRadioInput($setting);
260
+ break;
261
+ case UniteSettingsUG::TYPE_TEXTAREA:
262
+ $this->drawTextAreaInput($setting);
263
+ break;
264
+ case UniteSettingsUG::TYPE_CUSTOM:
265
+ $this->drawCustom($setting);
266
+ break;
267
+ case UniteSettingsUG::TYPE_BUTTON:
268
+ $this->drawButtonSetting($setting);
269
+ break;
270
+ case UniteSettingsUG::TYPE_MULTIPLE_TEXT:
271
+ $this->drawMultipleText($setting);
272
+ break;
273
+ case 'codemirror':
274
+ $this->drawCodeMirror($setting);
275
+ break;
276
+ default:
277
+ throw new Exception("wrong setting type - ".$setting["type"]);
278
+ break;
279
+ }
280
+ }
281
+
282
+ //-----------------------------------------------------------------------------------------------
283
+ //draw advanced order box
284
+ protected function drawOrderbox_advanced($setting){
285
+
286
+ $items = $setting["items"];
287
+ if(!is_array($items))
288
+ $this->throwError("Orderbox error - the items option must be array (items)");
289
+
290
+ //get arrItems modify items by saved value
291
+
292
+ if(!empty($setting["value"]) &&
293
+ getType($setting["value"]) == "array" &&
294
+ count($setting["value"]) == count($items)):
295
+
296
+ $savedItems = $setting["value"];
297
+
298
+ //make assoc array by id:
299
+ $arrAssoc = array();
300
+ foreach($items as $item)
301
+ $arrAssoc[$item[0]] = $item[1];
302
+
303
+ foreach($savedItems as $item){
304
+ $value = $item["id"];
305
+ $text = $value;
306
+ if(isset($arrAssoc[$value]))
307
+ $text = $arrAssoc[$value];
308
+ $arrItems[] = array($value,$text,$item["enabled"]);
309
+ }
310
+ else:
311
+ $arrItems = $items;
312
+ endif;
313
+
314
+ ?>
315
+ <ul class="orderbox_advanced" id="<?php echo $setting["id"]?>">
316
+ <?php
317
+ foreach($arrItems as $arrItem){
318
+ switch(getType($arrItem)){
319
+ case "string":
320
+ $value = $arrItem;
321
+ $text = $arrItem;
322
+ $enabled = true;
323
+ break;
324
+ case "array":
325
+ $value = $arrItem[0];
326
+ $text = (count($arrItem)>1)?$arrItem[1]:$arrItem[0];
327
+ $enabled = (count($arrItem)>2)?$arrItem[2]:true;
328
+ break;
329
+ default:
330
+ $this->throwError("Error in setting:".$setting.". unknown item type.");
331
+ break;
332
+ }
333
+ $checkboxClass = $enabled ? "div_checkbox_on" : "div_checkbox_off";
334
+
335
+ ?>
336
+ <li>
337
+ <div class="div_value"><?php echo $value?></div>
338
+ <div class="div_checkbox <?php echo $checkboxClass?>"></div>
339
+ <div class="div_text"><?php echo $text?></div>
340
+ <div class="div_handle"></div>
341
+ </li>
342
+ <?php
343
+ }
344
+
345
+ ?>
346
+ </ul>
347
+ <?php
348
+ }
349
+
350
+ //-----------------------------------------------------------------------------------------------
351
+ //draw order box
352
+ protected function drawOrderbox($setting){
353
+
354
+ $items = $setting["items"];
355
+
356
+ //get arrItems by saved value
357
+ $arrItems = array();
358
+
359
+ if(!empty($setting["value"]) &&
360
+ getType($setting["value"]) == "array" &&
361
+ count($setting["value"]) == count($items)){
362
+
363
+ $savedItems = $setting["value"];
364
+
365
+ foreach($savedItems as $value){
366
+ $text = $value;
367
+ if(isset($items[$value]))
368
+ $text = $items[$value];
369
+ $arrItems[] = array("value"=>$value,"text"=>$text);
370
+ }
371
+ } //get arrItems only from original items
372
+ else{
373
+ foreach($items as $value=>$text)
374
+ $arrItems[] = array("value"=>$value,"text"=>$text);
375
+ }
376
+
377
+
378
+ ?>
379
+ <ul class="orderbox" id="<?php echo $setting["id"]?>">
380
+ <?php
381
+ foreach($arrItems as $item){
382
+ $itemKey = $item["value"];
383
+ $itemText = $item["text"];
384
+
385
+ $value = (getType($itemKey) == "string")?$itemKey:$itemText;
386
+ ?>
387
+ <li>
388
+ <div class="div_value"><?php echo $value?></div>
389
+ <div class="div_text"><?php echo $itemText?></div>
390
+ </li>
391
+ <?php
392
+ }
393
+ ?>
394
+ </ul>
395
+ <?php
396
+ }
397
+
398
+ /**
399
+ *
400
+ * draw button
401
+ */
402
+ protected function drawButtonSetting($setting){
403
+ //set class
404
+ $class = UniteFunctionsUG::getVal($setting, "class");
405
+
406
+ if(!empty($class))
407
+ $class = "class='$class'";
408
+
409
+ $addParams = UniteFunctionsUG::getVal($setting, UniteSettingsUG::PARAM_ADDPARAMS);
410
+
411
+ ?>
412
+ <input type="button" id="<?php echo $setting["id"]?>" value="<?php echo $setting["value"]?>" <?php echo $class?> <?php echo $addParams?>>
413
+ <?php
414
+ }
415
+
416
+
417
+ //-----------------------------------------------------------------------------------------------
418
+ // draw text area input
419
+ protected function drawTextAreaInput($setting){
420
+ $disabled = "";
421
+ if (isset($setting["disabled"])) $disabled = 'disabled="disabled"';
422
+
423
+ //set style
424
+ $style = UniteFunctionsUG::getVal($setting, "style");
425
+ if(!empty($style))
426
+ $style = "style='".$style."'";
427
+
428
+ //set class
429
+ $class = UniteFunctionsUG::getVal($setting, "class");
430
+ if(!empty($class))
431
+ $class = "class='$class'";
432
+
433
+ ?>
434
+ <textarea id="<?php echo $setting["id"]?>" <?php echo $class?> name="<?php echo $setting["name"]?>" <?php echo $style?> <?php echo $disabled?>><?php echo $setting["value"]?></textarea>
435
+ <?php
436
+ }
437
+
438
+ //-----------------------------------------------------------------------------------------------
439
+ // draw radio input
440
+ protected function drawRadioInput($setting){
441
+ $items = $setting["items"];
442
+ $counter = 0;
443
+ $id = $setting["id"];
444
+ $isDisabled = UniteFunctionsUG::getVal($setting, "disabled",false);
445
+
446
+ ?>
447
+ <span id="<?php echo $id?>" class="radio_wrapper">
448
+ <?php
449
+ foreach($items as $value=>$text):
450
+ $counter++;
451
+ $radioID = $id."_".$counter;
452
+ $checked = "";
453
+ if($value == $setting["value"]) $checked = " checked";
454
+
455
+ $disabled = "";
456
+ if($isDisabled == true)
457
+ $disabled = 'disabled="disabled"';
458
+
459
+ ?>
460
+ <input type="radio" id="<?php echo $radioID?>" value="<?php echo $value?>" name="<?php echo $setting["name"]?>" <?php echo $disabled?> <?php echo $checked?>/>
461
+ <label for="<?php echo $radioID?>" style="cursor:pointer;"><?php _e($text)?></label>
462
+ &nbsp; &nbsp;
463
+ <?php
464
+ endforeach;
465
+ ?>
466
+ </span>
467
+ <?php
468
+ }
469
+
470
+
471
+ //-----------------------------------------------------------------------------------------------
472
+ // draw checkbox
473
+ protected function drawCheckboxInput($setting){
474
+ $checked = "";
475
+ if($setting["value"] == true) $checked = 'checked="checked"';
476
+ ?>
477
+ <input type="checkbox" id="<?php echo $setting["id"]?>" class="inputCheckbox" name="<?php echo $setting["name"]?>" <?php echo $checked?>/>
478
+ <?php
479
+ }
480
+
481
+ //-----------------------------------------------------------------------------------------------
482
+ //draw select input
483
+ protected function drawSelectInput($setting){
484
+
485
+ $className = "";
486
+ if(isset($this->arrControls[$setting["name"]])) $className = "control";
487
+ $class = "";
488
+ if($className != "") $class = "class='".$className."'";
489
+
490
+ $disabled = "";
491
+ if(isset($setting["disabled"]))
492
+ $disabled = 'disabled="disabled"';
493
+
494
+ ?>
495
+ <select id="<?php echo $setting["id"]?>" name="<?php echo $setting["name"]?>" <?php echo $disabled?> <?php echo $class?>>
496
+ <?php
497
+ foreach($setting["items"] as $value=>$text):
498
+ $text = __($text,UNITEGALLERY_TEXTDOMAIN);
499
+ $selected = "";
500
+ if($value == $setting["value"]) $selected = 'selected="selected"';
501
+ ?>
502
+ <option value="<?php echo $value?>" <?php echo $selected?>><?php echo $text?></option>
503
+ <?php
504
+ endforeach
505
+ ?>
506
+ </select>
507
+ <?php
508
+ }
509
+
510
+ /**
511
+ *
512
+ * draw custom setting
513
+ */
514
+ protected function drawCustom($setting){
515
+ dmp($setting);
516
+ exit();
517
+ }
518
+
519
+ //-----------------------------------------------------------------------------------------------
520
+ //draw hr row
521
+ protected function drawTextRow($setting){
522
+
523
+ //set cell style
524
+ $cellStyle = "";
525
+ if(isset($setting["padding"]))
526
+ $cellStyle .= "padding-left:".$setting["padding"].";";
527
+
528
+ if(!empty($cellStyle))
529
+ $cellStyle="style='$cellStyle'";
530
+
531
+ //set style
532
+ $rowStyle = "";
533
+ if(isset($setting["hidden"]) && $setting["hidden"] == true)
534
+ $rowStyle .= "display:none;";
535
+
536
+ if(!empty($rowStyle))
537
+ $rowStyle = "style='$rowStyle'";
538
+
539
+ ?>
540
+ <span class="spanSettingsStaticText"><?php echo __($setting["text"],UNITEGALLERY_TEXTDOMAIN)?></span>
541
+ <?php
542
+ }
543
+
544
+ //-----------------------------------------------------------------------------------------------
545
+ //draw hr row
546
+ protected function drawHrRow($setting){
547
+ //set hidden
548
+ $rowStyle = "";
549
+ if(isset($setting["hidden"]) && $setting["hidden"] == true)
550
+ $rowStyle = "style='display:none;'";
551
+
552
+ ?>
553
+ <li id="<?php echo $setting["id"]?>_row" <?php echo $rowStyle?> class="hrrow">
554
+ <hr />
555
+ </li>
556
+ <?php
557
+ }
558
+
559
+
560
+ //-----------------------------------------------------------------------------------------------
561
+ //draw settings row
562
+ protected function drawSettingRow($setting){
563
+
564
+ //set cellstyle:
565
+ $cellStyle = "";
566
+ if(isset($setting[UniteSettingsUG::PARAM_CELLSTYLE])){
567
+ $cellStyle .= $setting[UniteSettingsUG::PARAM_CELLSTYLE];
568
+ }
569
+
570
+ //set text style:
571
+ $textStyle = $cellStyle;
572
+ if(isset($setting[UniteSettingsUG::PARAM_TEXTSTYLE])){
573
+ $textStyle .= $setting[UniteSettingsUG::PARAM_TEXTSTYLE];
574
+ }
575
+
576
+ if($textStyle != "")
577
+ $textStyle = "style='".$textStyle."'";
578
+
579
+ if($cellStyle != "")
580
+ $cellStyle = "style='".$cellStyle."'";
581
+
582
+ //set hidden
583
+ $rowStyle = "";
584
+ if(isset($setting["hidden"]) && $setting["hidden"] == true) $rowStyle = "display:none;";
585
+ if(!empty($rowStyle)) $rowStyle = "style='$rowStyle'";
586
+
587
+ //set row class:
588
+ $rowClass = "";
589
+ if(isset($setting["disabled"]))
590
+ $rowClass = "setting-disabled";
591
+
592
+ if($setting["type"] == UniteSettingsUG::TYPE_TEXTAREA){
593
+ if(!empty($rowClass))
594
+ $rowClass .= " ";
595
+ $rowClass .= "setting_row_textarea";
596
+ }
597
+
598
+ if(!empty($rowClass))
599
+ $rowClass = "class='{$rowClass}'";
600
+
601
+
602
+ //modify text:
603
+ $text = UniteFunctionsUG::getVal($setting,"text","");
604
+ $text = __($text,UNITEGALLERY_TEXTDOMAIN);
605
+
606
+ // prevent line break (convert spaces to nbsp)
607
+ $text = str_replace(" ","&nbsp;",$text);
608
+
609
+ if($setting["type"] == UniteSettingsUG::TYPE_CHECKBOX)
610
+ $text = "<label for='{$setting["id"]}'>{$text}</label>";
611
+
612
+ //set settings text width:
613
+ $textWidth = "";
614
+ if(isset($setting["textWidth"]))
615
+ $textWidth = 'width="'.$setting["textWidth"].'"';
616
+
617
+ $description = UniteFunctionsUG::getVal($setting, "description");
618
+ $description = __($description,UNITEGALLERY_TEXTDOMAIN);
619
+
620
+ $unit = UniteFunctionsUG::getVal($setting, "unit");
621
+ $unit = __($unit,UNITEGALLERY_TEXTDOMAIN);
622
+
623
+ $required = UniteFunctionsUG::getVal($setting, "required");
624
+
625
+ $addHtml = UniteFunctionsUG::getVal($setting, UniteSettingsUG::PARAM_ADDTEXT);
626
+ $addHtmlBefore = UniteFunctionsUG::getVal($setting, UniteSettingsUG::PARAM_ADDTEXT_BEFORE_ELEMENT);
627
+
628
+
629
+ //set if draw text or not.
630
+ $toDrawText = true;
631
+ //if($setting["type"] == UniteSettingsUG::TYPE_BUTTON || $setting["type"] == UniteSettingsUG::TYPE_MULTIPLE_TEXT)
632
+ //$toDrawText = false;
633
+
634
+ $settingID = $setting["id"];
635
+ $attribsText = UniteFunctionsUG::getVal($setting, "attrib_text");
636
+
637
+
638
+ ?>
639
+ <li id="<?php echo $settingID?>_row" <?php echo $rowStyle." ".$rowClass?>>
640
+
641
+ <?php if($toDrawText == true):?>
642
+ <div id="<?php echo $settingID?>_text" class='setting_text' title="<?php echo $description?>" <?php echo $attribsText?>><?php echo $text ?></div>
643
+ <?php endif?>
644
+
645
+ <?php if(!empty($addHtmlBefore)):?>
646
+ <div class="settings_addhtmlbefore"><?php echo $addHtmlBefore?></div>
647
+ <?php endif?>
648
+
649
+ <div class='setting_input'>
650
+ <?php $this->drawInputs($setting);?>
651
+ <?php if(!empty($unit)):?>
652
+ <div class='setting_unit'><?php echo $unit?></div>
653
+ <?php endif?>
654
+ <?php if(!empty($required)):?>
655
+ <div class='setting_required'>*</div>
656
+ <?php endif?>
657
+ <?php if(!empty($addHtml)):?>
658
+ <div class="settings_addhtml"><?php echo $addHtml?></div>
659
+ <?php endif?>
660
+ </div>
661
+ <div class="unite-clear"></div>
662
+ </li>
663
+ <?php
664
+ if($setting['name'] == 'shadow_type'){ //For shadow types, add box with shadow types
665
+ $this->drawShadowTypes($setting['value']);
666
+ }
667
+ }
668
+
669
+ /**
670
+ *
671
+ * insert settings into saps array
672
+ */
673
+ private function groupSettingsIntoSaps(){
674
+ $arrSections = $this->settings->getArrSections();
675
+ $arrSaps = $arrSections[0]["arrSaps"];
676
+ $arrSettings = $this->settings->getArrSettings();
677
+
678
+ //group settings by saps
679
+ foreach($arrSettings as $key=>$setting){
680
+
681
+ $sapID = $setting["sap"];
682
+
683
+ if(isset($arrSaps[$sapID]["settings"]))
684
+ $arrSaps[$sapID]["settings"][] = $setting;
685
+ else
686
+ $arrSaps[$sapID]["settings"] = array($setting);
687
+ }
688
+ return($arrSaps);
689
+ }
690
+
691
+ /**
692
+ *
693
+ * draw buttons that defined earlier
694
+ */
695
+ private function drawButtons(){
696
+ foreach($this->arrButtons as $key=>$button){
697
+ if($key>0)
698
+ echo "<span class='hor_sap'></span>";
699
+ echo UniteFunctionsUG::getHtmlLink("#", $button["title"],$button["id"],$button["class"]);
700
+ }
701
+ }
702
+
703
+ /**
704
+ *
705
+ * draw some setting, can be setting array or name
706
+ */
707
+ public function drawSetting($setting,$state = null){
708
+ if(gettype($setting) == "string")
709
+ $setting = $this->settings->getSettingByName($setting);
710
+
711
+ switch($state){
712
+ case "hidden":
713
+ $setting["hidden"] = true;
714
+ break;
715
+ }
716
+
717
+ switch($setting["type"]){
718
+ case UniteSettingsUG::TYPE_HR:
719
+ $this->drawHrRow($setting);
720
+ break;
721
+ case UniteSettingsUG::TYPE_STATIC_TEXT:
722
+ $this->drawTextRow($setting);
723
+ break;
724
+ default:
725
+ $this->drawSettingRow($setting);
726
+ break;
727
+ }
728
+ }
729
+
730
+ /**
731
+ *
732
+ * draw setting by bulk names
733
+ */
734
+ public function drawSettingsByNames($arrSettingNames,$state=null){
735
+ if(gettype($arrSettingNames) == "string")
736
+ $arrSettingNames = explode(",",$arrSettingNames);
737
+
738
+ foreach($arrSettingNames as $name)
739
+ $this->drawSetting($name,$state);
740
+ }
741
+
742
+
743
+ /**
744
+ *
745
+ * draw all settings
746
+ */
747
+ public function drawSettings(){
748
+ $this->prepareToDraw();
749
+ $this->drawHeaderIncludes();
750
+
751
+
752
+ $arrSaps = $this->groupSettingsIntoSaps();
753
+
754
+ $class = "unite-postbox";
755
+ if(!empty($this->addClass))
756
+ $class .= " ".$this->addClass;
757
+
758
+ //draw wrapper
759
+ echo "<div class='settings_wrapper'>";
760
+
761
+ //draw settings - advanced - with sections
762
+ foreach($arrSaps as $key=>$sap):
763
+
764
+ //set accordion closed
765
+ $style = "";
766
+ if($this->isAccordion == false){
767
+ $h3Class = " no-accordion";
768
+ }else{
769
+ $h3Class = "";
770
+ if($key>0){
771
+ $style = "style='display:none;'";
772
+ $h3Class = " box_closed";
773
+ }
774
+ }
775
+
776
+ $text = $sap["text"];
777
+ $classIcon = UniteFunctionsUG::getVal($sap, "icon");
778
+ $text = __($text,UNITEGALLERY_TEXTDOMAIN);
779
+
780
+ ?>
781
+ <div class="<?php echo $class?>">
782
+ <div class="unite-postbox-title<?php echo $h3Class?>">
783
+
784
+ <?php if(!empty($classIcon)):?>
785
+ <i style="float:left;margin-top:4px;font-size:14px;" class="<?php echo $classIcon?>"></i>
786
+ <?php endif?>
787
+
788
+ <?php if($this->isAccordion == true):?>
789
+ <div class="unite-postbox-arrow"></div>
790
+ <?php endif?>
791
+
792
+ <span><?php echo $text ?></span>
793
+ </div>
794
+
795
+ <div class="inside" <?php echo $style?> >
796
+ <ul class="list_settings">
797
+ <?php
798
+
799
+ $settings = UniteFunctionsUG::getVal($sap, "settings", array());
800
+
801
+ foreach($settings as $setting)
802
+ $this->drawSetting($setting);
803
+
804
+ ?>
805
+ </ul>
806
+
807
+ <?php
808
+ if(!empty($this->arrButtons)){
809
+ ?>
810
+ <div class="unite-clear"></div>
811
+ <div class="settings_buttons">
812
+ <?php
813
+ $this->drawButtons();
814
+ ?>
815
+ </div>
816
+ <div class="unite-clear"></div>
817
+ <?php
818
+ }
819
+ ?>
820
+
821
+ <div class="unite-clear"></div>
822
+ </div>
823
+ </div>
824
+ <?php
825
+
826
+ endforeach;
827
+
828
+ echo "</div>"; //wrapper close
829
+ }
830
+
831
+
832
+ //-----------------------------------------------------------------------------------------------
833
+ // draw sections menu
834
+ public function drawSections($activeSection=0){
835
+ if(!empty($this->arrSections)):
836
+ echo "<ul class='listSections' >";
837
+ for($i=0;$i<count($this->arrSections);$i++):
838
+ $class = "";
839
+ if($activeSection == $i) $class="class='selected'";
840
+ $text = $this->arrSections[$i]["text"];
841
+ echo '<li '.$class.'><a onfocus="this.blur()" href="#'.($i+1).'"><div>'.$text.'</div></a></li>';
842
+ endfor;
843
+ echo "</ul>";
844
+ endif;
845
+
846
+ //call custom draw function:
847
+ if($this->customFunction_afterSections) call_user_func($this->customFunction_afterSections);
848
+ }
849
+
850
+ /**
851
+ *
852
+ * init accordion
853
+ */
854
+ private function putAccordionInit(){
855
+ ?>
856
+ <script type="text/javascript">
857
+ jQuery(document).ready(function(){
858
+ var settings = new UniteSettingsUG();
859
+ settings.initAccordion("<?php echo $this->formID?>");
860
+ });
861
+ </script>
862
+ <?php
863
+ }
864
+
865
+ /**
866
+ *
867
+ * activate the accordion
868
+ */
869
+ public function isAccordion($activate){
870
+ $this->isAccordion = $activate;
871
+ }
872
+
873
+
874
+ /**
875
+ *
876
+ * draw settings function
877
+ */
878
+ public function draw($formID=null){
879
+ if(empty($formID))
880
+ UniteFunctionsUG::throwError("You must provide formID to side settings.");
881
+
882
+ $this->formID = $formID;
883
+
884
+ if(!empty($formID)){
885
+ ?>
886
+ <form name="<?php echo $formID?>" id="<?php echo $formID?>">
887
+ <?php $this->drawSettings() ?>
888
+ </form>
889
+ <?php
890
+ }else
891
+ $this->drawSettings();
892
+
893
+ if($this->isAccordion == true)
894
+ $this->putAccordionInit();
895
+
896
+ }
897
+
898
+ }
899
+
900
+ ?>
inc_php/framework/translate.class.php ADDED
@@ -0,0 +1,107 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @package Unite Gallery
4
+ * @author Valiano
5
+ * @copyright (C) 2012 Unite CMS, All Rights Reserved.
6
+ * @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
7
+ * */
8
+ defined('UNITEGALLERY_INC') or die('Restricted access');
9
+
10
+
11
+ class UniteTranslateUG{
12
+
13
+ private $entries;
14
+ private $domain;
15
+
16
+
17
+ /**
18
+ * load language
19
+ */
20
+ public function __construct($domain){
21
+ $this->domain = $domain;
22
+ $this->get_translations_for_domain($domain);
23
+
24
+ }
25
+
26
+
27
+ /*
28
+ * read from language file and put it in entries for translate
29
+ * @Params String $domain - basse name of language file
30
+ */
31
+ private function get_translations_for_domain( $domain = "default" ){
32
+
33
+ if($this->entries != null){
34
+ return true;
35
+ }
36
+
37
+ $mo = new MO();
38
+ $current_language = JFactory::getLanguage();
39
+
40
+ $mo_file = JPATH_COMPONENT . DIRECTORY_SEPARATOR."language".DIRECTORY_SEPARATOR. $domain ."-". $current_language->getTag() .".mo" ;
41
+
42
+
43
+ if(!file_exists($mo_file)){
44
+ $mo_file = JPATH_COMPONENT . DIRECTORY_SEPARATOR."language".DIRECTORY_SEPARATOR. $domain ."-". str_replace("-", "_", $current_language->getTag()) .".mo" ;
45
+ if(!file_exists($mo_file)){
46
+ return false;
47
+ }
48
+ }
49
+
50
+ if ( !$mo->import_from_file( $mo_file ) ) return false;
51
+ if ( !isset( $lang[$domain] ) ){
52
+ $lang[$domain] = $mo;
53
+ }
54
+
55
+ $this->merge_with( $lang[$domain] );
56
+ }
57
+
58
+
59
+ /**
60
+ * translate text
61
+ */
62
+ private function translate_singular($singular, $context=null) {
63
+
64
+ $entry = new Translation_Entry(array('singular' => $singular, 'context' => $context));
65
+ $translated = $this->translate_entry($entry);
66
+ return ($translated && !empty($translated->translations))? $translated->translations[0] : $singular;
67
+ }
68
+
69
+
70
+
71
+ /*
72
+ * put data read from language file to entries for translate
73
+ */
74
+ private function merge_with(&$other) {
75
+
76
+ foreach( $other->entries as $entry ) {
77
+ $this->entries[$entry->key()] = $entry;
78
+ }
79
+
80
+ }
81
+
82
+
83
+ /**
84
+ * translate entry
85
+ */
86
+ private function translate_entry(&$entry) {
87
+
88
+ $key = $entry->key();
89
+ return isset($this->entries[$key])? $this->entries[$key] : false;
90
+ }
91
+
92
+
93
+ /**
94
+ * translate the text
95
+ */
96
+ public function translate($text) {
97
+
98
+ $translations = $this->translate_singular($text);
99
+
100
+ return $translations;
101
+ }
102
+
103
+
104
+
105
+ }
106
+
107
+ ?>
inc_php/framework/zip.class.php ADDED
@@ -0,0 +1,105 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @package Unite Gallery
4
+ * @author Valiano
5
+ * @copyright (C) 2012 Unite CMS, All Rights Reserved.
6
+ * @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
7
+ * */
8
+ defined('UNITEGALLERY_INC') or die('Restricted access');
9
+
10
+
11
+ class UniteZipUG{
12
+
13
+ private $zip;
14
+
15
+ /**
16
+ *
17
+ * get true / false if the zip archive exists.
18
+ */
19
+ public static function isZipExists(){
20
+ $exists = class_exists("ZipArchive");
21
+ return $exists;
22
+ }
23
+
24
+
25
+ /**
26
+ *
27
+ * add zip file
28
+ */
29
+ private function addItem($basePath,$path){
30
+
31
+ $rel_path = str_replace($basePath."/", "", $path);
32
+
33
+ if(is_dir($path)){ //directory
34
+
35
+ //add dir to zip
36
+ if($basePath != $path)
37
+ $this->zip->addEmptyDir($rel_path);
38
+
39
+ $files = scandir($path);
40
+ foreach($files as $file){
41
+ if($file == "." || $file == ".." || $file == ".svn")
42
+ continue;
43
+ $filepath = $path."/".$file;
44
+ $this->addItem($basePath, $filepath);
45
+ }
46
+ }
47
+ else{ //file
48
+ if(!file_exists($path))
49
+ throwError("filepath: '$path' don't exists, can't zip");
50
+
51
+ $this->zip->addFile($path,$rel_path);
52
+ }
53
+ }
54
+
55
+ /**
56
+ *
57
+ * make zip archive
58
+ * if exists additional paths, add additional items to the zip
59
+ */
60
+ public function makeZip($srcPath, $zipFilepath,$additionPaths = array()){
61
+
62
+ if(!is_dir($srcPath))
63
+ throwError("The path: '$srcPath' don't exists, can't zip");
64
+
65
+ $this->zip = new ZipArchive;
66
+ $success = $this->zip->open($zipFilepath, ZipArchive::CREATE);
67
+
68
+ if($success == false)
69
+ throwError("Can't create zip file: $zipFilepath");
70
+
71
+ $this->addItem($srcPath,$srcPath);
72
+
73
+ if(gettype($additionPaths) != "array")
74
+ throwError("Wrong additional paths variable.");
75
+
76
+
77
+ //add additional paths
78
+ if(!empty($additionPaths))
79
+ foreach($additionPaths as $path){
80
+ if(!is_dir($path))
81
+ throwError("Path: $path not found, can't zip");
82
+ $this->addItem($path, $path);
83
+ }
84
+
85
+ $this->zip->close();
86
+ }
87
+
88
+ /**
89
+ *
90
+ * Extract zip archive
91
+ */
92
+ public function extract($src, $dest){
93
+ $zip = new ZipArchive;
94
+ if ($zip->open($src)===true){
95
+ $zip->extractTo($dest);
96
+ $zip->close();
97
+ return true;
98
+ }
99
+ return false;
100
+ }
101
+
102
+
103
+ }
104
+
105
+ ?>
inc_php/index.html ADDED
File without changes
inc_php/unitegallery_categories.class.php ADDED
@@ -0,0 +1,353 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @package Unite Gallery
4
+ * @author Valiano
5
+ * @copyright (C) 2012 Unite CMS, All Rights Reserved.
6
+ * @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
7
+ * */
8
+ defined('UNITEGALLERY_INC') or die('Restricted access');
9
+
10
+
11
+ class UniteGalleryCategories extends UniteElementsBaseUG{
12
+
13
+
14
+ public function __construct(){
15
+ parent::__construct();
16
+
17
+ }
18
+
19
+
20
+ /**
21
+ *
22
+ * validate that category exists
23
+ */
24
+ public function validateCatExist($catID){
25
+ $this->getCat($catID);
26
+ }
27
+
28
+
29
+
30
+ /**
31
+ *
32
+ * get categories list
33
+ */
34
+ public function getList(){
35
+ $tableCats = GlobalsUG::$table_categories;
36
+ $tableItems = GlobalsUG::$table_items;
37
+
38
+ $query = "select cats.*, count(items.id) as num_items from {$tableCats} as cats";
39
+ $query .= " left join $tableItems as items on items.catid=cats.id GROUP BY cats.id order by cats.ordering";
40
+
41
+ $arrCats = $this->db->fetchSql($query);
42
+
43
+ return($arrCats);
44
+ }
45
+
46
+
47
+ /**
48
+ * get category list by id's string
49
+ */
50
+ public function getListByIds( $ids ) {
51
+
52
+ $ids = $this->db->escape($ids);
53
+
54
+ $tableCats = GlobalsUG::$table_categories;
55
+ $query = "select cats.* from {$tableCats} as cats WHERE cats.id IN(" . $ids . ")";
56
+ $arrCats = $this->db->fetchSql($query);
57
+
58
+ $arrCats = UniteFunctionsUG::arrayToAssoc($arrCats, "id");
59
+
60
+ //order by IDs
61
+ $arrIDs = explode(",", $ids);
62
+ $arrCatsFinal = array();
63
+ foreach($arrIDs as $id){
64
+ if(array_key_exists($id, $arrCats))
65
+ $arrCatsFinal[] = $arrCats[$id];
66
+ }
67
+
68
+
69
+ return($arrCatsFinal);
70
+ }
71
+
72
+
73
+ /**
74
+ *
75
+ * get category records simple without num items
76
+ */
77
+ public function getCatRecords(){
78
+ $arrCats = $this->db->fetch(GlobalsUG::$table_categories,"","ordering");
79
+ return($arrCats);
80
+ }
81
+
82
+
83
+ /**
84
+ *
85
+ * get categories list short
86
+ * addtype: empty (empty category), new (craete new category)
87
+ */
88
+ public function getCatsShort($addType = ""){
89
+
90
+ $arrCats = $this->getCatRecords();
91
+ $arrCatsOutput = array();
92
+
93
+ switch($addType){
94
+ case "empty":
95
+ $arrCatsOutput[""] = __("[Not Selected]", UNITEGALLERY_TEXTDOMAIN);
96
+ break;
97
+ case "new":
98
+ $arrCatsOutput["new"] = __("[Add New Category]", UNITEGALLERY_TEXTDOMAIN);
99
+ break;
100
+ case "component":
101
+ $arrCatsOutput[""] = __("[From Gallery Settings]", UNITEGALLERY_TEXTDOMAIN);
102
+ break;
103
+ }
104
+
105
+ foreach($arrCats as $cat){
106
+ $catID = UniteFunctionsUG::getVal($cat, "id");
107
+ $title = UniteFunctionsUG::getVal($cat, "title");
108
+ $arrCatsOutput[$catID] = $title;
109
+ }
110
+
111
+ return($arrCatsOutput);
112
+ }
113
+
114
+
115
+ /**
116
+ *
117
+ * get assoc value of category name
118
+ */
119
+ public function getArrCatTitlesAssoc(){
120
+ $arrCats = $this->getList();
121
+ $arrAssoc = array();
122
+ foreach($arrCats as $cat){
123
+ $arrAssoc[$cat["title"]] = true;
124
+ }
125
+ return($arrAssoc);
126
+ }
127
+
128
+
129
+ /**
130
+ *
131
+ * get max order from categories list
132
+ */
133
+ public function getMaxOrder(){
134
+
135
+ $query = "select MAX(ordering) as maxorder from ".GlobalsUG::$table_categories;
136
+
137
+ ///$query = "select * from ".self::TABLE_CATEGORIES;
138
+ $rows = $this->db->fetchSql($query);
139
+
140
+ $maxOrder = 0;
141
+ if(count($rows)>0) $maxOrder = $rows[0]["maxorder"];
142
+
143
+ if(!is_numeric($maxOrder))
144
+ $maxOrder = 0;
145
+
146
+ return($maxOrder);
147
+ }
148
+
149
+
150
+ /**
151
+ *
152
+ * get category
153
+ */
154
+ public function getCat($catID){
155
+
156
+ $objCat = new UniteGalleryCategory();
157
+ $objCat->initByID($catID);
158
+ $record = $objCat->getRecord();
159
+
160
+ return($record);
161
+ }
162
+
163
+
164
+ /**
165
+ * get true/false if some category exists
166
+ */
167
+ public function isCatExists($catID){
168
+
169
+ UniteFunctionsUG::validateNumeric($catID, "category id");
170
+
171
+ $arrCat = $this->db->fetchSingle(GlobalsUG::$table_categories,"id=$catID");
172
+ return !empty($arrCat);
173
+ }
174
+
175
+
176
+
177
+
178
+ /**
179
+ *
180
+ * update categories order
181
+ */
182
+ private function updateOrder($arrCatIDs){
183
+
184
+ foreach($arrCatIDs as $index=>$catID){
185
+ $order = $index+1;
186
+ $arrUpdate = array("ordering"=>$order);
187
+ $where = array("id"=>$catID);
188
+ $this->db->update(GlobalsUG::$table_categories,$arrUpdate,$where);
189
+ }
190
+ }
191
+
192
+
193
+ /**
194
+ *
195
+ * remove category from data
196
+ */
197
+ public function removeFromData($data){
198
+
199
+ $objCat = $this->getCatFromData($data);
200
+ $objCat->remove();
201
+
202
+ $response = array();
203
+ $response["htmlSelectCats"] = $this->getHtmlSelectCats();
204
+
205
+ return($response);
206
+ }
207
+
208
+ /**
209
+ * get category object from data
210
+ */
211
+ private function getCatFromData($data){
212
+
213
+ $catID = UniteFunctionsUG::getVal($data, "catID");
214
+ if(empty($catID))
215
+ $catID = UniteFunctionsUG::getVal($data, "catid");
216
+
217
+ UniteFunctionsUG::validateNotEmpty($catID,"category id");
218
+
219
+ $objCat = new UniteGalleryCategory();
220
+ $objCat->initByID($catID);
221
+
222
+ return($objCat);
223
+ }
224
+
225
+
226
+ /**
227
+ *
228
+ * update category from data
229
+ */
230
+ public function updateFromData($data){
231
+
232
+ $objCat = $this->getCatFromData($data);
233
+
234
+ $title = UniteFunctionsUG::getVal($data, "title");
235
+
236
+ $objCat->updateTitle($title);
237
+
238
+ }
239
+
240
+
241
+
242
+ /**
243
+ *
244
+ * update order from data
245
+ */
246
+ public function updateOrderFromData($data){
247
+ $arrCatIDs = UniteFunctionsUG::getVal($data, "cat_order");
248
+ if(is_array($arrCatIDs) == false)
249
+ UniteFunctionsUG::throwError("Wrong categories array");
250
+
251
+ $this->updateOrder($arrCatIDs);
252
+ }
253
+
254
+
255
+ /**
256
+ *
257
+ * add catgory from data, return cat select html list
258
+ */
259
+ public function addFromData(){
260
+
261
+ $objCat = new UniteGalleryCategory();
262
+
263
+ $response = $objCat->add();
264
+
265
+ $html = $objCat->getHTMLAdmin();
266
+
267
+ $response["htmlSelectCats"] = $this->getHtmlSelectCats();
268
+ $response["htmlCat"] = $html;
269
+
270
+ return($response);
271
+
272
+ }
273
+
274
+
275
+ /**
276
+ * change category sortby from data
277
+ */
278
+ public function changeCatSortbyFromData($data){
279
+
280
+ $objCat = $this->getCatFromData($data);
281
+
282
+ $sortBy = UniteFunctionsUG::getVal($data, "sortby");
283
+ $objCat->updateSortby($sortBy);
284
+
285
+ $catID = $objCat->getID();
286
+ $items = new UniteGalleryItems();
287
+ $itemsHtml = $items->getCatItemsHtml($catID);
288
+
289
+ //get items list
290
+ $response = array("itemsHtml"=>$itemsHtml);
291
+
292
+ return($response);
293
+ }
294
+
295
+
296
+ /**
297
+ * get list of categories
298
+ */
299
+ public function getHtmlCatList($selecteCatID = false){
300
+
301
+ $arrCats = $this->getList();
302
+
303
+ $html = "";
304
+
305
+ foreach($arrCats as $index => $cat):
306
+ $id = $cat["id"];
307
+
308
+ $class = "";
309
+ if($index == 0)
310
+ $class = "first-item";
311
+
312
+ if(!empty($selecteCatID) && $id == $selecteCatID){
313
+ if(!empty($class))
314
+ $class .= " ";
315
+ $class .= "selected-item";
316
+ }
317
+
318
+ if(!empty($class))
319
+ $class = "class=\"{$class}\"";
320
+
321
+ $objCat = new UniteGalleryCategory();
322
+ $objCat->initByRecord($cat);
323
+
324
+ $html .= $objCat->getHTMLAdmin($class);
325
+
326
+ endforeach;
327
+
328
+ return($html);
329
+ }
330
+
331
+
332
+ /**
333
+ *
334
+ * get items for select categories
335
+ */
336
+ public function getHtmlSelectCats(){
337
+
338
+ $arrCats = $this->getList();
339
+
340
+ $html = "";
341
+ foreach($arrCats as $cat):
342
+ $catID = $cat["id"];
343
+ $title = $cat["title"];
344
+ $html .= "<option value=\"{$catID}\">{$title}</option>";
345
+ endforeach;
346
+
347
+ return($html);
348
+ }
349
+
350
+
351
+ }
352
+
353
+ ?>
inc_php/unitegallery_category.class.php ADDED
@@ -0,0 +1,294 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @package Unite Gallery
4
+ * @author Valiano
5
+ * @copyright (C) 2012 Unite CMS, All Rights Reserved.
6
+ * @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
7
+ * */
8
+ defined('UNITEGALLERY_INC') or die('Restricted access');
9
+
10
+
11
+ class UniteGalleryCategory extends UniteElementsBaseUG{
12
+
13
+ private $titleBase = "New Category";
14
+
15
+ const SORTBY_CUSTOM = "custom";
16
+ const SORTBY_TITLE_ASC = "title_asc";
17
+ const SORTBY_TITLE_DESC = "title_desc";
18
+
19
+ private $id;
20
+ private $record;
21
+ private $title, $numItems, $params, $sortBy;
22
+
23
+
24
+ /**
25
+ * constructor
26
+ */
27
+ public function __construct(){
28
+ $this->sortBy = self::SORTBY_CUSTOM;
29
+
30
+ parent::__construct();
31
+ }
32
+
33
+
34
+ /**
35
+ * get sortby array
36
+ */
37
+ public static function getArrSortby(){
38
+
39
+ $arrSortby = array();
40
+ $arrSortby[self::SORTBY_CUSTOM] = __("Custom", UNITEGALLERY_TEXTDOMAIN);
41
+ $arrSortby[self::SORTBY_TITLE_ASC] = __("Title asc", UNITEGALLERY_TEXTDOMAIN);
42
+ $arrSortby[self::SORTBY_TITLE_DESC] = __("Title desc", UNITEGALLERY_TEXTDOMAIN);
43
+
44
+ return($arrSortby);
45
+ }
46
+
47
+
48
+ /**
49
+ * validate inited
50
+ */
51
+ private function validateInited(){
52
+ if(empty($this->id))
53
+ UniteFunctionsUG::throwError("The category is not inited");
54
+ }
55
+
56
+ /**
57
+ * validate sortby value
58
+ */
59
+ private function validateSortby($sortbyVal){
60
+
61
+ $arrSortby = self::getArrSortby();
62
+ if(array_key_exists($sortbyVal, $arrSortby) == false)
63
+ UniteFunctionsUG::throwError("Sortby value: $sortbyVal don't exists");
64
+ }
65
+
66
+
67
+ /**
68
+ * init category by record
69
+ */
70
+ public function initByRecord($record){
71
+
72
+ $this->id = $record["id"];
73
+
74
+ $this->title = $record["title"];
75
+ $this->numItems = UniteFunctionsUG::getVal($record, "num_items");
76
+
77
+ //init params
78
+ $params = UniteFunctionsUG::getVal($record, "params");
79
+
80
+ if(empty($params))
81
+ $params = array();
82
+ else{
83
+ $params = json_decode($params);
84
+ $params = UniteFunctionsUG::convertStdClassToArray($params);
85
+ }
86
+
87
+ $this->params = $params;
88
+
89
+ //init sortby
90
+ $this->sortBy = $this->getParam("sortby", self::SORTBY_CUSTOM);
91
+
92
+ $this->record = $record;
93
+ }
94
+
95
+
96
+ /**
97
+ * init category by id
98
+ */
99
+ public function initByID($catID){
100
+
101
+ UniteFunctionsUG::validateNumeric($catID, "category id");
102
+
103
+ $catID = (int)$catID;
104
+
105
+ $record = $this->db->fetchSingle(GlobalsUG::$table_categories,"id=$catID");
106
+ if(empty($record))
107
+ UniteFunctionsUG::throwError("Category with id: $catID not found");
108
+
109
+ $this->initByRecord($record);
110
+ }
111
+
112
+
113
+ /**
114
+ * get category record
115
+ */
116
+ public function getRecord(){
117
+ $this->validateInited();
118
+
119
+ return($this->record);
120
+ }
121
+
122
+
123
+ /**
124
+ * get param
125
+ */
126
+ public function getParam($paramName, $defaultValue=null){
127
+
128
+ $value = UniteFunctionsUG::getVal($this->params, $paramName, $defaultValue);
129
+
130
+ return($value);
131
+ }
132
+
133
+
134
+ /**
135
+ *
136
+ * get html of category
137
+ */
138
+ public function getHTMLAdmin($class = ""){
139
+
140
+ $this->validateInited();
141
+
142
+ $id = $this->id;
143
+ $title = $this->title;
144
+ $numItems = $this->numItems;
145
+ $sortby = $this->sortBy;
146
+
147
+ $showTitle = htmlspecialchars($title);
148
+
149
+ if(!empty($numItems))
150
+ $showTitle .= " ($numItems)";
151
+
152
+ $html = "";
153
+ $html .= "<li id=\"category_{$id}\" {$class} data-id=\"{$id}\" data-numitems=\"{$numItems}\" data-title=\"{$title}\" data-sortby=\"{$sortby}\">\n";
154
+ $html .= " <span class=\"cat_title\">{$showTitle}</span>\n";
155
+ $html .= "</li>\n";
156
+
157
+ return($html);
158
+ }
159
+
160
+
161
+ /**
162
+ * get sortby property
163
+ */
164
+ public function getSortby(){
165
+
166
+ $this->validateInited();
167
+
168
+ return($this->sortBy);
169
+ }
170
+
171
+ /**
172
+ * get ID
173
+ */
174
+ public function getID(){
175
+ $this->validateInited();
176
+
177
+ return($this->id);
178
+ }
179
+
180
+ /**
181
+ *
182
+ * add category
183
+ */
184
+ public function add($titleBase = null){
185
+
186
+ $objCategories = new UniteGalleryCategories();
187
+
188
+ $maxOrder = $objCategories->getMaxOrder();
189
+ if(empty($titleBase))
190
+ $titleBase = $this->titleBase;
191
+
192
+ //set title
193
+ $arrTitles = $objCategories->getArrCatTitlesAssoc();
194
+
195
+
196
+ $title = $titleBase;
197
+ $titleExists = array_key_exists($title, $arrTitles);
198
+ if($titleExists == true){
199
+ $counter = 1;
200
+ do{
201
+ $counter++;
202
+ $title = $titleBase." ".$counter;
203
+ $titleExists = array_key_exists($title, $arrTitles);
204
+ }while($titleExists == true);
205
+ }
206
+
207
+
208
+ //prepare insert array
209
+ $arrInsert = array();
210
+ $arrInsert["title"] = $title;
211
+ $arrInsert["ordering"] = $maxOrder+1;
212
+ $arrInsert["params"] = '';
213
+
214
+ //insert the category
215
+ $catID = $this->db->insert(GlobalsUG::$table_categories,$arrInsert);
216
+
217
+ if(empty($catID))
218
+ UniteFunctionsUG::throwError("Unable to create category. Please check if your database create autoincriment id's");
219
+
220
+ //init category
221
+ $arrInsert["id"] = $catID;
222
+ $arrInsert["num_itemd"] = 0;
223
+ $this->initByRecord($arrInsert);
224
+
225
+ //prepare output
226
+ $returnData = array("id"=>$catID,"title"=>$title);
227
+ return($returnData);
228
+ }
229
+
230
+
231
+ /**
232
+ *
233
+ * remove the category.
234
+ */
235
+ public function remove(){
236
+
237
+ $this->validateInited();
238
+
239
+ //remove category
240
+ $this->db->delete(GlobalsUG::$table_categories,"id=".$this->id);
241
+
242
+ //remove items
243
+ $this->db->delete(GlobalsUG::$table_items,"catid=".$this->id);
244
+ }
245
+
246
+
247
+ /**
248
+ * update param in db
249
+ */
250
+ private function updateParam($name, $value){
251
+
252
+ $this->validateInited();
253
+
254
+ $this->params[$name] = $value;
255
+
256
+ $strParams = json_encode($this->params);
257
+
258
+ $arrUpdate = array();
259
+ $arrUpdate["params"] = $strParams;
260
+ $this->db->update(GlobalsUG::$table_categories, $arrUpdate, array("id"=>$this->id));
261
+ }
262
+
263
+
264
+ /**
265
+ * update sortby param
266
+ * @param $sortbyValue
267
+ */
268
+ public function updateSortby($sortbyValue){
269
+
270
+ $this->validateSortby($sortbyValue);
271
+
272
+ $this->updateParam("sortby", $sortbyValue);
273
+
274
+ }
275
+
276
+
277
+ /**
278
+ *
279
+ * update category
280
+ */
281
+ public function updateTitle($title){
282
+
283
+ $this->validateInited();
284
+
285
+ $title = $this->db->escape($title);
286
+
287
+ $arrUpdate = array();
288
+ $arrUpdate["title"] = $title;
289
+ $this->db->update(GlobalsUG::$table_categories, $arrUpdate, array("id"=>$this->id));
290
+ }
291
+
292
+
293
+
294
+ }
inc_php/unitegallery_galleries.class.php ADDED
@@ -0,0 +1,388 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @package Unite Gallery
4
+ * @author Valiano
5
+ * @copyright (C) 2012 Unite CMS, All Rights Reserved.
6
+ * @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
7
+ * */
8
+ defined('UNITEGALLERY_INC') or die('Restricted access');
9
+
10
+
11
+ class UniteGalleryGalleries extends UniteElementsBaseUG{
12
+
13
+ private static $arrGalleryTypes; /* one time init only*/
14
+
15
+ public function __construct(){
16
+ parent::__construct();
17
+ }
18
+
19
+ /**
20
+ * get order array of the galleries
21
+ * order file: order.xml in the galleries folder.
22
+ */
23
+ private function getArrOrder(){
24
+ $filepathOrder = GlobalsUG::$pathGalleries."order.xml";
25
+ if(!file_exists($filepathOrder))
26
+ return(array());
27
+
28
+ $objOrder = simplexml_load_file($filepathOrder);
29
+
30
+ if(empty($objOrder))
31
+ return(array());
32
+
33
+ if(!isset($objOrder->item))
34
+ return(array());
35
+
36
+ $arrOrder = array();
37
+ foreach($objOrder->item as $item){
38
+ $strItem = (string)$item;
39
+ $arrOrder[] = $strItem;
40
+ }
41
+
42
+ return($arrOrder);
43
+ }
44
+
45
+
46
+ /**
47
+ *
48
+ * get galleries array from galleris folder with settings from config.xml from each gallery
49
+ */
50
+ private function initArrGalleryTypes(){
51
+
52
+ $arrOrder = $this->getArrOrder();
53
+
54
+ $strErrorPrefix = __("Load galleries error",UNITEGALLERY_TEXTDOMAIN);
55
+ $arrDirs = UniteFunctionsUG::getDirList(GlobalsUG::$pathGalleries);
56
+
57
+ $arrGalleries = array();
58
+
59
+ //reorder arrdirs:
60
+ $arrDirsNew = array();
61
+ $arrDirs = UniteFunctionsUG::arrayToAssoc($arrDirs);
62
+
63
+ foreach($arrOrder as $dir){
64
+ if(array_key_exists($dir, $arrDirs)){
65
+ $arrDirsNew[] = $dir;
66
+ unset($arrDirs[$dir]);
67
+ }
68
+ }
69
+
70
+ $arrDirsNew = array_merge($arrDirsNew, $arrDirs);
71
+
72
+ foreach($arrDirsNew as $dir){
73
+
74
+ $pathGallery = GlobalsUG::$pathGalleries.$dir."/";
75
+ if(is_dir($pathGallery) == false)
76
+ continue;
77
+
78
+ $objGallery = new UniteGalleryGalleryType();
79
+ $objGallery->initByFolder($dir);
80
+ $galleryName = $objGallery->getName();
81
+ $arrGalleries[$galleryName] = $objGallery;
82
+ }
83
+
84
+ self::$arrGalleryTypes = $arrGalleries;
85
+ }
86
+
87
+
88
+ /**
89
+ * validate that some gallery type exists
90
+ */
91
+ public function validateGalleryTypeExists($type){
92
+
93
+ $arrTypes = $this->getArrGalleryTypesShort();
94
+ if(isset($arrTypes[$type]) == false)
95
+ UniteFunctionsUG::throwError("Wrong gallery type: $type");
96
+ }
97
+
98
+
99
+ /**
100
+ *
101
+ * get galleries array
102
+ */
103
+ public function getArrGalleryTypes(){
104
+ if(empty(self::$arrGalleryTypes))
105
+ $this->initArrGalleryTypes();
106
+
107
+ return(self::$arrGalleryTypes);
108
+ }
109
+
110
+
111
+ /**
112
+ *
113
+ * get galleries as simple array
114
+ * get published only galleries
115
+ */
116
+ public function getArrGalleryTypesShort(){
117
+ $arrGalleries = $this->getArrGalleryTypes();
118
+
119
+ $arrShort = array();
120
+ foreach($arrGalleries as $objGallery){
121
+ $isPublishded = $objGallery->isPublished();
122
+ if($isPublishded == false)
123
+ continue;
124
+
125
+ $name = $objGallery->getName();
126
+ $arr = array();
127
+ $arr["name"] = $name;
128
+ $arr["title"] = $objGallery->getTypeTitle();
129
+ $arr["folder"] = $objGallery->getFolder();
130
+ $arrShort[$name] = $arr;
131
+ }
132
+
133
+ return($arrShort);
134
+ }
135
+
136
+
137
+
138
+ /**
139
+ *
140
+ * get gallery by name
141
+ */
142
+ public function getGalleryTypeByName($galleryName){
143
+ UniteFunctionsUG::validateNotEmpty($galleryName, "gallery name");
144
+ $arrGalleryTypes = $this->getArrGalleryTypes();
145
+
146
+ $objGalleryType = UniteFunctionsUG::getVal($arrGalleryTypes, $galleryName);
147
+ if(empty($objGalleryType))
148
+ UniteFunctionsUG::throwError("getGalleryTypeByName error, Gallery {$galleryName} not found!");
149
+
150
+ return($objGalleryType);
151
+ }
152
+
153
+ /**
154
+ *
155
+ * get galleries array
156
+ */
157
+ public function getArrGalleries($order = ""){
158
+
159
+ $arrGalleries = array();
160
+ $response = $this->db->fetch(GlobalsUG::$table_galleries, "", $order);
161
+
162
+ foreach($response as $record){
163
+ $id = $record["id"];
164
+
165
+ if(empty($id)) //for some strange reasons the id can be 0 sometimes
166
+ continue;
167
+
168
+ $objGallery = new UniteGalleryGallery();
169
+ $objGallery->initByRecord($record);
170
+ $arrGalleries[] = $objGallery;
171
+ }
172
+
173
+ return($arrGalleries);
174
+ }
175
+
176
+ /**
177
+ * get id - title array of the galleries
178
+ */
179
+ public function getArrGalleriesShort($addEmpty = false){
180
+
181
+ $arrGalleries = array();
182
+ $response = $this->db->fetch(GlobalsUG::$table_galleries);
183
+
184
+ if($addEmpty == true)
185
+ $arrGalleries["empty"] = __("[Not Selected]", UNITEGALLERY_TEXTDOMAIN);
186
+
187
+ foreach($response as $record){
188
+ $id = UniteFunctionsUG::getVal($record, "id");
189
+ $title = UniteFunctionsUG::getVal($record, "title");
190
+
191
+ $arrGalleries[$id] = $title;
192
+ }
193
+
194
+ return($arrGalleries);
195
+ }
196
+
197
+
198
+ /**
199
+ *
200
+ * add gallery from data by gallery name
201
+ */
202
+ public function addGaleryFromData($type, $data){
203
+
204
+ $objGallery = new UniteGalleryGallery();
205
+ $params = UniteFunctionsUG::getVal($data, "params",array());
206
+ if(is_array($params) == false)
207
+ $params = array();
208
+
209
+ $mainParams = UniteFunctionsUG::getVal($data, "main");
210
+
211
+ if(!empty($mainParams))
212
+ $params = array_merge($mainParams, $params);
213
+
214
+ //create items category if needed
215
+ $category = UniteFunctionsUG::getVal($params, "category");
216
+
217
+ if($category == "new"){
218
+ $objGallery->validateInputSettings($params, false);
219
+ $title = $params["title"];
220
+ $objCategory = new UniteGalleryCategory();
221
+ $response = $objCategory->add($title);
222
+
223
+ $newCategoryID = $response["id"];
224
+ $params["category"] = $newCategoryID;
225
+ $params["categories"] = $newCategoryID;
226
+ }
227
+
228
+
229
+ $galleryID = $objGallery->create($type, $params);
230
+
231
+ return($galleryID);
232
+ }
233
+
234
+
235
+ /**
236
+ * update gallery from data
237
+ */
238
+ public function changeGalleryThemeFromData($data){
239
+
240
+ $galleryID = UniteFunctionsUG::getVal($data, "galleryID");
241
+ UniteFunctionsUG::validateNotEmpty($galleryID,"Gallery ID");
242
+
243
+ $toTheme = UniteFunctionsUG::getVal($data, "totheme");
244
+ UniteFunctionsUG::validateNotEmpty($toTheme);
245
+
246
+ $this->validateGalleryTypeExists($toTheme);
247
+
248
+ $objGallery = new UniteGalleryGallery();
249
+ $objGallery->initByID($galleryID);
250
+ $objGallery->updateGalleryType($toTheme);
251
+
252
+ $urlRedirect = HelperUG::getGalleryView($galleryID);
253
+
254
+ return($urlRedirect);
255
+ }
256
+
257
+
258
+ /**
259
+ * get gallery by id
260
+ */
261
+ private function getGalleryByID($galleryID){
262
+
263
+ UniteFunctionsUG::validateNotEmpty($galleryID,"gallery id");
264
+ UniteFunctionsUG::validateNumeric($galleryID);
265
+ $gallery = new UniteGalleryGallery();
266
+ $gallery->initByID($galleryID);
267
+
268
+ return($gallery);
269
+ }
270
+
271
+
272
+ /**
273
+ * update gallery from data
274
+ */
275
+ public function updateGalleryFromData($data){
276
+
277
+ $galleryID = UniteFunctionsUG::getVal($data, "galleryID");
278
+ UniteFunctionsUG::validateNotEmpty($galleryID,"Gallery ID");
279
+ $updateParamsOnly = UniteFunctionsUG::getVal($data, "updateParamsOnly");
280
+
281
+ $objGallery = new UniteGalleryGallery();
282
+ $objGallery->initByID($galleryID);
283
+
284
+ $params = UniteFunctionsUG::getVal($data, "params",array());
285
+ $mainParams = UniteFunctionsUG::getVal($data, "main");
286
+
287
+ if(!empty($mainParams))
288
+ $params = array_merge($mainParams, $params);
289
+
290
+
291
+ if($updateParamsOnly == true)
292
+ $objGallery->updateParams($params);
293
+ else
294
+ $objGallery->update($params); //update with title and alias
295
+
296
+ }
297
+
298
+
299
+ /**
300
+ *
301
+ * delete gallery from data
302
+ */
303
+ public function deleteGalleryFromData($data){
304
+
305
+ $galleryID = UniteFunctionsUG::getVal($data, "galleryID");
306
+ UniteFunctionsUG::validateNotEmpty($galleryID,"gallery id");
307
+
308
+ $gallery = new UniteGalleryGallery();
309
+ $gallery->initByID($galleryID);
310
+ $gallery->delete();
311
+
312
+ }
313
+
314
+ /**
315
+ *
316
+ * duplicate gallery from data
317
+ */
318
+ public function duplicateGalleryFromData($data){
319
+
320
+ $galleryID = UniteFunctionsUG::getVal($data, "galleryID");
321
+ UniteFunctionsUG::validateNotEmpty($galleryID,"gallery id");
322
+
323
+ $gallery = new UniteGalleryGallery();
324
+ $gallery->initByID($galleryID);
325
+
326
+ $gallery->duplicate();
327
+ }
328
+
329
+ /**
330
+ * export gallery settings from data
331
+ */
332
+ public function exportGallerySettings($galleryID){
333
+
334
+ $gallery = $this->getGalleryByID($galleryID);
335
+ $gallery->exportSettings();
336
+ }
337
+
338
+
339
+ /**
340
+ * import gallery settings from upload file
341
+ */
342
+ public function importGallerySettingsFromUploadFile($galleryID){
343
+
344
+ $gallery = $this->getGalleryByID($galleryID);
345
+
346
+ $arrFile = UniteFunctionsUG::getVal($_FILES, "export_file");
347
+ try{
348
+
349
+ $linkBack = HelperUG::getAdvancedView($galleryID);
350
+ $htmlLinkBack = UniteFunctionsUG::getHtmlLink($linkBack, "Go Back");
351
+
352
+ if(empty($arrFile))
353
+ UniteFunctionsUG::throwError("Import file not found");
354
+
355
+ //get content
356
+ $filepath = UniteFunctionsUG::getVal($arrFile, "tmp_name");
357
+ $content = file_get_contents($filepath);
358
+
359
+ //remove temp path
360
+ @unlink($filepath);
361
+
362
+ if(empty($content))
363
+ UniteFunctionsUG::throwError("No content found");
364
+
365
+ $arrContent = @unserialize($content);
366
+
367
+ if(empty($arrContent))
368
+ UniteFunctionsUG::throwError("No content format");
369
+
370
+ $gallery->importSettings($arrContent);
371
+
372
+ //redirect back to settings
373
+ dmp("gallery settings imported, redirecting...");
374
+ UniteFunctionsUG::putRedirectJS($linkBack);
375
+ exit();
376
+
377
+ }catch(Exception $e){
378
+ $message = $e->getMessage();
379
+ echo "<div style='color:#B80A0A;font-size:18px;'><b>Import Settings Error: </b> $message</div><br>";
380
+ echo $htmlLinkBack;
381
+ exit();
382
+ }
383
+
384
+ }
385
+
386
+ }
387
+
388
+ ?>
inc_php/unitegallery_gallery.class.php ADDED
@@ -0,0 +1,533 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @package Unite Gallery
4
+ * @author Valiano
5
+ * @copyright (C) 2012 Unite CMS, All Rights Reserved.
6
+ * @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
7
+ * */
8
+ defined('UNITEGALLERY_INC') or die('Restricted access');
9
+
10
+
11
+ class UniteGalleryGallery extends UniteElementsBaseUG{
12
+
13
+ private $id;
14
+ private $objType;
15
+ private $type;
16
+ private $typeTitle;
17
+ private $title;
18
+ private $alias;
19
+ private $ordering;
20
+ private $arrParams;
21
+ private $isTypeExists;
22
+ private $isTilesType = false;
23
+
24
+ /**
25
+ *
26
+ * construct
27
+ */
28
+ public function __construct(){
29
+ parent::__construct();
30
+ }
31
+
32
+ /**
33
+ * validate that the gallery inited
34
+ */
35
+ private function validateInited(){
36
+ if(empty($this->id))
37
+ UniteFunctionsUG::throwError("The gallery not inited");
38
+ }
39
+
40
+
41
+ /**
42
+ *
43
+ * init gallery by id
44
+ */
45
+ public function initByID($id){
46
+
47
+ UniteFunctionsUG::validateNumeric($id, "galleryID");
48
+
49
+ $id = $this->db->escape($id);
50
+
51
+ $response = $this->db->fetch(GlobalsUG::$table_galleries,"id={$id}");
52
+
53
+ if(empty($response))
54
+ UniteFunctionsUG::throwError("Gallery with id: {$id} not found");
55
+
56
+ $record = $response[0];
57
+ $this->initByRecord($record);
58
+ }
59
+
60
+
61
+ /**
62
+ * init gallery by alias
63
+ */
64
+ public function initByAlias($alias){
65
+
66
+ $alias = $this->db->escape($alias);
67
+
68
+ $response = $this->db->fetch(GlobalsUG::$table_galleries,"alias='{$alias}'");
69
+ if(empty($response))
70
+ UniteFunctionsUG::throwError("Gallery with alias: {$alias} not found");
71
+
72
+ $record = $response[0];
73
+ $this->initByRecord($record);
74
+ }
75
+
76
+
77
+ /**
78
+ *
79
+ * init gallery by record
80
+ */
81
+ public function initByRecord($record){
82
+
83
+ UniteFunctionsUG::validateNotEmpty($record,"record empty");
84
+
85
+ $this->id = UniteFunctionsUG::getVal($record, "id");
86
+ $this->title = UniteFunctionsUG::getVal($record, "title");
87
+ $this->alias = UniteFunctionsUG::getVal($record, "alias");
88
+ $this->ordering = UniteFunctionsUG::getVal($record, "ordering");
89
+ $this->type = UniteFunctionsUG::getVal($record, "type");
90
+
91
+ //set type title:
92
+ if(!empty($this->type)){
93
+ try{
94
+ UniteFunctionsUG::validateNotEmpty($this->type,"Gallery Type");
95
+
96
+ $objGalleries = new UniteGalleryGalleries();
97
+ $this->objType = $objGalleries->getGalleryTypeByName($this->type);
98
+ $this->typeTitle = $this->objType->getTypeTitle();
99
+ $this->isTypeExists = true;
100
+ $this->isTilesType = $this->objType->isTilesType();
101
+
102
+
103
+ }catch(Exception $e){
104
+ $this->isTypeExists = false;
105
+ $this->typeTitle = $this->type." - gallery type not exists!";
106
+ }
107
+ }
108
+
109
+
110
+ $this->arrParams = array();
111
+ $params = UniteFunctionsUG::getVal($record, "params");
112
+ if(!empty($params))
113
+ $this->arrParams = (array)json_decode($params);
114
+
115
+ }
116
+
117
+
118
+
119
+ /**
120
+ * get the ID
121
+ */
122
+ public function getID(){
123
+ $this->validateInited();
124
+ return($this->id);
125
+ }
126
+
127
+ /**
128
+ * get type title
129
+ */
130
+ public function getTypeTitle(){
131
+ return($this->typeTitle);
132
+ }
133
+
134
+ /**
135
+ * get type name
136
+ */
137
+ public function getTypeName(){
138
+ return($this->type);
139
+ }
140
+
141
+
142
+ /**
143
+ * get true if that gallery type exists
144
+ */
145
+ public function isTypeExists(){
146
+
147
+ return($this->isTypeExists);
148
+ }
149
+
150
+
151
+ /**
152
+ * get gallery type object
153
+ */
154
+ public function getObjType(){
155
+ return($this->objType);
156
+ }
157
+
158
+
159
+ /**
160
+ * get combination of title (alias)
161
+ */
162
+ public function getShowTitle(){
163
+ $showTitle = $this->title." ($this->alias)";
164
+ return($showTitle);
165
+ }
166
+
167
+ /**
168
+ * get alias
169
+ */
170
+ public function getAlias(){
171
+ return($this->alias);
172
+ }
173
+
174
+ /**
175
+ * get title
176
+ */
177
+ public function getTitle(){
178
+ return($this->title);
179
+ }
180
+
181
+
182
+ /**
183
+ *
184
+ * get slider shortcode
185
+ */
186
+ public function getShortcode(){
187
+ $shortCode = "[unitegallery {$this->alias}]";
188
+ return($shortCode);
189
+ }
190
+
191
+ /**
192
+ * get params
193
+ */
194
+ public function getParams(){
195
+ return($this->arrParams);
196
+ }
197
+
198
+
199
+ /**
200
+ * get some param from params
201
+ */
202
+ public function getParam($name){
203
+ $this->validateInited();
204
+ $value = UniteFunctionsUG::getVal($this->arrParams, $name);
205
+ return($value);
206
+ }
207
+
208
+
209
+ /**
210
+ * get params for settings object
211
+ */
212
+ public function getParamsForSettings(){
213
+ $arrParams = $this->arrParams;
214
+ $arrParams["title"] = $this->title;
215
+ $arrParams["alias"] = $this->alias;
216
+
217
+ return($arrParams);
218
+ }
219
+
220
+ /**
221
+ * return if the gallery tiles type
222
+ */
223
+ public function isTilesType(){
224
+
225
+ return($this->isTilesType);
226
+ }
227
+
228
+
229
+ /**
230
+ *
231
+ * get max order
232
+ */
233
+ private function getMaxOrder(){
234
+
235
+ $maxOrder = 0;
236
+ $arrGaleryRecords = $this->db->fetch(GlobalsUG::$table_galleries,"","ordering desc","","limit 1");
237
+ if(empty($arrGaleryRecords))
238
+ return($maxOrder);
239
+ $maxOrder = $arrGaleryRecords[0]["ordering"];
240
+
241
+ return($maxOrder);
242
+ }
243
+
244
+ /**
245
+ *
246
+ * check if alias exists in DB
247
+ */
248
+ private function isAliasExistsInDB($alias){
249
+ $alias = $this->db->escape($alias);
250
+
251
+ $where = "alias='$alias'";
252
+ if(!empty($this->id))
253
+ $where .= " and id != '{$this->id}'";
254
+
255
+ $response = $this->db->fetch(GlobalsUG::$table_galleries,$where);
256
+ return(!empty($response));
257
+
258
+ }
259
+
260
+ /**
261
+ *
262
+ * validate settings for add
263
+ */
264
+ public function validateInputSettings($params, $checkAlias = true){
265
+
266
+ $title = UniteFunctionsUG::getVal($params, "title");
267
+ $alias = UniteFunctionsUG::getVal($params, "alias");
268
+
269
+ UniteFunctionsUG::validateNotEmpty($title,"title");
270
+ UniteFunctionsUG::validateNotEmpty($alias,"alias");
271
+
272
+ $isMatch = preg_match("/^[A-Za-z0-9_]+$/", $alias);
273
+ if(!$isMatch)
274
+ UniteFunctionsUG::throwError("<b>Wrong Alias</b>! The alias should be contain from english letters and numbers without spaces, underscore alowed example: my_gallery1");
275
+
276
+ if($checkAlias == true && $this->isAliasExistsInDB($alias))
277
+ UniteFunctionsUG::throwError(__("Some other gallery with alias <b>'$alias'</b> already exists. Please write another alias",UNITEGALLERY_TEXTDOMAIN));
278
+ }
279
+
280
+ /**
281
+ *
282
+ * add gallery from params.
283
+ */
284
+ public function create($type, $params){
285
+
286
+ $title = UniteFunctionsUG::getVal($params, "title");
287
+ $alias = UniteFunctionsUG::getVal($params, "alias");
288
+
289
+ $this->validateInputSettings($params);
290
+
291
+ $jsonParams = json_encode($params);
292
+
293
+ $maxOrder = $this->getMaxOrder();
294
+ $currentOrder = $maxOrder+1;
295
+
296
+ //insert slider to database
297
+ $arrData = array();
298
+ $arrData["title"] = $title;
299
+ $arrData["type"] = $type;
300
+ $arrData["alias"] = $alias;
301
+ $arrData["params"] = $jsonParams;
302
+ $arrData["ordering"] = $currentOrder;
303
+
304
+ $galleryID = $this->db->insert(GlobalsUG::$table_galleries,$arrData);
305
+
306
+ if(empty($galleryID))
307
+ UniteFunctionsUG::throwError("Unable to create gallery. Please check if your database create autoincriment id's");
308
+
309
+ return($galleryID);
310
+ }
311
+
312
+ private function a_________UPDATE____________(){}
313
+
314
+ /**
315
+ *
316
+ * update the gallery by params
317
+ */
318
+ public function update($params){
319
+ $this->validateInited();
320
+
321
+ $title = UniteFunctionsUG::getVal($params, "title");
322
+ $alias = UniteFunctionsUG::getVal($params, "alias");
323
+
324
+ $this->validateInputSettings($params);
325
+
326
+ $arrData = array();
327
+ $arrData["title"] = $title;
328
+ $arrData["alias"] = $alias;
329
+
330
+ $this->updateData($arrData);
331
+
332
+ $this->updateParams($params);
333
+ }
334
+
335
+
336
+ /**
337
+ * update data in db
338
+ */
339
+ private function updateData($arrData){
340
+ $this->validateInited();
341
+
342
+ $this->db->update(GlobalsUG::$table_galleries,$arrData,array("id"=>$this->id));
343
+ }
344
+
345
+
346
+ /**
347
+ * udate gallery params, merge with existing
348
+ * no title and alias should exist in the given params
349
+ */
350
+ public function updateParams($arrParams){
351
+
352
+ $this->validateInited();
353
+ $this->arrParams = array_merge($this->arrParams, $arrParams);
354
+
355
+ $jsonParams = json_encode($this->arrParams);
356
+ $arrData = array();
357
+ $arrData["params"] = $jsonParams;
358
+
359
+ $this->db->update(GlobalsUG::$table_galleries, $arrData, array("id"=>$this->id));
360
+ }
361
+
362
+ /**
363
+ * update some param name in database
364
+ */
365
+ public function updateParam($name, $value){
366
+ $arrParams = array();
367
+ $arrParams[$name] = $value;
368
+ $this->updateParams($arrParams);
369
+ }
370
+
371
+
372
+
373
+ /**
374
+ * update items category from data
375
+ * the gallery is not inited
376
+ */
377
+ public function updateItemsCategoryFromData($data){
378
+
379
+ $galleryID = UniteFunctionsUG::getVal($data, "galleryID");
380
+ if(empty($galleryID))
381
+ return(false);
382
+
383
+ $this->initByID($galleryID);
384
+
385
+ $catID = UniteFunctionsUG::getVal($data, "catID");
386
+ UniteFunctionsUG::validateNumeric($catID,"category id");
387
+
388
+ $this->updateParam("category", $catID);
389
+
390
+ }
391
+
392
+
393
+ /**
394
+ * update gallery type from data
395
+ */
396
+ public function updateGalleryType($newType){
397
+
398
+ $this->validateInited();
399
+
400
+ $currentType = $this->getTypeName();
401
+ if($currentType == $newType)
402
+ UniteFunctionsUG::throwError("The gallery is already: ".$newType);
403
+
404
+ $arrUpdate = array();
405
+ $arrUpdate["type"] = $newType;
406
+ $this->updateData($arrUpdate);
407
+ }
408
+
409
+
410
+ /**
411
+ * delete the gallery
412
+ */
413
+ public function delete(){
414
+ $this->validateInited();
415
+ $this->db->delete(GlobalsUG::$table_galleries,"id={$this->id}");
416
+ }
417
+
418
+
419
+ /**
420
+ *
421
+ * duplicate gallery
422
+ */
423
+ public function duplicate(){
424
+ $this->validateInited();
425
+
426
+ //get slider number:
427
+ $response = $this->db->fetch(GlobalsUG::$table_galleries);
428
+ $numGalleries = count($response);
429
+ $newGallerySerial = $numGalleries + 1;
430
+
431
+ $newTitle = __("Gallery",UNITEGALLERY_TEXTDOMAIN).$newGallerySerial;
432
+ $newAlias = "gallery".$newGallerySerial;
433
+
434
+ //insert a new gallery
435
+ $sqlSelect = "select ".GlobalsUG::FIELDS_GALLERY." from ".GlobalsUG::$table_galleries." where id={$this->id}";
436
+ $sqlInsert = "insert into ".GlobalsUG::$table_galleries." (".GlobalsUG::FIELDS_GALLERY.") ($sqlSelect)";
437
+
438
+ $this->db->runSql($sqlInsert);
439
+ $lastID = $this->db->getLastInsertID();
440
+ UniteFunctionsUG::validateNotEmpty($lastID);
441
+
442
+ $arrParams = $this->arrParams;
443
+ $arrParams["title"] = $newTitle;
444
+ $arrParams["alias"] = $newAlias;
445
+
446
+ $jsonParams = json_encode($arrParams);
447
+
448
+ //update the new slider with the title and the alias values
449
+ $arrUpdate = array();
450
+ $arrUpdate["title"] = $newTitle;
451
+ $arrUpdate["alias"] = $newAlias;
452
+ $arrUpdate["params"] = $jsonParams;
453
+
454
+ $this->db->update(GlobalsUG::$table_galleries, $arrUpdate, array("id"=>$lastID));
455
+ }
456
+
457
+
458
+ /**
459
+ * get category id
460
+ */
461
+ public function getCatID(){
462
+ $catID = $this->getParam("category");
463
+ return($catID);
464
+ }
465
+ /**
466
+ * export gallery settings to downloadable file
467
+ */
468
+ public function exportSettings(){
469
+ $this->validateInited();
470
+ $galleryID = $this->id;
471
+
472
+ $record = $this->db->fetchSingle(GlobalsUG::$table_galleries,"id={$galleryID}");
473
+ UniteFunctionsUG::validateNotEmpty($record, "Gallery Record");
474
+ unset($record["id"]);
475
+
476
+ $strRecord = serialize($record);
477
+ $filename = "unitegallery_".$record["alias"].".txt";
478
+
479
+ UniteFunctionsUG::downloadFileFromContent($strRecord, $filename);
480
+
481
+ //the download content should exit
482
+ UniteFunctionsUG::throwError("Something wrong witht the export, please try again");
483
+ exit();
484
+ }
485
+
486
+
487
+ /**
488
+ * import settings
489
+ */
490
+ public function importSettings($arrContent){
491
+
492
+ $this->validateInited();
493
+
494
+ $jsonParams = UniteFunctionsUG::getVal($arrContent, "params");
495
+ $paramsNew = (array)json_decode($jsonParams);
496
+
497
+ if(empty($paramsNew))
498
+ return(false);
499
+
500
+ //unset variables
501
+ $arrUnset = array(
502
+ "title",
503
+ "alias",
504
+ "category",
505
+ "gallery_width",
506
+ "gallery_height",
507
+ "full_width",
508
+ "enable_categories",
509
+ "shortcode",
510
+ "gallery_min_width",
511
+ "include_jquery",
512
+ "js_to_body",
513
+ "compress_output",
514
+ "gallery_debug_errors",
515
+ "categories",
516
+ "enable_category_tabs",
517
+ "gallery_min_width",
518
+ "gallery_min_height"
519
+ );
520
+
521
+ foreach($arrUnset as $key){
522
+ if(array_key_exists($key, $paramsNew))
523
+ unset($paramsNew[$key]);
524
+ }
525
+
526
+ $this->updateParams($paramsNew);
527
+ }
528
+
529
+
530
+
531
+ }
532
+
533
+ ?>
inc_php/unitegallery_gallery_type.class.php ADDED
@@ -0,0 +1,210 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @package Unite Gallery
4
+ * @author Valiano
5
+ * @copyright (C) 2012 Unite CMS, All Rights Reserved.
6
+ * @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
7
+ * */
8
+ defined('UNITEGALLERY_INC') or die('Restricted access');
9
+
10
+
11
+ class UniteGalleryGalleryType extends UniteElementsBaseUG{
12
+
13
+ const FILENAME_SCRIPTS = "scripts.php";
14
+ const FILENAME_OUTPUT = "output.php";
15
+ const FILENAME_INCLUDES = "includes.php";
16
+
17
+ private $pathGallery;
18
+ private $folderName;
19
+ private $filepathXmlFile;
20
+ private $urlBase;
21
+
22
+ private $name;
23
+ private $isPublished;
24
+ private $typeTitle;
25
+ private $itemsType = "all"; //all , video , images
26
+ private $isTilesType = false;
27
+
28
+
29
+ public function __construct(){
30
+ parent::__construct();
31
+ }
32
+
33
+ /**
34
+ *
35
+ * validate that the gallery is inited
36
+ */
37
+ private function validataInited(){
38
+ if(empty($this->name))
39
+ UniteFunctionsUG::throwError("The gallery {$this->$folderName} is not inited!");
40
+ }
41
+
42
+
43
+
44
+ /**
45
+ *
46
+ * get gallery data from xml file
47
+ */
48
+ private function initDataFromXml(){
49
+
50
+ $errorPrefix = $this->filepathXmlFile." parsing error:";
51
+
52
+ if(!file_exists($this->filepathXmlFile))
53
+ UniteFunctionsUG::throwError("File: '$filepath' not exists!!!");
54
+
55
+ $obj = simplexml_load_file($this->filepathXmlFile);
56
+
57
+ if(empty($obj))
58
+ UniteFunctionsUG::throwError("Wrong xml file format: {$this->filepathXmlFile}");
59
+
60
+ $objGeneral = $obj->general;
61
+ if(empty($objGeneral))
62
+ UniteFunctionsUG::throwError($errorPrefix."General section not found.");
63
+
64
+
65
+ //get general data
66
+ $arrData = (array)$objGeneral;
67
+ $this->name = UniteFunctionsUG::getVal($arrData, "name");
68
+ $this->typeTitle = UniteFunctionsUG::getVal($arrData, "title");
69
+ $this->isPublished = UniteFunctionsUG::getVal($arrData, "published");
70
+ $this->isPublished = UniteFunctionsUG::strToBool($this->isPublished);
71
+ $this->itemsType = UniteFunctionsUG::getVal($arrData, "items_type", "all");
72
+
73
+ $isTilesType = UniteFunctionsUG::getVal($arrData, "istiles");
74
+ $isTilesType = UniteFunctionsUG::strToBool($isTilesType);
75
+
76
+ $this->isTilesType = $isTilesType;
77
+
78
+ //validatopm
79
+ UniteFunctionsUG::validateNotEmpty($this->name,$errorPrefix);
80
+ UniteFunctionsUG::validateNotEmpty($this->typeTitle,$errorPrefix);
81
+ }
82
+
83
+
84
+ /**
85
+ *
86
+ * init gallery by it's folder
87
+ */
88
+ public function initByFolder($folderName){
89
+
90
+ $pathGallery = GlobalsUG::$pathGalleries.$folderName."/";
91
+ if(is_dir($pathGallery) == false)
92
+ UniteFunctionsUG::throwError("Gallery $folderName not exists in gallery folder");
93
+
94
+ $this->pathGallery = $pathGallery;
95
+
96
+ $filepathConfig = $pathGallery."config.xml";
97
+ if(file_exists($filepathConfig) == false)
98
+ UniteFunctionsUG::throwError("$folderName gallery config file not exists. ");
99
+
100
+ $this->folderName = $folderName;
101
+ $this->filepathXmlFile = $filepathConfig;
102
+
103
+ $this->initDataFromXml();
104
+ }
105
+
106
+ /**
107
+ *
108
+ * get gallery name
109
+ */
110
+ public function getName(){
111
+ $this->validataInited();
112
+ return($this->name);
113
+ }
114
+
115
+ /**
116
+ *
117
+ * get gallery folder
118
+ */
119
+ public function getFolder(){
120
+ $this->validataInited();
121
+ return($this->folderName);
122
+ }
123
+
124
+
125
+ /**
126
+ *
127
+ * get gallery title
128
+ */
129
+ public function getTypeTitle(){
130
+ $this->validataInited();
131
+ return($this->typeTitle);
132
+ }
133
+
134
+
135
+ /**
136
+ *
137
+ * get if the gallery is published
138
+ */
139
+ public function isPublished(){
140
+ $this->validataInited();
141
+ return($this->isPublished);
142
+ }
143
+
144
+
145
+ /**
146
+ * get if the gallery tiles type
147
+ */
148
+ public function isTilesType(){
149
+
150
+ $this->validataInited();
151
+
152
+ return($this->isTilesType);
153
+ }
154
+
155
+
156
+ /**
157
+ *
158
+ * get if the gallery is published
159
+ */
160
+ public function getItemsType(){
161
+ $this->validataInited();
162
+ return($this->itemsType);
163
+ }
164
+
165
+
166
+ /**
167
+ *
168
+ * get gallery path
169
+ */
170
+ public function getPathGallery(){
171
+ $this->validataInited();
172
+ return($this->pathGallery);
173
+ }
174
+
175
+ /**
176
+ *
177
+ * get path scripts include
178
+ */
179
+ public function getPathScriptsIncludes(){
180
+ $this->validataInited();
181
+ $pathScripts = $this->pathGallery.self::FILENAME_SCRIPTS;
182
+ return($pathScripts);
183
+ }
184
+
185
+
186
+ /**
187
+ *
188
+ * get path script includes
189
+ */
190
+ public function getPathIncludes(){
191
+ $this->validataInited();
192
+ $pathIncludes = $this->pathGallery.self::FILENAME_INCLUDES;
193
+ return($pathIncludes);
194
+ }
195
+
196
+ /**
197
+ *
198
+ * get url gallery base
199
+ */
200
+ public function getUrlGalleryBase(){
201
+ $urlGalleryBase = GlobalsUG::$urlGalleries.$this->folderName."/";
202
+ return($urlGalleryBase);
203
+ }
204
+
205
+
206
+
207
+
208
+ }
209
+
210
+ ?>
inc_php/unitegallery_globals.class.php ADDED
@@ -0,0 +1,171 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @package Unite Gallery
4
+ * @author Valiano
5
+ * @copyright (C) 2012 Unite CMS, All Rights Reserved.
6
+ * @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
7
+ * */
8
+ defined('UNITEGALLERY_INC') or die('Restricted access');
9
+
10
+ class GlobalsUG{
11
+
12
+ const SHOW_TRACE = false;
13
+ const ENABLE_TRANSLATIONS = false;
14
+
15
+ const PLUGIN_TITLE = "Unite Gallery Lite";
16
+ const PLUGIN_NAME = "unitegallery";
17
+
18
+
19
+ const TABLE_GALLERIES_NAME = "unitegallery_galleries";
20
+ const TABLE_ITEMS_NAME = "unitegallery_items";
21
+ const TABLE_CATEGORIES_NAME = "unitegallery_categories";
22
+
23
+ const DIR_THUMBS = "unitegallery_thumbs";
24
+ const THUMB_WIDTH = 300;
25
+ const THUMB_WIDTH_LARGE = 768;
26
+ const THUMB_WIDTH_BIG = 1024;
27
+
28
+ const VIEW_DEFAULT = "galleries";
29
+ const VIEW_ITEMS = "items";
30
+ const VIEW_GALLERIES = "galleries";
31
+ const VIEW_GALLERY = "gallery";
32
+ const VIEW_CATEGORY_TABS = "categorytabs";
33
+ const VIEW_ADVANCED = "advanced";
34
+ const VIEW_PREVIEW = "preview";
35
+ const VIEW_MEDIA_SELECT = "mediaselect";
36
+
37
+ const FIELDS_ITEMS = "published,title,alias,type,ordering,catid,imageid,url_image,url_thumb,contentid,content,params";
38
+ const FIELDS_GALLERY = "type,title,alias,ordering,params";
39
+ const DEFAULT_JPG_QUALITY = 81;
40
+
41
+ const YOUTUBE_EXAMPLE_ID = "A3PDXmYoF5U";
42
+ const VIMEO_EXAMPLE_ID = "73234449";
43
+ const WISTIA_EXAMPLE_ID = "9oedgxuciv";
44
+
45
+ public static $isScriptsInFooter = false; //tells that scripts are added to footer
46
+
47
+ public static $table_galleries;
48
+ public static $table_categories;
49
+ public static $table_items;
50
+
51
+ public static $pathSettings;
52
+ public static $filepathItemSettings;
53
+ public static $pathPlugin;
54
+ public static $pathGalleries;
55
+ public static $pathTemplates;
56
+ public static $pathFullVersion;
57
+ public static $pathViews;
58
+ public static $pathHelpersViews;
59
+ public static $pathHelpersTemplates;
60
+ public static $pathHelpersClasses;
61
+ public static $pathHelpersSettings;
62
+ public static $pathProvider;
63
+
64
+ public static $url_base;
65
+ public static $url_media_ug;
66
+ public static $url_images;
67
+ public static $url_component_client;
68
+ public static $url_component_admin;
69
+ public static $url_ajax;
70
+ public static $url_ajax_front;
71
+ public static $urlPlugin;
72
+ public static $urlGalleries;
73
+ public static $url_elfinder;
74
+ public static $url_provider;
75
+
76
+ public static $is_admin;
77
+ public static $isFullVersion;
78
+ public static $path_base;
79
+ public static $path_media_ug;
80
+ public static $path_cache;
81
+ public static $path_images;
82
+ public static $path_elfinder;
83
+
84
+ public static $arrClientSideText = array();
85
+
86
+
87
+ /**
88
+ * init globals
89
+ */
90
+ public static function initGlobals($pluginFolder){
91
+
92
+ UniteProviderFunctionsUG::initGlobalsBase($pluginFolder);
93
+
94
+ self::$is_admin == false; //this var set from admin object
95
+
96
+ self::$pathSettings = self::$pathPlugin."settings/";
97
+ self::$pathGalleries = self::$pathPlugin."galleries/";
98
+ self::$path_elfinder = self::$pathPlugin."libraries/elfinder/";
99
+ self::$pathTemplates = self::$pathPlugin."views/templates/";
100
+ self::$pathViews = self::$pathPlugin."views/";
101
+ self::$pathHelpersViews = self::$pathPlugin."helpers/views/";
102
+ self::$pathHelpersTemplates = self::$pathPlugin."helpers/templates/";
103
+ self::$pathHelpersClasses = self::$pathPlugin."helpers/classes/";
104
+ self::$pathHelpersSettings = self::$pathPlugin."helpers/settings/";
105
+ self::$pathProvider = self::$pathPlugin."inc_php/framework/provider/";
106
+ self::$pathFullVersion = self::$pathPlugin."fullversion/";
107
+
108
+ self::$isFullVersion = is_dir(self::$pathFullVersion);
109
+
110
+ UniteFunctionsUG::validateDir(self::$pathGalleries);
111
+
112
+ self::$filepathItemSettings = self::$pathSettings."item_settings.php";
113
+
114
+ self::$urlGalleries = self::$urlPlugin."galleries/";
115
+ self::$url_elfinder = self::$urlPlugin."libraries/elfinder/";
116
+ self::$url_provider = self::$urlPlugin."inc_php/framework/provider/";
117
+
118
+ self::initClientSideText();
119
+ }
120
+
121
+
122
+ /**
123
+ * init client side text for globals
124
+ */
125
+ public static function initClientSideText(){
126
+
127
+ self::$arrClientSideText = array(
128
+ "please_fill_item_title"=>__("Please fill in item title",UNITEGALLERY_TEXTDOMAIN),
129
+ "updating_item_data"=>__("Updating item data...",UNITEGALLERY_TEXTDOMAIN),
130
+ "loading_item_data"=>__("Loading item data...",UNITEGALLERY_TEXTDOMAIN),
131
+ "edit_item"=>__("Edit Item",UNITEGALLERY_TEXTDOMAIN),
132
+ "edit_media_item"=>__("Edit Media Item",UNITEGALLERY_TEXTDOMAIN),
133
+ "add_image"=>__("Add image (use shift or ctrl for choosing multiple images)",UNITEGALLERY_TEXTDOMAIN),
134
+ "adding_category"=>__("Adding Category...",UNITEGALLERY_TEXTDOMAIN),
135
+ "do_you_sure_remove"=>__("Do you sure to remove this category and it's items?",UNITEGALLERY_TEXTDOMAIN),
136
+ "removing_category"=>__("Removing Category...",UNITEGALLERY_TEXTDOMAIN),
137
+ "cancel"=>__("Cancel",UNITEGALLERY_TEXTDOMAIN),
138
+ "update"=>__("Update",UNITEGALLERY_TEXTDOMAIN),
139
+ "import"=>__("Import",UNITEGALLERY_TEXTDOMAIN),
140
+ "restore"=>__("Restore",UNITEGALLERY_TEXTDOMAIN),
141
+ "updating"=>__("Updating...",UNITEGALLERY_TEXTDOMAIN),
142
+ "restoring"=>__("Restoring...",UNITEGALLERY_TEXTDOMAIN),
143
+ "updating_category"=>__("Updating Category...",UNITEGALLERY_TEXTDOMAIN),
144
+ "adding_item"=>__("Adding Item...",UNITEGALLERY_TEXTDOMAIN),
145
+ "updating_categories_order"=>__("Updating Categories Order...",UNITEGALLERY_TEXTDOMAIN),
146
+ "removing_items"=>__("Removing Items...",UNITEGALLERY_TEXTDOMAIN),
147
+ "updating_title"=>__("Updating Title...",UNITEGALLERY_TEXTDOMAIN),
148
+ "duplicating_items"=>__("Duplicating Items...",UNITEGALLERY_TEXTDOMAIN),
149
+ "updating_items_order"=>__("Updating Items Order...",UNITEGALLERY_TEXTDOMAIN),
150
+ "copying_items"=>__("Copying Items...",UNITEGALLERY_TEXTDOMAIN),
151
+ "moving_items"=>__("Moving Items...",UNITEGALLERY_TEXTDOMAIN),
152
+ "confirm_remove_items"=>__("Are you sure you want to delete these items?",UNITEGALLERY_TEXTDOMAIN),
153
+ "confirm_remove_gallery"=>__("Are you sure you want to delete this gallery?",UNITEGALLERY_TEXTDOMAIN)
154
+ );
155
+
156
+ }
157
+
158
+ /**
159
+ * print all globals variables
160
+ */
161
+ public static function printVars(){
162
+ $methods = get_class_vars( "GlobalsUG" );
163
+ dmp($methods);
164
+ exit();
165
+ }
166
+ }
167
+
168
+ //init the globals
169
+ GlobalsUG::initGlobals($currentFolder);
170
+
171
+ ?>
inc_php/unitegallery_globals_gallery.class.php ADDED
@@ -0,0 +1,66 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @package Unite Gallery
4
+ * @author Valiano
5
+ * @copyright (C) 2012 Unite CMS, All Rights Reserved.
6
+ * @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
7
+ * */
8
+ defined('UNITEGALLERY_INC') or die('Restricted access');
9
+
10
+
11
+ class GlobalsUGGallery{
12
+
13
+ public static $isInited = false;
14
+ public static $gallery;
15
+ public static $objGalleryType;
16
+ public static $galleryTypeName;
17
+ public static $galleryTypeTitle;
18
+ public static $galleryID;
19
+
20
+ public static $type;
21
+ public static $pathBase;
22
+ public static $pathViews;
23
+ public static $pathTemplates;
24
+ public static $pathSettings;
25
+
26
+ public static $urlBase;
27
+ public static $urlJs;
28
+ public static $urlCss;
29
+ public static $urlImages;
30
+
31
+
32
+ /**
33
+ *
34
+ * init globals static vars by the gallery object
35
+ */
36
+ public static function init(UniteGalleryGalleryType $galleryType, $objGallery, $galleryID){
37
+
38
+ self::$objGalleryType = new UniteGalleryGalleryType();
39
+ self::$objGalleryType = $galleryType;
40
+
41
+ self::$galleryTypeName = self::$objGalleryType->getName();
42
+ self::$galleryTypeTitle = self::$objGalleryType->getTypeTitle();
43
+
44
+ self::$gallery = new UniteGalleryGallery();
45
+ self::$gallery = $objGallery;
46
+
47
+ self::$galleryID = $galleryID;
48
+
49
+ self::$type = self::$objGalleryType->getName();
50
+ self::$pathBase = self::$objGalleryType->getPathGallery();
51
+ self::$urlBase = self::$objGalleryType->getUrlGalleryBase();
52
+
53
+ self::$pathViews = self::$pathBase."views/";
54
+ self::$pathTemplates = self::$pathViews."templates/";
55
+ self::$pathSettings = self::$pathBase."settings/";
56
+
57
+ self::$urlCss = self::$urlBase."css/";
58
+ self::$urlJs = self::$urlBase."js/";
59
+ self::$urlImages = self::$urlBase."images/";
60
+
61
+ self::$isInited = true;
62
+
63
+ }
64
+
65
+ }
66
+ ?>
inc_php/unitegallery_helper.class.php ADDED
@@ -0,0 +1,505 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @package Unite Gallery
4
+ * @author Valiano
5
+ * @copyright (C) 2012 Unite CMS, All Rights Reserved.
6
+ * @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
7
+ * */
8
+ defined('UNITEGALLERY_INC') or die('Restricted access');
9
+
10
+
11
+ /**
12
+ *
13
+ * gallery helper functions class
14
+ *
15
+ */
16
+ class HelperUG extends UniteHelperBaseUG{
17
+
18
+ public static $operations;
19
+
20
+
21
+ /**
22
+ * convert url to full url
23
+ */
24
+ public static function URLtoFull($url){
25
+ $url = trim($url);
26
+
27
+ if(empty($url))
28
+ return("");
29
+
30
+ $urlLower = strtolower($url);
31
+
32
+ if(strpos($urlLower, "http://") !== false || strpos($urlLower, "https://") !== false)
33
+ return($url);
34
+
35
+ $url = GlobalsUG::$url_base.$url;
36
+ return($url);
37
+ }
38
+
39
+ /**
40
+ * convert some url to relative
41
+ */
42
+ public static function URLtoRelative($url){
43
+
44
+ $url = str_replace(GlobalsUG::$url_base, "", $url);
45
+
46
+ return($url);
47
+ }
48
+
49
+
50
+ /**
51
+ * strip base path part from the path
52
+ */
53
+ public static function pathToRelative($path, $addDots = true){
54
+
55
+ $realpath = realpath($path);
56
+ if(!$realpath)
57
+ return($path);
58
+
59
+ $len = strlen($realpath);
60
+ $realBase = realpath(GlobalsUG::$path_base);
61
+ $relativePath = str_replace($realBase, "", $realpath);
62
+
63
+ //add dots
64
+ if($addDots == true && strlen($relativePath) != strlen($realpath))
65
+ $relativePath = "..".$relativePath;
66
+
67
+ return $relativePath;
68
+ }
69
+
70
+
71
+ /**
72
+ * get details of the image by the image url.
73
+ */
74
+ public static function getImageDetails($urlImage){
75
+
76
+ $info = UniteFunctionsUG::getPathInfo($urlImage);
77
+ $urlDir = UniteFunctionsUG::getVal($info, "dirname");
78
+ if(!empty($urlDir))
79
+ $urlDir = $urlDir."/";
80
+
81
+ $arrInfo = array();
82
+ $arrInfo["url_full"] = GlobalsUG::$url_base.$urlImage;
83
+ $arrInfo["url_dir_image"] = $urlDir;
84
+ $arrInfo["url_dir_thumbs"] = $urlDir.GlobalsUG::DIR_THUMBS."/";
85
+
86
+ $filepath = GlobalsUG::$path_base.urldecode($urlImage);
87
+ $filepath = realpath($filepath);
88
+
89
+ $path = dirname($filepath)."/";
90
+ $pathThumbs = $path.GlobalsUG::DIR_THUMBS."/";
91
+
92
+ $arrInfo["filepath"] = $filepath;
93
+ $arrInfo["path"] = $path;
94
+ $arrInfo["path_thumbs"] = $pathThumbs;
95
+
96
+ return($arrInfo);
97
+ }
98
+
99
+
100
+ /**
101
+ *
102
+ * get gallery view
103
+ */
104
+ public static function getGalleryView($galleryID = ""){
105
+ $urlView = self::getViewUrl(GlobalsUG::VIEW_GALLERY,"id={$galleryID}");
106
+ return($urlView);
107
+ }
108
+
109
+
110
+ /**
111
+ * get advanced gallery view
112
+ */
113
+ public static function getAdvancedView($galleryID){
114
+
115
+ $url = self::getViewUrl(GlobalsUG::VIEW_ADVANCED, "id={$galleryID}");
116
+ return($url);
117
+ }
118
+
119
+ /**
120
+ *
121
+ * get preview view
122
+ * @param $galleryID
123
+ */
124
+ public static function getPreviewView($galleryID){
125
+ $urlView = self::getViewUrl(GlobalsUG::VIEW_PREVIEW,"id={$galleryID}");
126
+ return($urlView);
127
+ }
128
+
129
+ /**
130
+ * get galleries view
131
+ */
132
+ public static function getGalleriesView(){
133
+ $urlView = self::getViewUrl(GlobalsUG::VIEW_GALLERIES);
134
+ return($urlView);
135
+ }
136
+
137
+ /**
138
+ * get items view
139
+ */
140
+ public static function getItemsView($galleryID=null){
141
+
142
+ $options = "";
143
+ if(!empty($galleryID))
144
+ $options = "galleryid={$galleryID}";
145
+
146
+ $urlView = self::getViewUrl(GlobalsUG::VIEW_ITEMS, $options);
147
+ return($urlView);
148
+ }
149
+
150
+
151
+ /**
152
+ * get ajax url with params for actions in admin only
153
+ */
154
+ public static function getUrlAjaxActions($clientAction, $params = ""){
155
+
156
+ $nonce = "";
157
+ if(method_exists("UniteProviderFunctionsUG", "getNonce"))
158
+ $nonce = "&nonce=".UniteProviderFunctionsUG::getNonce();
159
+
160
+ $urlAjax = GlobalsUG::$url_ajax."?action=unitegallery_ajax_action{$nonce}&client_action={$clientAction}";
161
+ if(!empty($params))
162
+ $urlAjax .= "&".$params;
163
+
164
+ $urlAjax = UniteFunctionsUG::normalizeLink($urlAjax);
165
+
166
+ return($urlAjax);
167
+ }
168
+
169
+
170
+ /**
171
+ *
172
+ * get url to some view.
173
+ */
174
+ public static function getViewUrl($viewName,$urlParams=""){
175
+
176
+ $params = "&view=".$viewName;
177
+
178
+ if(!empty($urlParams))
179
+ $params .= "&".$urlParams;
180
+
181
+ $link = GlobalsUG::$url_component_admin.$params;
182
+
183
+ $link = UniteFunctionsUG::normalizeLink($link);
184
+
185
+ return($link);
186
+ }
187
+
188
+
189
+ /**
190
+ * require some template from "templates" folder
191
+ */
192
+ public static function getPathTemplate($templateName, $path = null){
193
+
194
+ if($path == null)
195
+ $path = GlobalsUG::$pathTemplates;
196
+
197
+ $pathTemplate = $path.$templateName.".php";
198
+ UniteFunctionsUG::validateFilepath($pathTemplate,"Template");
199
+
200
+ return($pathTemplate);
201
+ }
202
+
203
+ /**
204
+ * get filename title from some url
205
+ * used to get item title from image url
206
+ */
207
+ public static function getTitleFromUrl($url, $defaultTitle = "item"){
208
+
209
+ $info = pathinfo($url);
210
+ $filename = UniteFunctionsUG::getVal($info, "filename");
211
+ $filename = urldecode($filename);
212
+
213
+ $title = $defaultTitle;
214
+ if(!empty($filename))
215
+ $title = $filename;
216
+
217
+
218
+ return($title);
219
+ }
220
+
221
+
222
+ /**
223
+ * get general setting value
224
+ */
225
+ public static function getGeneralSetting($name){
226
+ $arrSettings = self::$operations->getGeneralSettings();
227
+ if(array_key_exists($name,$arrSettings) == false)
228
+ UniteFunctionsUG::throwError("General setting: {$name} don't exists");
229
+ $value = $arrSettings[$name];
230
+ return($value);
231
+ }
232
+
233
+ protected function a______________PUT_SCRIPTS_______________(){}
234
+
235
+ /**
236
+ *
237
+ * register script helper function
238
+ * @param $scriptFilename
239
+ */
240
+ public static function addScript($scriptName, $folder="js", $handle=null){
241
+ if($handle == null)
242
+ $handle = GlobalsUG::PLUGIN_NAME."-".$scriptName;
243
+
244
+ UniteProviderFunctionsUG::addScript($handle, GlobalsUG::$urlPlugin .$folder."/".$scriptName.".js");
245
+ }
246
+
247
+
248
+ /**
249
+ *
250
+ * register common script helper function
251
+ * the handle for the common script is coming without plugin name
252
+ */
253
+ public static function addScriptCommon($scriptName, $handle=null, $folder="js"){
254
+ if($handle == null)
255
+ $handle = $scriptName;
256
+
257
+ self::addScript($scriptName, $folder, $handle);
258
+ }
259
+
260
+ /**
261
+ *
262
+ * register script helper function
263
+ * @param $scriptFilename
264
+ */
265
+ public static function addScriptAbsoluteUrl($urlScript, $handle){
266
+
267
+ UniteProviderFunctionsUG::addScript($handle, $urlScript);
268
+
269
+ }
270
+
271
+
272
+ /**
273
+ *
274
+ * register style helper function
275
+ * @param $styleFilename
276
+ */
277
+ public static function addStyle($styleName,$handle=null,$folder="css"){
278
+ if($handle == null)
279
+ $handle = GlobalsUG::PLUGIN_NAME."-".$styleName;
280
+
281
+ UniteProviderFunctionsUG::addStyle($handle, GlobalsUG::$urlPlugin .$folder."/".$styleName.".css");
282
+
283
+ }
284
+
285
+
286
+ /**
287
+ *
288
+ * register common script helper function
289
+ * the handle for the common script is coming without plugin name
290
+ */
291
+ public static function addStyleCommon($styleName,$handle=null,$folder="css"){
292
+ if($handle == null)
293
+ $handle = $styleName;
294
+ self::addStyle($styleName,$handle,$folder);
295
+
296
+ }
297
+
298
+
299
+ /**
300
+ *
301
+ * register style absolute url helper function
302
+ */
303
+ public static function addStyleAbsoluteUrl($styleUrl, $handle){
304
+
305
+ UniteProviderFunctionsUG::addStyle($handle, $styleUrl);
306
+
307
+ }
308
+
309
+
310
+ /**
311
+ * put style inside the page
312
+ */
313
+ public static function addStyleInline($style){
314
+
315
+ UniteProviderFunctionsUG::addStyleInline($style);
316
+
317
+ }
318
+
319
+
320
+ /**
321
+ * put scripts of some gallery
322
+ */
323
+ public static function putGalleryScripts($objGallery){
324
+
325
+ $galleryID = $objGallery->getID();
326
+
327
+ $objType = $objGallery->getObjType();
328
+ GlobalsUGGallery::init($objType, $objGallery, $galleryID);
329
+
330
+ //require the gallery includes
331
+ $filepathIncludes = GlobalsUGGallery::$pathBase."includes.php";
332
+ if(file_exists($filepathIncludes))
333
+ require_once $filepathIncludes;
334
+
335
+ $filepathOutput = GlobalsUGGallery::$pathBase."client_output.php";
336
+ UniteFunctionsUG::validateFilepath($filepathOutput);
337
+
338
+ //get the output object
339
+ $arrOptions = array("scriptsonly"=>true);
340
+ require $filepathOutput;
341
+ }
342
+
343
+
344
+ /**
345
+ * put globals scripts ouptut for master page
346
+ */
347
+ public static function putGlobalHtmlOutput(){
348
+
349
+ $galleryTypeName = "";
350
+
351
+ //set max items for lite version
352
+ global $ugMaxItems;
353
+
354
+ if(!empty(UniteGalleryAdmin::$currentGalleryType)){
355
+
356
+ $ugMaxItems = 12;
357
+ switch($galleryTypeName){
358
+ case "ug-carousel":
359
+ case "ug-tilescolumns":
360
+ case "ug-tilesjustified":
361
+ case "ug-tilesgrid":
362
+ $ugMaxItems = 20;
363
+ break;
364
+ }
365
+
366
+ }
367
+
368
+ //set gallery type name and id
369
+ $galleryTypeName = "";
370
+ $galleryID = "";
371
+
372
+ if(!empty(UniteGalleryAdmin::$currentGalleryType)){
373
+
374
+ $galleryTypeName = GlobalsUGGallery::$galleryTypeName;
375
+ $galleryID = GlobalsUGGallery::$galleryID;
376
+ }
377
+
378
+ ?>
379
+
380
+ <a id="fancybox_trigger" style="display:none" href="index.php?option=com_media&view=images&tmpl=component&author=&fieldid=field_image_dialog_choose">Fancybox Trigger</a>
381
+
382
+
383
+ <?php
384
+ $script = "
385
+ var g_galleryType = \"{$galleryTypeName}\";
386
+ var g_view = \"".UniteGalleryAdmin::$view."\";
387
+ var g_galleryID = \"".$galleryID."\";
388
+ var g_pluginName = \"".GlobalsUG::PLUGIN_NAME."\";
389
+ var g_urlAjaxActions = \"".GlobalsUG::$url_ajax."\";
390
+ var g_urlViewBase = \"".GlobalsUG::$url_component_admin."\";
391
+ if(typeof(g_settingsObj) == 'undefined')
392
+ var g_settingsObj = {};
393
+ var g_ugAdmin;
394
+ ";
395
+
396
+ //get nonce
397
+ if(method_exists("UniteProviderFunctionsUG", "getNonce"))
398
+ $script .= "\n var g_ugNonce='".UniteProviderFunctionsUG::getNonce()."';";
399
+
400
+
401
+ UniteProviderFunctionsUG::printCustomScript($script);
402
+
403
+ }
404
+
405
+
406
+ /**
407
+ * put html global text
408
+ */
409
+ public static function putGlobalClientSideTextHtml(){
410
+
411
+ $jsArrayText = UniteFunctionsUG::phpArrayToJsArrayText(GlobalsUG::$arrClientSideText);
412
+
413
+ $script = "
414
+ var g_ugtext = {
415
+ ".$jsArrayText."
416
+ };
417
+ ";
418
+
419
+ UniteProviderFunctionsUG::printCustomScript($script);
420
+
421
+ }
422
+
423
+
424
+ protected function a______________OUTPUT_GALLERY_______________(){}
425
+
426
+
427
+ /**
428
+ * output some gallery by alias
429
+ * mixed - alias or id
430
+ * outputType - can be alias or ID
431
+ * arrItems - alternative items
432
+ */
433
+ public static function outputGallery($mixed, $catID = null, $outputType = "alias", $arrItems = null){
434
+
435
+ try{
436
+
437
+ if ($mixed instanceof UniteGalleryGallery) {
438
+
439
+ $objGallery = $mixed;
440
+
441
+ }else{
442
+
443
+ //init the gallery enviropment
444
+ $objGallery = new UniteGalleryGallery();
445
+
446
+ if($outputType == "alias")
447
+ $objGallery->initByAlias($mixed);
448
+ else
449
+ $objGallery->initByID($mixed);
450
+ }
451
+
452
+ $galleryID = $objGallery->getID();
453
+
454
+ $objType = $objGallery->getObjType();
455
+ GlobalsUGGallery::init($objType, $objGallery, $galleryID);
456
+
457
+ $filepathOutput = GlobalsUGGallery::$pathBase."client_output.php";
458
+ UniteFunctionsUG::validateFilepath($filepathOutput);
459
+
460
+ //require the gallery includes
461
+ $filepathIncludes = GlobalsUGGallery::$pathBase."includes.php";
462
+ if(file_exists($filepathIncludes))
463
+ require_once $filepathIncludes;
464
+
465
+ $arrOptions = array();
466
+ $arrOptions["categoryid"] = "";
467
+
468
+ if($catID && is_numeric($catID) && $catID > 0)
469
+ $arrOptions["categoryid"] = $catID;
470
+
471
+ if($arrItems !== null)
472
+ $arrOptions["items"] = $arrItems;
473
+
474
+ //run the output
475
+ require $filepathOutput;
476
+
477
+ if(!isset($uniteGalleryOutput))
478
+ UniteFunctionsUG::throwError("uniteGalleryOutput variable not found");
479
+
480
+ return($uniteGalleryOutput);
481
+
482
+ }catch(Exception $e){
483
+ $message = "<b>Unite Gallery Error:</b><br><br> ".$e->getMessage();
484
+
485
+ $operations = new UGOperations();
486
+ $operations->putModuleErrorMessage($message);
487
+ }
488
+
489
+ }
490
+
491
+
492
+ /**
493
+ * function that never used, for autocomplete only
494
+ */
495
+ private function init(){
496
+ self::$operations = new UGOperations();
497
+ }
498
+
499
+ }
500
+
501
+ //init the operations
502
+ HelperUG::$operations = new UGOperations();
503
+
504
+
505
+ ?>
inc_php/unitegallery_helper_gallery.class.php ADDED
@@ -0,0 +1,255 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @package Unite Gallery
4
+ * @author Valiano
5
+ * @copyright (C) 2012 Unite CMS, All Rights Reserved.
6
+ * @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
7
+ * */
8
+ defined('UNITEGALLERY_INC') or die('Restricted access');
9
+
10
+
11
+ /**
12
+ *
13
+ * gallery helper functions class
14
+ *
15
+ */
16
+ class HelperGalleryUG{
17
+
18
+ /**
19
+ *
20
+ * validate that the current gallery inited
21
+ */
22
+ private static function validateInited(){
23
+
24
+ if(empty(GlobalsUGGallery::$objGalleryType))
25
+ UniteFunctionsUG::throwError("Gallery type not inited!");
26
+ }
27
+
28
+
29
+ /**
30
+ *
31
+ * get template path of the gallery
32
+ */
33
+ public static function getPathTemplate($template){
34
+ self::validateInited();
35
+ return HelperUG::getPathTemplate($template, GlobalsUGGallery::$pathTemplates);
36
+ }
37
+
38
+ /**
39
+ * get template path from the helper templates folder
40
+ *
41
+ */
42
+ public static function getPathHelperTemplate($template){
43
+
44
+ return HelperUG::getPathTemplate($template, GlobalsUG::$pathHelpersTemplates);
45
+ }
46
+
47
+
48
+
49
+
50
+ /**
51
+ *
52
+ * get view path
53
+ */
54
+ public static function getPathView($view, $validate=true){
55
+ self::validateInited();
56
+ $filepathView = GlobalsUGGallery::$pathViews.$view.".php";
57
+
58
+ if($validate == true)
59
+ UniteFunctionsUG::validateFilepath($filepathView, "View not found");
60
+
61
+ return($filepathView);
62
+ }
63
+
64
+ /**
65
+ *
66
+ * get viewhelper path
67
+ */
68
+ public static function getPathViewHelper($view){
69
+ self::validateInited();
70
+ $filepathViewHelper = GlobalsUG::$pathHelpersViews.$view.".php";
71
+ UniteFunctionsUG::validateFilepath($filepathViewHelper, "View not found");
72
+ return($filepathViewHelper);
73
+ }
74
+
75
+
76
+ /**
77
+ *
78
+ * get filepath of settings file by name
79
+ */
80
+ public static function getFilepathSettings($settingsName){
81
+ self::validateInited();
82
+ $filepathSettings = GlobalsUGGallery::$pathSettings.$settingsName.".php";
83
+ UniteFunctionsUG::validateFilepath($filepathSettings, "Settings file not found");
84
+ return($filepathSettings);
85
+ }
86
+
87
+
88
+ /**
89
+ *
90
+ * get galleries view url
91
+ */
92
+ public static function getUrlViewGalleriesList(){
93
+ $url = HelperUG::getViewUrl(GlobalsUG::VIEW_GALLERIES);
94
+
95
+ return($url);
96
+ }
97
+
98
+
99
+ /**
100
+ *
101
+ * get view gallery settings
102
+ */
103
+ public static function getUrlViewGallery($galleryID = ""){
104
+
105
+ if(empty($galleryID))
106
+ $galleryID = GlobalsUGGallery::$galleryID;
107
+
108
+ $url = HelperUG::getViewUrl(GlobalsUG::VIEW_GALLERY,"id={$galleryID}");
109
+ return($url);
110
+ }
111
+
112
+
113
+ /**
114
+ * get items view
115
+ */
116
+ public static function getUrlViewItems($options=""){
117
+
118
+ $options = "";
119
+ if(empty($options)){
120
+ $galleryID = GlobalsUGGallery::$galleryID;
121
+ $options = "galleryid={$galleryID}";
122
+ }
123
+
124
+ $url = HelperUG::getViewUrl(GlobalsUG::VIEW_ITEMS, $options);
125
+ return($url);
126
+ }
127
+
128
+
129
+
130
+ /**
131
+ *
132
+ * get view gallery settings
133
+ */
134
+ public static function getUrlViewCurrentGallery(){
135
+
136
+ $galleryID = GlobalsUGGallery::$galleryID;
137
+ $url = HelperUG::getViewUrl(GlobalsUG::VIEW_GALLERY,"id={$galleryID}");
138
+ return($url);
139
+ }
140
+
141
+
142
+ /**
143
+ * get view category settings of the current gallery
144
+ * @return string
145
+ */
146
+ public static function getUrlViewCategoryTabs(){
147
+
148
+ $galleryID = GlobalsUGGallery::$galleryID;
149
+
150
+ $url = HelperUG::getViewUrl(GlobalsUG::VIEW_CATEGORY_TABS, "id={$galleryID}");
151
+ return($url);
152
+
153
+ }
154
+
155
+
156
+ /**
157
+ * get view category settings of the current gallery
158
+ * @return string
159
+ */
160
+ public static function getUrlViewAdvanced(){
161
+
162
+ $galleryID = GlobalsUGGallery::$galleryID;
163
+
164
+ $url = HelperUG::getViewUrl(GlobalsUG::VIEW_ADVANCED, "id={$galleryID}");
165
+ return($url);
166
+ }
167
+
168
+
169
+ /**
170
+ *
171
+ * get url ov preview gallery view
172
+ */
173
+ public static function getUrlViewPreview($galleryID = ""){
174
+ if(empty($galleryID)){
175
+ $galleryID = GlobalsUGGallery::$galleryID;
176
+ }
177
+
178
+ UniteFunctionsUG::validateNotEmpty($galleryID, "gallery id");
179
+ $url = HelperUG::getPreviewView($galleryID);
180
+
181
+ return($url);
182
+ }
183
+
184
+
185
+ /**
186
+ * add script to gallery folder
187
+ * should be called from scripts.php file in gallery root folder
188
+ */
189
+ public static function addScript($url, $name){
190
+
191
+ self::addScriptAbsoluteUrl(GlobalsUGGallery::$urlBase.$url, $name);
192
+
193
+ }
194
+
195
+ /**
196
+ * add script absolute url
197
+ */
198
+ public static function addScriptAbsoluteUrl($url, $name){
199
+
200
+ HelperUG::addScriptAbsoluteUrl($url, $name);
201
+
202
+ }
203
+
204
+ /**
205
+ * add style to gallery folder
206
+ * should be called from scripts.php file in gallery root folder
207
+ */
208
+ public static function addStyle($url, $name){
209
+
210
+ self::addStyleAbsoluteUrl(GlobalsUGGallery::$urlBase.$url);
211
+
212
+ }
213
+
214
+
215
+ /**
216
+ * add style absolute url
217
+ */
218
+ public static function addStyleAbsoluteUrl($url, $name){
219
+
220
+ HelperUG::addStyleAbsoluteUrl($url, $name);
221
+
222
+ }
223
+
224
+
225
+ /**
226
+ * add item to javascript text array
227
+ */
228
+ public static function addJsText($name, $text){
229
+
230
+ GlobalsUG::$arrClientSideText[$name] = $text;
231
+
232
+ }
233
+
234
+
235
+ /**
236
+ * get gallery id from html id
237
+ */
238
+ public static function getGalleryIDFromHtmlID($galleryHtmlID){
239
+
240
+ if(empty($galleryHtmlID))
241
+ return("");
242
+
243
+ $arr = explode("_", $galleryHtmlID);
244
+ if(count($arr) < 3)
245
+ return("");
246
+
247
+ $galleryID = $arr[count($arr)-2]; //one before the last
248
+
249
+ return($galleryID);
250
+ }
251
+
252
+
253
+ }
254
+
255
+ ?>
inc_php/unitegallery_item.class.php ADDED
@@ -0,0 +1,686 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @package Unite Gallery
4
+ * @author Valiano
5
+ * @copyright (C) 2012 Unite CMS, All Rights Reserved.
6
+ * @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
7
+ * */
8
+ defined('UNITEGALLERY_INC') or die('Restricted access');
9
+
10
+
11
+ class UniteGalleryItem extends UniteElementsBaseUG{
12
+
13
+ const TYPE_IMAGE = "image";
14
+ const TYPE_YOUTUBE = "youtube";
15
+ const TYPE_VIMEO = "vimeo";
16
+ const TYPE_HTML5VIDEO = "html5video";
17
+ const TYPE_SOUNDCLOUD = "soundcloud";
18
+ const TYPE_WISTIA = "wistia";
19
+
20
+ private $itemTitleBase = "Item";
21
+
22
+ private $id = null;
23
+ private $isInited = false;
24
+ private $title,$data,$type,$urlImage,$urlThumb,$imageID,$alt;
25
+ private $content, $contentID, $params;
26
+ private $isPublished;
27
+
28
+
29
+ /**
30
+ *
31
+ * constructor
32
+ */
33
+ public function __construct(){
34
+ parent::__construct();
35
+ $itemTitleBase = __("Item",UNITEGALLERY_TEXTDOMAIN);
36
+ }
37
+
38
+ /**
39
+ *
40
+ * validate that the item inited
41
+ */
42
+ private function validateInited(){
43
+ if($this->isInited == false)
44
+ UniteFunctionsUG::throwError("The item is not inited!");
45
+ }
46
+
47
+
48
+ /**
49
+ * init item by ID
50
+ */
51
+ public function initByID($id){
52
+
53
+ UniteFunctionsUG::validateNumeric($id, "item id");
54
+
55
+ $record = $this->db->fetchSingle(GlobalsUG::$table_items,"id={$id}");
56
+ $this->initByDBRecord($record);
57
+ }
58
+
59
+
60
+ /**
61
+ * add data to params array by type
62
+ * for better clearance of the item params
63
+ */
64
+ private function initParamsByType(){
65
+
66
+ //set description
67
+ if($this->type != self::TYPE_IMAGE)
68
+ $this->params["description"] = $this->content;
69
+
70
+ //set content id by type
71
+ switch($this->type){
72
+ case self::TYPE_WISTIA:
73
+ case self::TYPE_VIMEO:
74
+ case self::TYPE_YOUTUBE:
75
+ $this->params["videoid"] = $this->contentID;
76
+ break;
77
+ case self::TYPE_SOUNDCLOUD:
78
+ $this->params["trackid"] = $this->contentID;
79
+ break;
80
+ }
81
+
82
+ }
83
+
84
+
85
+ /**
86
+ *
87
+ * init item by db record
88
+ */
89
+ public function initByDBRecord($record){
90
+
91
+ $this->isInited = true;
92
+
93
+ $this->data = $record;
94
+ $jsonParams = UniteFunctionsUG::getVal($record, "params");
95
+
96
+ $this->id = UniteFunctionsUG::getVal($record, "id");
97
+
98
+ $this->params = array();
99
+
100
+ if(!empty($jsonParams))
101
+ $this->params = (array)json_decode($jsonParams);
102
+
103
+ $this->title = UniteFunctionsUG::getVal($record, "title");
104
+
105
+ $this->alt = UniteFunctionsUG::getVal($this->params, "ug_item_alt");
106
+
107
+ $this->imageID = UniteFunctionsUG::getVal($record, "imageid");
108
+ $this->type = UniteFunctionsUG::getVal($record, "type");
109
+ $this->content = UniteFunctionsUG::getVal($record, "content");
110
+ $this->contentID = UniteFunctionsUG::getVal($record, "contentid");
111
+
112
+ $published = UniteFunctionsUG::getVal($record, "published");
113
+ $this->isPublished = UniteFunctionsUG::strToBool($published);
114
+
115
+ //set image by url
116
+ $this->urlImage = UniteFunctionsUG::getVal($record, "url_image");
117
+ if(empty($this->urlImage))
118
+ $this->urlImage = $this->getParam("image");
119
+
120
+ //HelperUG::URLtoFull($this->getParam("image"));
121
+ $this->urlThumb = UniteFunctionsUG::getVal($record, "url_thumb");
122
+ if(empty($this->urlThumb))
123
+ $this->urlThumb = $this->getParam("thumb");
124
+
125
+ if(!empty($this->imageID)){
126
+
127
+ $this->urlImage = UniteProviderFunctionsUG::getImageUrlFromImageID($this->imageID);
128
+ $this->urlThumb = UniteProviderFunctionsUG::getThumbUrlFromImageID($this->imageID);
129
+ }
130
+
131
+ $this->urlImage = HelperUG::URLtoFull($this->urlImage);
132
+ $this->urlThumb = HelperUG::URLtoFull($this->urlThumb);
133
+
134
+ $this->initParamsByType();
135
+
136
+ $this->migrateParamsNewValues();
137
+ }
138
+
139
+
140
+ /**
141
+ * migrate params for new values
142
+ * example: title to ug_item_title
143
+ */
144
+ private function migrateParamsNewValues(){
145
+
146
+ $this->migrateNewValue("title", "ug_item_title");
147
+ $this->migrateNewValue("description", "ug_item_description");
148
+ $this->migrateNewValue("enable_link", "ug_item_enable_link");
149
+ $this->migrateNewValue("link", "ug_item_link");
150
+ $this->migrateNewValue("link_open_in", "ug_item_link_open_in");
151
+
152
+ }
153
+
154
+
155
+ /**
156
+ * migrate the param to new value
157
+ */
158
+ private function migrateNewValue($oldName, $newName){
159
+
160
+ if(is_array($this->params) && array_key_exists($oldName, $this->params) && array_key_exists($newName, $this->params) == false)
161
+ $this->params[$newName] = $this->params[$oldName];
162
+
163
+ }
164
+
165
+
166
+ /**
167
+ * init by data array
168
+ */
169
+ public function initByData($data){
170
+ if(empty($data))
171
+ UniteFunctionsUG::throwError("init item error - the data is empty");
172
+
173
+ $this->isInited = true;
174
+ $this->type = self::TYPE_IMAGE;
175
+
176
+ $this->title = UniteFunctionsUG::getVal($data, "title");
177
+
178
+ $params = array();
179
+ $params["ug_item_description"] = UniteFunctionsUG::getVal($data, "description");
180
+
181
+ $this->alt = UniteFunctionsUG::getVal($data, "alt");
182
+
183
+ $this->imageID = UniteFunctionsUG::getVal($data, "image_id");
184
+ $this->urlImage = UniteFunctionsUG::getVal($data, "url_image");
185
+ $this->urlThumb = UniteFunctionsUG::getVal($data, "url_thumb");
186
+
187
+ if(!empty($this->imageID) && empty($this->urlImage))
188
+ $this->urlImage = UniteProviderFunctionsUG::getImageUrlFromImageID($this->imageID);
189
+
190
+ if(!empty($this->imageID) && empty($this->urlThumb))
191
+ $this->urlThumb = UniteProviderFunctionsUG::getThumbUrlFromImageID($this->imageID);
192
+
193
+ $this->urlImage = HelperUG::URLtoFull($this->urlImage);
194
+ $this->urlThumb = HelperUG::URLtoFull($this->urlThumb);
195
+
196
+ $this->isPublished = true;
197
+
198
+ $this->params = $params;
199
+ }
200
+
201
+
202
+ /**
203
+ *
204
+ * get some param
205
+ */
206
+ public function getParam($name, $defaultValue = ""){
207
+ $this->validateInited();
208
+ $value = UniteFunctionsUG::getVal($this->params, $name, $defaultValue);
209
+ return($value);
210
+ }
211
+
212
+
213
+ /**
214
+ * get item params plus title and alias for settings
215
+ */
216
+ private function getArrValues(){
217
+ $this->validateInited();
218
+ $arrValues = $this->params;
219
+
220
+ $arrValues["ug_item_title"] = $this->title;
221
+ $arrValues["ug_item_alias"] = $this->getAlias();
222
+
223
+ $arrValues["title"] = $this->title;
224
+ $arrValues["alias"] = $this->getAlias();
225
+
226
+ //set old style values comatability
227
+ $arrValues["ug_item_title"] = $this->title;
228
+
229
+ return($arrValues);
230
+ }
231
+
232
+
233
+
234
+ /**
235
+ * get item settings object
236
+ */
237
+ public function getObjSettings(){
238
+ $this->validateInited();
239
+ $arrValues = $this->getArrValues();
240
+
241
+ //get settingItem object
242
+ require GlobalsUG::$filepathItemSettings;
243
+
244
+ $settingsItem->setStoredValues($arrValues);
245
+
246
+ return($settingsItem);
247
+ }
248
+
249
+
250
+ /**
251
+ * get item alias
252
+ */
253
+ public function getAlias(){
254
+ $this->validateInited();
255
+ $alias = UniteFunctionsUG::getVal($this->data, "alias");
256
+ return($alias);
257
+ }
258
+
259
+
260
+ /**
261
+ * get item type
262
+ */
263
+ public function getType(){
264
+ $this->validateInited();
265
+ return($this->type);
266
+ }
267
+
268
+
269
+ /**
270
+ * get item title
271
+ */
272
+ public function getTitle(){
273
+
274
+ $this->validateInited();
275
+
276
+ return($this->title);
277
+ }
278
+
279
+ /**
280
+ * get data title for output, if the image has alt, return the title
281
+ */
282
+ public function getDataTitleForOutput(){
283
+
284
+ $this->validateInited();
285
+
286
+ if(empty($this->alt))
287
+ return("");
288
+
289
+ if(empty($this->title))
290
+ return($this->alt);
291
+
292
+ return($this->title);
293
+ }
294
+
295
+ /**
296
+ * get alt text
297
+ */
298
+ public function getAlt(){
299
+
300
+ $this->validateInited();
301
+
302
+ if(!empty($this->alt))
303
+ return($this->alt);
304
+
305
+ return($this->title);
306
+ }
307
+
308
+ /**
309
+ *
310
+ * get url image
311
+ */
312
+ public function getUrlImage($thumbSize = ""){
313
+
314
+ if(empty($thumbSize) || $thumbSize == "full")
315
+ return($this->urlImage);
316
+ else
317
+ return($this->getUrlThumb($thumbSize));
318
+ }
319
+
320
+
321
+ /**
322
+ *
323
+ * get thumb url
324
+ */
325
+ public function getUrlThumb($thumbSize = ""){
326
+
327
+ $thumbSize = trim($thumbSize);
328
+ if(empty($thumbSize))
329
+ return($this->urlThumb);
330
+
331
+ //get thumb url by image url
332
+ if(empty($this->imageID)){
333
+
334
+ if($thumbSize == "full")
335
+ return($this->urlImage);
336
+
337
+ if(method_exists("UniteProviderFunctionsUG", "getThumbWidth") == false)
338
+ return($this->urlThumb);
339
+
340
+ $thumbWidth = UniteProviderFunctionsUG::getThumbWidth($thumbSize);
341
+ $operations = new UGOperations();
342
+
343
+ try{
344
+
345
+ $urlThumb = $operations->createThumbs($this->urlImage, $thumbWidth);
346
+ $urlThumb = HelperUG::URLtoFull($urlThumb);
347
+
348
+ }catch(Exception $error){
349
+ if(!empty($this->urlThumb))
350
+ return($this->urlThumb);
351
+
352
+ throw new Error($error);
353
+ }
354
+
355
+ return($urlThumb);
356
+ }else{ //with image id
357
+
358
+ if(method_exists("UniteProviderFunctionsUG", "getThumbUrlFromImageID")){
359
+ $urlThumb = UniteProviderFunctionsUG::getThumbUrlFromImageID($this->imageID, $thumbSize);
360
+ if(!empty($urlThumb)){
361
+ $urlThumb = HelperUG::URLtoFull($urlThumb);
362
+ return($urlThumb);
363
+ }
364
+ }
365
+ }
366
+
367
+
368
+ return($this->urlThumb);
369
+ }
370
+
371
+
372
+ /**
373
+ *
374
+ * get params
375
+ */
376
+ public function getParams(){
377
+ return($this->params);
378
+ }
379
+
380
+
381
+ /**
382
+ * get item data including params
383
+ */
384
+ public function getData(){
385
+ $this->validateInited();
386
+
387
+ $data = array();
388
+
389
+ //merge params
390
+ $data = array_merge($data, $this->params);
391
+
392
+ //fill with item data
393
+ $data["id"] = $this->id;
394
+ $data["title"] = $this->title;
395
+ $data["type"] = $this->type;
396
+ $data["url_image"] = $this->urlImage;
397
+ $data["url_thumb"] = $this->urlThumb;
398
+ $data["image_id"] = $this->imageID;
399
+ $data["is_published"] = $this->isPublished;
400
+ $data["alias"] = $this->getAlias();
401
+
402
+ return($data);
403
+ }
404
+
405
+ /**
406
+ * get additional item insert data from media items
407
+ */
408
+ private function getAddDataFromMedia($data, $arrInsert){
409
+
410
+ $params = array();
411
+ $contentID = "";
412
+ $type = UniteFunctionsUG::getVal($data, "type");
413
+
414
+ $content = UniteFunctionsUG::getVal($data, "description");
415
+
416
+ switch($type){
417
+ case self::TYPE_YOUTUBE:
418
+ case self::TYPE_VIMEO:
419
+ case self::TYPE_WISTIA:
420
+ $contentID = UniteFunctionsUG::getVal($data, "videoid");
421
+ break;
422
+ case self::TYPE_HTML5VIDEO:
423
+ $params["video_mp4"] = UniteFunctionsUG::getVal($data, "urlVideo_mp4");
424
+ $params["video_webm"] = UniteFunctionsUG::getVal($data, "urlVideo_webm");
425
+ $params["video_ogv"] = UniteFunctionsUG::getVal($data, "urlVideo_ogv");
426
+ break;
427
+ default:
428
+ UniteFunctionsUG::throwError("Wrong media type: ".$type);
429
+ break;
430
+ }
431
+
432
+ $arrInsert["contentid"] = trim($contentID);
433
+ $arrInsert["content"] = trim($content);
434
+
435
+ if(!empty($params))
436
+ $arrInsert["params"] = $params;
437
+
438
+ return($arrInsert);
439
+ }
440
+
441
+
442
+ /**
443
+ *
444
+ * add item to database from data, init the item on the way by the record.
445
+ * return item id
446
+ */
447
+ public function add($data){
448
+
449
+ $catID = UniteFunctionsUG::getVal($data, "catID");
450
+
451
+ $type = UniteFunctionsUG::getVal($data, "type");
452
+
453
+ $params = "";
454
+
455
+ $urlImage = UniteFunctionsUG::getVal($data, "urlImage");
456
+ $urlImage = HelperUG::URLtoRelative($urlImage);
457
+
458
+ $urlThumb = UniteFunctionsUG::getVal($data, "urlThumb");
459
+ $urlThumb = HelperUG::URLtoRelative($urlThumb);
460
+
461
+
462
+ //get max items order
463
+ $items = new UniteGalleryItems();
464
+ $maxOrder = $items->getMaxOrder($catID);
465
+
466
+ $arrInsert = array();
467
+ $arrInsert["type"] = $type;
468
+ $arrInsert["published"] = 1;
469
+ $arrInsert["ordering"] = $maxOrder+1;
470
+ $arrInsert["catid"] = $catID;
471
+ $arrInsert["url_image"] = $urlImage;
472
+ $arrInsert["url_thumb"] = $urlThumb;
473
+ $arrInsert["imageid"] = 0;
474
+
475
+ $arrParams = array();
476
+
477
+ switch($type){
478
+ case self::TYPE_IMAGE:
479
+
480
+ $urlImage = UniteFunctionsUG::getVal($data, "urlImage");
481
+ $arrInsert["catid"] = $catID;
482
+
483
+ //set params
484
+ $title = HelperUG::getTitleFromUrl($urlImage, $this->itemTitleBase);
485
+ $imageID = UniteFunctionsUG::getVal($data, "imageID" , 0);
486
+
487
+ $arrInsert["imageid"] = $imageID;
488
+
489
+ //get title from attachment
490
+ if(!empty($imageID)){
491
+ $data = null;
492
+
493
+ if(method_exists("UniteProviderFunctionsUG", "getImageDataFromImageID"))
494
+ $data = UniteProviderFunctionsUG::getImageDataFromImageID($imageID);
495
+
496
+ //set title from image meta
497
+ $dataTitle = UniteFunctionsUG::getVal($data, "title");
498
+ if(!empty($dataTitle))
499
+ $title = $dataTitle;
500
+
501
+ //set decription from image meta
502
+ $dataDesc = UniteFunctionsUG::getVal($data, "description");
503
+ if(!empty($dataDesc))
504
+ $arrParams["ug_item_description"] = $dataDesc;
505
+
506
+ }
507
+
508
+ break;
509
+ default: //add media item
510
+ $title = UniteFunctionsUG::getVal($data, "title");
511
+ $arrInsert = $this->getAddDataFromMedia($data, $arrInsert);
512
+ break;
513
+
514
+ }
515
+
516
+ UniteFunctionsUG::validateNotEmpty($title, "title");
517
+
518
+ $arrInsert["title"] = $title;
519
+
520
+ //add params
521
+ $arrParamsExisting = UniteFunctionsUG::getVal($arrInsert, "params");
522
+ if(is_array($arrParamsExisting))
523
+ $arrParams = array_merge($arrParams, $arrParamsExisting);
524
+
525
+ $jsonParams = json_encode($arrParams);
526
+ $arrInsert["params"] = $jsonParams;
527
+
528
+ //insert the category
529
+ $itemID = $this->db->insert(GlobalsUG::$table_items, $arrInsert);
530
+
531
+ $arrInsert["id"] = $itemID;
532
+ $this->initByDBRecord($arrInsert);
533
+
534
+ return($itemID);
535
+ }
536
+
537
+
538
+ /**
539
+ *
540
+ * get html for admin browsing
541
+ */
542
+ public function getHtmlForAdmin(){
543
+ $this->validateInited();
544
+
545
+ $title = $this->title;
546
+
547
+ $title_small = UniteFunctionsUG::limitStringSize($title, 25);
548
+
549
+ $title = htmlspecialchars($title);
550
+ $title_small = htmlspecialchars($title_small);
551
+
552
+ $itemID = $this->id;
553
+
554
+ //set thumb
555
+ $urlThumb = $this->urlThumb;
556
+
557
+ $style = "";
558
+ $imageText = "";
559
+ if(!empty($urlThumb)){
560
+ $urlThumb = addslashes($urlThumb);
561
+
562
+ $style = "style=\"background-image:url('{$urlThumb}')\"";
563
+ }
564
+ else{
565
+ $imageText = __("No Image",UNITEGALLERY_TEXTDOMAIN);
566
+ }
567
+
568
+ $urlImage = $this->urlImage;
569
+
570
+ $type = $this->type;
571
+
572
+ $addHtml = "";
573
+ switch($this->type){
574
+ case self::TYPE_VIMEO:
575
+ case self::TYPE_YOUTUBE:
576
+ case self::TYPE_WISTIA:
577
+ $videoID = $this->getParam("videoid");
578
+ $addHtml = "data-videoid=\"{$videoID}\"";
579
+ break;
580
+ case self::TYPE_HTML5VIDEO:
581
+ $videoMp4 = $this->getParam("video_mp4");
582
+ $videoWebm = $this->getParam("video_webm");
583
+ $videoOgv = $this->getParam("video_ogv");
584
+
585
+ $addHtml = "data-mp4=\"{$videoMp4}\" data-webm=\"{$videoWebm}\" data-ogv=\"{$videoOgv}\"";
586
+
587
+ break;
588
+ }
589
+
590
+ //set html output
591
+ $htmlItem = "<li id=\"ug_item_{$itemID}\" class=\"item_type_{$type}\" data-id=\"{$itemID}\" data-title=\"{$title}\" data-image=\"{$urlImage}\" data-type=\"{$type}\" {$addHtml} >";
592
+ $htmlItem .= " <div class=\"ug-item-title unselectable\" unselectable=\"on\">{$title_small}</div>";
593
+ $htmlItem .= " <div class=\"ug-item-image unselectable\" unselectable=\"on\" {$style}>{$imageText}</div>";
594
+ $htmlItem .= " <div class=\"ug-item-icon unselectable\" unselectable=\"on\"></div>";
595
+ $htmlItem .= "</li>";
596
+
597
+ return($htmlItem);
598
+ }
599
+
600
+
601
+ /**
602
+ *
603
+ * update item data image in db
604
+ */
605
+ private function updateItemData_image($data){
606
+
607
+ $newParams = UniteFunctionsUG::getVal($data, "params");
608
+ if(is_array($newParams) == false)
609
+ $newParams = array();
610
+
611
+ $updateParams = array_merge($this->params, $newParams);
612
+
613
+ $title = UniteFunctionsUG::getVal($updateParams, "ug_item_title");
614
+ UniteFunctionsUG::validateNotEmpty($title, "Item Title");
615
+
616
+ $jsonUpdateParams = json_encode($updateParams);
617
+
618
+ $arrUpdate = array();
619
+
620
+ $arrUpdate["title"] = $title;
621
+ $arrUpdate["params"] = $jsonUpdateParams;
622
+
623
+ $this->data = array_merge($arrUpdate, $this->data);
624
+
625
+ $this->db->update(GlobalsUG::$table_items,$arrUpdate,array("id"=>$this->id));
626
+
627
+ $this->initByDBRecord($this->data);
628
+ }
629
+
630
+
631
+ /**
632
+ * update item data - media in db
633
+ */
634
+ private function updateItemData_media($data){
635
+
636
+ $title = UniteFunctionsUG::getVal($data, "title");
637
+ UniteFunctionsUG::validateNotEmpty($title, "Item Title");
638
+
639
+ $type = UniteFunctionsUG::getVal($data, "type");
640
+
641
+ $urlImage = UniteFunctionsUG::getVal($data, "urlImage");
642
+ $urlThumb = UniteFunctionsUG::getVal($data, "urlThumb");
643
+
644
+ $arrUpdate = array();
645
+
646
+ $arrUpdate["type"] = $type;
647
+ $arrUpdate["url_image"] = HelperUG::URLtoRelative($urlImage);
648
+ $arrUpdate["url_thumb"] = HelperUG::URLtoRelative($urlThumb);
649
+ $arrUpdate["title"] = trim($title);
650
+
651
+ $arrUpdate = $this->getAddDataFromMedia($data, $arrUpdate);
652
+
653
+ $arrParams = UniteFunctionsUG::getVal($arrUpdate, "params");
654
+ if(is_array($arrParams))
655
+ $arrUpdate["params"] = json_encode($arrParams);
656
+
657
+ $this->db->update(GlobalsUG::$table_items,$arrUpdate,array("id"=>$this->id));
658
+
659
+ //init the item again from the new record
660
+ $this->data = array_merge($this->data, $arrUpdate);
661
+
662
+ $this->initByDBRecord($this->data);
663
+ }
664
+
665
+
666
+ /**
667
+ * update item data
668
+ */
669
+ public function updateItemData($data){
670
+
671
+ $this->validateInited();
672
+
673
+ switch($this->type){
674
+ case self::TYPE_IMAGE:
675
+ $this->updateItemData_image($data);
676
+ break;
677
+ default: //update media item
678
+ $this->updateItemData_media($data);
679
+ break;
680
+ }
681
+
682
+ }
683
+
684
+ }
685
+
686
+ ?>
inc_php/unitegallery_items.class.php ADDED
@@ -0,0 +1,1090 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @package Unite Gallery
4
+ * @author Valiano
5
+ * @copyright (C) 2012 Unite CMS, All Rights Reserved.
6
+ * @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
7
+ * */
8
+ defined('UNITEGALLERY_INC') or die('Restricted access');
9
+
10
+
11
+ class UniteGalleryItems extends UniteElementsBaseUG{
12
+
13
+ private $operations;
14
+ private static $arrTotalItems = array(); //total items cache
15
+
16
+
17
+ /**
18
+ * constructor
19
+ */
20
+ public function __construct(){
21
+ parent::__construct();
22
+ $this->operations = new UGOperations();
23
+ }
24
+
25
+
26
+ /**
27
+ *
28
+ * update item
29
+ */
30
+ private function update($itemID,$arrUpdate){
31
+
32
+ $this->db->update(GlobalsUG::$table_items,$arrUpdate,array("id"=>$itemID));
33
+ }
34
+
35
+
36
+ private function a____________GETTERS_____________(){}
37
+
38
+
39
+ /**
40
+ *
41
+ * get items by id's
42
+ */
43
+ private function getItemsByIDs($itemIDs){
44
+ $strItems = implode(",", $itemIDs);
45
+ $tableItems = GlobalsUG::$table_items;
46
+ $sql = "select * from {$tableItems} where id in({$strItems})";
47
+ $arrItems = $this->db->fetchSql($sql);
48
+
49
+ return($arrItems);
50
+ }
51
+
52
+
53
+
54
+
55
+ /**
56
+ *
57
+ * get html of cate items
58
+ */
59
+ public function getCatItemsHtml($catID){
60
+
61
+ $items = $this->getCatItems($catID);
62
+
63
+ $htmlItems = "";
64
+
65
+ foreach($items as $item){
66
+ $html = $item->getHtmlForAdmin();
67
+ $htmlItems .= $html;
68
+ }
69
+
70
+ return($htmlItems);
71
+ }
72
+
73
+
74
+
75
+
76
+ /**
77
+ * get category orderby
78
+ */
79
+ private function getCatOrderby($catID){
80
+ $catID = (int)$catID;
81
+
82
+ //get ordering
83
+ $objCat = new UniteGalleryCategory();
84
+ $objCat->initByID($catID);
85
+
86
+ $sortby = $objCat->getSortby();
87
+
88
+ $orderBy = "ordering";
89
+ switch($sortby){
90
+ case "title_asc":
91
+ $orderBy = "title asc";
92
+ break;
93
+ case "title_desc":
94
+ $orderBy = "title desc";
95
+ break;
96
+ }
97
+
98
+ return($orderBy);
99
+ }
100
+
101
+
102
+
103
+ /**
104
+ *
105
+ * get max order from categories list
106
+ */
107
+ public function getMaxOrder($catID){
108
+
109
+ UniteFunctionsUG::validateNotEmpty($catID,"category id");
110
+
111
+ $tableItems = GlobalsUG::$table_items;
112
+ $query = "select MAX(ordering) as maxorder from {$tableItems} where catid={$catID}";
113
+
114
+ ///$query = "select * from ".self::TABLE_CATEGORIES;
115
+ $rows = $this->db->fetchSql($query);
116
+
117
+ $maxOrder = 0;
118
+ if(count($rows)>0) $maxOrder = $rows[0]["maxorder"];
119
+
120
+ if(!is_numeric($maxOrder))
121
+ $maxOrder = 0;
122
+
123
+ return($maxOrder);
124
+ }
125
+
126
+ /**
127
+ *
128
+ * get item data html for edit item
129
+ */
130
+ private function getItemSettingsHtml($objItem){
131
+
132
+ $settingsItem = $objItem->getObjSettings();
133
+
134
+ $output = new UniteSettingsProductUG();
135
+ $output->init($settingsItem);
136
+ $output->setShowDescAsTips(true);
137
+ $output->setShowSaps(false);
138
+
139
+ ob_start();
140
+ $output->draw("form_item_settings", true);
141
+ $html = ob_get_contents();
142
+ ob_clean();
143
+
144
+ $response = array();
145
+ $response["htmlSettings"] = $html;
146
+
147
+ return($response);
148
+ }
149
+
150
+
151
+ /**
152
+ * for image, get settings html
153
+ * for media get data object
154
+ */
155
+ public function getItemData($data){
156
+
157
+ $itemID = UniteFunctionsUG::getVal($data, "itemid");
158
+ $objItem = new UniteGalleryItem();
159
+ $objItem->initByID($itemID);
160
+ $itemType = $objItem->getType();
161
+
162
+ switch($itemType){
163
+ case UniteGalleryItem::TYPE_IMAGE:
164
+ $response = $this->getItemSettingsHtml($objItem);
165
+ break;
166
+ default:
167
+ $response = $objItem->getData();
168
+ break;
169
+ }
170
+
171
+ return($response);
172
+ }
173
+
174
+
175
+ /**
176
+ *
177
+ * get html of categories and items.
178
+ */
179
+ private function getCatsAndItemsHtml($catID){
180
+
181
+ $htmlItems = $this->getCatItemsHtml($catID);
182
+ $objCats = new UniteGalleryCategories();
183
+ $htmlCatList = $objCats->getHtmlCatList($catID);
184
+
185
+ $response = array();
186
+ $response["htmlItems"] = $htmlItems;
187
+ $response["htmlCats"] = $htmlCatList;
188
+
189
+ return($response);
190
+ }
191
+
192
+
193
+ /**
194
+ *
195
+ * get category items html
196
+ */
197
+ public function getCatItemsHtmlFromData($data){
198
+
199
+ $catID = UniteFunctionsUG::getVal($data, "catID");
200
+ UniteFunctionsUG::validateNumeric($catID,"category id");
201
+ $itemsHtml = $this->getCatItemsHtml($catID);
202
+
203
+ $response = array("itemsHtml"=>$itemsHtml);
204
+
205
+ return($response);
206
+ }
207
+
208
+ private function a____________GET_ITEMS_____________(){}
209
+
210
+
211
+ /**
212
+ * get items from array of items
213
+ */
214
+ public function getItemsFromArray($arrData){
215
+
216
+ $arrItems = array();
217
+ foreach($arrData as $data){
218
+
219
+ $item = new UniteGalleryItem();
220
+ $item->initByData($data);
221
+
222
+ $arrItems[] = $item;
223
+ }
224
+
225
+ return($arrItems);
226
+ }
227
+
228
+
229
+ /**
230
+ * get items array from records array
231
+ */
232
+ private function getItemsFromRecords($records){
233
+
234
+ $arrItems = array();
235
+ foreach($records as $record){
236
+ $objItem = new UniteGalleryItem();
237
+ $objItem->initByDBRecord($record);
238
+ $arrItems[] = $objItem;
239
+ }
240
+
241
+ return($arrItems);
242
+ }
243
+
244
+
245
+ /**
246
+ * get records of some category
247
+ */
248
+ private function getCatItemsRecords($catID){
249
+ $catID = (int)$catID;
250
+
251
+ $cat = new UniteGalleryCategories();
252
+ $cat->validateCatExist($catID);
253
+
254
+ $orderBy = $this->getCatOrderby($catID);
255
+
256
+ $records = $this->db->fetch(GlobalsUG::$table_items, "catid=$catID", $orderBy);
257
+
258
+ return($records);
259
+ }
260
+
261
+
262
+ /**
263
+ * get paging limit
264
+ */
265
+ private function getPagingLimit($totalItems, $maxItems, $minItems){
266
+
267
+ $maxItems = (int)$maxItems;
268
+ $minItems = (int)$minItems;
269
+
270
+ //validate
271
+ if($maxItems < $minItems)
272
+ UniteFunctionsUG::throwError("Max items $minItems should be bigger then min items $minItems");
273
+
274
+ if($totalItems < $maxItems)
275
+ return($totalItems);
276
+
277
+ $remain = $totalItems-$maxItems;
278
+ if($remain > $minItems)
279
+ return($maxItems);
280
+
281
+ //take ultimate number of items
282
+ $limit = $totalItems - $minItems;
283
+ if($limit < $minItems)
284
+ $limit = $minItems;
285
+
286
+ return($limit);
287
+ }
288
+
289
+
290
+ /**
291
+ * get records of some category
292
+ */
293
+ private function getCatItemsRecordsLimit($catID, $maxItems, $minItems){
294
+ $catID = (int)$catID;
295
+
296
+ $cat = new UniteGalleryCategories();
297
+ $cat->validateCatExist($catID);
298
+
299
+ $orderBy = $this->getCatOrderby($catID);
300
+
301
+ $where = "catid=$catID";
302
+
303
+ $totalItems = $this->getTotalCatItems($catID);
304
+
305
+ $limit = $this->getPagingLimit($totalItems, $maxItems, $minItems);
306
+
307
+ if($limit >= $totalItems)
308
+ $records = $this->db->fetch(GlobalsUG::$table_items, $where, $orderBy);
309
+ else
310
+ $records = $this->db->fetchOffset(GlobalsUG::$table_items, 0, $limit, $where, $orderBy);
311
+
312
+ return($records);
313
+ }
314
+
315
+
316
+ /**
317
+ * get category items with some offset and limit
318
+ */
319
+ private function getCatItemsOffset($catID, $offset, $limit){
320
+
321
+ $catID = (int)$catID;
322
+
323
+ $cat = new UniteGalleryCategories();
324
+ $cat->validateCatExist($catID);
325
+
326
+ $orderBy = $this->getCatOrderby($catID);
327
+
328
+ $where = "catid=$catID";
329
+
330
+ $records = $this->db->fetchOffset(GlobalsUG::$table_items, $offset, $limit, $where, $orderBy);
331
+
332
+ $arrItems = $this->getItemsFromRecords($records);
333
+
334
+ return($arrItems);
335
+ }
336
+
337
+
338
+ /**
339
+ * get category items
340
+ */
341
+ public function getCatItemsLimit($catID, $maxItems, $minItems){
342
+ $catID = (int)$catID;
343
+
344
+ $records = $this->getCatItemsRecordsLimit($catID, $maxItems, $minItems);
345
+
346
+ $arrItems = $this->getItemsFromRecords($records);
347
+
348
+ return($arrItems);
349
+ }
350
+
351
+
352
+ /**
353
+ * get total items by category
354
+ */
355
+ public function getTotalCatItems($catID){
356
+ $catID = (int)$catID;
357
+ $key = "cat_".$catID;
358
+ if(isset(self::$arrTotalItems[$key]))
359
+ return(self::$arrTotalItems[$key]);
360
+
361
+ $where = "catid=$catID";
362
+
363
+ $totalItems = $this->db->getTotalRows(GlobalsUG::$table_items, $where);
364
+
365
+ self::$arrTotalItems[$key] = $totalItems; //cache
366
+
367
+ return($totalItems);
368
+ }
369
+
370
+
371
+ /**
372
+ * get category items
373
+ */
374
+ public function getCatItems($catID){
375
+ $catID = (int)$catID;
376
+
377
+ $records = $this->getCatItemsRecords($catID);
378
+
379
+ $arrItems = $this->getItemsFromRecords($records);
380
+
381
+ return($arrItems);
382
+ }
383
+
384
+
385
+ private function a____________HTML_FRONT_____________(){}
386
+
387
+ /**
388
+ * get video add html
389
+ */
390
+ public function getVideoAddHtml($type, $objItem){
391
+
392
+ $addHtml = "";
393
+ switch($type){
394
+ case UniteGalleryItem::TYPE_YOUTUBE:
395
+ case UniteGalleryItem::TYPE_VIMEO:
396
+ case UniteGalleryItem::TYPE_WISTIA:
397
+ $videoID = $objItem->getParam("videoid");
398
+ $addHtml .= "data-videoid=\"{$videoID}\" ";
399
+ break;
400
+ case UniteGalleryItem::TYPE_HTML5VIDEO:
401
+ $urlMp4 = $objItem->getParam("video_mp4");
402
+ $urlWebm = $objItem->getParam("video_webm");
403
+ $urlOgv = $objItem->getParam("video_ogv");
404
+
405
+ $addHtml .= "data-videomp4=\"{$urlMp4}\" ";
406
+ $addHtml .= "data-videowebm=\"{$urlWebm}\" ";
407
+ $addHtml .= "data-videoogv=\"{$urlOgv}\" ";
408
+
409
+ break;
410
+ }
411
+
412
+ return($addHtml);
413
+ }
414
+
415
+
416
+ /**
417
+ * get front html of items array
418
+ */
419
+ public function getItemsHtmlFront($arrItems, $thumbSize = "", $bigImageSize="", $isTilesType = false, $thumbSizeMobile = "", $bigImageSizeMobile = ""){
420
+
421
+ $tab = " ";
422
+ $nl = "\n".$tab;
423
+
424
+ $totalHTML = "";
425
+ $counter = 0;
426
+
427
+ foreach($arrItems as $objItem):
428
+
429
+ if($isTilesType && $counter >= 20)
430
+ break;
431
+ else
432
+ if($isTilesType == false && $counter >= 12)
433
+ break;
434
+
435
+ $counter++;
436
+
437
+ $urlImage = $objItem->getUrlImage($bigImageSize);
438
+ $urlThumb = $objItem->getUrlThumb($thumbSize);
439
+
440
+ //set mobile thumb and image settings
441
+ $urlImageMobile = "";
442
+ if(!empty($bigImageSizeMobile) && $bigImageSizeMobile != $bigImageSize){
443
+
444
+ $urlImageMobile = $objItem->getUrlImage($bigImageSizeMobile);
445
+ if($urlImageMobile === $urlImage)
446
+ $urlImageMobile = "";
447
+ }
448
+
449
+ $urlThumbMobile = "";
450
+ if(!empty($thumbSizeMobile) && $thumbSizeMobile != $thumbSize){
451
+
452
+ $urlThumbMobile = $objItem->getUrlThumb($thumbSizeMobile);
453
+ if($urlThumbMobile == $urlThumb)
454
+ $urlThumbMobile = "";
455
+ }
456
+
457
+ //set other options
458
+ $type = $objItem->getType();
459
+ $alt = $objItem->getAlt();
460
+ $dataTitle = $objItem->getDataTitleForOutput();
461
+
462
+ $description = $objItem->getParam("ug_item_description");
463
+
464
+ $enableLink = $objItem->getParam("ug_item_enable_link");
465
+ $enableLink = UniteFunctionsUG::strToBool($enableLink);
466
+
467
+ //combine description
468
+ if($enableLink == true){
469
+ $link = $objItem->getParam("ug_item_link");
470
+ }
471
+
472
+ $description = htmlspecialchars($description);
473
+ $alt = htmlspecialchars($alt);
474
+ $dataTitle = htmlspecialchars($dataTitle);
475
+
476
+ $strType = "";
477
+ if($type != UniteGalleryItem::TYPE_IMAGE){
478
+ $strType = "data-type=\"{$type}\" ";
479
+ }
480
+
481
+ $addHtml = $this->getVideoAddHtml($type, $objItem);
482
+
483
+ //set link (on tiles mode)
484
+ $linkStart = "";
485
+ $linkEnd = "";
486
+ if($enableLink == true){
487
+ $linkStart = "<a href=\"{$link}\">";
488
+ $linkEnd = "</a>";
489
+ }
490
+
491
+ $html = "\n";
492
+
493
+ //set html output
494
+ $srcOutputType = HelperUG::getGeneralSetting("src_output_type");
495
+ switch($srcOutputType){
496
+ case "empty":
497
+ $htmlSrc = "";
498
+ $htmlDataImage = " data-image=\"{$urlImage}\"";
499
+ $htmlDataThumb = "data-thumb=\"{$urlThumb}\"";
500
+ break;
501
+ case "image":
502
+ $htmlSrc = $urlImage;
503
+ $htmlDataImage = "";
504
+ $htmlDataThumb = "data-thumb=\"{$urlThumb}\"";
505
+ break;
506
+ case "thumb":
507
+ $htmlSrc = $urlThumb;
508
+ $htmlDataImage = " data-image=\"{$urlImage}\"";
509
+ $htmlDataThumb = "";
510
+ break;
511
+ default:
512
+ UniteFunctionsUG::throwError("Wrong src output type: $srcOutputType");
513
+ break;
514
+ }
515
+ if($linkStart)
516
+ $html .= $nl.$linkStart;
517
+
518
+ $html .= $nl."<img alt=\"{$alt}\"";
519
+ $html .= $nl." {$strType} src=\"{$htmlSrc}\"{$htmlDataImage}";
520
+
521
+ if(!empty($urlImageMobile))
522
+ $html .= $nl." data-image-mobile=\"{$urlImageMobile}\"";
523
+
524
+ if(!empty($htmlDataThumb))
525
+ $html .= $nl." {$htmlDataThumb}";
526
+
527
+ if(!empty($urlThumbMobile))
528
+ $html .= $nl." data-thumb-mobile=\"{$urlThumbMobile}\"";
529
+ $html .= $nl." title=\"{$description}\"";
530
+
531
+ if(!empty($dataTitle))
532
+ $html .= $nl." data-title=\"{$dataTitle}\"";
533
+
534
+ $html .= $nl." {$addHtml}style=\"display:none\">";
535
+
536
+ if($linkEnd)
537
+ $html .= $nl.$linkEnd;
538
+
539
+ $totalHTML .= $html;
540
+
541
+ endforeach;
542
+
543
+ return($totalHTML);
544
+
545
+ }
546
+
547
+
548
+ /**
549
+ * get front html from items array
550
+ */
551
+ private function getGalleryCatItemsHtmlFront($arrItems, $gallery){
552
+
553
+ //get thumb size
554
+ $thumbSize = $gallery->getParam("thumb_resolution");
555
+ $bigImageSize = $gallery->getParam("big_image_resolution");
556
+
557
+ $thumbSizeMobile = $gallery->getParam("thumb_resolution_mobile");
558
+ $bigImageSizeMobile = $gallery->getParam("big_image_resolution_mobile");
559
+
560
+ $isTilesType = $gallery->isTilesType();
561
+ //get items html
562
+ $htmlItems = $this->getItemsHtmlFront($arrItems, $thumbSize, $bigImageSize, $isTilesType, $thumbSizeMobile, $bigImageSizeMobile);
563
+
564
+ return($htmlItems);
565
+ }
566
+
567
+
568
+
569
+ /**
570
+ * get loadmore
571
+ */
572
+ public function getHtmlLoadmore($data){
573
+
574
+ $galleryID = UniteFunctionsUG::getVal($data, "galleryID");
575
+
576
+ $numLoadedItems = UniteFunctionsUG::getVal($data, "numitems",0);
577
+ $numLoadedItems = (int)$numLoadedItems;
578
+
579
+ $gallery = new UniteGalleryGallery();
580
+ $gallery->initByID($galleryID);
581
+ $catID = $gallery->getCatID();
582
+
583
+ UniteFunctionsUG::validateNumeric($catID, "category id");
584
+
585
+ $enableLoadmore = $gallery->getParam("show_loadmore");
586
+ $enableLoadmore = UniteFunctionsUG::strToBool($enableLoadmore);
587
+
588
+ if($enableLoadmore == false)
589
+ UniteFunctionsUG::throwError("Load more feature disabled in this gallery");
590
+
591
+ $maxItems = $gallery->getParam("loadmore_max_items");
592
+ $minItems = $gallery->getParam("loadmore_min_items");
593
+
594
+ $maxItems = (int)$maxItems;
595
+ $minItems = (int)$minItems;
596
+
597
+ $totalItems = $this->getTotalCatItems($catID);
598
+ $remainingItems = $totalItems - $numLoadedItems;
599
+
600
+ if($remainingItems <= 0)
601
+ return(array());
602
+
603
+ $limit = $this->getPagingLimit($remainingItems, $maxItems, $minItems);
604
+
605
+ $arrItems = $this->getCatItemsOffset($catID, $numLoadedItems, $limit);
606
+
607
+ //get show loadmore
608
+ $numItems = count($arrItems);
609
+ $totalItemsLoaded = $numLoadedItems + $numItems;
610
+ $showLoadmore = true;
611
+
612
+
613
+ if($totalItemsLoaded >= $totalItems)
614
+ $showLoadmore = false;
615
+
616
+ $htmlItems = $this->getGalleryCatItemsHtmlFront($arrItems, $gallery);
617
+
618
+ $output = array();
619
+ $output["show_loadmore"] = $showLoadmore;
620
+ $output["html_items"] = $htmlItems;
621
+
622
+ return($output);
623
+ }
624
+
625
+
626
+ /**
627
+ * get front html from data
628
+ */
629
+ public function getHtmlFrontFromData($data){
630
+
631
+ $catID = UniteFunctionsUG::getVal($data, "catid");
632
+ $galleryID = UniteFunctionsUG::getVal($data, "galleryID");
633
+
634
+ UniteFunctionsUG::validateNumeric($catID, "category id");
635
+
636
+ if(empty($galleryID))
637
+ UniteFunctionsUG::throwError("The gallery ID not given");
638
+
639
+ //get thumb resolution param from the gallery
640
+ $gallery = new UniteGalleryGallery();
641
+ $gallery->initByID($galleryID);
642
+
643
+ //validate if enable categories
644
+ $enableCatTabs = $gallery->getParam('enable_category_tabs');
645
+ $enableCatTabs = UniteFunctionsUG::strToBool($enableCatTabs);
646
+
647
+ if($enableCatTabs == false)
648
+ UniteFunctionsUG::throwError("The tabs functionality disabled");
649
+
650
+ //check that the category id inside the params
651
+ $params = $gallery->getParams();
652
+ $tabCatIDs = $gallery->getParam("categorytabs_ids");
653
+ $arrTabIDs = explode(",", $tabCatIDs);
654
+ if(in_array($catID, $arrTabIDs) == false)
655
+ UniteFunctionsUG::throwError("Get items not alowed for this category");
656
+
657
+ //get arrItems
658
+ $arrItems = $this->getCatItems($catID);
659
+
660
+ $htmlItems = $this->getGalleryCatItemsHtmlFront($arrItems, $gallery);
661
+
662
+ return($htmlItems);
663
+ }
664
+
665
+
666
+
667
+ private function a____________SETTERS_____________(){}
668
+
669
+
670
+ /**
671
+ *
672
+ * delete items
673
+ */
674
+ private function deleteItems($arrItems){
675
+
676
+ UniteFunctionsUG::validateNotEmpty($arrItems, "arrItems");
677
+
678
+ //sanitize
679
+ foreach($arrItems as $key=>$itemID)
680
+ $arrItems[$key] = (int)$itemID;
681
+
682
+ $strItems = implode($arrItems,",");
683
+ $this->db->delete(GlobalsUG::$table_items,"id in($strItems)");
684
+ }
685
+
686
+ /**
687
+ *
688
+ * duplciate items within same category
689
+ */
690
+ private function duplicateItems($arrItemIDs, $catID){
691
+
692
+ foreach($arrItemIDs as $itemID){
693
+ $this->copyItem($itemID);
694
+ }
695
+ }
696
+
697
+
698
+ /**
699
+ *
700
+ * copy items to some category
701
+ */
702
+ private function copyItems($arrItemIDs,$catID){
703
+ $category = new UniteGalleryCategories();
704
+ $category->validateCatExist($catID);
705
+
706
+ foreach($arrItemIDs as $itemID){
707
+ $this->copyItem($itemID,$catID);
708
+ }
709
+ }
710
+
711
+ /**
712
+ *
713
+ * move items to some category by change category id
714
+ */
715
+ private function moveItem($itemID,$catID){
716
+ $itemID = (int)$itemID;
717
+ $catID = (int)$catID;
718
+
719
+ $arrUpdate = array();
720
+ $arrUpdate["catid"] = $catID;
721
+ $this->db->update(GlobalsUG::$table_items,$arrUpdate,array("id"=>$itemID));
722
+ }
723
+
724
+ /**
725
+ *
726
+ * move multiple items to some category
727
+ */
728
+ private function moveItems($arrItemIDs, $catID){
729
+ $category = new UniteGalleryCategories();
730
+ $category->validateCatExist($catID);
731
+
732
+ foreach($arrItemIDs as $itemID){
733
+ $this->moveItem($itemID, $catID);
734
+ }
735
+ }
736
+
737
+
738
+ /**
739
+ *
740
+ * save items order
741
+ */
742
+ private function saveItemsOrder($arrItemIDs){
743
+
744
+ //get items assoc
745
+ $arrItems = $this->getItemsByIDs($arrItemIDs);
746
+ $arrItems = UniteFunctionsUG::arrayToAssoc($arrItems,"id");
747
+
748
+ $order = 0;
749
+ foreach($arrItemIDs as $itemID){
750
+ $order++;
751
+
752
+ $arrItem = UniteFunctionsUG::getVal($arrItems, $itemID);
753
+ if(!empty($arrItem) && $arrItem["ordering"] == $order)
754
+ continue;
755
+
756
+ $arrUpdate = array();
757
+ $arrUpdate["ordering"] = $order;
758
+ $this->db->update(GlobalsUG::$table_items,$arrUpdate,array("id"=>$itemID));
759
+ }
760
+
761
+ }
762
+
763
+
764
+
765
+ /**
766
+ * add image / images from data
767
+ * return items html
768
+ */
769
+ private function addFromData_images($data){
770
+
771
+ $catID = UniteFunctionsUG::getVal($data, "catID");
772
+
773
+ $arrImages = UniteFunctionsUG::getVal($data, "urlImage");
774
+
775
+ $isMultiple = false;
776
+ if(is_array($arrImages) == true)
777
+ $isMultiple = true;
778
+
779
+ //add items, singe or multiple
780
+ if($isMultiple == true){
781
+
782
+ $itemHtml = "";
783
+ foreach($arrImages as $item){
784
+ $addData = array();
785
+ $addData["catID"] = $catID;
786
+ $urlImage = UniteFunctionsUG::getVal($item, "url");
787
+ $urlImage = HelperUG::URLtoRelative($urlImage);
788
+ $imageID = UniteFunctionsUG::getVal($item, "id", 0);
789
+
790
+ //make thumb and store thumb address
791
+ $addData["urlImage"] = $urlImage;
792
+ $addData["imageID"] = $imageID;
793
+
794
+ if(empty($imageID)){
795
+ $urlThumb = $this->operations->createThumbs($urlImage);
796
+ $addData["urlThumb"] = $urlThumb;
797
+ }else{
798
+ $addData["urlThumb"] = UniteProviderFunctionsUG::getThumbUrlFromImageID($imageID);
799
+ }
800
+
801
+ $addData["type"] = UniteGalleryItem::TYPE_IMAGE;
802
+
803
+
804
+ $objItem = new UniteGalleryItem();
805
+ $objItem->add($addData);
806
+ $itemHtml .= $objItem->getHtmlForAdmin();
807
+ }
808
+ }else{
809
+ $item = new UniteGalleryItem();
810
+ $item->add($data);
811
+
812
+ //get item html
813
+ $itemHtml = $item->getHtmlForAdmin();
814
+ }
815
+
816
+
817
+ return($itemHtml);
818
+ }
819
+
820
+ /**
821
+ * add image / images from data
822
+ * return items html
823
+ */
824
+ private function addFromData_media($data){
825
+
826
+ $item = new UniteGalleryItem();
827
+ $item->add($data);
828
+
829
+ $itemHtml = $item->getHtmlForAdmin();
830
+
831
+ return($itemHtml);
832
+ }
833
+
834
+
835
+
836
+ /**
837
+ *
838
+ * copy item to same or different category
839
+ * if copy to same, then the item will be duplicated
840
+ */
841
+ public function copyItem($itemID,$newCatID = -1){
842
+ $order = $this->getMaxOrder($newCatID);
843
+ $newOrder = $order+1;
844
+
845
+ $fields_item = GlobalsUG::FIELDS_ITEMS;
846
+ $sqlSelect = "select ".$fields_item." from ".GlobalsUG::$table_items." where id={$itemID}";
847
+ $sqlInsert = "insert into ".GlobalsUG::$table_items." (".$fields_item.") ($sqlSelect)";
848
+
849
+ $this->db->runSql($sqlInsert);
850
+
851
+ $newItemID = $this->db->getLastInsertID();
852
+
853
+ //update the ordering:
854
+ $arrUpdate = array();
855
+ $arrUpdate["ordering"] = $newOrder;
856
+ if($newCatID != -1 && !empty($newCatID))
857
+ $arrUpdate["catid"] = $newCatID;
858
+
859
+ $this->db->update(GlobalsUG::$table_items,$arrUpdate,array("id"=>$newItemID));
860
+ }
861
+
862
+
863
+
864
+ /**
865
+ *
866
+ * add item from data
867
+ */
868
+ public function addFromData($data){
869
+
870
+ $type = UniteFunctionsUG::getVal($data, "type");
871
+
872
+ $catID = UniteFunctionsUG::getVal($data, "catID");
873
+ UniteFunctionsUG::validateNumeric($catID,"category id");
874
+
875
+ switch($type){
876
+ case "image":
877
+ $itemHtml = $this->addFromData_images($data);
878
+ break;
879
+ default: //add media
880
+ $itemHtml = $this->addFromData_media($data);
881
+ break;
882
+ }
883
+
884
+ //get categories html
885
+ $objCats = new UniteGalleryCategories();
886
+ $htmlCatList = $objCats->getHtmlCatList($catID);
887
+
888
+ //output html items and cats
889
+ $output = array();
890
+ $output["htmlItem"] = $itemHtml;
891
+ $output["htmlCats"] = $htmlCatList;
892
+
893
+ return($output);
894
+ }
895
+
896
+
897
+ /**
898
+ * remove items from data
899
+ */
900
+ public function removeItemsFromData($data){
901
+
902
+ $catID = UniteFunctionsUG::getVal($data, "catid");
903
+
904
+ $itemIDs = UniteFunctionsUG::getVal($data, "arrItemsIDs");
905
+
906
+ $this->deleteItems($itemIDs);
907
+
908
+ $response = $this->getCatsAndItemsHtml($catID);
909
+
910
+ return($response);
911
+ }
912
+
913
+
914
+ /**
915
+ * update item title
916
+ */
917
+ public function updateItemTitleFromData($data){
918
+
919
+ $itemID = $data["itemID"];
920
+ $title = $data["title"];
921
+
922
+ $arrUpdate = array();
923
+ $arrUpdate["title"] = $title;
924
+ $this->update($itemID,$arrUpdate);
925
+ }
926
+
927
+
928
+ /**
929
+ *
930
+ * duplicate items
931
+ */
932
+ public function duplicateItemsFromData($data){
933
+
934
+ $catID = UniteFunctionsUG::getVal($data, "catID");
935
+
936
+ $arrIDs = UniteFunctionsUG::getVal($data, "arrIDs");
937
+
938
+ $this->duplicateItems($arrIDs, $catID);
939
+
940
+ $response = $this->getCatsAndItemsHtml($catID);
941
+
942
+ return($response);
943
+ }
944
+
945
+
946
+ /**
947
+ *
948
+ * save items order from data
949
+ */
950
+ public function saveOrderFromData($data){
951
+
952
+ $catID = UniteFunctionsUG::getVal($data, "catid");
953
+ $itemsIDs = UniteFunctionsUG::getVal($data, "items_order");
954
+ if(empty($itemsIDs))
955
+ return(false);
956
+
957
+ //change category sortby to custom
958
+
959
+ $objCat = new UniteGalleryCategory();
960
+ $objCat->initByID($catID);
961
+ $objCat->updateSortby(UniteGalleryCategory::SORTBY_CUSTOM);
962
+
963
+ //change items order
964
+ $this->saveItemsOrder($itemsIDs);
965
+ }
966
+
967
+
968
+ /**
969
+ *
970
+ * copy / move items to some category
971
+ * @param $data
972
+ */
973
+ public function copyMoveItemsFromData($data){
974
+
975
+ $targetCatID = UniteFunctionsUG::getVal($data, "targetCatID");
976
+ $selectedCatID = UniteFunctionsUG::getVal($data, "selectedCatID");
977
+
978
+ $arrItemIDs = UniteFunctionsUG::getVal($data, "arrItemIDs");
979
+
980
+ UniteFunctionsUG::validateNotEmpty($targetCatID,"category id");
981
+ UniteFunctionsUG::validateNotEmpty($arrItemIDs,"item id's");
982
+
983
+ $operation = UniteFunctionsUG::getVal($data, "operation");
984
+
985
+ switch($operation){
986
+ case "copy":
987
+ $this->copyItems($arrItemIDs, $targetCatID);
988
+ break;
989
+ case "move":
990
+ $this->moveItems($arrItemIDs, $targetCatID);
991
+ break;
992
+ default:
993
+ UniteFunctionsUG::throwError("Wrong operation: $operation");
994
+ break;
995
+ }
996
+
997
+ $repsonse = $this->getCatsAndItemsHtml($selectedCatID);
998
+ return($repsonse);
999
+ }
1000
+
1001
+
1002
+
1003
+
1004
+ /**
1005
+ *
1006
+ * update item data
1007
+ * get html item for admin response
1008
+ */
1009
+ public function updateItemData($data){
1010
+ $itemID = UniteFunctionsUG::getVal($data, "itemID");
1011
+
1012
+ UniteFunctionsUG::validateNotEmpty($itemID, "item params");
1013
+
1014
+ $item = new UniteGalleryItem();
1015
+ $item->initByID($itemID);
1016
+
1017
+ $item->updateItemData($data);
1018
+
1019
+ $htmlItem = $item->getHtmlForAdmin();
1020
+
1021
+ $response = array("html_item"=>$htmlItem);
1022
+
1023
+ return($response);
1024
+ }
1025
+
1026
+
1027
+ /**
1028
+ * export category items from data
1029
+ */
1030
+ public function exportCatItemsFromData($data){
1031
+
1032
+ $catID = UniteFunctionsUG::getVal($data, "catid");
1033
+
1034
+ $arrItems = $this->getCatItemsRecords($catID);
1035
+ $arrExportItems = array();
1036
+
1037
+ foreach($arrItems as $item){
1038
+ unset($item["id"]);
1039
+ $arrExportItems[] = $item;
1040
+ }
1041
+
1042
+ $strExport = serialize($arrExportItems);
1043
+
1044
+ $filename = "items_export.txt";
1045
+ UniteFunctionsUG::downloadFileFromContent($strExport, $filename);
1046
+
1047
+ }
1048
+
1049
+
1050
+ /**
1051
+ * import category items from data
1052
+ */
1053
+ public function importCatItemsFromData($data){
1054
+
1055
+ $catID = UniteFunctionsUG::getVal($data, "catID");
1056
+ $objCat = new UniteGalleryCategories();
1057
+ $objCat->validateCatExist($catID);
1058
+
1059
+ $arrFile = UniteFunctionsUG::getVal($_FILES, "import_file");
1060
+ if(empty($arrFile))
1061
+ UniteFunctionsUG::throwError("import file not found");
1062
+
1063
+ $filepath = UniteFunctionsUG::getVal($arrFile, "tmp_name");
1064
+ UniteFunctionsUG::validateFilepath($filepath, "uploaded import file");
1065
+
1066
+ $content = file_get_contents($filepath);
1067
+
1068
+ if(empty($content))
1069
+ UniteFunctionsUG::throwError("wrong import file content");
1070
+
1071
+ $arrRecords = @unserialize($content);
1072
+
1073
+ if(is_array($arrRecords) == false)
1074
+ UniteFunctionsUG::throwError("wrong import file format");
1075
+
1076
+ foreach($arrRecords as $record){
1077
+
1078
+ $record["catid"] = $catID;
1079
+ $this->db->insert(GlobalsUG::$table_items, $record);
1080
+ }
1081
+
1082
+ $response = $this->getCatsAndItemsHtml($catID);
1083
+
1084
+ return($response);
1085
+ }
1086
+
1087
+
1088
+ }
1089
+
1090
+ ?>
inc_php/unitegallery_manager.class.php ADDED
@@ -0,0 +1,591 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * @package Unite Gallery
5
+ * @author Valiano
6
+ * @copyright (C) 2012 Unite CMS, All Rights Reserved.
7
+ * @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
8
+ * */
9
+
10
+ class UniteGalleryManager{
11
+
12
+ const TYPE_MAIN = "main";
13
+ const TYPE_ITEMS_INLINE = "inline";
14
+
15
+ protected $type = null;
16
+ protected $hasCats = true;
17
+ protected $hasSortBy = false;
18
+
19
+ protected $options = array();
20
+
21
+ protected $objCats = null;
22
+ protected $selectedCategory = "";
23
+ private $managerAddHtml = "";
24
+ private $errorMessage = null;
25
+ protected $itemsLoaderText = "";
26
+ protected $textItemsSelected = "";
27
+
28
+
29
+ protected function a___________REWRITE_FUNCTIONS________(){}
30
+
31
+ /**
32
+ * put items buttons
33
+ */
34
+ protected function putItemsButtons(){
35
+
36
+ ?>
37
+ put buttons from child classes
38
+ <?php
39
+ }
40
+
41
+
42
+ /**
43
+ * put filters - function for override
44
+ */
45
+ protected function putItemsFilters(){}
46
+
47
+
48
+ /**
49
+ * ge tmenu single item
50
+ */
51
+ protected function getMenuSingleItem(){
52
+
53
+ $arrMenuItem = array();
54
+ $arrMenuItem["no_action"] = __("No Action",UNITEGALLERY_TEXTDOMAIN);
55
+
56
+ return($arrMenuItem);
57
+ }
58
+
59
+ /**
60
+ * get item field menu
61
+ */
62
+ protected function getMenuField(){
63
+
64
+ $arrMenuField = array();
65
+ $arrMenuField["no_action"] = __("No Action",UNITEGALLERY_TEXTDOMAIN);
66
+
67
+ return($arrMenuField);
68
+ }
69
+
70
+
71
+ /**
72
+ * put additional html here
73
+ */
74
+ protected function putAddHtml(){
75
+ dmp("put add html here by child class");
76
+ }
77
+
78
+
79
+ /**
80
+ * get no items text
81
+ */
82
+ protected function getNoItemsText(){
83
+ $text = __("No Items", UNITEGALLERY_TEXTDOMAIN);
84
+ return($text);
85
+ }
86
+
87
+ protected function a___________SET_DATA_BEFORE_PUT________(){}
88
+
89
+
90
+ /**
91
+ * set manager add html, must be called before put
92
+ */
93
+ protected function setManagerAddHtml($addHtml){
94
+ $this->managerAddHtml = $addHtml;
95
+ }
96
+
97
+ protected function a___________MAIN_FUNCTIONS________(){}
98
+
99
+
100
+ /**
101
+ * validate inited function
102
+ */
103
+ private function validateInited(){
104
+ if(empty($this->type))
105
+ UniteFunctionsUG::throwError("The manager is not inited");
106
+ }
107
+
108
+
109
+ /**
110
+ * put categories html
111
+ */
112
+ private function putHtmlCats(){
113
+
114
+ $htmlCatList = $this->objCats->getHtmlCatList();
115
+
116
+ ?>
117
+ <div id="categories_wrapper" class="categories_wrapper unselectable">
118
+ <div class="manager_title">
119
+ <?php _e("Categories", UNITEGALLERY_TEXTDOMAIN)?>
120
+ </div>
121
+ <div class="manager_buttons">
122
+ <a id="button_add_category" type="button" class="unite-button-secondary"><?php _e("Add",UNITEGALLERY_TEXTDOMAIN)?></a>
123
+ <a id="button_remove_category" type="button" class="unite-button-secondary button-disabled"><?php _e("Delete",UNITEGALLERY_TEXTDOMAIN)?></a>
124
+ <a id="button_edit_category" type="button" class="unite-button-secondary button-disabled"><?php _e("Edit",UNITEGALLERY_TEXTDOMAIN)?></a>
125
+ </div>
126
+ <hr>
127
+ <div id="cats_section" class="cats_section">
128
+ <div class="cat_list_wrapper">
129
+ <ul id="list_cats" class="list_cats">
130
+ <?php echo $htmlCatList?>
131
+ </ul>
132
+ </div>
133
+ </div>
134
+ </div>
135
+ <?php
136
+ }
137
+
138
+ /**
139
+ * function for override
140
+ */
141
+ protected function putInitItems(){}
142
+
143
+
144
+ /**
145
+ * put items html sortby
146
+ */
147
+ protected function putItemsHtmlSortBy(){
148
+
149
+ $arrSortby = UniteGalleryCategory::getArrSortby();
150
+
151
+ ?>
152
+ <div id="um_sortby_items_wrapper" class="um-sortby-wrapper unite-sortby-items unite-disabled" >
153
+
154
+ <span>
155
+ <?php _e("Sort By", UNITEGALLERY_TEXTDOMAIN)?>:
156
+ </span>
157
+
158
+ <select id="um_select_sortby_items" disabled="disabled">
159
+ <?php
160
+ foreach($arrSortby as $key => $title){
161
+ ?>
162
+ <option value="<?php echo $key?>"><?php echo $title?></option>
163
+ <?php
164
+ }
165
+ ?>
166
+ </select>
167
+
168
+ </div>
169
+ <?php
170
+ }
171
+
172
+
173
+ /**
174
+ * put items wrapper html
175
+ */
176
+ private function putItemsWrapper(){
177
+ ?>
178
+ <div class="items_wrapper unselectable">
179
+
180
+ <?php if($this->hasCats == true):?>
181
+
182
+ <div class="manager_title">
183
+ <?php _e("Items",UNITEGALLERY_TEXTDOMAIN)?>
184
+ <?php if($this->hasSortBy)
185
+ $this->putItemsHtmlSortBy();
186
+ ?>
187
+ </div>
188
+
189
+ <?php endif?>
190
+
191
+ <?php $this->putItemsFilters() ?>
192
+
193
+ <div id="manager_buttons" class="manager_buttons">
194
+
195
+ <?php $this->putItemsButtons()?>
196
+
197
+ </div>
198
+
199
+ <hr>
200
+
201
+ <div id="items_outer" class="items_outer">
202
+
203
+ <div id="items_list_wrapper" class="items_list_wrapper unselectable">
204
+ <div id="items_loader" class="items_loader" style="display:none;">
205
+ <?php echo $this->itemsLoaderText?>...
206
+ </div>
207
+
208
+ <div id="no_items_text" class="no_items_text" style="display:none;">
209
+ <?php echo $this->getNoItemsText()?>
210
+ </div>
211
+
212
+ <ul id="ug_list_items" class="ug-list-items unselectable ug-listitems-<?php echo $this->type?>"><?php $this->putInitItems()?></ul>
213
+ <div id="drag_indicator" class="drag_indicator" style="display:none;"></div>
214
+ <div id="shadow_bar" class="shadow_bar" style="display:none"></div>
215
+ <div id="select_bar" class="select_bar" style="display:none"></div>
216
+ </div>
217
+
218
+ </div>
219
+ </div>
220
+ <?php
221
+ }
222
+
223
+
224
+ /**
225
+ * html status operations html
226
+ */
227
+ private function putStatusLineOperations(){
228
+
229
+ ?>
230
+
231
+ <div class="status_operations">
232
+ <div class="status_num_selected">
233
+ <span id="num_items_selected">0</span> <?php echo $this->textItemsSelected?>
234
+ </div>
235
+
236
+ <?php if($this->hasCats == true):
237
+ $htmlCatSelect = $this->objCats->getHtmlSelectCats();
238
+ ?>
239
+
240
+ <div id="item_operations_wrapper" class="item_operations_wrapper unite-disabled">
241
+
242
+ <select id="select_item_operations" disabled="disabled">
243
+ <option value="copy"><?php _e("Copy To",UNITEGALLERY_TEXTDOMAIN)?></option>
244
+ <option value="move"><?php _e("Move To",UNITEGALLERY_TEXTDOMAIN)?></option>
245
+ </select>
246
+
247
+ <select id="select_item_category" disabled="disabled">
248
+ <?php echo $htmlCatSelect ?>
249
+ </select>
250
+
251
+ <a id="button_items_operation" class="unite-button-secondary button-disabled" href="javascript:void(0)">GO</a>
252
+ </div>
253
+
254
+ <?php endif?>
255
+
256
+ </div>
257
+
258
+ <?php
259
+
260
+ }
261
+
262
+
263
+ /**
264
+ * put status line html
265
+ */
266
+ private function putStatusLine(){
267
+
268
+ ?>
269
+ <div class="status_line">
270
+ <div class="status_loader_wrapper">
271
+ <div id="status_loader" class="status_loader" style="display:none;"></div>
272
+ </div>
273
+ <div class="status_text_wrapper">
274
+ <span id="status_text" class="status_text" style="display:none;"></span>
275
+ </div>
276
+
277
+ <?php
278
+ $this->putStatusLineOperations();
279
+ ?>
280
+
281
+
282
+ </div>
283
+ <?php
284
+ }
285
+
286
+ /**
287
+ * put copy move menu
288
+ */
289
+ private function putMenuCopyMove(){
290
+ ?>
291
+ <ul id="menu_copymove" class="unite-context-menu" style="display:none">
292
+ <li>
293
+ <a href="javascript:void(0)" data-operation="copymove_copy"><?php _e("Copy Here",UNITEGALLERY_TEXTDOMAIN)?></a>
294
+ <a href="javascript:void(0)" data-operation="copymove_move"><?php _e("Move Here",UNITEGALLERY_TEXTDOMAIN)?></a>
295
+ </li>
296
+ </ul>
297
+ <?php
298
+ }
299
+
300
+
301
+
302
+ /**
303
+ * put single item menu
304
+ */
305
+ private function putMenuSingleItem(){
306
+
307
+ $arrMenuItem = $this->getMenuSingleItem();
308
+
309
+ ?>
310
+ <!-- Right menu single -->
311
+
312
+ <ul id="rightmenu_item" class="unite-context-menu" style="display:none">
313
+ <?php foreach($arrMenuItem as $operation=>$text):?>
314
+ <li>
315
+ <a href="javascript:void(0)" data-operation="<?php echo $operation?>"><?php echo $text?></a>
316
+ </li>
317
+ <?php endforeach?>
318
+ </ul>
319
+
320
+ <?php
321
+ }
322
+
323
+ /**
324
+ * get multiple items menu
325
+ */
326
+ protected function getMenuMulitipleItems(){
327
+ $arrMenuItemMultiple = array();
328
+ $arrMenuItemMultiple["no_action"] = __("No Action",UNITEGALLERY_TEXTDOMAIN);
329
+ return($arrMenuItemMultiple);
330
+ }
331
+
332
+
333
+ /**
334
+ * put multiple items menu
335
+ */
336
+ private function putMenuMultipleItems(){
337
+
338
+ $arrMenuItemMultiple = $this->getMenuMulitipleItems();
339
+
340
+ ?>
341
+ <!-- Right menu multiple -->
342
+
343
+ <ul id="rightmenu_item_multiple" class="unite-context-menu" style="display:none">
344
+ <?php foreach($arrMenuItemMultiple as $operation=>$text):?>
345
+ <li>
346
+ <a href="javascript:void(0)" data-operation="<?php echo $operation?>"><?php echo $text?></a>
347
+ </li>
348
+ <?php endforeach?>
349
+ </ul>
350
+
351
+ <?php
352
+ }
353
+
354
+
355
+ /**
356
+ * get category menu
357
+ */
358
+ protected function getMenuCategory(){
359
+
360
+ $arrMenuCat = array();
361
+ $arrMenuCat["no_action"] = __("No Action",UNITEGALLERY_TEXTDOMAIN);
362
+
363
+ return($arrMenuCat);
364
+ }
365
+
366
+ /**
367
+ * put right menu category
368
+ */
369
+ private function putMenuCategory(){
370
+
371
+ //init category menu
372
+ $arrMenuCat = $this->getMenuCategory();
373
+
374
+ ?>
375
+ <!-- Right menu category -->
376
+ <ul id="rightmenu_cat" class="unite-context-menu" style="display:none">
377
+ <?php foreach($arrMenuCat as $operation=>$text):?>
378
+ <li>
379
+ <a href="javascript:void(0)" data-operation="<?php echo $operation?>"><?php echo $text?></a>
380
+ </li>
381
+ <?php endforeach?>
382
+ </ul>
383
+
384
+ <?php
385
+ }
386
+
387
+
388
+
389
+ /**
390
+ * put right menu field
391
+ */
392
+ private function putMenuField(){
393
+
394
+ $arrMenuField = $this->getMenuField();
395
+
396
+
397
+ ?>
398
+ <!-- Right menu field -->
399
+ <ul id="rightmenu_field" class="unite-context-menu" style="display:none">
400
+ <?php foreach($arrMenuField as $operation=>$text):?>
401
+ <li>
402
+ <a href="javascript:void(0)" data-operation="<?php echo $operation?>"><?php echo $text?></a>
403
+ </li>
404
+ <?php endforeach?>
405
+ </ul>
406
+
407
+ <?php
408
+ }
409
+
410
+
411
+
412
+ /**
413
+ * put right menu category field
414
+ */
415
+ private function putMenuCatField(){
416
+
417
+ //init category field menu
418
+ $arrMenuCatField = array();
419
+ $arrMenuCatField["add_category"] = __("Add Category",UNITEGALLERY_TEXTDOMAIN);
420
+
421
+ ?>
422
+ <!-- Right menu category field-->
423
+ <ul id="rightmenu_catfield" class="unite-context-menu" style="display:none">
424
+ <?php foreach($arrMenuCatField as $operation=>$text):?>
425
+ <li>
426
+ <a href="javascript:void(0)" data-operation="<?php echo $operation?>"><?php echo $text?></a>
427
+ </li>
428
+ <?php endforeach?>
429
+ </ul>
430
+
431
+ <?php
432
+ }
433
+
434
+ /**
435
+ * put category edit dialog
436
+ */
437
+ private function putDialogEditCategory(){
438
+ ?>
439
+ <div id="dialog_edit_category" title="<?php _e("Edit Category",UNITEGALLERY_TEXTDOMAIN)?>" style="display:none;">
440
+
441
+ <div class="dialog_edit_category_inner unite-inputs">
442
+
443
+ <?php _e("Category ID", UNITEGALLERY_TEXTDOMAIN)?>: <b><span id="span_catdialog_id"></span></b>
444
+
445
+ <br><br>
446
+
447
+ <?php _e("Edit Name", UNITEGALLERY_TEXTDOMAIN)?>:
448
+ <input type="text" id="input_cat_title" class="unite-input-regular">
449
+ </div>
450
+
451
+ </div>
452
+
453
+ <?php
454
+ }
455
+
456
+
457
+ /**
458
+ * put scripts according manager type
459
+ */
460
+ public static function putScriptsIncludes($type){
461
+
462
+ HelperUG::addScript("unitegallery_manager_items");
463
+ HelperUG::addScript("unitegallery_manager");
464
+ HelperUG::addStyle("unitegallery_manager","unitegallery_manager_css");
465
+
466
+ switch($type){
467
+ case self::TYPE_MAIN:
468
+ HelperUG::addScript("unitegallery_manager_cats");
469
+ HelperUG::addScript("unitegallery_manager_actions_main");
470
+ break;
471
+ case self::TYPE_ITEMS_INLINE:
472
+ HelperUG::addScript("unitegallery_manager_actions_inline");
473
+ break;
474
+ }
475
+
476
+ }
477
+
478
+
479
+ /**
480
+ * output manager html
481
+ */
482
+ public function outputHtml(){
483
+
484
+ $this->validateInited();
485
+
486
+ $addClass = "";
487
+ if($this->hasCats == false)
488
+ $addClass = " ug-nocats ";
489
+
490
+ try{
491
+
492
+ ?>
493
+
494
+ <div id="ug_managerw" class="ug-manager-outer" data-type="<?php echo $this->type?>" <?php echo $this->managerAddHtml?>>
495
+
496
+ <div class="manager_wrapper <?php echo $addClass?> unselectable" >
497
+
498
+ <?php if($this->hasCats == true): ?>
499
+
500
+ <table class="layout_table" width="100%" cellpadding="0" cellspacing="0">
501
+
502
+ <tr>
503
+ <td class="cell_cats" width="220px" valign="top">
504
+ <?php $this->putHtmlCats()?>
505
+ </td>
506
+
507
+ <td class="cell_items" valign="top">
508
+
509
+ <?php $this->putItemsWrapper()?>
510
+
511
+ </td>
512
+ </tr>
513
+ <tr>
514
+ <td colspan="2">
515
+
516
+ <?php $this->putStatusLine() ?>
517
+
518
+ </td>
519
+ </tr>
520
+
521
+ </table>
522
+
523
+ <?php else:?>
524
+
525
+ <?php
526
+ $this->putItemsWrapper();
527
+ $this->putStatusLine();
528
+ ?>
529
+
530
+
531
+ <?php endif?>
532
+
533
+ </div> <!-- end manager wrapper -->
534
+
535
+ <div id="manager_shadow_overlay" class="manager_shadow_overlay" style="display:none"></div>
536
+
537
+ <?php
538
+
539
+
540
+ $this->putMenuSingleItem();
541
+ $this->putMenuMultipleItems();
542
+ $this->putMenuField();
543
+
544
+ if($this->hasCats):
545
+ $this->putMenuCopyMove();
546
+ $this->putMenuCategory();
547
+ $this->putMenuCatField();
548
+ $this->putDialogEditCategory();
549
+ endif;
550
+
551
+ $this->putAddHtml();
552
+
553
+ ?>
554
+
555
+ </div>
556
+ <?php
557
+
558
+ }catch(Exception $e){
559
+ $message = "<br><br>manager error: <b>".$e->getMessage()."</b>";
560
+
561
+ echo "</div>";
562
+ echo "</div>";
563
+ echo "</div>";
564
+
565
+ echo "<div class='unite-color-red'>".$message."</div>";
566
+
567
+ if(GlobalsUG::SHOW_TRACE == true)
568
+ dmp($e->getTraceAsString());
569
+ }
570
+
571
+ }
572
+
573
+
574
+ /**
575
+ * init manager
576
+ */
577
+ protected function init(){
578
+
579
+ //the type should be set already in child classes
580
+ $this->validateInited();
581
+
582
+ $this->itemsLoaderText = __("Getting Items", UNITEGALLERY_TEXTDOMAIN);
583
+ $this->textItemsSelected = __("items selected",UNITEGALLERY_TEXTDOMAIN);
584
+
585
+ if($this->hasCats){
586
+ $this->objCats = new UniteGalleryCategories();
587
+ }
588
+
589
+ }
590
+
591
+ }
inc_php/unitegallery_manager_inline.class.php ADDED
@@ -0,0 +1,175 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @package Unite Gallery
4
+ * @author Valiano
5
+ * @copyright (C) 2012 Unite CMS, All Rights Reserved.
6
+ * @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
7
+ * */
8
+
9
+ class UniteGalleryManagerInline extends UniteGalleryManager{
10
+
11
+ private $startAddon;
12
+
13
+
14
+ /**
15
+ * construct the manager
16
+ */
17
+ public function __construct(){
18
+
19
+ $this->type = self::TYPE_ITEMS_INLINE;
20
+
21
+ $this->init();
22
+ }
23
+
24
+ /**
25
+ * validate that the start addon exists
26
+ */
27
+ private function validateStartAddon(){
28
+
29
+ if(empty($this->startAddon))
30
+ UniteFunctionsUG::throwError("The start addon not given");
31
+
32
+ }
33
+
34
+
35
+ /**
36
+ * init the data from start addon
37
+ */
38
+ private function initStartAddonData(){
39
+
40
+ //set init data
41
+ $arrItems = $this->startAddon->getArrItems();
42
+
43
+ $strItems = "";
44
+ if(!empty($arrItems)){
45
+ $strItems = json_encode($arrItems);
46
+ $strItems = htmlspecialchars($strItems);
47
+ }
48
+
49
+ $addHtml = " data-init-items=\"{$strItems}\" ";
50
+
51
+ $this->setManagerAddHtml($addHtml);
52
+
53
+ }
54
+
55
+
56
+ /**
57
+ * set start addon
58
+ */
59
+ public function setStartAddon($addon){
60
+ $this->startAddon = new UniteCreatorAddon(); //just for code completion
61
+ $this->startAddon = $addon;
62
+
63
+ $this->initStartAddonData();
64
+ }
65
+
66
+
67
+ /**
68
+ * get single item menu
69
+ */
70
+ protected function getMenuSingleItem(){
71
+
72
+ $arrMenuItem = array();
73
+ $arrMenuItem["edit_item"] = __("Edit Item",UNITEGALLERY_TEXTDOMAIN);
74
+ $arrMenuItem["remove_items"] = __("Delete",UNITEGALLERY_TEXTDOMAIN);
75
+ $arrMenuItem["duplicate_items"] = __("Duplicate",UNITEGALLERY_TEXTDOMAIN);
76
+
77
+ return($arrMenuItem);
78
+ }
79
+
80
+ /**
81
+ * get multiple items menu
82
+ */
83
+ protected function getMenuMulitipleItems(){
84
+ $arrMenuItemMultiple = array();
85
+ $arrMenuItemMultiple["remove_items"] = __("Delete",UNITEGALLERY_TEXTDOMAIN);
86
+ $arrMenuItemMultiple["duplicate_items"] = __("Duplicate",UNITEGALLERY_TEXTDOMAIN);
87
+ return($arrMenuItemMultiple);
88
+ }
89
+
90
+
91
+ /**
92
+ * get item field menu
93
+ */
94
+ protected function getMenuField(){
95
+ $arrMenuField = array();
96
+ $arrMenuField["add_item"] = __("Add Item",UNITEGALLERY_TEXTDOMAIN);
97
+ $arrMenuField["select_all"] = __("Select All",UNITEGALLERY_TEXTDOMAIN);
98
+
99
+ return($arrMenuField);
100
+ }
101
+
102
+
103
+ /**
104
+ * put items buttons
105
+ */
106
+ protected function putItemsButtons(){
107
+
108
+ $this->validateStartAddon();
109
+
110
+ $itemType = $this->startAddon->getItemsType();
111
+
112
+ //put add item button according the type
113
+ switch($itemType){
114
+ default:
115
+ case UniteCreatorAddon::ITEMS_TYPE_DEFAULT:
116
+ ?>
117
+ <a data-action="add_item" type="button" class="unite-button-primary button-disabled ug-button-item ug-button-add"><?php _e("Add Item",UNITEGALLERY_TEXTDOMAIN)?></a>
118
+ <?php
119
+ break;
120
+ case UniteCreatorAddon::ITEMS_TYPE_IMAGE:
121
+ ?>
122
+ <a data-action="add_images" type="button" class="unite-button-primary button-disabled ug-button-item ug-button-add"><?php _e("Add Images",UNITEGALLERY_TEXTDOMAIN)?></a>
123
+ <?php
124
+ break;
125
+ }
126
+
127
+ ?>
128
+ <a data-action="select_all_items" type="button" class="unite-button-secondary button-disabled ug-button-item ug-button-select" data-textselect="<?php _e("Select All",UNITEGALLERY_TEXTDOMAIN)?>" data-textunselect="<?php _e("Unselect All",UNITEGALLERY_TEXTDOMAIN)?>"><?php _e("Select All",UNITEGALLERY_TEXTDOMAIN)?></a>
129
+ <a data-action="duplicate_items" type="button" class="unite-button-secondary button-disabled ug-button-item"><?php _e("Duplicate",UNITEGALLERY_TEXTDOMAIN)?></a>
130
+ <a data-action="remove_items" type="button" class="unite-button-secondary button-disabled ug-button-item"><?php _e("Delete",UNITEGALLERY_TEXTDOMAIN)?></a>
131
+ <a data-action="edit_item" type="button" class="unite-button-secondary button-disabled ug-button-item ug-single-item"><?php _e("Edit Item",UNITEGALLERY_TEXTDOMAIN)?> </a>
132
+ <?php
133
+ }
134
+
135
+
136
+ /**
137
+ * put add edit item dialog
138
+ */
139
+ private function putAddEditDialog(){
140
+
141
+ ?>
142
+ <div title="<?php _e("Edit Item",UNITEGALLERY_TEXTDOMAIN)?>" class="ug-dialog-edit-item" style="display:none;">
143
+ <div class="ug-item-config-settings">
144
+ <?php
145
+ if($this->startAddon)
146
+ $this->startAddon->putHtmlItemConfig()
147
+ ?>
148
+ </div>
149
+ </div>
150
+ <?php
151
+ }
152
+
153
+
154
+ /**
155
+ * put additional html here
156
+ */
157
+ protected function putAddHtml(){
158
+
159
+ $this->putAddEditDialog();
160
+
161
+ }
162
+
163
+
164
+ /**
165
+ * init the addons manager
166
+ */
167
+ protected function init(){
168
+
169
+ $this->hasCats = false;
170
+
171
+ parent::init();
172
+ }
173
+
174
+
175
+ }
inc_php/unitegallery_manager_main.class.php ADDED
@@ -0,0 +1,269 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @package Unite Gallery
4
+ * @author Valiano
5
+ * @copyright (C) 2012 Unite CMS, All Rights Reserved.
6
+ * @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
7
+ * */
8
+
9
+ class UniteGalleryManagerMain extends UniteGalleryManager{
10
+
11
+ private $itemsType = "all";
12
+
13
+
14
+ /**
15
+ * construct the manager
16
+ */
17
+ public function __construct(){
18
+ $this->type = self::TYPE_MAIN;
19
+
20
+ $this->init();
21
+ }
22
+
23
+
24
+ /**
25
+ * get single item menu
26
+ */
27
+ protected function getMenuSingleItem(){
28
+
29
+ $arrMenuItem = array();
30
+ $arrMenuItem["edit_item"] = __("Edit item",UNITEGALLERY_TEXTDOMAIN);
31
+ $arrMenuItem["edit_item_title"] = __("Edit Title",UNITEGALLERY_TEXTDOMAIN);
32
+ $arrMenuItem["preview_item"] = __("Preview Item",UNITEGALLERY_TEXTDOMAIN);
33
+ $arrMenuItem["remove_item"] = __("Delete",UNITEGALLERY_TEXTDOMAIN);
34
+ $arrMenuItem["duplicate_item"] = __("Duplicate",UNITEGALLERY_TEXTDOMAIN);
35
+
36
+ return($arrMenuItem);
37
+ }
38
+
39
+
40
+ /**
41
+ * get item field menu
42
+ */
43
+ protected function getMenuField(){
44
+ $arrMenuField = array();
45
+
46
+ $arrMenuField["select_all_items"] = __("Select All",UNITEGALLERY_TEXTDOMAIN);
47
+
48
+ if($this->itemsType != "video")
49
+ $arrMenuField["add_images"] = __("Add Images",UNITEGALLERY_TEXTDOMAIN);
50
+
51
+ if($this->itemsType != "images")
52
+ $arrMenuField["add_video"] = __("Add Video",UNITEGALLERY_TEXTDOMAIN);
53
+
54
+ return($arrMenuField);
55
+ }
56
+
57
+
58
+ /**
59
+ * get multiple items menu
60
+ */
61
+ protected function getMenuMulitipleItems(){
62
+ $arrMenuItemMultiple = array();
63
+ $arrMenuItemMultiple["remove_item"] = __("Delete",UNITEGALLERY_TEXTDOMAIN);
64
+ $arrMenuItemMultiple["duplicate_item"] = __("Duplicate",UNITEGALLERY_TEXTDOMAIN);
65
+ return($arrMenuItemMultiple);
66
+ }
67
+
68
+
69
+ /**
70
+ * get category menu
71
+ */
72
+ protected function getMenuCategory(){
73
+
74
+ $arrMenuCat = array();
75
+ $arrMenuCat["edit_category"] = __("Edit Category",UNITEGALLERY_TEXTDOMAIN);
76
+ $arrMenuCat["delete_category"] = __("Delete Category",UNITEGALLERY_TEXTDOMAIN);
77
+ $arrMenuCat["export_cat_items"] = __("Export items",UNITEGALLERY_TEXTDOMAIN);
78
+ $arrMenuCat["import_cat_items"] = __("Import items",UNITEGALLERY_TEXTDOMAIN);
79
+
80
+ return($arrMenuCat);
81
+ }
82
+
83
+
84
+ /**
85
+ * get no items text
86
+ */
87
+ protected function getNoItemsText(){
88
+ if($this->hasCats == true)
89
+ $text = __("Empty Category", UNITEGALLERY_TEXTDOMAIN);
90
+ else
91
+ $text = __("No Items Found", UNITEGALLERY_TEXTDOMAIN);
92
+
93
+ return($text);
94
+ }
95
+
96
+
97
+ /**
98
+ * put items buttons
99
+ */
100
+ protected function putItemsButtons(){
101
+ ?>
102
+
103
+ <?php if($this->itemsType != "video"):?>
104
+ <a data-action="add_images" type="button" class="unite-button-secondary unite-button-blue button-disabled ug-button-item ug-button-add"><?php _e("Add Images",UNITEGALLERY_TEXTDOMAIN)?></a>
105
+ <?php endif?>
106
+
107
+ <?php if($this->itemsType != "images"):?>
108
+ <a data-action="add_video" type="button" class="unite-button-secondary unite-button-blue button-disabled ug-button-item ug-button-add"><?php _e("Add Video",UNITEGALLERY_TEXTDOMAIN)?></a>
109
+ <?php endif?>
110
+
111
+ <a data-action="select_all_items" type="button" class="unite-button-secondary button-disabled ug-button-item ug-button-select" data-textselect="<?php _e("Select All",UNITEGALLERY_TEXTDOMAIN)?>" data-textunselect="<?php _e("Unselect All",UNITEGALLERY_TEXTDOMAIN)?>"><?php _e("Select All",UNITEGALLERY_TEXTDOMAIN)?></a>
112
+
113
+ <a data-action="edit_item_title" type="button" class="unite-button-secondary button-disabled ug-button-item ug-single-item"><?php _e("Edit Title",UNITEGALLERY_TEXTDOMAIN)?></a>
114
+ <a data-action="edit_item" type="button" class="unite-button-secondary button-disabled ug-button-item ug-single-item"><?php _e("Edit item",UNITEGALLERY_TEXTDOMAIN)?> </a>
115
+
116
+ <a data-action="duplicate_item" type="button" class="unite-button-secondary button-disabled ug-button-item"><?php _e("Duplicate",UNITEGALLERY_TEXTDOMAIN)?></a>
117
+ <a data-action="remove_item" type="button" class="unite-button-secondary button-disabled ug-button-item"><?php _e("Delete",UNITEGALLERY_TEXTDOMAIN)?></a>
118
+ <?php
119
+ }
120
+
121
+
122
+
123
+ /**
124
+ * put scripts
125
+ */
126
+ private function putScripts(){
127
+
128
+ $script = "
129
+ jQuery(document).ready(function(){
130
+ var selectedCatID = \"{$this->selectedCategory}\";
131
+ var managerAdmin = new UCManagerAdmin();
132
+ managerAdmin.initManager(selectedCatID);
133
+ });
134
+ ";
135
+
136
+ UniteProviderFunctionsUG::printCustomScript($script);
137
+ }
138
+
139
+ /**
140
+ * put dialog edit title
141
+ */
142
+ private function putDialogEditTitle(){
143
+ ?>
144
+ <div id="dialog_edit_item_title" title="<?php _e("Edit Title",UNITEGALLERY_TEXTDOMAIN)?>" style="display:none;">
145
+
146
+ <div class="dialog_edit_title_inner unite-inputs mtop_20 mbottom_20" >
147
+ <?php _e("Edit Title", UNITEGALLERY_TEXTDOMAIN)?>:
148
+ <input type="text" id="input_item_title" class="unite-input-wide">
149
+ </div>
150
+
151
+ </div>
152
+
153
+ <?php
154
+ }
155
+
156
+ /**
157
+ * put edit item dialog
158
+ */
159
+ private function putDialogEditItem(){
160
+
161
+ ?>
162
+
163
+ <div id="dialog_edit_item" title="<?php _e("Edit Item",UNITEGALLERY_TEXTDOMAIN)?>" style="display:none;">
164
+
165
+ <div id="dialog_edit_item_loader" class="loader_round">
166
+ <?php _e("Loading Item Data...",UNITEGALLERY_TEXTDOMAIN)?>
167
+ </div>
168
+
169
+ <div id="dialog_edit_item_content" class="dialog_edit_item_content"></div>
170
+
171
+ <div id="dialog_edit_error_message" class="unite_error_message" style="display:none"></div>
172
+
173
+ </div>
174
+
175
+ <?php
176
+ }
177
+
178
+
179
+ /**
180
+ * put import items dialog
181
+ */
182
+ private function putDialogImportItems(){
183
+ ?>
184
+
185
+ <div id="dialog_import_items" title="<?php _e("Import Items",UNITEGALLERY_TEXTDOMAIN)?>" style="display:none;">
186
+ <br>
187
+ <?php _e("Select export items file", UNITEGALLERY_TEXTDOMAIN)?>:
188
+
189
+ <form id="form_import_items" name="form_import_items">
190
+ <input type="file" name="import_file">
191
+ </form>
192
+
193
+ <br><br>
194
+
195
+ <a id="dialog_import_upload" href="javascript:void(0)" class="unite-button-primary"><?php _e("Import Items")?></a>
196
+
197
+ <div id="dialog_import_items_loader" class="loader_text" style="display:none">
198
+ <?php _e("Uploading Items file...",UNITEGALLERY_TEXTDOMAIN)?>
199
+ </div>
200
+
201
+ <div id="dialog_import_items_error" class="unite_error_message" style="display:none"></div>
202
+
203
+ <div class="dialog_import_items_success" class="unite_success_message" style="display:none"><?php _e("Items Imported Successfully")?></div>
204
+
205
+ </div>
206
+
207
+ <?php
208
+ }
209
+
210
+
211
+ /**
212
+ * put video dialog
213
+ */
214
+ protected function putVideoDialog(){
215
+
216
+ require GlobalsUG::$pathViews."system/video_dialog.php";
217
+ }
218
+
219
+
220
+ /**
221
+ * put additional html here
222
+ */
223
+ protected function putAddHtml(){
224
+
225
+ $this->putDialogEditTitle();
226
+ $this->putDialogEditItem();
227
+ $this->putDialogImportItems();
228
+
229
+ $this->putScripts();
230
+ }
231
+
232
+
233
+ /**
234
+ * put init items
235
+ */
236
+ protected function putInitItems(){
237
+ /*
238
+ $objitems = new UniteCreatoritems();
239
+ $htmlitems = $objitems->getCatitemsHtml(null);
240
+
241
+ echo $htmlitems;
242
+ */
243
+ }
244
+
245
+
246
+ /**
247
+ * init the items manager
248
+ */
249
+ protected function init(){
250
+
251
+ //set items type
252
+ $isGalleryPage = GlobalsUGGallery::$isInited;
253
+ if($isGalleryPage){
254
+ $this->itemsType = GlobalsUGGallery::$objGalleryType->getItemsType();
255
+ $this->selectedCategory = GlobalsUGGallery::$gallery->getParam("category");
256
+ }
257
+
258
+ $this->hasCats = true;
259
+ $this->hasSortBy = true;
260
+
261
+ parent::init();
262
+
263
+ $this->itemsLoaderText = __("Getting items",UNITEGALLERY_TEXTDOMAIN);
264
+ $this->textItemsSelected = __("items selected",UNITEGALLERY_TEXTDOMAIN);
265
+ $this->filterActive = true;
266
+ }
267
+
268
+
269
+ }
inc_php/unitegallery_operations.class.php ADDED
@@ -0,0 +1,459 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @package Unite Gallery
4
+ * @author Valiano
5
+ * @copyright (C) 2012 Unite CMS, All Rights Reserved.
6
+ * @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
7
+ * */
8
+ defined('UNITEGALLERY_INC') or die('Restricted access');
9
+
10
+
11
+ class UGOperations extends UniteElementsBaseUG{
12
+
13
+ private static $arrGeneralSettings = null;
14
+
15
+ const GENERAL_SETTINGS_OPTION = "unite_gallery_general_settings";
16
+
17
+
18
+ /**
19
+ * get general settings object
20
+ */
21
+ public function getGeneralSettingsObject(){
22
+
23
+ $settingsFilepath = GlobalsUG::$pathSettings."general_settings.xml";
24
+ $settings = new UniteSettingsUG();
25
+ $settings->loadXMLFile($settingsFilepath);
26
+
27
+ $settingsProviderFilepath = GlobalsUG::$pathProvider."settings/general_settings_provider.xml";
28
+
29
+ if(file_exists($settingsProviderFilepath)){
30
+ $settingsProvider = new UniteSettingsUG();
31
+ $settingsProvider->loadXMLFile($settingsProviderFilepath);
32
+
33
+ $settings->mergeSettings($settingsProvider);
34
+ }
35
+
36
+ $arrValues = UniteProviderFunctionsUG::getOption(self::GENERAL_SETTINGS_OPTION);
37
+
38
+ if(!empty($arrValues))
39
+ $settings->setStoredValues($arrValues);
40
+
41
+
42
+ return($settings);
43
+ }
44
+
45
+
46
+ /**
47
+ * get general settings
48
+ */
49
+ public function getGeneralSettings(){
50
+
51
+ if(self::$arrGeneralSettings === null){
52
+ $objSettings = $this->getGeneralSettingsObject();
53
+ self::$arrGeneralSettings = $objSettings->getArrValues();
54
+ }
55
+
56
+
57
+ return(self::$arrGeneralSettings);
58
+ }
59
+
60
+
61
+ /**
62
+ * update general settings
63
+ */
64
+ public function updateGeneralSettingsFromData($data){
65
+
66
+ $arrValues = UniteFunctionsUG::getVal($data, "general_settings");
67
+
68
+ UniteProviderFunctionsUG::updateOption(self::GENERAL_SETTINGS_OPTION, $arrValues);
69
+ }
70
+
71
+
72
+ /**
73
+ * get error message html
74
+ */
75
+ public function getErrorMessageHtml($message, $trace = ""){
76
+
77
+ $html = '<div style="width:100%;min-width:400px;height:300px;margin-bottom:10px;border:1px solid black;margin:0px auto;overflow:auto;">';
78
+ $html .= '<div style="padding-left:20px;padding-right:20px;line-height:1.5;padding-top:40px;color:red;font-size:16px;text-align:left;">';
79
+ $html .= $message;
80
+
81
+ if(!empty($trace)){
82
+ $html .= '<div style="text-align:left;padding-left:20px;padding-top:20px;">';
83
+ $html .= "<pre>{$trace}</pre>";
84
+ $html .= "</div>";
85
+ }
86
+
87
+ $html .= '</div></div>';
88
+
89
+ return($html);
90
+ }
91
+
92
+
93
+ /**
94
+ * put error mesage from the module
95
+ */
96
+ public function putModuleErrorMessage($message, $trace = ""){
97
+
98
+ ?>
99
+ <div style="width:100%;min-width:400px;height:300px;margin-bottom:10px;border:1px solid black;margin:0px auto;overflow:auto;">
100
+ <div style="padding-left:20px;padding-right:20px;line-height:1.5;padding-top:40px;color:red;font-size:16px;text-align:left;">
101
+ <?php echo $message?>
102
+ </div>
103
+
104
+ <?php if(!empty($trace)):?>
105
+
106
+ <div style="text-align:left;padding-left:20px;padding-top:20px;">
107
+ <pre><?php echo $trace?></pre>
108
+ </div>
109
+
110
+ <?php endif?>
111
+
112
+ </div>
113
+ <?php
114
+ }
115
+
116
+
117
+ /**
118
+ * put top menu with some view
119
+ */
120
+ public function putTopMenu($view){
121
+
122
+ $viewGalleries = HelperUG::getGalleriesView();
123
+ $viewItems = HelperUG::getItemsView();
124
+
125
+ $activeGalleries = "";
126
+ $activeItems = "";
127
+ switch($view){
128
+ default:
129
+ case GlobalsUG::VIEW_GALLERIES:
130
+ $activeGalleries = "class='active'";
131
+ break;
132
+ case GlobalsUG::VIEW_ITEMS:
133
+ $activeItems = "class='active'";
134
+ break;
135
+ }
136
+
137
+ ?>
138
+
139
+ <div class="top_menu_wrapper">
140
+ <ul class="unite-top-main-menu">
141
+ <li <?php echo $activeGalleries?>><a class="unite-button-secondary" href="<?php echo $viewGalleries?>"><?php _e("Gallery List", UNITEGALLERY_TEXTDOMAIN)?></a></li>
142
+ <li <?php echo $activeItems?>><a class="unite-button-secondary" href="<?php echo $viewItems?>"><?php _e("Edit Items", UNITEGALLERY_TEXTDOMAIN)?></a></li>
143
+ </ul>
144
+ </div>
145
+
146
+ <?php
147
+ }
148
+
149
+
150
+ /**
151
+ * create thumbs from image by url
152
+ * the image must be relative path to the platform base
153
+ */
154
+ public function createThumbs($urlImage, $thumbWidth = null){
155
+
156
+ if($thumbWidth === null)
157
+ $thumbWidth = GlobalsUG::THUMB_WIDTH;
158
+
159
+ $urlImage = HelperUG::URLtoRelative($urlImage);
160
+
161
+ $info = HelperUG::getImageDetails($urlImage);
162
+
163
+ //check thumbs path
164
+ $pathThumbs = $info["path_thumbs"];
165
+ if(!is_dir($pathThumbs))
166
+ @mkdir($pathThumbs);
167
+
168
+ if(!is_dir($pathThumbs))
169
+ UniteFunctionsUG::throwError("Can't make thumb folder: {$pathThumbs}. Please check php and folder permissions");
170
+
171
+ $filepathImage = $info["filepath"];
172
+
173
+ $filenameThumb = $this->imageView->makeThumb($filepathImage, $pathThumbs, $thumbWidth);
174
+
175
+ $urlThumb = "";
176
+ if(!empty($filenameThumb)){
177
+ $urlThumbs = $info["url_dir_thumbs"];
178
+ $urlThumb = $urlThumbs.$filenameThumb;
179
+ }
180
+
181
+ return($urlThumb);
182
+ }
183
+
184
+
185
+ /**
186
+ * return thumb url from image url, return full url of the thumb
187
+ * if some error occured, return empty string
188
+ */
189
+ public function getThumbURLFromImageUrl($urlImage, $imageID){
190
+
191
+ try{
192
+ $imageID = trim($imageID);
193
+ if(!empty($imageID)){
194
+ $urlThumb = UniteProviderFunctionsUG::getThumbUrlFromImageID($imageID);
195
+ }else{
196
+ $urlThumb = $this->createThumbs($urlImage);
197
+ }
198
+
199
+ $urlThumb = HelperUG::URLtoFull($urlThumb);
200
+ return($urlThumb);
201
+
202
+ }catch(Exception $e){
203
+
204
+ return("");
205
+ }
206
+
207
+ return("");
208
+ }
209
+
210
+
211
+ /**
212
+ * run client ajax actions
213
+ */
214
+ function onClientAjaxActions(){
215
+
216
+ $action = UniteFunctionsUG::getPostGetVariable("action");
217
+ if($action != "unitegallery_ajax_action"){
218
+ echo "nothing here";exit();
219
+ }
220
+
221
+ $clientAction = UniteFunctionsUG::getPostGetVariable("client_action");
222
+ $objItems = new UniteGalleryItems();
223
+ $galleryHtmlID = UniteFunctionsUG::getPostVariable("galleryID");
224
+ $data = UniteFunctionsUG::getPostVariable("data", "", UniteFunctionsUG::SANITIZE_NOTHING);
225
+
226
+ if(empty($data))
227
+ $data = array();
228
+
229
+ $data["galleryID"] = HelperGalleryUG::getGalleryIDFromHtmlID($galleryHtmlID);
230
+
231
+ try{
232
+
233
+ switch($clientAction){
234
+ case "front_get_cat_items":
235
+
236
+ $html = $objItems->getHtmlFrontFromData($data);
237
+
238
+ $output = array("html"=>$html);
239
+
240
+ HelperUG::ajaxResponseData($output);
241
+ break;
242
+ case "front_loadmore":
243
+ $output = $objItems->getHtmlLoadmore($data);
244
+ HelperUG::ajaxResponseData($output);
245
+ break;
246
+ default:
247
+ HelperUG::ajaxResponseError("wrong ajax action: <b>$action</b> ");
248
+ break;
249
+ }
250
+
251
+ }catch(Exception $e){
252
+ $message = $e->getMessage();
253
+
254
+ $errorMessage = $message;
255
+ if(GlobalsUG::SHOW_TRACE == true){
256
+ $trace = $e->getTraceAsString();
257
+ $errorMessage = $message."<pre>".$trace."</pre>";
258
+ }
259
+
260
+ HelperUG::ajaxResponseError($errorMessage);
261
+ }
262
+
263
+
264
+ //it's an ajax action, so exit
265
+ HelperUG::ajaxResponseError("No response output on <b> $action </b> action. please check with the developer.");
266
+ exit();
267
+
268
+ }
269
+
270
+
271
+ /**
272
+ * put first 3 fields of the ajax form
273
+ */
274
+ public function putAjaxFormFields($clientAction, $galleryID = null){
275
+ ?>
276
+ <input type="hidden" name="action" value="unitegallery_ajax_action">
277
+ <input type="hidden" name="client_action" value="<?php echo $clientAction?>">
278
+
279
+ <?php if(method_exists("UniteProviderFunctionsUG", "getNonce")):?>
280
+
281
+ <input type="hidden" name="nonce" value="<?php echo UniteProviderFunctionsUG::getNonce(); ?>">
282
+ <?php endif;
283
+ if(!empty($galleryID)): ?>
284
+ <input type="hidden" name="galleryid" value="<?php echo $galleryID ?>">
285
+ <?php endif;
286
+
287
+ }
288
+
289
+
290
+ /**
291
+ * encode category id for exporting
292
+ */
293
+ private function export_encodeCatID($catID){
294
+
295
+ //if multiple string
296
+ if(strpos($catID,",") !== false){
297
+ $arrIDs = explode(",", $catID);
298
+ foreach($arrIDs as $key=>$id)
299
+ $arrIDs[$key] = "cat_".$id;
300
+ $strIDs = implode(",", $arrIDs);
301
+ return($strIDs);
302
+ }
303
+
304
+ //if simple number
305
+ $catID = "cat_".$catID;
306
+
307
+ return($catID);
308
+ }
309
+
310
+
311
+ /**
312
+ * decode category id
313
+ */
314
+ private function export_decodeCatID($catID, $index){
315
+
316
+ //if multiple string
317
+ if(strpos($catID,",") !== false){
318
+ $arrIDs = explode(",", $catID);
319
+ foreach($arrIDs as $key=>$id)
320
+ $arrIDs[$key] = $index[$id];
321
+
322
+ $strIDs = implode(",", $arrIDs);
323
+ return($strIDs);
324
+ }
325
+
326
+ //if simple number
327
+ $catID = $index[$catID];
328
+
329
+ return($catID);
330
+ }
331
+
332
+
333
+ /**
334
+ * export all gallery content
335
+ */
336
+ public function exportAllContent(){
337
+
338
+ //prepare categories
339
+ $arrCats = $this->db->fetch(GlobalsUG::$table_categories);
340
+
341
+ //update aliases
342
+ foreach($arrCats as $key=>$cat){
343
+ $cat["alias"] = $this->export_encodeCatID($cat["id"]);
344
+ $arrCats[$key] = $cat;
345
+ }
346
+
347
+ //-----------------------
348
+
349
+ //prepare galleries
350
+ $arrGalleries = $this->db->fetch(GlobalsUG::$table_galleries);
351
+ foreach($arrGalleries as $key=>$gallery){
352
+
353
+ $params = $gallery["params"];
354
+ $arrParams = (array)json_decode($params);
355
+
356
+ //change category id to alias
357
+ if(array_key_exists("category", $arrParams))
358
+ $arrParams["category"] = $this->export_encodeCatID($arrParams["category"]);
359
+
360
+ if(array_key_exists("categorytabs_ids", $arrParams)){
361
+ $arrParams["categorytabs_ids"] = $this->export_encodeCatID($arrParams["categorytabs_ids"]);
362
+ }
363
+
364
+ $params = json_encode($arrParams);
365
+ $arrGalleries[$key]["params"] = $params;
366
+ }
367
+
368
+ //-----------------------
369
+ //prepare items
370
+ $arrItems = $this->db->fetch(GlobalsUG::$table_items);
371
+ foreach($arrItems as $key=>$item){
372
+ $item["catid"] = $this->export_encodeCatID($item["catid"]);
373
+ $arrItems[$key] = $item;
374
+ }
375
+
376
+ $output = array();
377
+ $output["categories"] = $arrCats;
378
+ $output["galleries"] = $arrGalleries;
379
+ $output["items"] = $arrItems;
380
+
381
+ $strOutput = serialize($output);
382
+ $filename = "unitegallery_export.txt";
383
+
384
+ header( 'Content-Description: File Transfer' );
385
+ header( 'Content-Disposition: attachment; filename=' . $filename );
386
+
387
+ echo $strOutput;
388
+ exit();
389
+ }
390
+
391
+
392
+
393
+ /**
394
+ * import all content
395
+ */
396
+ public function importAllContent($content){
397
+
398
+ $arrData = unserialize($content);
399
+ $arrCats = $arrData["categories"];
400
+
401
+ //insert categories
402
+ $this->db->runSql("delete from ".GlobalsUG::$table_categories);
403
+
404
+ foreach($arrCats as $cat){
405
+ unset($cat["id"]);
406
+ $this->db->insert(GlobalsUG::$table_categories, $cat);
407
+ }
408
+
409
+ $arrCatsNew = $this->db->fetch(GlobalsUG::$table_categories);
410
+
411
+ //prepare cats index
412
+ $indexCats = array();
413
+ foreach($arrCatsNew as $cat){
414
+ $indexCats[$cat["alias"]] = $cat["id"];
415
+ }
416
+
417
+ //--------------
418
+ //import galleries
419
+ $arrGalleries = $arrData["galleries"];
420
+ $this->db->runSql("delete from ".GlobalsUG::$table_galleries);
421
+
422
+ foreach($arrGalleries as $gallery){
423
+ unset($gallery["id"]);
424
+
425
+ $params = $gallery["params"];
426
+ $arrParams = (array)json_decode($params);
427
+
428
+ //change category id to alias
429
+ if(array_key_exists("category", $arrParams))
430
+ $arrParams["category"] = $this->export_decodeCatID($arrParams["category"], $indexCats);
431
+
432
+ if(array_key_exists("categorytabs_ids", $arrParams)){
433
+ $arrParams["categorytabs_ids"] = $this->export_decodeCatID($arrParams["categorytabs_ids"], $indexCats);
434
+ }
435
+
436
+ $gallery["params"] = json_encode($arrParams);
437
+
438
+ $this->db->insert(GlobalsUG::$table_galleries, $gallery);
439
+ }
440
+
441
+
442
+ //--------------
443
+ // import items
444
+ $arrItems = $arrData["items"];
445
+ $this->db->runSql("delete from ".GlobalsUG::$table_items);
446
+
447
+ foreach($arrItems as $item){
448
+ unset($item["id"]);
449
+ $item["catid"] = $this->export_decodeCatID($item["catid"], $indexCats);
450
+
451
+ $this->db->insert(GlobalsUG::$table_items, $item);
452
+ }
453
+
454
+ }
455
+
456
+
457
+ }
458
+
459
+ ?>
includes.php ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ // no direct access
4
+ defined('UNITEGALLERY_INC') or die;
5
+
6
+ global $uniteGalleryVersion;
7
+ $uniteGalleryVersion = "1.7.54";
8
+
9
+ $currentFile = __FILE__;
10
+ $currentFolder = dirname($currentFile);
11
+
12
+ //include frameword files
13
+ require_once $currentFolder . '/inc_php/framework/include_framework.php';
14
+
15
+ require_once $currentFolder . '/inc_php/unitegallery_globals.class.php';
16
+ require_once $currentFolder . '/inc_php/unitegallery_globals_gallery.class.php';
17
+ require_once $currentFolder . '/inc_php/unitegallery_operations.class.php';
18
+ require_once $currentFolder . '/inc_php/unitegallery_category.class.php';
19
+ require_once $currentFolder . '/inc_php/unitegallery_categories.class.php';
20
+ require_once $currentFolder . '/inc_php/unitegallery_item.class.php';
21
+ require_once $currentFolder . '/inc_php/unitegallery_items.class.php';
22
+ require_once $currentFolder . '/inc_php/unitegallery_galleries.class.php';
23
+ require_once $currentFolder . '/inc_php/unitegallery_gallery.class.php';
24
+ require_once $currentFolder . '/inc_php/unitegallery_gallery_type.class.php';
25
+ require_once $currentFolder . '/inc_php/unitegallery_items.class.php';
26
+ require_once $currentFolder . '/inc_php/unitegallery_helper.class.php';
27
+ require_once $currentFolder . '/inc_php/unitegallery_helper_gallery.class.php';
28
+
29
+ require_once $currentFolder . '/inc_php/unitegallery_manager.class.php';
30
+ require_once $currentFolder . '/inc_php/unitegallery_manager_main.class.php';
31
+ require_once $currentFolder . '/inc_php/unitegallery_manager_inline.class.php';
32
+
33
+
34
+ //include all gallery files
35
+ $objGalleries = new UniteGalleryGalleries();
36
+ $arrGalleries = $objGalleries->getArrGalleryTypes();
37
+
38
+ foreach($arrGalleries as $gallery){
39
+ $filepathIncludes = $gallery->getPathIncludes();
40
+ $pathGallery = $gallery->getPathGallery();
41
+ if(file_exists($filepathIncludes))
42
+ require $filepathIncludes;
43
+ }
44
+
45
+
46
+ ?>
js/admin.js ADDED
@@ -0,0 +1,914 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ (function($){
3
+ $.mlp = {x:0,y:0}; // Mouse Last Position
4
+ function documentHandler(){
5
+ var $current = this === document ? $(this) : $(this).contents();
6
+ $current.mousemove(function(e){jQuery.mlp = {x:e.pageX,y:e.pageY}});
7
+ $current.find("iframe").load(documentHandler);
8
+ }
9
+ $(documentHandler);
10
+ $.fn.ismouseover = function(overThis) {
11
+ var result = false;
12
+ this.eq(0).each(function() {
13
+ var $current = $(this).is("iframe") ? $(this).contents().find("body") : $(this);
14
+ var offset = $current.offset();
15
+ result = offset.left<=$.mlp.x && offset.left + $current.outerWidth() > $.mlp.x &&
16
+ offset.top<=$.mlp.y && offset.top + $current.outerHeight() > $.mlp.y;
17
+ });
18
+ return result;
19
+ };
20
+ })(jQuery);
21
+
22
+ if(typeof window.addEvent == "undefined")
23
+ window.addEvent = function(){};
24
+
25
+
26
+ /**
27
+ * Drop Down selector plugin
28
+ * ------------------------------------------------------------
29
+ */
30
+ jQuery.fn.dropDownSelectorPluginUG = function( config ) {
31
+
32
+ var cfg = {
33
+ wrapperCls : 'unite-drop-down-wrapper',
34
+ filterPanelCls : "unite-selected-items",
35
+ selected : [],
36
+ hiddenInputName : "",
37
+ label : "",
38
+ textEmpty : "No items chosen",
39
+ makeMultiple : false, //make the select box multiple
40
+ panelLabel : "Selected Items",
41
+ isSortable : true,
42
+ selectFirstID : "", //first item select, if exists, update it together with tags add
43
+ firstItemText : "[First Item From List]"
44
+ };
45
+ jQuery.extend(cfg, config);
46
+
47
+ //validation:
48
+ if(cfg.hiddenInputName == "")
49
+ throw new Error("The dropdown selector plugin muyst have hidden input name");
50
+
51
+ var dropDownElement = jQuery(this),
52
+ wrapper,
53
+ htmlSelect,
54
+ wrapperPanel,
55
+ filterPanel,
56
+ hiddenInput,
57
+ selectFirstItem,
58
+ filters = [];
59
+
60
+ wrapper = jQuery('<div></div>');
61
+ wrapper.addClass( cfg.wrapperCls );
62
+ dropDownElement.before( wrapper );
63
+ htmlSelect = dropDownElement.clone();
64
+ dropDownElement.remove();
65
+ wrapperPanel = jQuery('<div><div class="label">' + cfg.panelLabel + ':</div><ul></ul></div>');
66
+ filterPanel = wrapperPanel.find("ul");
67
+ filterPanel.append(cfg.textEmpty);
68
+
69
+ wrapperPanel.addClass(cfg.filterPanelCls);
70
+ hiddenInput = jQuery("input[name=" + cfg.hiddenInputName + "]");
71
+ if ( hiddenInput.length == 0) {
72
+
73
+ hiddenInput = jQuery('<input name="' + cfg.hiddenInputName + '" />');
74
+ wrapperPanel.append( hiddenInput );
75
+ }
76
+ wrapper.append( jQuery('<div></div>').append( htmlSelect ) );
77
+ wrapper.append( wrapperPanel );
78
+ dropDownElement = htmlSelect;
79
+
80
+ if(cfg.makeMultiple == true)
81
+ dropDownElement.attr("multiple", "multiple");
82
+
83
+ //And finally Initialize filters with values
84
+ var hiddenInputValue = hiddenInput.attr("value");
85
+
86
+ //init first select
87
+ if(cfg.selectFirstID != ""){
88
+ selectFirstItem = jQuery("#" + cfg.selectFirstID);
89
+ selectFirstItem.append(jQuery('<option>', { value : "first" , selected: "selected"}).text(cfg.firstItemText));
90
+ }
91
+
92
+ if ( hiddenInputValue ) {
93
+
94
+ var values = hiddenInputValue.split(",");
95
+
96
+ hiddenInput.val("");
97
+ for ( var i=0; i < values.length; i++) {
98
+ addFilter( values[i] );
99
+ }
100
+
101
+ }
102
+
103
+ dropDownElement.val("");
104
+
105
+ if(cfg.isSortable == true)
106
+ filterPanel.sortable({
107
+ create: function(){
108
+ filterPanel.data("is_sortable", true);
109
+ },
110
+ update:updateHiddenInput
111
+ });
112
+
113
+ /**
114
+ * on select choose
115
+ */
116
+ function selected ( event ) {
117
+ var val;
118
+ if ( (val = dropDownElement.val() ) != "" ) {
119
+ addFilter(val);
120
+ }
121
+ }
122
+
123
+ /**
124
+ * add filter
125
+ */
126
+ function addFilter( valueId ){
127
+
128
+ if(!valueId) {
129
+ return false;
130
+ }
131
+
132
+ if ( filters.length == 0 ) {
133
+ filterPanel.html("");
134
+ }
135
+
136
+ var option = dropDownElement.find('option[value='+valueId+']');
137
+ if(option.length == 0)
138
+ return(false);
139
+
140
+ var optionText = option.text();
141
+
142
+ var object = {
143
+ id : valueId,
144
+ text : optionText
145
+ };
146
+
147
+ filters.push( object );
148
+
149
+ if(selectFirstItem){
150
+ selectFirstItem.append(jQuery('<option>', { value : valueId }).text(optionText));
151
+ }
152
+
153
+ option.remove();
154
+ filterPanel.append(filterItemFactory(object));
155
+
156
+ updateHiddenInput();
157
+ }
158
+
159
+
160
+ /**
161
+ * remove filter
162
+ */
163
+ function removeFilter( config ){
164
+
165
+ var li = filterPanel.find("li[_id="+config.id+"]"),
166
+ option = jQuery('<option></option>');
167
+ li.remove();
168
+
169
+ if(selectFirstItem){
170
+ var option = selectFirstItem.find('option[value='+config.id+']');
171
+ if(option.length)
172
+ option.remove();
173
+ }
174
+
175
+ option.html( config.text );
176
+ option.attr("value", config.id);
177
+ dropDownElement.append(option);
178
+
179
+ updateHiddenInput();
180
+ }
181
+
182
+
183
+ /**
184
+ * update hidden input
185
+ */
186
+ function updateHiddenInput(){
187
+
188
+ var arrValues = [];
189
+
190
+ var isSortable = filterPanel.data("is_sortable");
191
+ if(isSortable === true){
192
+
193
+ arrValues = filterPanel.sortable( "toArray" ,{attribute: "_id"});
194
+
195
+ }else{ //get the array from the dome
196
+
197
+ var objLI = filterPanel.find("li");
198
+ jQuery.each(objLI, function(index, item){
199
+ var id = jQuery(item).attr("_id");
200
+
201
+ if(jQuery(item).hasClass("ui-sortable-placeholder") == false)
202
+ arrValues.push(id);
203
+ });
204
+
205
+ }
206
+
207
+ //make string from the array
208
+ var strValues = "";
209
+
210
+ if(arrValues.length != 0)
211
+ strValues = arrValues.join(",");
212
+
213
+ hiddenInput.val(strValues);
214
+ }
215
+
216
+
217
+ /**
218
+ * init plugin
219
+ */
220
+ function filterItemFactory( config )
221
+ {
222
+ var element = jQuery('<li></li>'),
223
+ innerElement = jQuery('<div></div>'),
224
+ removeAction = jQuery('<a class="remove"></a>');
225
+ element.append(innerElement);
226
+ element.attr("_id", config.id);
227
+ innerElement.html( config.text );
228
+ innerElement.append(removeAction);
229
+ removeAction.click(removeFilter.bind(this, config));
230
+ return element;
231
+ }
232
+ dropDownElement.change(selected.bind(this));
233
+
234
+ };
235
+
236
+ //---- End drop down selector plugin -----
237
+
238
+ /**
239
+ * Unite Admin Class
240
+ */
241
+ function UniteAdminUG(){
242
+
243
+ var t = this;
244
+
245
+ var g_errorMessageID = null, g_hideMessageCounter = 0;
246
+ var g_ajaxLoaderID = null, g_ajaxHideButtonID = null, g_successMessageID = null;
247
+ var g_colorPickerCallback = null;
248
+ var g_providerAdmin = new UniteProviderAdminUG();
249
+
250
+ this.__________GENERAL_FUNCTIONS_____ = function(){};
251
+
252
+
253
+ /**
254
+ * debug html on the top of the page (from the master view)
255
+ */
256
+ this.debug = function(html){
257
+ jQuery("#div_debug").show().html(html);
258
+ };
259
+
260
+ /**
261
+ * output data to console
262
+ */
263
+ this.trace = function(data,clear){
264
+ if(clear && clear == true)
265
+ console.clear();
266
+ console.log(data);
267
+ };
268
+
269
+
270
+ /**
271
+ * escape html, turn html to a string
272
+ */
273
+ this.htmlspecialchars = function(string){
274
+ return string
275
+ .replace(/&/g, "&amp;")
276
+ .replace(/</g, "&lt;")
277
+ .replace(/>/g, "&gt;")
278
+ .replace(/"/g, "&quot;")
279
+ .replace(/'/g, "&#039;");
280
+ };
281
+
282
+
283
+ /**
284
+ * capitalize first letter
285
+ */
286
+ this.capitalizeFirstLetter = function(str){
287
+
288
+ str = str.substr(0, 1).toUpperCase() + str.substr(1).toLowerCase();
289
+ return(str);
290
+ };
291
+
292
+
293
+ /**
294
+ * Find absolute position on the screen of some element
295
+ */
296
+ this.getAbsolutePos = function(obj){
297
+ var curleft = curtop = 0;
298
+ if (obj.offsetParent) {
299
+ curleft = obj.offsetLeft;
300
+ curtop = obj.offsetTop;
301
+ while (obj = obj.offsetParent) {
302
+ curleft += obj.offsetLeft;
303
+ curtop += obj.offsetTop;
304
+ }
305
+ }
306
+ return[curleft,curtop];
307
+ };
308
+
309
+
310
+ /**
311
+ * strip slashes to some string
312
+ */
313
+ this.stripslashes = function(str) {
314
+ return (str + '').replace(/\\(.?)/g, function (s, n1) {
315
+ switch (n1) {
316
+ case '\\':
317
+ return '\\';
318
+ case '0':
319
+ return '\u0000';
320
+ case '':
321
+ return '';
322
+ default:
323
+ return n1;
324
+ }
325
+ });
326
+ };
327
+
328
+ /**
329
+ * turn string value ("true", "false") to string
330
+ */
331
+ this.strToBool = function(str){
332
+
333
+ if(str == undefined)
334
+ return(false);
335
+
336
+ if(typeof(str) != "string")
337
+ return(false);
338
+
339
+ str = str.toLowerCase();
340
+
341
+ var bool = (str == "true")?true:false;
342
+ return(bool);
343
+ };
344
+
345
+ /**
346
+ * set callback on color picker movement
347
+ */
348
+ this.setColorPickerCallback = function(callbackFunc){
349
+ g_colorPickerCallback = callbackFunc;
350
+ };
351
+
352
+ /**
353
+ * on color picker event. Pass the event further
354
+ */
355
+ this.onColorPickerMoveEvent = function(event){
356
+
357
+ if(typeof g_colorPickerCallback == "function")
358
+ g_colorPickerCallback(event);
359
+ };
360
+
361
+ /**
362
+ * change rgb & rgba to hex
363
+ */
364
+ this.rgb2hex = function(rgb) {
365
+ if (rgb.search("rgb") == -1 || jQuery.trim(rgb) == '') return rgb; //ie6
366
+
367
+ function hex(x) {
368
+ return ("0" + parseInt(x).toString(16)).slice(-2);
369
+ }
370
+
371
+ if(rgb.indexOf('-moz') > -1){
372
+ var temp = rgb.split(' ');
373
+ delete temp[0];
374
+ rgb = jQuery.trim(temp.join(' '));
375
+ }
376
+
377
+ if(rgb.split(')').length > 2){
378
+ var hexReturn = '';
379
+ var rgbArr = rgb.split(')');
380
+ for(var i = 0; i < rgbArr.length - 1; i++){
381
+ rgbArr[i] += ')';
382
+ var temp = rgbArr[i].split(',');
383
+ if(temp.length == 4){
384
+ rgb = temp[0]+','+temp[1]+','+temp[2];
385
+ rgb += ')';
386
+ }else{
387
+ rgb = rgbArr[i];
388
+ }
389
+ rgb = jQuery.trim(rgb);
390
+
391
+ rgb = rgb.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+))?\)$/);
392
+
393
+ hexReturn += "#" + hex(rgb[1]) + hex(rgb[2]) + hex(rgb[3])+" ";
394
+ }
395
+
396
+ return hexReturn;
397
+ }else{
398
+ var temp = rgb.split(',');
399
+ if(temp.length == 4){
400
+ rgb = temp[0]+','+temp[1]+','+temp[2];
401
+ rgb += ')';
402
+ }
403
+
404
+ rgb = rgb.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+))?\)$/);
405
+
406
+ return "#" + hex(rgb[1]) + hex(rgb[2]) + hex(rgb[3]);
407
+ }
408
+
409
+
410
+ };
411
+
412
+ /**
413
+ * get rgb from hex values
414
+ */
415
+ this.convertHexToRGB = function(hex) {
416
+ var hex = parseInt(((hex.indexOf('#') > -1) ? hex.substring(1) : hex), 16);
417
+ return [hex >> 16,(hex & 0x00FF00) >> 8,(hex & 0x0000FF)];
418
+ };
419
+
420
+
421
+
422
+ /**
423
+ * get transparency value from 0 to 100
424
+ */
425
+ this.getTransparencyFromRgba = function(rgba, inPercent){
426
+ var temp = rgba.split(',');
427
+ if(temp.length == 4){
428
+ inPercent = (typeof inPercent !== 'undefined') ? inPercent : true;
429
+ return (inPercent) ? temp[3].replace(/[^\d.]/g, "") : temp[3].replace(/[^\d.]/g, "") * 100;
430
+ }
431
+
432
+ return false;
433
+ };
434
+
435
+
436
+ /**
437
+ * strip html tags
438
+ */
439
+ this.stripTags = function(input, allowed) {
440
+ allowed = (((allowed || "") + "").toLowerCase().match(/<[a-z][a-z0-9]*>/g) || []).join(''); // making sure the allowed arg is a string containing only tags in lowercase (<a><b><c>)
441
+ var tags = /<\/?([a-z][a-z0-9]*)\b[^>]*>/gi,
442
+ commentsAndPhpTags = /<!--[\s\S]*?-->|<\?(?:php)?[\s\S]*?\?>/gi;
443
+ return input.replace(commentsAndPhpTags, '').replace(tags, function ($0, $1) {
444
+ return allowed.indexOf('<' + $1.toLowerCase() + '>') > -1 ? $0 : '';
445
+ });
446
+ };
447
+
448
+ /**
449
+ * load css file on the fly
450
+ * replace current item if exists
451
+ */
452
+ this.loadCssFile = function(urlCssFile,replaceID){
453
+
454
+ var rand = Math.floor((Math.random()*100000)+1);
455
+
456
+ if(urlCssFile.indexOf("?") == -1)
457
+ urlCssFile += "?rand="+rand;
458
+ else
459
+ urlCssFile += "&rand="+rand;
460
+
461
+ if(replaceID)
462
+ jQuery("#"+replaceID).remove();
463
+
464
+ jQuery("head").append("<link>");
465
+ var css = jQuery("head").children(":last");
466
+ css.attr({
467
+ rel: "stylesheet",
468
+ type: "text/css",
469
+ href: urlCssFile
470
+ });
471
+
472
+ //replace current element
473
+ if(replaceID)
474
+ css.attr({id:replaceID});
475
+ };
476
+
477
+
478
+ /**
479
+ * unselect some button / buttons
480
+ */
481
+ this.enableButton = function(buttonID){
482
+ jQuery(buttonID).removeClass("button-disabled");
483
+ };
484
+
485
+
486
+ /**
487
+ * unselect some button / buttons
488
+ */
489
+ this.disableButton = function(buttonID){
490
+ jQuery(buttonID).addClass("button-disabled");
491
+ };
492
+
493
+ /**
494
+ * return true / false if the button enabled
495
+ */
496
+ this.isButtonEnabled = function(buttonID){
497
+ if(jQuery(buttonID).hasClass("button-disabled"))
498
+ return(false);
499
+
500
+ return(true);
501
+ };
502
+
503
+ /**
504
+ * check if was pressed right mouse button
505
+ */
506
+ this.isRightButtonPressed = function(event){
507
+
508
+ if(event.buttons == 2 || event.button == 2)
509
+ return(true);
510
+
511
+ return(false);
512
+ };
513
+
514
+ this._____________DIALOGS__________ = function(){};
515
+
516
+ /**
517
+ * open "add image" dialog
518
+ */
519
+ this.openAddImageDialog = function(title, onInsert, isMultiple){
520
+
521
+ g_providerAdmin.openAddImageDialog(title, onInsert, isMultiple);
522
+
523
+ };
524
+
525
+
526
+ /**
527
+ * open video dialog
528
+ */
529
+ this.openVideoDialog = function(callbackFunction, itemData){
530
+
531
+ g_ugMediaDialog.openVideoDialog(callbackFunction, itemData);
532
+
533
+ };
534
+
535
+
536
+ this.__________AJAX_REQUEST_____ = function(){};
537
+
538
+ /**
539
+ * show error message or call once custom handler function
540
+ */
541
+ this.showErrorMessage = function(htmlError){
542
+
543
+ if(g_errorMessageID !== null){
544
+ jQuery("#"+g_errorMessageID).show().html(htmlError);
545
+ }else
546
+ jQuery("#error_message").show().html(htmlError);
547
+
548
+ showAjaxButton();
549
+ };
550
+
551
+ /**
552
+ * hide error message
553
+ */
554
+ var hideErrorMessage = function(){
555
+ if(g_errorMessageID !== null){
556
+ jQuery("#"+g_errorMessageID).hide();
557
+ if(g_hideMessageCounter > 0){
558
+ g_hideMessageCounter = 0;
559
+ g_errorMessageID = null;
560
+ }else
561
+ g_hideMessageCounter++;
562
+ }else
563
+ jQuery("#error_message").hide();
564
+ };
565
+
566
+
567
+ /**
568
+ * set error message id
569
+ */
570
+ this.setErrorMessageID = function(id){
571
+ g_errorMessageID = id;
572
+ g_hideMessageCounter = 0;
573
+ };
574
+
575
+
576
+
577
+ /**
578
+ * set success message id
579
+ */
580
+ this.setSuccessMessageID = function(id){
581
+ g_successMessageID = id;
582
+ };
583
+
584
+ /**
585
+ * show success message
586
+ */
587
+ this.showSuccessMessage = function(htmlSuccess){
588
+ var id = "#success_message";
589
+ var delay = 2000;
590
+ if(g_successMessageID){
591
+ id = "#"+g_successMessageID;
592
+ delay = 500;
593
+ }
594
+
595
+ jQuery(id).show().html(htmlSuccess);
596
+ setTimeout("g_ugAdmin.hideSuccessMessage()",delay);
597
+ };
598
+
599
+
600
+ /**
601
+ * hide success message
602
+ */
603
+ this.hideSuccessMessage = function(){
604
+
605
+ if(g_successMessageID){
606
+ jQuery("#"+g_successMessageID).hide();
607
+ g_successMessageID = null; //can be used only once.
608
+ }
609
+ else
610
+ jQuery("#success_message").slideUp("slow").fadeOut("slow");
611
+
612
+ showAjaxButton();
613
+ };
614
+
615
+
616
+ /**
617
+ * set ajax loader id that will be shown, and hidden on ajax request
618
+ * this loader will be shown only once, and then need to be sent again.
619
+ */
620
+ this.setAjaxLoaderID = function(id){
621
+ g_ajaxLoaderID = id;
622
+ };
623
+
624
+ /**
625
+ * show loader on ajax actions
626
+ */
627
+ var showAjaxLoader = function(){
628
+ if(g_ajaxLoaderID)
629
+ jQuery("#"+g_ajaxLoaderID).show();
630
+ };
631
+
632
+ /**
633
+ * hide and remove ajax loader. next time has to be set again before "ajaxRequest" function.
634
+ */
635
+ var hideAjaxLoader = function(){
636
+ if(g_ajaxLoaderID){
637
+ jQuery("#"+g_ajaxLoaderID).hide();
638
+ g_ajaxLoaderID = null;
639
+ }
640
+ };
641
+
642
+ /**
643
+ * set button to hide / show on ajax operations.
644
+ */
645
+ this.setAjaxHideButtonID = function(buttonID){
646
+ g_ajaxHideButtonID = buttonID;
647
+ };
648
+
649
+ /**
650
+ * if exist ajax button to hide, hide it.
651
+ */
652
+ var hideAjaxButton = function(){
653
+ if(g_ajaxHideButtonID)
654
+ jQuery("#"+g_ajaxHideButtonID).hide();
655
+ };
656
+
657
+ /**
658
+ * if exist ajax button, show it, and remove the button id.
659
+ */
660
+ var showAjaxButton = function(){
661
+ if(g_ajaxHideButtonID){
662
+ jQuery("#"+g_ajaxHideButtonID).show();
663
+ g_ajaxHideButtonID = null;
664
+ }
665
+ };
666
+
667
+
668
+ /**
669
+ * add url param
670
+ */
671
+ function addUrlParam(url, param, value){
672
+
673
+ if(url.indexOf("?") == -1)
674
+ url += "?";
675
+ else
676
+ url += "&";
677
+
678
+ if(typeof value == "undefined")
679
+ url += param;
680
+ else
681
+ url += param + "=" + value;
682
+
683
+ return(url);
684
+ }
685
+
686
+
687
+ /**
688
+ * get ajax url with action and params
689
+ */
690
+ this.getUrlAjax = function(action, params){
691
+ var url = g_urlAjaxActions;
692
+
693
+ url = addUrlParam(url, "action", g_pluginName+"_ajax_action");
694
+
695
+ if(typeof g_ugNonce == "string")
696
+ url = addUrlParam(url, "nonce", g_ugNonce);
697
+
698
+ if(action)
699
+ url = addUrlParam(url, "client_action", action);
700
+
701
+ if(params)
702
+ url = addUrlParam(url, params);
703
+
704
+ return(url);
705
+ }
706
+
707
+
708
+ /**
709
+ * Ajax request function. call wp ajax, if error - print error message.
710
+ * if success, call "success function"
711
+ * the request can include files from some form
712
+ */
713
+ this.ajaxRequest = function(action, data, successFunction, includeFilesFormID){
714
+
715
+ if(typeof data == "undefined")
716
+ var data = {};
717
+
718
+ //add galleryID to data
719
+ if(g_galleryID != ""){
720
+ data.galleryID = g_galleryID;
721
+ }
722
+
723
+ var objData = {
724
+ action:g_pluginName+"_ajax_action",
725
+ client_action:action,
726
+ gallery_type: g_galleryType,
727
+ data:data
728
+ };
729
+
730
+ if(typeof g_ugNonce == "string")
731
+ objData["nonce"] = g_ugNonce;
732
+
733
+ hideErrorMessage();
734
+ showAjaxLoader();
735
+ hideAjaxButton();
736
+
737
+ //add attachment
738
+ var isFileIncludes = false;
739
+
740
+ if(includeFiles