/administrator/components/com_oziogallery2/classes/ozio.helper.php

https://github.com/MaBelleEcole/Main · PHP · 396 lines · 328 code · 35 blank · 33 comment · 14 complexity · 70e2b8bfa7cec325dbdb8c8493985ac9 MD5 · raw file

  1. <?php
  2. /**
  3. * This file is part of Ozio Gallery 2.
  4. *
  5. * Ozio Gallery 2 is free software: you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation, either version 2 of the License, or
  8. * (at your option) any later version.
  9. *
  10. * Foobar is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with Foobar. If not, see <http://www.gnu.org/licenses/>.
  17. *
  18. * @copyright Copyright (C) 2010 Open Source Solutions S.L.U. All rights reserved.
  19. * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see RT-LICENSE.php
  20. */
  21. defined( '_JEXEC' ) or die( 'Restricted access' );
  22. class ozio_helper
  23. {
  24. function imagerotator($dir)
  25. {
  26. global $mainframe;
  27. $VAMBpathAssoluto = JPATH_SITE;
  28. $VAMBpathAssoluto = str_replace("\\", "/" , $VAMBpathAssoluto);
  29. $dir = $VAMBpathAssoluto.'/components/com_oziogallery2/skin/imagerotator';
  30. if($objs = @glob($dir.'/xml/*'))
  31. {
  32. foreach($objs as $obj)
  33. {
  34. @is_dir($obj)? Svuota($obj) : @unlink($obj);
  35. }
  36. }
  37. @rmdir($dir);
  38. //copio file index.html nella cartella temporanea
  39. $file = 'index.html';
  40. $source = JPATH_ROOT . DS . 'components' . DS . 'com_oziogallery2';
  41. $dest = JPATH_ROOT . DS . 'components' . DS . 'com_oziogallery2' . DS . 'skin' . DS . 'imagerotator' . DS . 'xml' . DS;
  42. @copy($source. DS .$file,$dest. DS .$file);
  43. $message = JText::_('Cartella XML').' Imagerotator '.JText::_('svuotata correttamente');
  44. $link = 'index.php?option=com_oziogallery2&view=reset';
  45. $mainframe->redirect( $link, $message);
  46. }
  47. function accordion($dir)
  48. {
  49. global $mainframe;
  50. $VAMBpathAssoluto = JPATH_SITE;
  51. $VAMBpathAssoluto = str_replace("\\", "/" , $VAMBpathAssoluto);
  52. $dir = $VAMBpathAssoluto.'/components/com_oziogallery2/skin/accordion';
  53. if($objs = @glob($dir.'/xml/*'))
  54. {
  55. foreach($objs as $obj)
  56. {
  57. @is_dir($obj)? Svuota($obj) : @unlink($obj);
  58. }
  59. }
  60. @rmdir($dir);
  61. //copio file index.html nella cartella temporanea
  62. $file = 'index.html';
  63. $source = JPATH_ROOT . DS . 'components' . DS . 'com_oziogallery2';
  64. $dest = JPATH_ROOT . DS . 'components' . DS . 'com_oziogallery2' . DS . 'skin' . DS . 'accordion' . DS . 'xml' . DS;
  65. @copy($source. DS .$file,$dest. DS .$file);
  66. $message = JText::_('Cartella XML').' Accordion '.JText::_('svuotata correttamente');
  67. $link = 'index.php?option=com_oziogallery2&view=reset';
  68. $mainframe->redirect( $link, $message);
  69. }
  70. function carousel($dir)
  71. {
  72. global $mainframe;
  73. $VAMBpathAssoluto = JPATH_SITE;
  74. $VAMBpathAssoluto = str_replace("\\", "/" , $VAMBpathAssoluto);
  75. $dir = $VAMBpathAssoluto.'/components/com_oziogallery2/skin/carousel';
  76. if($objs = @glob($dir.'/xml/*'))
  77. {
  78. foreach($objs as $obj)
  79. {
  80. @is_dir($obj)? Svuota($obj) : @unlink($obj);
  81. }
  82. }
  83. @rmdir($dir);
  84. //copio file index.html nella cartella temporanea
  85. $file = 'index.html';
  86. $source = JPATH_ROOT . DS . 'components' . DS . 'com_oziogallery2';
  87. $dest = JPATH_ROOT . DS . 'components' . DS . 'com_oziogallery2' . DS . 'skin' . DS . 'carousel' . DS . 'xml' . DS;
  88. @copy($source. DS .$file,$dest. DS .$file);
  89. $message = JText::_('Cartella XML').' Carousel '.JText::_('svuotata correttamente');
  90. $link = 'index.php?option=com_oziogallery2&view=reset';
  91. $mainframe->redirect( $link, $message);
  92. }
  93. function flashgallery($dir)
  94. {
  95. global $mainframe;
  96. $VAMBpathAssoluto = JPATH_SITE;
  97. $VAMBpathAssoluto = str_replace("\\", "/" , $VAMBpathAssoluto);
  98. $dir = $VAMBpathAssoluto.'/components/com_oziogallery2/skin/flashgallery';
  99. if($objs = @glob($dir.'/xml/*'))
  100. {
  101. foreach($objs as $obj)
  102. {
  103. @is_dir($obj)? Svuota($obj) : @unlink($obj);
  104. }
  105. }
  106. @rmdir($dir);
  107. //copio file index.html nella cartella temporanea
  108. $file = 'index.html';
  109. $source = JPATH_ROOT . DS . 'components' . DS . 'com_oziogallery2';
  110. $dest = JPATH_ROOT . DS . 'components' . DS . 'com_oziogallery2' . DS . 'skin' . DS . 'flashgallery' . DS . 'xml' . DS;
  111. @copy($source. DS .$file,$dest. DS .$file);
  112. $message = JText::_('Cartella XML').' FlashGallery '.JText::_('svuotata correttamente');
  113. $link = 'index.php?option=com_oziogallery2&view=reset';
  114. $mainframe->redirect( $link, $message);
  115. }
  116. function tilt($dir)
  117. {
  118. global $mainframe;
  119. $VAMBpathAssoluto = JPATH_SITE;
  120. $VAMBpathAssoluto = str_replace("\\", "/" , $VAMBpathAssoluto);
  121. $dir = $VAMBpathAssoluto.'/components/com_oziogallery2/skin/tiltviewer';
  122. if($objs = @glob($dir.'/xml/*'))
  123. {
  124. foreach($objs as $obj)
  125. {
  126. @is_dir($obj)? Svuota($obj) : @unlink($obj);
  127. }
  128. }
  129. @rmdir($dir);
  130. //copio file index.html nella cartella temporanea
  131. $file = 'index.html';
  132. $source = JPATH_ROOT . DS . 'components' . DS . 'com_oziogallery2';
  133. $dest = JPATH_ROOT . DS . 'components' . DS . 'com_oziogallery2' . DS . 'skin' . DS . 'tiltviewer' . DS . 'xml' . DS;
  134. @copy($source. DS .$file,$dest. DS .$file);
  135. $message = JText::_('Cartella XML').' Tilt 3D '.JText::_('svuotata correttamente');
  136. $link = 'index.php?option=com_oziogallery2&view=reset';
  137. $mainframe->redirect( $link, $message);
  138. }
  139. function resetImg ($dir)
  140. {
  141. global $mainframe;
  142. $VAMBpathAssoluto = JPATH_SITE;
  143. $VAMBpathAssoluto = str_replace("\\", "/" , $VAMBpathAssoluto);
  144. $dir = $VAMBpathAssoluto.'/components/com_oziogallery2/skin/imagerotator';
  145. if($objs = @glob($dir.'/xml/*'))
  146. {
  147. foreach($objs as $obj)
  148. {
  149. @is_dir($obj)? Svuota($obj) : @unlink($obj);
  150. }
  151. }
  152. @rmdir($dir);
  153. //copio file index.html nella cartella temporanea
  154. $file = 'index.html';
  155. $source = JPATH_ROOT . DS . 'components' . DS . 'com_oziogallery2';
  156. $dest = JPATH_ROOT . DS . 'components' . DS . 'com_oziogallery2' . DS . 'skin' . DS . 'imagerotator' . DS . 'xml' . DS;
  157. @copy($source. DS .$file,$dest. DS .$file);
  158. $message = '<p style="line-height:300%; font-size: 12px; font-weight:bold;">';
  159. $message .= JText::_('Cartella XML').' Imagerotator '.JText::_('svuotata correttamente');
  160. $message .= '</p>';
  161. $link = 'index.php?option=com_oziogallery2&view=resetel&tmpl=component';
  162. $mainframe->redirect( $link, $message);
  163. }
  164. function resetAcc ($dir)
  165. {
  166. global $mainframe;
  167. $VAMBpathAssoluto = JPATH_SITE;
  168. $VAMBpathAssoluto = str_replace("\\", "/" , $VAMBpathAssoluto);
  169. $dir = $VAMBpathAssoluto.'/components/com_oziogallery2/skin/accordion';
  170. if($objs = @glob($dir.'/xml/*'))
  171. {
  172. foreach($objs as $obj)
  173. {
  174. @is_dir($obj)? Svuota($obj) : @unlink($obj);
  175. }
  176. }
  177. @rmdir($dir);
  178. //copio file index.html nella cartella temporanea
  179. $file = 'index.html';
  180. $source = JPATH_ROOT . DS . 'components' . DS . 'com_oziogallery2';
  181. $dest = JPATH_ROOT . DS . 'components' . DS . 'com_oziogallery2' . DS . 'skin' . DS . 'accordion' . DS . 'xml' . DS;
  182. @copy($source. DS .$file,$dest. DS .$file);
  183. $message = '<p style="line-height:300%; font-size: 12px; font-weight:bold;">';
  184. $message .= JText::_('Cartella XML').' Accordion '.JText::_('svuotata correttamente');
  185. $message .= '</p>';
  186. $link = 'index.php?option=com_oziogallery2&view=resetel&tmpl=component';
  187. $mainframe->redirect( $link, $message);
  188. }
  189. function resetCar ($dir)
  190. {
  191. global $mainframe;
  192. $VAMBpathAssoluto = JPATH_SITE;
  193. $VAMBpathAssoluto = str_replace("\\", "/" , $VAMBpathAssoluto);
  194. $dir = $VAMBpathAssoluto.'/components/com_oziogallery2/skin/carousel';
  195. if($objs = @glob($dir.'/xml/*'))
  196. {
  197. foreach($objs as $obj)
  198. {
  199. @is_dir($obj)? Svuota($obj) : @unlink($obj);
  200. }
  201. }
  202. @rmdir($dir);
  203. //copio file index.html nella cartella temporanea
  204. $file = 'index.html';
  205. $source = JPATH_ROOT . DS . 'components' . DS . 'com_oziogallery2';
  206. $dest = JPATH_ROOT . DS . 'components' . DS . 'com_oziogallery2' . DS . 'skin' . DS . 'carousel' . DS . 'xml' . DS;
  207. @copy($source. DS .$file,$dest. DS .$file);
  208. $message = '<p style="line-height:300%; font-size: 12px; font-weight:bold;">';
  209. $message .= JText::_('Cartella XML').' Carousel '.JText::_('svuotata correttamente');
  210. $message .= '</p>';
  211. $link = 'index.php?option=com_oziogallery2&view=resetel&tmpl=component';
  212. $mainframe->redirect( $link, $message);
  213. }
  214. function resetFLG($dir)
  215. {
  216. global $mainframe;
  217. $VAMBpathAssoluto = JPATH_SITE;
  218. $VAMBpathAssoluto = str_replace("\\", "/" , $VAMBpathAssoluto);
  219. $dir = $VAMBpathAssoluto.'/components/com_oziogallery2/skin/flashgallery';
  220. if($objs = @glob($dir.'/xml/*'))
  221. {
  222. foreach($objs as $obj)
  223. {
  224. @is_dir($obj)? Svuota($obj) : @unlink($obj);
  225. }
  226. }
  227. @rmdir($dir);
  228. //copio file index.html nella cartella temporanea
  229. $file = 'index.html';
  230. $source = JPATH_ROOT . DS . 'components' . DS . 'com_oziogallery2';
  231. $dest = JPATH_ROOT . DS . 'components' . DS . 'com_oziogallery2' . DS . 'skin' . DS . 'flashgallery' . DS . 'xml' . DS;
  232. @copy($source. DS .$file,$dest. DS .$file);
  233. $message = '<p style="line-height:300%; font-size: 12px; font-weight:bold;">';
  234. $message .= JText::_('Cartella XML').' FlashGallery '.JText::_('svuotata correttamente');
  235. $message .= '</p>';
  236. $link = 'index.php?option=com_oziogallery2&view=resetel&tmpl=component';
  237. $mainframe->redirect( $link, $message);
  238. }
  239. function resetTilt($dir)
  240. {
  241. global $mainframe;
  242. $VAMBpathAssoluto = JPATH_SITE;
  243. $VAMBpathAssoluto = str_replace("\\", "/" , $VAMBpathAssoluto);
  244. $dir = $VAMBpathAssoluto.'/components/com_oziogallery2/skin/tiltviewer';
  245. if($objs = @glob($dir.'/xml/*'))
  246. {
  247. foreach($objs as $obj)
  248. {
  249. @is_dir($obj)? Svuota($obj) : @unlink($obj);
  250. }
  251. }
  252. @rmdir($dir);
  253. //copio file index.html nella cartella temporanea
  254. $file = 'index.html';
  255. $source = JPATH_ROOT . DS . 'components' . DS . 'com_oziogallery2';
  256. $dest = JPATH_ROOT . DS . 'components' . DS . 'com_oziogallery2' . DS . 'skin' . DS . 'tiltviewer' . DS . 'xml' . DS;
  257. @copy($source. DS .$file,$dest. DS .$file);
  258. $message = '<p style="line-height:300%; font-size: 12px; font-weight:bold;">';
  259. $message .= JText::_('Cartella XML').' Tilt 3D '.JText::_('svuotata correttamente');
  260. $message .= '</p>';
  261. $link = 'index.php?option=com_oziogallery2&view=resetel&tmpl=component';
  262. $mainframe->redirect( $link, $message);
  263. }
  264. function mediagallery($dir)
  265. {
  266. global $mainframe;
  267. $VAMBpathAssoluto = JPATH_SITE;
  268. $VAMBpathAssoluto = str_replace("\\", "/" , $VAMBpathAssoluto);
  269. $dir = $VAMBpathAssoluto.'/components/com_oziogallery2/skin/mediagallery';
  270. if($objs = @glob($dir.'/xml/*'))
  271. {
  272. foreach($objs as $obj)
  273. {
  274. @is_dir($obj)? Svuota($obj) : @unlink($obj);
  275. }
  276. }
  277. @rmdir($dir);
  278. //copio file index.html nella cartella temporanea
  279. $file = 'index.html';
  280. $source = JPATH_ROOT . DS . 'components' . DS . 'com_oziogallery2';
  281. $dest = JPATH_ROOT . DS . 'components' . DS . 'com_oziogallery2' . DS . 'skin' . DS . 'mediagallery' . DS . 'xml' . DS;
  282. @copy($source. DS .$file,$dest. DS .$file);
  283. $message = JText::_('Cartella XML').' mediagallery '.JText::_('svuotata correttamente');
  284. $link = 'index.php?option=com_oziogallery2&view=reset';
  285. $mainframe->redirect( $link, $message);
  286. }
  287. function resetmediagallery($dir)
  288. {
  289. global $mainframe;
  290. $VAMBpathAssoluto = JPATH_SITE;
  291. $VAMBpathAssoluto = str_replace("\\", "/" , $VAMBpathAssoluto);
  292. $dir = $VAMBpathAssoluto.'/components/com_oziogallery2/skin/mediagallery';
  293. if($objs = @glob($dir.'/xml/*'))
  294. {
  295. foreach($objs as $obj)
  296. {
  297. @is_dir($obj)? Svuota($obj) : @unlink($obj);
  298. }
  299. }
  300. @rmdir($dir);
  301. //copio file index.html nella cartella temporanea
  302. $file = 'index.html';
  303. $source = JPATH_ROOT . DS . 'components' . DS . 'com_oziogallery2';
  304. $dest = JPATH_ROOT . DS . 'components' . DS . 'com_oziogallery2' . DS . 'skin' . DS . 'mediagallery' . DS . 'xml' . DS;
  305. @copy($source. DS .$file,$dest. DS .$file);
  306. $message = '<p style="line-height:300%; font-size: 12px; font-weight:bold;">';
  307. $message .= JText::_('Cartella XML').' mediagallery '.JText::_('svuotata correttamente');
  308. $message .= '</p>';
  309. $link = 'index.php?option=com_oziogallery2&view=resetel&tmpl=component';
  310. $mainframe->redirect( $link, $message);
  311. }
  312. function cooliris($dir)
  313. {
  314. global $mainframe;
  315. $VAMBpathAssoluto = JPATH_SITE;
  316. $VAMBpathAssoluto = str_replace("\\", "/" , $VAMBpathAssoluto);
  317. $dir = $VAMBpathAssoluto.'/components/com_oziogallery2/skin/cooliris';
  318. if($objs = @glob($dir.'/xml/*'))
  319. {
  320. foreach($objs as $obj)
  321. {
  322. @is_dir($obj)? Svuota($obj) : @unlink($obj);
  323. }
  324. }
  325. @rmdir($dir);
  326. //copio file index.html nella cartella temporanea
  327. $file = 'index.html';
  328. $source = JPATH_ROOT . DS . 'components' . DS . 'com_oziogallery2';
  329. $dest = JPATH_ROOT . DS . 'components' . DS . 'com_oziogallery2' . DS . 'skin' . DS . 'cooliris' . DS . 'xml' . DS;
  330. @copy($source. DS .$file,$dest. DS .$file);
  331. $message = JText::_('Cartella XML').' Tilt 3D '.JText::_('svuotata correttamente');
  332. $link = 'index.php?option=com_oziogallery2&view=reset';
  333. $mainframe->redirect( $link, $message);
  334. }
  335. function resetcooliris($dir)
  336. {
  337. global $mainframe;
  338. $VAMBpathAssoluto = JPATH_SITE;
  339. $VAMBpathAssoluto = str_replace("\\", "/" , $VAMBpathAssoluto);
  340. $dir = $VAMBpathAssoluto.'/components/com_oziogallery2/skin/cooliris';
  341. if($objs = @glob($dir.'/xml/*'))
  342. {
  343. foreach($objs as $obj)
  344. {
  345. @is_dir($obj)? Svuota($obj) : @unlink($obj);
  346. }
  347. }
  348. @rmdir($dir);
  349. //copio file index.html nella cartella temporanea
  350. $file = 'index.html';
  351. $source = JPATH_ROOT . DS . 'components' . DS . 'com_oziogallery2';
  352. $dest = JPATH_ROOT . DS . 'components' . DS . 'com_oziogallery2' . DS . 'skin' . DS . 'cooliris' . DS . 'xml' . DS;
  353. @copy($source. DS .$file,$dest. DS .$file);
  354. $message = '<p style="line-height:300%; font-size: 12px; font-weight:bold;">';
  355. $message .= JText::_('Cartella XML').' cooliris '.JText::_('svuotata correttamente');
  356. $message .= '</p>';
  357. $link = 'index.php?option=com_oziogallery2&view=resetel&tmpl=component';
  358. $mainframe->redirect( $link, $message);
  359. }
  360. }
  361. ?>