source: extensions/Panoramas/AI_jQuery.php @ 3417

Last change on this file since 3417 was 3339, checked in by vdigital, 15 years ago

+ Add Front2Back to depository
+ Add Panoramas to depository

  • Property svn:eol-style set to LF
  • Property svn:keywords set to Author Date Id Revision
File size: 2.8 KB
Line 
1<?php 
2if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
3add_event_handler('render_element_content', 'AI_jQuery_change_picture', 40, 2 );
4
5global $conf;
6if ( !isset($conf['AI jQuery On name']) )
7  { $conf['AI jQuery On name'] = '_360'; }
8if ( !isset($conf['AI jQuery speed']) )
9  { $conf['AI jQuery speed'] = 'slow'; }
10if ( !isset($conf['AI jQuery timeout']) )
11  { $conf['AI jQuery timeout'] = '42200'; }
12if ( !isset($conf['AI jQuery containerwidth']) )
13  { $conf['AI jQuery containerwidth'] = '700'; }
14if ( !isset($conf['AI jQuery animationSpeed']) )
15  { $conf['AI jQuery animationSpeed'] = '45000'; }
16if ( !isset($conf['AI jQuery displayTitle']) )
17  { $conf['AI jQuery displayTitle'] = 'yes'; } 
18if ( !isset($conf['AI jQuery controlBox']) )
19  { $conf['AI jQuery controlBox'] = 'mycontrolboxclass'; } 
20
21function AI_jQuery_change_picture($content, $image)
22{
23  global $conf, $template, $page;
24  if ( !stristr($image['name'], $conf['AI jQuery On name']) )
25    { return $content; }
26  if (!isset($image['image_url']) or !empty($content))
27  { // nothing to do or someone hooked us - so we skip;
28    return $content;
29  }
30  $title = strtr(substr(strip_tags($image['comment']),0,72),'"',' ');
31  if ( $title == '') { $conf['AI jQuery displayTitle'] = 'none'; }
32  else { $title .= '...<br />('.$image['width'].'x'.$image['height'].')';   }
33
34  $template->set_filenames(
35    array('ai_jquery_content' => dirname(__FILE__) . '/content.tpl') );
36  $uuid = uniqid(rand());
37  if (isset($image['high_url'])) {
38    $img_url = "javascript:phpWGOpenWindow('" . $image['high_url'] 
39             . "','". $uuid 
40             . "','scrollbars=yes,toolbar=no,status=no,resizable=yes')";
41    $img_url = $image['high_url'];
42    $target = '_blank';
43  }
44  else { 
45    $img_url = '#' ;
46    $target = '_self';
47  }
48
49  if ( !isset($page['slideshow']) and isset($image['high_url']) )
50    $template->assign( 'high', array(
51      'U_HIGH' => $image['high_url'], 
52      'UUID'   => $uuid,));
53
54  $template->assign( array(
55      'AI_JQUERY_PATH' => AI_JQUERY_PATH, 
56      'SRC_IMG'     => $image['element_url'],
57      'ALT_IMG'     => $image['file'],
58      'WIDTH_IMG'   => $image['width'],
59      'HEIGHT_IMG'  => $image['height'],
60      'WIDTH_FRM'   => $conf['AI jQuery containerwidth'],
61      'COMMENT_IMG' => $title,
62      'U_HIGH'      => $img_url,
63      'U_TRGT'      => $target,
64      'speed'       => $conf['AI jQuery speed'],
65      'timeout'     => $conf['AI jQuery timeout'],
66      'containerwidth' => $conf['AI jQuery containerwidth'],
67      'animationSpeed' => $conf['AI jQuery animationSpeed'],
68      'controlBox'       => $conf['AI jQuery controlBox'],
69      'displayTitle'       => $conf['AI jQuery displayTitle'],
70      'speed'       => $conf['AI jQuery speed'],
71      'height'       => $image['height'],
72      )
73    );
74  return $template->parse('ai_jquery_content', true);
75} 
76?>
Note: See TracBrowser for help on using the repository browser.