PageRenderTime 47ms CodeModel.GetById 18ms RepoModel.GetById 0ms app.codeStats 0ms

/j17/modules/mod_vinaora_cu3er_3d_slideshow/helper.php

http://vinaora-3d-slideshow.googlecode.com/
PHP | 747 lines | 445 code | 173 blank | 129 comment | 53 complexity | 869467c4979a5de32158e4fdd7d38ffa MD5 | raw file
  1. <?php
  2. /**
  3. * @version $Id: helper.php 2011-08-08 vinaora $
  4. * @package Vinaora Cu3er 3D Slideshow
  5. * @subpackage mod_vinaora_cu3er_3d_slideshow
  6. * @copyright Copyright (C) 2010 - 2011 VINAORA. All rights reserved.
  7. * @license GNU General Public License version 2 or later; see LICENSE.txt
  8. * @website http://vinaora.com
  9. * @twitter http://twitter.com/vinaora
  10. * @facebook http://facebook.com/vinaora
  11. */
  12. // no direct access
  13. defined('_JEXEC') or die;
  14. class modVinaoraCu3er3DSlideshowHelper
  15. {
  16. private $params;
  17. private $separator = "\n";
  18. private $tweenNames = array("defaults", "tweenIn", "tweenOut", "tweenOver");
  19. private $buttonNames = array("prev_button", "next_button", "prev_symbol", "next_symbol", "auto_play", "preloader", "description");
  20. function __construct(&$params){
  21. $this->params = $params;
  22. $color = $this->params->get('transition_cube_color', '#000000');
  23. $color = str_replace('#', '0x', $color);
  24. $this->params->set('transition_cube_color', $color);
  25. $color = $this->params->get('description_heading_text_color', '#000000');
  26. $color = str_replace('#', '0x', $color);
  27. $this->params->set('description_heading_text_color', $color);
  28. $color = $this->params->get('description_paragraph_text_color', '#000000');
  29. $color = str_replace('#', '0x', $color);
  30. $this->params->set('description_paragraph_text_color', $color);
  31. }
  32. /*
  33. * Get content of the config file
  34. */
  35. public function getConfig($name){
  36. $xml = false;
  37. $name = JPath::clean($name);
  38. //Remove the Directory Separator (DS) at the begin of $name if exits
  39. $name = ltrim($name, DS);
  40. if ( !is_file(JPATH_BASE.DS.$name) ){
  41. // JError::raiseNotice('0', JText::_('MOD_VINAORA_CU3ER_3D_SLIDESHOW_ERROR_FILE_CONFIG_NOTFOUND'));
  42. return false;
  43. }
  44. // $ext = pathinfo($filename, PATHINFO_EXTENSION);
  45. $ext = strtolower(substr($name, -4, 4));
  46. // Load from file if it is .xml
  47. if ( $ext == '.xml' ){
  48. $xml = simplexml_load_file( JPATH_BASE.DS.$name );
  49. }
  50. // Load from URL if it is .xml.php
  51. elseif ( $ext == '.php' ) {
  52. $xml = simplexml_load_file( JURI::base().JPath::clean($name, '/') );
  53. }
  54. else{
  55. JError::raiseNotice('0', JText::_('MOD_VC3S_ERROR_FILE_CONFIG_INVALID'));
  56. return false;
  57. }
  58. return $xml;
  59. }
  60. /*
  61. * Create the config file
  62. */
  63. public function createConfig($name){
  64. jimport('joomla.filesystem.file');
  65. $name = JPath::clean($name);
  66. //Remove the Directory Separator (DS) at the begin of $name if exits
  67. $name = ltrim($name, DS);
  68. $name = JPATH_BASE.DS.$name;
  69. if ( is_writeable(dirname($name)) ){
  70. if ( JFile::write($name, $this->getXML()) ) return true;
  71. else{
  72. JError::raiseNotice('0', JText::_('MOD_VC3S_ERROR_FILE_UNWRITABLE'));
  73. }
  74. }
  75. else{
  76. // Folder is not writeable
  77. JError::raiseNotice('0', JText::_('MOD_VC3S_ERROR_DIRECTORY_UNWRITABLE'));
  78. }
  79. return false;
  80. }
  81. /*
  82. * Create content of the config file
  83. */
  84. public function getXML(){
  85. $this->getItems();
  86. $xml = '<?xml version="1.0" encoding="utf-8"?>';
  87. // Create Element - <cu3er>
  88. $node = new SimpleXMLElement($xml.'<cu3er />');
  89. // Create Element - <cu3er>.<settings>
  90. $nodeL1 =& $node->addChild('settings');
  91. // Create Element - <cu3er>.<settings>.<general>
  92. $nodeL2 =& $this->_createGeneral($nodeL1);
  93. // Create Element - <cu3er>.<settings>.<debug>
  94. if ($this->params->get('enable_debug')){
  95. $nodeL2 =& $this->_createDebug($nodeL1);
  96. }
  97. // Create Element - <cu3er>.<settings>.<auto_play>
  98. if ($this->params->get('enable_auto_play')){
  99. $nodeL2 =& $this->_createAutoPlay($nodeL1);
  100. }
  101. // Create Element - <cu3er>.<settings>.<pre_button>
  102. if ($this->params->get('enable_prev_button')){
  103. $nodeL2 =& $this->_createPreviousButton($nodeL1);
  104. }
  105. // Create Element - <cu3er>.<settings>.<pre_symbol>
  106. if ($this->params->get('enable_prev_symbol')){
  107. $nodeL2 =& $this->_createPreviousSymbol($nodeL1);
  108. }
  109. // Create Element - <cu3er>.<settings>.<next_button>
  110. if ($this->params->get('enable_next_button')){
  111. $nodeL2 =& $this->_createNextButton($nodeL1);
  112. }
  113. // Create Element - <cu3er>.<settings>.<next_symbol>
  114. if ($this->params->get('enable_next_symbol')){
  115. $nodeL2 =& $this->_createNextSymbol($nodeL1);
  116. }
  117. // Create Element - <cu3er>.<settings>.<preloader>
  118. if ($this->params->get('enable_preloader')){
  119. $nodeL2 =& $this->_createPreloader($nodeL1);
  120. }
  121. // Create Element - <cu3er>.<settings>.<description>
  122. if ($this->params->get('enable_description_box')){
  123. $nodeL2 =& $this->_createDescriptionBox($nodeL1);
  124. }
  125. // Create Element - <cu3er>.<settings>.<transitions>
  126. if ($this->params->get('transition_type') == 'first'){
  127. $nodeL2 =& $this->_createTransitions($nodeL1);
  128. }
  129. // Create Element - <cu3er>.<slides>
  130. $nodeL2 =& $this->_createSlides($node);
  131. $xml = $node->asXML();
  132. // $xml = self::replaceTweenName($xml);
  133. return $xml;
  134. }
  135. /*
  136. * Create General Settings
  137. */
  138. private function _createGeneral(&$node){
  139. $general = array();
  140. $general["slide_panel_width"] = intval( $this->params->get('slide_panel_width') );
  141. $general["slide_panel_height"] = intval( $this->params->get('slide_panel_height') );
  142. $general["slide_panel_horizontal_align"] = $this->params->get('slide_panel_horizontal_align');
  143. $general["slide_panel_vertical_align"] = $this->params->get('slide_panel_vertical_align');
  144. $general["ui_visibility_time"] = intval( $this->params->get('ui_visibility_time') );
  145. // Create Element - <cu3er>.<settings>.<general>
  146. $nodeL1 =& $node->addChild('general');
  147. // Create Attributes of <cu3er>.<settings>.<general>
  148. self::addAttributes($nodeL1, $general);
  149. return $node;
  150. }
  151. /*
  152. * Create Debug Settings
  153. */
  154. private function _createDebug(&$node){
  155. $debug = array();
  156. $debug["x"] = intval( $this->params->get('debug_x') );
  157. $debug["y"] = intval( $this->params->get('debug_y') );
  158. // Create Element - <cu3er>.<settings>.<debug>
  159. $nodeL1 =& $node->addChild('debug');
  160. // Create Attributes of <cu3er>.<settings>.<debug>
  161. self::addAttributes($nodeL1, $debug);
  162. return $node;
  163. }
  164. /*
  165. * Create Auto-Play Settings
  166. */
  167. private function _createAutoPlay(&$node){
  168. $name = "auto_play";
  169. $attbs = array();
  170. $attbs["defaults"] =
  171. array(
  172. "symbol" => $this->params->get('auto_play_symbol', 'linear'),
  173. "time" => $this->params->get('auto_play_time_defaults', 5)
  174. );
  175. $attbs["tweenIn"] =& $this->getTweenArray($name, 'in');
  176. $attbs["tweenOut"] =& $this->getTweenArray($name, 'out');
  177. $attbs["tweenOver"] =& $this->getTweenArray($name, 'over');
  178. // Create Element - <cu3er>.<settings>.<auto_play>
  179. $nodeL1 = $this->createButton($node, $name, $this->tweenNames, $attbs);
  180. return $node;
  181. }
  182. /*
  183. * Create Previous Button Settings
  184. */
  185. private function _createPreviousButton(&$node){
  186. $name = "prev_button";
  187. $attbs = array();
  188. $attbs["defaults"] =
  189. array(
  190. "round_corners" => $this->params->get('prev_button_round_corners', '0, 0, 0, 0')
  191. );
  192. $attbs["tweenIn"] =& $this->getTweenArray($name, 'in');
  193. $attbs["tweenOut"] =& $this->getTweenArray($name, 'out');
  194. $attbs["tweenOver"] =& $this->getTweenArray($name, 'over');
  195. // Create Element - <cu3er>.<settings>.<prev_button>
  196. $nodeL1 = $this->createButton($node, $name, $this->tweenNames, $attbs);
  197. return $node;
  198. }
  199. /*
  200. * Create Previous Symbol Settings
  201. */
  202. private function _createPreviousSymbol(&$node){
  203. $name = "prev_symbol";
  204. $attbs = array();
  205. $attbs["defaults"] =
  206. array(
  207. "type" => $this->params->get('prev_symbol_type', '1')
  208. );
  209. $attbs["tweenIn"] =& $this->getTweenArray($name, 'in');
  210. $attbs["tweenOut"] =& $this->getTweenArray($name, 'out');
  211. $attbs["tweenOver"] =& $this->getTweenArray($name, 'over');
  212. // Create Element - <cu3er>.<settings>.<prev_symbol>
  213. $nodeL1 = $this->createButton($node, $name, $this->tweenNames, $attbs);
  214. return $node;
  215. }
  216. /*
  217. * Create Next Button Settings
  218. */
  219. private function _createNextButton(&$node){
  220. $name = "next_button";
  221. $attbs = array();
  222. $attbs["defaults"] =
  223. array(
  224. "round_corners" => $this->params->get('next_button_round_corners', '0, 0, 0, 0')
  225. );
  226. $attbs["tweenIn"] =& $this->getTweenArray($name, 'in');
  227. $attbs["tweenOut"] =& $this->getTweenArray($name, 'out');
  228. $attbs["tweenOver"] =& $this->getTweenArray($name, 'over');
  229. // Create Element - <cu3er>.<settings>.<next_button>
  230. $nodeL1 = $this->createButton($node, $name, $this->tweenNames, $attbs);
  231. return $node;
  232. }
  233. /*
  234. * Create Next Symbol Settings
  235. */
  236. private function _createNextSymbol(&$node){
  237. $name = "next_symbol";
  238. $attbs = array();
  239. $attbs["defaults"] =
  240. array(
  241. "type" => $this->params->get('next_symbol_type', '1')
  242. );
  243. $attbs["tweenIn"] =& $this->getTweenArray($name, 'in');
  244. $attbs["tweenOut"] =& $this->getTweenArray($name, 'out');
  245. $attbs["tweenOver"] =& $this->getTweenArray($name, 'over');
  246. // Create Element - <cu3er>.<settings>.<next_symbol>
  247. $nodeL1 = $this->createButton($node, $name, $this->tweenNames, $attbs);
  248. return $node;
  249. }
  250. /*
  251. * Create Preloader Settings
  252. */
  253. private function _createPreloader(&$node){
  254. $name = "preloader";
  255. $attbs = array();
  256. $attbs["defaults"] =
  257. array(
  258. "symbol" => $this->params->get('preloader_symbol', 'linear')
  259. );
  260. $attbs["tweenIn"] =& $this->getTweenArray($name, 'in');
  261. $attbs["tweenOut"] =& $this->getTweenArray($name, 'out');
  262. // $attbs["tweenOver"] =& $this->getTweenArray($name, 'over');
  263. // Create Element - <cu3er>.<settings>.<preloader>
  264. $nodeL1 = $this->createButton($node, $name, $this->tweenNames, $attbs);
  265. return $node;
  266. }
  267. /*
  268. * Create Description Box Settings
  269. */
  270. private function _createDescriptionBox(&$node){
  271. $name = "description";
  272. $attbs = array();
  273. $attbs["defaults"] =
  274. array(
  275. "round_corners" => $this->params->get('description_round_corners', '0, 0, 0, 0'),
  276. "heading_font" => $this->params->get('description_heading_font', 'Georgia'),
  277. "heading_text_size" => $this->params->get('description_heading_text_size', '18'),
  278. "heading_text_color" => $this->params->get('description_heading_text_color', '#000000'),
  279. "heading_text_align" => $this->params->get('description_heading_text_align', 'left'),
  280. "heading_text_margin" => $this->params->get('description_heading_text_margin', '10, 25, 0, 25'),
  281. "heading_text_leading" => $this->params->get('description_heading_text_leading', '0'),
  282. "heading_text_letterSpacing" => $this->params->get('description_heading_text_letterSpacing', '0'),
  283. "paragraph_font" => $this->params->get('description_paragraph_font', 'Arial'),
  284. "paragraph_text_size" => $this->params->get('description_paragraph_text_size', '12'),
  285. "paragraph_text_color" => $this->params->get('description_paragraph_text_color', '#000000'),
  286. "paragraph_text_align" => $this->params->get('description_paragraph_text_align', 'left'),
  287. "paragraph_text_margin" => $this->params->get('description_paragraph_text_margin', '5, 25, 0, 25'),
  288. "paragraph_text_leading" => $this->params->get('description_paragraph_text_leading', '0'),
  289. "paragraph_text_letterSpacing" => $this->params->get('description_paragraph_text_letterSpacing', '0')
  290. );
  291. $attbs["tweenIn"] =& $this->getTweenArray($name, 'in');
  292. $attbs["tweenOut"] =& $this->getTweenArray($name, 'out');
  293. $attbs["tweenOver"] =& $this->getTweenArray($name, 'over');
  294. // Create Element - <cu3er>.<settings>.<description>
  295. $nodeL1 = $this->createButton($node, $name, $this->tweenNames, $attbs);
  296. return $node;
  297. }
  298. /*
  299. * Create Transitions Settings
  300. */
  301. private function _createTransitions(&$node){
  302. $node =& $this->_createTransition($node, 0);
  303. return $node;
  304. }
  305. /*
  306. * Create Element <transiton> for slide
  307. */
  308. private function _createTransition(&$node, $position){
  309. if ($position){
  310. $nodeL1 = $node->addChild('transition');
  311. }
  312. else{
  313. $nodeL1 = $node->addChild('transitions');
  314. $position = 1;
  315. }
  316. $attbs = array("num", "slicing", "direction", "duration", "delay", "shader", "light_position", "cube_color", "z_multiplier");
  317. $found = false;
  318. $a_slicing = array("horizontal", "vertical");
  319. $a_direction = array("left", "right", "up", "down");
  320. $a_shader = array("none", "flat", "phong");
  321. if ($this->params->get('transition_type') == 'auto'){
  322. $nodeL1->addAttribute('num', mt_rand(1, 5) );
  323. $nodeL1->addAttribute('slicing', $a_slicing[mt_rand(0, count($a_slicing)-1)] );
  324. $nodeL1->addAttribute('direction', $a_direction[mt_rand(0, count($a_direction)-1)] );
  325. $nodeL1->addAttribute('duration', mt_rand(1, 5) / 10);
  326. $nodeL1->addAttribute('delay', mt_rand(1, 5) / 10);
  327. $nodeL1->addAttribute('shader', $a_shader[mt_rand(0, count($a_shader)-1)] );
  328. $found = true;
  329. }
  330. else{
  331. foreach ($attbs as $value){
  332. $param = $this->params->get('transition_'.$value);
  333. $str = trim( self::getParam($param, $position) );
  334. if ( strlen($str) ){
  335. $nodeL1->addAttribute($value, $str);
  336. $found = true;
  337. }
  338. }
  339. }
  340. // Remove Child if have no attributes
  341. // if (!$found) $node->removeChild($nodeL1);
  342. return $node;
  343. }
  344. /*
  345. * Create A Button.
  346. * $name: Previous Button, Next Button, Previous Symbol, Next Symbol, Auto Load, Preloader, Description Box
  347. */
  348. private function createButton(&$node, $name, $childNames, $attbs){
  349. if (!in_array($name, $this->buttonNames)) return;
  350. $nodeL1 =& $node->addChild($name);
  351. foreach ($childNames as $child){
  352. if (empty($child)) continue;
  353. $nodeL2 =& $nodeL1->addChild($child);
  354. if (array_key_exists($child, $attbs)){
  355. $attb = $attbs[$child];
  356. if (isset($attb)){
  357. self::addAttributes($nodeL2, $attb);
  358. }
  359. }
  360. }
  361. return $node;
  362. }
  363. /*
  364. * Add the attributes to a node
  365. */
  366. public static function addAttributes(&$node, $attbs){
  367. if(is_array($attbs)){
  368. foreach ($attbs as $key=>$value){
  369. $value = trim($value);
  370. if (strlen($value)){
  371. $node->addAttribute($key, $value);
  372. }
  373. }
  374. }
  375. return $node;
  376. }
  377. /*
  378. * Create Element <slides>
  379. */
  380. private function _createSlides(&$node){
  381. $nodeL1 =& $node->addChild('slides');
  382. $slides = explode("\n", $this->params->get('slide_url'));
  383. for($i=1; $i<=count($slides); $i++){
  384. $nodeL2 = $this->_createSlide($nodeL1, $i);
  385. if ($this->params->get('transition_type') != 'none'){
  386. $nodeL2 = $this->_createTransition($nodeL1, $i);
  387. }
  388. }
  389. return $node;
  390. }
  391. /*
  392. * Create Element <slide>
  393. * Default: Return the First Slide
  394. */
  395. private function _createSlide(&$node, $position=1){
  396. $nodeL0 =& $node->addChild('slide');
  397. $found = false;
  398. $param = $this->params->get('slide_url');
  399. $str = trim( self::getParam($param, $position, $this->separator) );
  400. $str = self::validImageURL($str);
  401. if ( strlen($str) ){
  402. $found = true;
  403. $nodeL1 =& $nodeL0->addChild('url', $str);
  404. }
  405. $param = $this->params->get('slide_link');
  406. $str = trim ( self::getParam($param, $position, $this->separator) );
  407. if ( strlen($str) ){
  408. $found = true;
  409. $nodeL1 =& $nodeL0->addChild('link', $str);
  410. $param = $this->params->get('slide_link_target');
  411. $attb = trim ( self::getParam($param, $position, $this->separator) );
  412. $attb = self::validTarget($attb);
  413. if ( strlen($attb) ){
  414. $nodeL1->addAttribute('target', $attb);
  415. }
  416. }
  417. $param = $this->params->get('enable_description_box');
  418. if ( $param ){
  419. $nodeL1 =& $nodeL0->addChild('description');
  420. $param = $this->params->get('slide_description_heading');
  421. $str = trim( self::getParam($param, $position, $this->separator) );
  422. if ( strlen($str) ){
  423. $found = true;
  424. $nodeL2 =& $nodeL1->addChild('heading', $str);
  425. }
  426. $param = $this->params->get('slide_description_paragraph');
  427. $str = trim( self::getParam($param, $position, $this->separator) );
  428. if ( strlen($str) ){
  429. $found = true;
  430. $nodeL2 =& $nodeL1->addChild('paragraph', $str);
  431. }
  432. $param = $this->params->get('slide_description_link');
  433. $str = trim ( self::getParam($param, $position, $this->separator) );
  434. if ( strlen($str) ){
  435. $found = true;
  436. $nodeL2 =& $nodeL1->addChild('link', $str);
  437. $param = $this->params->get('slide_description_link_target');
  438. $attb = trim ( self::getParam($param, $position, $this->separator) );
  439. $attb = self::validTarget($attb);
  440. if ( strlen($attb) ){
  441. $nodeL2->addAttribute('target', $attb);
  442. }
  443. }
  444. }
  445. // if (!$found) $node->removeChild($nodeL0);
  446. return $node;
  447. }
  448. private function getTweenArray($name, $type){
  449. $tween = array();
  450. $keys = array("time", "delay", "x", "y", "width", "height", "rotation", "alpha", "tint", "scaleX", "scaleY");
  451. foreach ($keys as $key){
  452. $tween[$key] = self::getTween($this->params->get($name."_".$key), $type);
  453. }
  454. return $tween;
  455. }
  456. /*
  457. * GetTween by Type: In/TweenIn, Out/TweenOut, Over/TweenOver
  458. */
  459. private static function getTween($param, $type='in'){
  460. $type = strtolower(trim($type));
  461. $return = NULL;
  462. switch($type){
  463. case 'in':
  464. case 'tweenin':
  465. $return = self::getParam($param, 1);
  466. break;
  467. case 'out':
  468. case 'tweenout':
  469. $return = self::getParam($param, 2);
  470. break;
  471. case 'over':
  472. case 'tweenover':
  473. $return = self::getParam($param, 3);
  474. break;
  475. }
  476. return $return;
  477. }
  478. /*
  479. * Get a Parameter in a String Parameters which are seperated with a separator symbol (default: vertical bar '|').
  480. * Example: Parameters = "value1 | value2 | value3". Return "value2" if positon = 2
  481. */
  482. public static function getParam($param, $position=1, $separator='|'){
  483. $return = NULL;
  484. if(!empty($param)){
  485. $items = explode($separator, $param);
  486. if ( ($position > count($items)) || ($position<1) ) return NULL;
  487. else {
  488. $return = trim( $items[$position-1] );
  489. if ( !strlen($return) ) return NULL;
  490. }
  491. }
  492. return $return;
  493. }
  494. /*
  495. * Validate Link Target
  496. */
  497. public static function validTarget($target = '_blank'){
  498. $target = strtolower(trim($target));
  499. $target = "_".ltrim($target, '_');
  500. $valid = array ('_blank', '_top', '_parent', '_self');
  501. $target = in_array($target, $valid) ? $target : '_blank';
  502. return $target;
  503. }
  504. /*
  505. * Valid Color
  506. */
  507. public static function validColor($color, $prefix="", $default="ffffff"){
  508. $color = strtolower ( trim($color) );
  509. if (empty($color)) return $prefix.$default;
  510. // Remove '0x' from the beginning of string if exist
  511. $color = ltrim($color, "0x") ;
  512. // Remove '#' from the beginning of string if exist
  513. $color = ltrim($color, "#") ;
  514. // The length of string less than or equal 6
  515. $color = substr($color, 0, 6);
  516. $valid = true;
  517. $hexa = '0,1,2,3,4,5,6,7,8,9,a,b,c,d,e,f';
  518. $hexa = explode(",", $hexa);
  519. // TODO: check the length of $color
  520. for($i=0; $i<strlen($color); $i++){
  521. if(!in_array($color[$i], $hexa)){
  522. $valid = false;
  523. break;
  524. }
  525. }
  526. $color = ($valid === false) ? $default : $color;
  527. $color = $prefix.$color;
  528. return $color;
  529. }
  530. /*
  531. *
  532. */
  533. public static function validImageURL($str){
  534. return $str;
  535. }
  536. /*
  537. * Replace TweenName from lowercase to pascalName format
  538. */
  539. private static function replaceTweenName($str){
  540. $str = str_replace('<tweenin ', '<tweenIn ', $str);
  541. $str = str_replace('<tweenout ', '<tweenOut ', $str);
  542. $str = str_replace('<tweenover ', '<tweenOver ', $str);
  543. return $str;
  544. }
  545. /*
  546. * Add SWFObject Library to <head> tag
  547. */
  548. public static function addSWFObject($source='local', $version='2.2'){
  549. if($source == 'local'){
  550. JHTML::script("media/mod_vinaora_cu3er_3d_slideshow/js/swfobject/$version/swfobject.js");
  551. return true;
  552. }
  553. if($source == 'google'){
  554. JHTML::script("https://ajax.googleapis.com/ajax/libs/swfobject/$version/swfobject.js");
  555. return true;
  556. }
  557. return false;
  558. }
  559. private function getItems(){
  560. $filter = '([^\s]+(\.(?i)(jpg|png|gif|bmp))$)';
  561. $exclude = array('.svn', 'CVS', '.DS_Store', '__MACOSX', '.htaccess');
  562. $slide_dir = $this->params->get('slide_dir');
  563. if ($slide_dir && $slide_dir!='-1'){
  564. $items = JFolder::files(JPATH_ROOT.'/images/'.$slide_dir, $filter, false, false, $exclude);
  565. if (!empty($items) && count($items)){
  566. foreach($items as $key=>$value){
  567. $items[$key] = JURI::base(true)."/images/$slide_dir/$value";
  568. }
  569. $str = implode($this->separator, $items);
  570. $this->params->set("slide_url", $str);
  571. }
  572. }
  573. }
  574. }