public
Description: Git mirror of the CMS Made Simple 2.0 rewrite
Homepage: http://cmsmadesimple.org
Clone URL: git://github.com/tedkulp/cmsmadesimple-2-0.git
ImageGallery plugin now generates javascript by itself and includes href 
base 


git-svn-id: http://svn.cmsmadesimple.org/svn/cmsmadesimple/trunk@2816 
3d254a34-79dc-0310-9e5f-be208747d8a0
tsw (author)
Fri May 26 09:53:07 -0700 2006
commit  b796e8153e2c9a79c91e0d2349b127177a25de0e
tree    75085c66ea57d6634826c3ad43fb03c73cdabbb9
parent  5968ef691528f77f7e36a6c808fe664fe9c0cd8a
...
39
40
41
 
 
42
43
44
...
74
75
76
 
 
 
 
77
78
79
...
422
423
424
425
 
 
 
426
427
428
...
447
448
449
 
 
450
451
452
...
471
472
473
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
474
...
39
40
41
42
43
44
45
46
...
76
77
78
79
80
81
82
83
84
85
...
428
429
430
 
431
432
433
434
435
436
...
455
456
457
458
459
460
461
462
...
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
0
@@ -39,6 +39,8 @@ if(isset($params['thumbPicTitleTag'])) $thumbPicTitleTag = $params['thumbPicTitl
0
 if(isset($params['sortBy'])) $sortBy = $params['sortBy'];
0
 if(isset($params['sortByOrder'])) $sortByOrder = $params['sortByOrder'];
0
 
0
+
0
+
0
 //Read Image Folder
0
 $selfA = explode('/', $_SERVER["PHP_SELF"]);
0
 $self = $selfA[sizeOf($selfA)-1] . '?page=' . $_GET['page'];
0
@@ -74,6 +76,10 @@ $liste = $tmp['file'];
0
 $count = 1;
0
 $output = '';
0
 
0
+ if($type=="popup") {
0
+ $output .= generate_javascript();
0
+ }
0
+
0
 //thumbcount
0
 $deci = array();
0
 for($i=1; $i<=sizeof($liste); $i++) {
0
@@ -422,7 +428,9 @@ good for most people :) </p>
0
 </pre>
0
 <br/>
0
 
0
- <h4>The popup javascript</h4>
0
+ <h4>The popup javascript is now included in plugin code and will be generated automatically if you still have javascript in your template please remove it.</h4>
0
+<?php
0
+/*
0
 <pre>
0
 {literal}
0
 &lt;script type=&quot;text/javascript&quot;&gt;
0
@@ -447,6 +455,8 @@ function PopupPic(bigPic,title,w,h) {
0
 {/literal}
0
 </pre>
0
 <br />
0
+*/
0
+?>
0
   <?php
0
 }
0
 
0
@@ -471,4 +481,39 @@ function smarty_cms_about_function_ImageGallery() {
0
   <?php
0
 }
0
 
0
+function generate_javascript() {
0
+global $gCms;
0
+$config=$gCms->config;
0
+
0
+static $count;
0
+if ($count==0) {
0
+
0
+$out = "
0
+<script type=\"text/javascript\">
0
+<!--
0
+function PopupPic(bigPic,title,w,h) {
0
+var winl = (screen.width - w) / 2;
0
+var wint = (screen.height - h) / 2;
0
+var smarty_hack = 'head';
0
+newWindow = window.open('',title,'height='+h+',width='+w+',top='+wint+',left='+winl+',resizable=0,scrollbars=0');
0
+newWindow.document.write('<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">');
0
+newWindow.document.write('<html><head><title>'+title+'</title><base href=\"".$config[root_url]."/\" />');
0
+newWindow.document.write('<meta http-equiv=\"content-type\" content=\"text/html; charset=UTF-8\" />');
0
+newWindow.document.write('<style type=\"text/css\"><!-- html, body {margin: 0px; background-color: #000;} --></style>');
0
+newWindow.document.write('</'+smarty_hack+'><body onclick=\"self.close()\">');
0
+newWindow.document.write('<p><img src=\"'+bigPic+'\" alt=\"'+title+'\" /></p>');
0
+newWindow.document.write('</body></html>');
0
+newWindow.document.close();
0
+newWindow.focus();
0
+}
0
+-->
0
+</script>
0
+";
0
+}
0
+
0
+$count++;
0
+
0
+return $out;
0
+}
0
+
0
 ?>

Comments

    No one has commented yet.