Advertisement
dutchbunny

css vqmod popup

May 23rd, 2014
175
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.53 KB | None | 0 0
  1. <modification>
  2. <id><![CDATA[Open Selected Option in pop-up]]></id>
  3. <version><![CDATA[1.0]]></version>
  4. <vqmver><![CDATA[2.1.7]]></vqmver>
  5. <author><![CDATA[[email protected]]]></author>
  6.  
  7. <file name="admin/view/template/catalog/option_form.tpl">
  8. <operation error="log">
  9. <search position="replace" error="log" ><![CDATA[<?php echo $entry_type; ?>]]></search>
  10. <add><![CDATA[Open in popup:</td><td><?php if($popup==1) { $check1='checked="checked"'; $check2="";} else {$check1=""; $check2='checked="checked"';} ?><input type="radio" name="popup" value="0" id="popup0" <?php echo $check2; ?>>NO &nbsp; &nbsp; &nbsp; <input type="radio" name="popup" value="1" id="popup1" <?php echo $check1; ?>>YES</td></tr><tr><td><?php echo $entry_type; ?>]]></add>
  11. </operation>
  12. </file>
  13.  
  14. <file name="admin/model/catalog/option.php">
  15. <operation error="log">
  16. <search position="replace" error="log"><![CDATA[$data['sort_order']]]></search>
  17. <add><![CDATA[$data['sort_order'] . "' , popup = '" . $data['popup'] ]]></add>
  18. </operation>
  19. </file>
  20.  
  21. <file name="admin/controller/catalog/option.php">
  22. <operation error="log">
  23. <search position="replace" error="log"><![CDATA[$result['name'],]]></search>
  24. <add><![CDATA[$result['name'],
  25. 'popup' => $result['popup'],
  26. ]]></add>
  27. </operation>
  28. <operation error="log">
  29. <search position="replace" error="log"><![CDATA[if (isset($this->request->post['sort_order'])) {]]></search>
  30. <add><![CDATA[
  31. if (isset($this->request->post['popup'])) {
  32. $this->data['popup'] = $this->request->post['popup'];
  33. } elseif (!empty($option_info)) {
  34. $this->data['popup'] = $option_info['popup'];
  35. } else {
  36. $this->data['popup'] = '';
  37. }
  38.  
  39. if (isset($this->request->post['sort_order'])) {]]></add>
  40. </operation>
  41. </file>
  42.  
  43. <file name="catalog/controller/product/product.php">
  44. <operation error="log">
  45. <search position="after" error="log"><![CDATA[$option['product_option_id'],]]></search>
  46. <add><![CDATA['popup' => $option['popup'],]]></add>
  47. </operation>
  48. </file>
  49.  
  50. <file name="catalog/model/catalog/product.php">
  51. <operation error="log">
  52. <search position="after" error="log"><![CDATA[$product_option['type'],]]></search>
  53. <add><![CDATA['popup' => $product_option['popup'],]]></add>
  54. </operation>
  55. </file>
  56.  
  57. <file name="catalog/view/theme/*/template/common/header.tpl">
  58. <operation error="log">
  59. <search position="before" error="log"><![CDATA[</head>]]></search>
  60. <add><![CDATA[
  61.  
  62. <style>
  63.  
  64. .overlay {
  65. background-color: rgba(0, 0, 0, 0.6);
  66. bottom: 0;
  67. cursor: default;
  68. left: 0;
  69. opacity: 0;
  70. position: fixed;
  71. right: 0;
  72. top: 0;
  73. visibility: hidden;
  74. z-index: 99999;
  75.  
  76. -webkit-transition: opacity .5s;
  77. -moz-transition: opacity .5s;
  78. -ms-transition: opacity .5s;
  79. -o-transition: opacity .5s;
  80. transition: opacity .5s;
  81. }
  82. .overlay:target {
  83. visibility: visible;
  84. opacity: 99999;
  85. }
  86. .popup {
  87. background-color: #fff;
  88. border: 3px solid #fff;
  89. display: inline-block;
  90. left: 50%;
  91. opacity: 0;
  92. padding: 15px;
  93. position: fixed;
  94. text-align: justify;
  95. top: 40%;
  96. visibility: hidden;
  97. z-index: 99999;
  98.  
  99. -webkit-transform: translate(-50%, -50%);
  100. -moz-transform: translate(-50%, -50%);
  101. -ms-transform: translate(-50%, -50%);
  102. -o-transform: translate(-50%, -50%);
  103. transform: translate(-50%, -50%);
  104.  
  105. -webkit-border-radius: 10px;
  106. -moz-border-radius: 10px;
  107. -ms-border-radius: 10px;
  108. -o-border-radius: 10px;
  109. border-radius: 10px;
  110.  
  111. -webkit-box-shadow: 0 1px 1px 2px rgba(0, 0, 0, 0.4) inset;
  112. -moz-box-shadow: 0 1px 1px 2px rgba(0, 0, 0, 0.4) inset;
  113. -ms-box-shadow: 0 1px 1px 2px rgba(0, 0, 0, 0.4) inset;
  114. -o-box-shadow: 0 1px 1px 2px rgba(0, 0, 0, 0.4) inset;
  115. box-shadow: 0 1px 1px 2px rgba(0, 0, 0, 0.4) inset;
  116.  
  117. -webkit-transition: opacity .5s, top .5s;
  118. -moz-transition: opacity .5s, top .5s;
  119. -ms-transition: opacity .5s, top .5s;
  120. -o-transition: opacity .5s, top .5s;
  121. transition: opacity .5s, top .5s;
  122. }
  123. .overlay:target+.popup {
  124. top: 60%;
  125. opacity: 1;
  126. visibility: visible;
  127. min-height:75px;
  128. font-size:14px;
  129. }
  130. .close {
  131. background-color: rgba(0, 0, 0, 0.8);
  132. height: 30px;
  133. line-height: 30px;
  134. position: absolute;
  135. right: 0;
  136. text-align: center;
  137. text-decoration: none;
  138. bottom: 5px;
  139. right: 5px;
  140. width: 70px;
  141.  
  142. -webkit-border-radius: 15px;
  143. -moz-border-radius: 15px;
  144. -ms-border-radius: 15px;
  145. -o-border-radius: 15px;
  146. border-radius: 15px;
  147. }
  148. .close:before {
  149. color: rgba(255, 255, 255, 0.9);
  150. content: "Ga verder";
  151. font-size: 14px;
  152. text-shadow: 0 -1px rgba(0, 0, 0, 0.9);
  153. }
  154. .close:hover {
  155. background-color: rgba(64, 128, 128, 0.8);
  156. }
  157.  
  158.  
  159. </style>
  160.  
  161. ]]></add>
  162. </operation>
  163.  
  164. </file>
  165.  
  166. <file name="catalog/view/theme/*/template/product/product.tpl">
  167.  
  168.  
  169. <operation error="log">
  170. <search position="replace" error="log"><![CDATA[<div id="option-<?php echo $option['product_option_id']; ?>" class="option">]]></search>
  171. <add><![CDATA[<?php
  172. if($option['popup']=="1") {
  173. $rtest="";
  174. if($option['type']=='radio') {
  175. $rtest='style="width:980px;"';
  176. print('
  177. <script>
  178. function updateRadio'.$option['product_option_id'].'() {
  179. var radioVal = [];
  180. var checkTest = "";
  181. $(\'#option-'.$option['product_option_id'].' :checked\').each(function() {
  182. radioVal.push($(this).next(\'label\').html());
  183. checkTest = $(this).next(\'label\').find(\'.tt\').find(\'span\').find(\'i\').find(\'img\').attr(\'src\');
  184. });
  185. $(\'#t-'.$option['product_option_id'].'\').html(\' \'+ radioVal.join("<br />") +\' \');
  186. $( ".image-additional" ).append(\' <div id="rphoto'.$option['product_option_id'].'" style="display:inline; position:relative;"></div> \');
  187.  
  188. //if($(this).next(\'label\').find(\'.tt\').find(\'span\').find(\'i\').html()) $(\'#rphoto'.$option['product_option_id'].'\').html(\' \'+ $(this).next(\'label\').find(\'.tt\').find(\'span\').find(\'i\').html() +\' \');
  189. if($(this).next(\'label\').find(\'.tt\').find(\'span\').find(\'i\').html()) $(\'#rphoto'.$option['product_option_id'].'\').html(\'<a href="\'+ checkTest +\'" rel="prettyPhoto[pp_gal]" title="a" ><img src="\'+ checkTest +\'" title="a" alt="a" style="width:138px; height:138px;" ></a>\');
  190.  
  191.  
  192. $("a[rel^=\'prettyPhoto\']").prettyPhoto({animation_speed: \'fast\', /* fast/slow/normal */
  193. slideshow: 5000,
  194. autoplay_slideshow: false,
  195. opacity: 0.80,
  196. show_title: true,
  197. allow_resize: true,
  198. default_width: 500,
  199. default_height: 344,
  200. counter_separator_label: "/",
  201. theme: \'dark_rounded\',
  202. horizontal_padding: 20,
  203. hideflash: false,
  204. wmode: \'opaque\',
  205. autoplay: true,
  206. modal: false,
  207. deeplinking: false,
  208. overlay_gallery: true,
  209. keyboard_shortcuts: true,
  210. changepicturecallback: function(){},
  211. callback: function(){},
  212. ie6_fallback: true
  213. });
  214.  
  215.  
  216. }
  217. $(function() {
  218. $(\'#option-'.$option['product_option_id'].' input\').click(updateRadio'.$option['product_option_id'].');
  219. updateRadio'.$option['product_option_id'].'();
  220. });
  221.  
  222. </script>
  223. ');}
  224.  
  225.  
  226. if($option['type']=='checkbox') {
  227. print('
  228. <script>
  229. function updateCheck'.$option['product_option_id'].'() {
  230. var checkVals = [];
  231. var checkImg = [];
  232. var checkTest = "";
  233. $(\'#option-'.$option['product_option_id'].' :checked\').each(function() {
  234. checkVals.push($(this).next(\'label\').html());
  235. //checkImg.push($(this).next(\'label\').find(\'.tt\').find(\'span\').find(\'i\').html());
  236. checkTest = $(this).next(\'label\').find(\'.tt\').find(\'span\').find(\'i\').find(\'img\').attr(\'src\');
  237. checkImg.push(\'<a href="\'+ checkTest +\'" rel="prettyPhoto[pp_gal]" title="a" ><img src="\'+ checkTest +\'" title="a" alt="a" style="width:138px; height:138px;" ></a>\');
  238. });
  239. $(\'#t-'.$option['product_option_id'].'\').html(\' \'+ checkVals.join("<br />") +\' \');
  240. $( ".image-additional" ).append(\' <div id="cphoto'.$option['product_option_id'].'" style="display:inline; position:relative; "></div> \');
  241. //$(\'#cphoto'.$option['product_option_id'].'\').html(\' \'+ checkVals +\'\');
  242.  
  243. $(\'#cphoto'.$option['product_option_id'].'\').html(\' \'+ checkImg.join("") +\' \');
  244.  
  245.  
  246.  
  247.  
  248.  
  249. $("a[rel^=\'prettyPhoto\']").prettyPhoto({animation_speed: \'fast\', /* fast/slow/normal */
  250. slideshow: 5000,
  251. autoplay_slideshow: false,
  252. opacity: 0.80,
  253. show_title: true,
  254. allow_resize: true,
  255. default_width: 500,
  256. default_height: 344,
  257. counter_separator_label: "/",
  258. theme: \'dark_rounded\',
  259. horizontal_padding: 20,
  260. hideflash: false,
  261. wmode: \'opaque\',
  262. autoplay: true,
  263. modal: false,
  264. deeplinking: false,
  265. overlay_gallery: true,
  266. keyboard_shortcuts: true,
  267. changepicturecallback: function(){},
  268. callback: function(){},
  269. ie6_fallback: true
  270. });
  271.  
  272.  
  273.  
  274.  
  275.  
  276.  
  277.  
  278. //$(\'#cphoto'.$option['product_option_id'].'\').html(\' \'+ checkImg +\' \');
  279. }
  280. $(function() {
  281. $(\'#option-'.$option['product_option_id'].' input\').click(updateCheck'.$option['product_option_id'].');
  282. updateCheck'.$option['product_option_id'].'();
  283. });
  284.  
  285. </script>
  286. ');}
  287.  
  288. print('<a href="'.$_SERVER['REQUEST_URI'].'#popup-'.$option['product_option_id'].'">'.$option['name'].'</a><br /><div id="t-'.$option['product_option_id'].'"></div><br /><a href="'.$_SERVER['REQUEST_URI'].'#x" class="overlay" id="popup-'.$option['product_option_id'].'"></a><div class="popup" '.$rtest.'><div id="option-'.$option['product_option_id'].'" class="option">');} else { print('<div id="option-'.$option['product_option_id'].'" class="option">');}
  289. ?>]]></add>
  290.  
  291. </operation>
  292. <operation error="log">
  293. <search position="before" error="log" offset="3" index="2,3,4,5,6,7,8,9"><![CDATA[<?php if ($option['type']]]></search>
  294. <add><![CDATA[<?php if($option['popup']=="1") print('<a class="close" href="'.$_SERVER['REQUEST_URI'].'#close"></a></div>'); ?>]]></add>
  295. </operation>
  296. </file>
  297.  
  298. </modification>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement