PageRenderTime 42ms CodeModel.GetById 14ms RepoModel.GetById 0ms app.codeStats 0ms

/modules/mod_image_show_gk4/styles/gk_black_and_white/view.php

https://gitlab.com/ppapadatis/Videolearn
PHP | 114 lines | 73 code | 27 blank | 14 comment | 30 complexity | 7a6951f2052fcf23cc63e711ec02662b MD5 | raw file
  1. <?php
  2. /**
  3. * GK Image Show - view file
  4. * @package Joomla!
  5. * @Copyright (C) 2009-2011 Gavick.com
  6. * @ All rights reserved
  7. * @ Joomla! is Free Software
  8. * @ Released under GNU/GPL License : http://www.gnu.org/copyleft/gpl.html
  9. * @ version $Revision: GK4 1.0 $
  10. **/
  11. // no direct access
  12. defined('_JEXEC') or die;
  13. ?>
  14. <div id="gkIs-<?php echo $this->config['module_id'];?>" class="gkIsWrapper-gk_black_and_white<?php if($this->config['config']->gk_black_and_white->gk_black_and_white_slide_links == 1) echo ' slide-links'; ?>">
  15. <div class="gkIsPreloader">Loading...</div>
  16. <div class="gkIsSlides" style="width: <?php echo $width; ?>px;height: <?php echo $height; ?>px;">
  17. <?php for($i = 0; $i < count($this->config['image_show_data']); $i++) : ?>
  18. <?php if($this->config['image_show_data'][$i]->published) : ?>
  19. <?php
  20. unset($path, $title, $link);
  21. // creating slide path
  22. $path = $uri->root().'modules/mod_image_show_gk4/cache/'.GKIS_BlackAndWhite_Image::translateName($this->config['image_show_data'][$i]->image, $this->config['module_id']);
  23. ?>
  24. <span class="gkIsSlide"><?php echo $path; ?></span>
  25. <?php endif; ?>
  26. <?php endfor; ?>
  27. </div>
  28. <?php if($this->config['config']->gk_black_and_white->gk_black_and_white_show_text_block == 1) : ?>
  29. <div class="gkIsText" style="bottom:<?php echo $this->config['config']->gk_black_and_white->gk_black_and_white_text_block_position_y; ?>px;right:<?php echo $this->config['config']->gk_black_and_white->gk_black_and_white_text_block_position_x; ?>px;width:<?php echo $this->config['config']->gk_black_and_white->gk_black_and_white_text_block_width; ?>px;">Text</div>
  30. <?php endif; ?>
  31. <?php if($this->config['config']->gk_black_and_white->gk_black_and_white_pagination == 1) : ?>
  32. <ul class="gkIsPagination" style="top:<?php echo $this->config['config']->gk_black_and_white->gk_black_and_white_pagination_position_y; ?>px;left:<?php echo $this->config['config']->gk_black_and_white->gk_black_and_white_pagination_position_x; ?>px;">
  33. <?php for($i = 0; $i < count($this->config['image_show_data']); $i++) : ?>
  34. <?php if($this->config['image_show_data'][$i]->published) : ?>
  35. <li><?php echo $i+1; ?></li>
  36. <?php endif; ?>
  37. <?php endfor; ?>
  38. </ul>
  39. <?php endif; ?>
  40. <div class="gkIsTextData">
  41. <?php for($i = 0; $i < count($this->config['image_show_data']); $i++) : ?>
  42. <?php if($this->config['image_show_data'][$i]->published) : ?>
  43. <?php
  44. // cleaning variables
  45. unset($title, $link, $text, $exploded_text);
  46. // creating slide title
  47. if($this->config['image_show_data'][$i]->type == "k2"){
  48. $title = htmlspecialchars($this->articlesK2[$this->config['image_show_data'][$i]->artK2_id]["title"]);
  49. $link = $this->articlesK2[$this->config['image_show_data'][$i]->artK2_id]["link"];
  50. $text = $this->articlesK2[$this->config['image_show_data'][$i]->artK2_id]["content"];
  51. } else {
  52. $title = htmlspecialchars(($this->config['image_show_data'][$i]->type == "text") ? $this->config['image_show_data'][$i]->name : $this->articles[$this->config['image_show_data'][$i]->art_id]["title"]);
  53. $link = ($this->config['image_show_data'][$i]->type == "text") ? $this->config['image_show_data'][$i]->url : $this->articles[$this->config['image_show_data'][$i]->art_id]["link"];
  54. $text = ($this->config['image_show_data'][$i]->type == "text") ? $this->config['image_show_data'][$i]->content : $this->articles[$this->config['image_show_data'][$i]->art_id]["content"];
  55. }
  56. $title = substr($title, 0, $this->config['config']->gk_black_and_white->gk_black_and_white_title_char_amount);
  57. $part_one = explode(' ', $title);
  58. $part_one = $part_one[0];
  59. if(count(explode(' ', $title)) > 1) $part_two = substr($title, strpos($title,' '));
  60. else $part_two = '';
  61. $title = '<span>' . $part_one . '</span>' . $part_two ;
  62. // creating slide text
  63. $text = htmlspecialchars_decode($text);
  64. if($this->config['config']->gk_black_and_white->gk_black_and_white_clean_xhtml == 1) $text = strip_tags($text);
  65. $exploded_text = explode(" ", stripslashes($text));
  66. $text = '';
  67. for($j = 0; $j < $this->config['config']->gk_black_and_white->gk_black_and_white_wordcount; $j++) {
  68. if(isset($exploded_text[$j])) $text .= $exploded_text[$j]." ";
  69. }
  70. if($this->config['config']->gk_black_and_white->gk_black_and_white_wordcount < count($exploded_text)) $text .= '&hellip;';
  71. ?>
  72. <div class="gkIsTextItem">
  73. <?php if($this->config['config']->gk_black_and_white->gk_black_and_white_title_link == 1) : ?>
  74. <h4><a href="<?php echo $link; ?>"><?php echo $title; ?></a></h4>
  75. <?php else : ?>
  76. <h4><a href="<?php echo $link; ?>" class="gkToRemove"><?php echo $title; ?></a></h4>
  77. <?php endif; ?>
  78. <p><?php echo $text; ?>
  79. <?php if($this->config['config']->gk_black_and_white->gk_black_and_white_show_readmore == 1) : ?>
  80. <a href="<?php echo $link; ?>" class="readon">&raquo;</a>
  81. <?php endif; ?>
  82. </p>
  83. </div>
  84. <?php endif; ?>
  85. <?php endfor; ?>
  86. </div>
  87. </div>