[4292] | 1 | <?php |
---|
| 2 | /* |
---|
| 3 | Plugin Name: Look_like_gbo2 |
---|
[4869] | 4 | Version: 2.0.O |
---|
[4292] | 5 | Plugin URI: http://phpwebgallery.net/ext/extension_view.php?eid=251 |
---|
| 6 | Author: Ex-Ftb |
---|
| 7 | Author URI: http://www.photos.bouteyron.fr/ |
---|
| 8 | Description: Display thumbnail under button. Add navigation on picture look like GBo Gallery |
---|
| 9 | Add a border around picture ...... |
---|
| 10 | */ |
---|
| 11 | /* 2.0.d fix notice when HD picture is desactivate*/ |
---|
[4523] | 12 | /* 2.0.e fix notice with redirec.tpl */ |
---|
| 13 | /* 2.0.f Tooltip and frame define by plugin vs Css*/ |
---|
[4603] | 14 | /* 2.0.g always display metadata + maintain IPTC */ |
---|
[4523] | 15 | /* 2.0.h new languages PL, ES, HU */ |
---|
| 16 | /* 2.0.i Manage tab for tooltip and frame settings */ |
---|
[4591] | 17 | /* 2.0.J add sample display and fix bug in admin with chrome */ |
---|
[4604] | 18 | /* 2.0.K fix warning du to language file */ |
---|
[4729] | 19 | /* 2.0.L Avoid problem with Gally */ |
---|
| 20 | /* 2.0.M - fix bug on image alt attribute |
---|
| 21 | - fix bug on active -> erase the paramater when it's not mandatory. */ |
---|
[4869] | 22 | /* 2.0.N - fix bug no navigation on picture, whit out frame */ |
---|
| 23 | /* 2.0.O - compliant with extended description */ |
---|
[4292] | 24 | if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); |
---|
| 25 | /* création d'une instance de la classe */ |
---|
| 26 | $obj = new look_like_gbo(); /* class loading */ |
---|
[4603] | 27 | global $conf; |
---|
| 28 | |
---|
[4869] | 29 | define ('LLGBO_INFO_VERSION','2.0.O'); |
---|
[4603] | 30 | if (!defined('LLGBO_PATH')) |
---|
| 31 | {define('LLGBO_PATH' , PHPWG_PLUGINS_PATH . basename(dirname(__FILE__)) . '/');} |
---|
[4523] | 32 | |
---|
| 33 | $conf['LLGBO_SETTINGS'] = explode("," , $conf['LLGBO']); |
---|
| 34 | $conf['LLGBO_TOOLTIP'] = explode(",",$conf['LLGBOTOOLTIP']); |
---|
[4574] | 35 | $conf['LLGBO_FRAME'] = explode (",",$conf['LLGBOFRAME']); |
---|
| 36 | $conf['LLGBO_HEADER'] = explode (",",$conf['LLGBOHEADER']); |
---|
[4729] | 37 | |
---|
[4523] | 38 | ///////////////////////////////////////////////////// |
---|
[4713] | 39 | /* PLUGIN CLASS */ |
---|
| 40 | ///////////////////////////////////////////////////// |
---|
[4292] | 41 | class look_like_gbo |
---|
| 42 | {/* Set the administration panel of the plugin */ |
---|
| 43 | function plugin_admin_menu($menu) |
---|
| 44 | { array_push($menu, |
---|
| 45 | array( |
---|
| 46 | 'NAME' => 'Look_like_GBo', |
---|
[4523] | 47 | 'URL' => get_admin_plugin_menu_link(dirname(__FILE__).'/admin/llgbo_admin.php') )); |
---|
[4292] | 48 | return $menu; } |
---|
[4603] | 49 | |
---|
[4713] | 50 | //------------------------------------------------------------- |
---|
| 51 | /* ALWAYS DISPLAY METADATA */ |
---|
| 52 | //------------------------------------------------------------- |
---|
[4292] | 53 | function AutoDisplayMetadata() |
---|
[4523] | 54 | {global $conf; |
---|
| 55 | If ($conf['LLGBO_SETTINGS'] [2] == 'true' ) // exif under bt |
---|
| 56 | {$_GET['metadata'] = 'O';} |
---|
[4603] | 57 | |
---|
| 58 | If ($conf['LLGBO_SETTINGS'][10] == 'true' ) //always display metadata |
---|
| 59 | {if ( pwg_get_session_var('show_metadata') == null ) |
---|
| 60 | { pwg_set_session_var('show_metadata', 1 );}} |
---|
[4292] | 61 | } |
---|
[4713] | 62 | //------------------------------------------------------------- |
---|
| 63 | // RESET NOFOLLOW, NOINDEX |
---|
| 64 | //------------------------------------------------------------- |
---|
[4292] | 65 | function MyBeginheader() |
---|
[4523] | 66 | { global $page,$conf; |
---|
| 67 | If ($conf['LLGBO_SETTINGS'][2] == 'true' ) // reset nofollow, noindex |
---|
| 68 | { unset ($page['meta_robots']);} |
---|
[4292] | 69 | } |
---|
[4713] | 70 | //------------------------------------------------------------- |
---|
| 71 | // MANAGE H E A D E R |
---|
| 72 | //------------------------------------------------------------- |
---|
[4292] | 73 | function Myheader() |
---|
[4523] | 74 | {global $template,$conf; |
---|
[4574] | 75 | $page_name = script_basename(); |
---|
[4578] | 76 | if (!isset($page_name)) {$page_name ='index';} |
---|
[4574] | 77 | if ($conf['LLGBO_SETTINGS'] [6] = 'true' ) |
---|
| 78 | {$no_header = false; |
---|
[4578] | 79 | if ( $page_name == 'index') |
---|
[4574] | 80 | {// print_r($_GET.'----'.$page_name ); |
---|
| 81 | if ((count ($_GET)) == 0 and ($conf['LLGBO_HEADER'][0] == 'false')) {$no_header = true;}// home |
---|
| 82 | foreach($_GET as $cle =>$valeur) |
---|
| 83 | {//print_r($cle.'_'.$valeur); |
---|
| 84 | if ((strpos( $cle ,'categories') == true ) and ($conf['LLGBO_HEADER'][0] == 'false')) {$no_header = true;}// categories |
---|
| 85 | if ((strpos( $cle ,'category') == true ) and ($conf['LLGBO_HEADER'][1] == 'false')) {$no_header = true;break;} |
---|
| 86 | if ((strpos( $cle ,'filter=') == true ) and ($conf['LLGBO_HEADER'][2] == 'false')) {$no_header = true;break;} |
---|
| 87 | if ((strpos( $cle ,'categories/flat') == true ) and ($conf['LLGBO_HEADER'][3] == 'false')) {$no_header = true;break;} |
---|
| 88 | if ((strpos( $cle ,'categories/posted-monthly-list') == true ) and ($conf['LLGBO_HEADER'][4] == 'false')) {$no_header = true;break;} |
---|
| 89 | if ((strpos( $cle ,'additional_page') == true ) and ($conf['LLGBO_HEADER'][6] == 'false')) {$no_header = true;break;} |
---|
| 90 | if ((strpos( $cle ,'most_visited') == true ) and ($conf['LLGBO_HEADER'][7] == 'false')) {$no_header = true;break;} |
---|
| 91 | if ((strpos( $cle ,'best_rated') == true ) and ($conf['LLGBO_HEADER'][8] == 'false')) {$no_header = true;break;} |
---|
| 92 | if ((strpos( $cle ,'list') == true ) and ($conf['LLGBO_HEADER'][9] == 'false')) {$no_header = true;break;} |
---|
| 93 | if ((strpos( $cle ,'recent_pics') == true ) and ($conf['LLGBO_HEADER'][10] == 'false')) {$no_header = true;break;} |
---|
| 94 | if ((strpos( $cle ,'tags') == true ) and ($conf['LLGBO_HEADER'][11] == 'false')) {$no_header = true;break;} |
---|
| 95 | if ((strpos( $cle ,'created-monthly-list') == true ) and ($conf['LLGBO_HEADER'][12] == 'false')) {$no_header = true;break;} |
---|
| 96 | if ((strpos( $cle ,'favorites') == true ) and ($conf['LLGBO_HEADER'][19] == 'false')) {$no_header = true;break;} |
---|
[4578] | 97 | if ((strpos( $cle ,'recent_cats') == true ) and ($conf['LLGBO_HEADER'][20] == 'false')) {$no_header = true;break;} |
---|
[4574] | 98 | } |
---|
| 99 | } |
---|
| 100 | //print_r($_GET.'----'.$page_name ); |
---|
| 101 | if ( $page_name == 'picture' and $conf['LLGBO_HEADER'][5] == 'false') {$no_header = true;}//picture page |
---|
| 102 | if ( $page_name == 'tags' and $conf['LLGBO_HEADER'][11] == 'false') {$no_header = true;}//tags |
---|
| 103 | if ( $page_name == 'search' and $conf['LLGBO_HEADER'][13] == 'false') {$no_header = true;}//search |
---|
| 104 | if ( $page_name == 'comments' and $conf['LLGBO_HEADER'][14] == 'false') {$no_header = true;}//comments |
---|
| 105 | if ( $page_name == 'about' and $conf['LLGBO_HEADER'][15] == 'false') {$no_header = true;}//about |
---|
| 106 | if ( $page_name == 'notification' and $conf['LLGBO_HEADER'][16] == 'false') {$no_header = true;}//notification |
---|
| 107 | if ( $page_name == 'register' and $conf['LLGBO_HEADER'][17] == 'false') {$no_header = true;} //notification |
---|
| 108 | if ( $page_name == 'identification' and $conf['LLGBO_HEADER'][18] == 'false') {$no_header = true;}//about |
---|
| 109 | if ($no_header == true) |
---|
| 110 | {$template->append('head_elements',"\n".' <STYLE type="text/css">#theHeader{display: none}</STYLE>');} |
---|
| 111 | } |
---|
| 112 | // |
---|
| 113 | If ($conf['LLGBO_SETTINGS'] [9] == 'true' ) |
---|
| 114 | {$template->append('head_elements',"\n".' <STYLE type="text/css">.navThumb{display: none} </STYLE>');} |
---|
| 115 | |
---|
[4292] | 116 | } // end header |
---|
[4713] | 117 | |
---|
| 118 | //------------------------------------------------------------- |
---|
| 119 | //* IMPROVE FUNCTIONNALITIES --> PICTURE.TPL |
---|
| 120 | //------------------------------------------------------------- |
---|
[4292] | 121 | function DisplayGboLook() |
---|
[4523] | 122 | { global $template,$conf; |
---|
| 123 | $u_metadata = $template->get_template_vars('U_METADATA'); |
---|
| 124 | $swt = ' swttips="'; |
---|
| 125 | If ($conf['LLGBO_SETTINGS'] [2] == 'true' ) // exif under bt |
---|
| 126 | { $metadata = $template->get_template_vars('metadata'); |
---|
| 127 | if(is_array($metadata)) |
---|
| 128 | {foreach($metadata[0] as $cle =>$tableau) |
---|
| 129 | { if(is_array($tableau)) |
---|
| 130 | {foreach($tableau as $cle=>$valeur) |
---|
| 131 | { $swt= $swt.$cle.' : '.$valeur.'<br>'; } |
---|
| 132 | } } |
---|
| 133 | $template->assign( 'U_METADATA', $u_metadata.'"'.$swt); |
---|
[4713] | 134 | $template->Clear_assign('metadata'); |
---|
[4523] | 135 | } // hide original metadata |
---|
| 136 | } |
---|
| 137 | |
---|
[4292] | 138 | } |
---|
[4713] | 139 | //----------------------------------------------------------------- |
---|
| 140 | /* ------ MANAGE PICTURE PAGE---------------- */ |
---|
| 141 | //----------------------------------------------------------------- |
---|
[4292] | 142 | function MyPictureOptions($content ) |
---|
[4713] | 143 | {global $template,$conf,$user,$lang; |
---|
[4523] | 144 | $sweetcss = ' <! --- LLGBO tooltip css--> |
---|
| 145 | <style type="text/css"> |
---|
| 146 | div#toolTip {position:absolute;z-index:1000;width:'.$conf['LLGBO_TOOLTIP'][0].'px;background:'.$conf['LLGBO_TOOLTIP'][3].';color:'.$conf['LLGBO_TOOLTIP'][5].';border:'.$conf['LLGBO_TOOLTIP'][1].'px solid '.$conf['LLGBO_TOOLTIP'][2].';padding:5px;min-height:1em;-moz-border-radius:5px} |
---|
| 147 | div#toolTip p {margin:0;padding:0;color:'.$conf['LLGBO_TOOLTIP'][5].';font-size:0.8em;font-family:Verdana,Arial,Helvetica,sans-serif;text-align:left} |
---|
| 148 | div#toolTip p em {display:block;margin-top:3px;font-style:normal;font-weight:bold;text-align:left} |
---|
| 149 | div#toolTip p.title {color:'.$conf['LLGBO_TOOLTIP'][4].';text-align:center;padding:0 0 3px 0;} |
---|
| 150 | </style>'; |
---|
[4713] | 151 | //----------------------------------------------------------------- |
---|
| 152 | // ----------- add JS tooltip in footer -------------------- |
---|
| 153 | //----------------------------------------------------------------- |
---|
[4574] | 154 | If (($conf['LLGBO'][1] == 'true' ) /* tooltip */ or ($conf['LLGBO_SETTINGS'] [2] == 'true' ) /* exif under bt */ |
---|
| 155 | or ($conf['LLGBO_SETTINGS'] [4] === 'true' ) /* usemap and Display Thumb */) |
---|
[4292] | 156 | { $javacss = '<script type="text/javascript" charset="utf-8" src="'.LLGBO_PATH; |
---|
| 157 | $linkcss = '<link rel="stylesheet" type="text/css" href="'.LLGBO_PATH; |
---|
[4523] | 158 | $sweetcss = $sweetcss."\n".$javacss.'js/sweettitlesn.js"></script>'."\n"; |
---|
[4713] | 159 | $template->append('footer_elements',$sweetcss); } |
---|
| 160 | //----------------------------------------------------------------- |
---|
[4292] | 161 | // Navigation improvement are always available |
---|
[4713] | 162 | //----------------------------------------------------------------- |
---|
[4292] | 163 | $ThePicture = $template->get_template_vars('current'); |
---|
| 164 | $next = $template->get_template_vars('next'); |
---|
| 165 | $prev = $template->get_template_vars('previous'); |
---|
| 166 | $last = $template->get_template_vars('last'); |
---|
| 167 | $first = $template->get_template_vars('first'); |
---|
| 168 | $swtimg = ' swttips="<center><img src='; |
---|
| 169 | $nextthumb_title = $next['TITLE']; |
---|
| 170 | $prevthumb_title = $prev['TITLE']; |
---|
| 171 | $usemap =''; |
---|
[4713] | 172 | //---------------------------------------------------- |
---|
| 173 | //------- Tooltip ------------- |
---|
| 174 | //---------------------------------------------------- |
---|
[4523] | 175 | If ($conf['LLGBO_SETTINGS'][1] == 'true' )/* tooltip */ |
---|
| 176 | { $nextthumb_title = $next['TITLE']; |
---|
| 177 | $prevthumb_title = $prev['TITLE']; |
---|
[4292] | 178 | if (isset($first)){$template->assign('first', array('TITLE' => $first['TITLE'].'"'.$swtimg.$first['THUMB_SRC'].'>', |
---|
| 179 | 'U_IMG' => $first['U_IMG']));} |
---|
| 180 | if (isset($prev)){$template->assign('previous', array('TITLE' => $prev['TITLE'].'"'.$swtimg.$prev['THUMB_SRC'].'>', |
---|
| 181 | 'U_IMG' => $prev['U_IMG'], 'THUMB_SRC' => $prev['THUMB_SRC'])); } |
---|
| 182 | if (isset($next)){$template->assign('next', array('TITLE' => $next['TITLE'].'"'.$swtimg.$next['THUMB_SRC'].'>', |
---|
| 183 | 'U_IMG' => $next['U_IMG'], 'THUMB_SRC' => $next['THUMB_SRC']));} |
---|
| 184 | if (isset($last)){$template->assign('last', array('TITLE' => $last['TITLE'].'"'.$swtimg.$last['THUMB_SRC'].'>', |
---|
| 185 | 'U_IMG' => $last['U_IMG']));} |
---|
| 186 | } |
---|
[4713] | 187 | ///// YOGA or SIMPLE ///////////////////// |
---|
| 188 | $themeconf = $template->get_template_vars('themeconf'); |
---|
| 189 | $tpl_name = $themeconf['template']; |
---|
[4292] | 190 | ///////////////////////////////////////////// |
---|
[4713] | 191 | // AN OTHER PLUGIN IS WORKING -> GO BACK |
---|
| 192 | // - - - - - - - - - - - - - - - - - - - - |
---|
[4292] | 193 | if ( !empty($content) ) { return $content; } |
---|
| 194 | ////////////////////////////////////////////////////////////////////// |
---|
| 195 | // frame and navigation on picture are only available on picture extension |
---|
| 196 | ///////////////////////////////////////////////////////////////// |
---|
[4713] | 197 | if ($ThePicture['is_picture'] <> 1 ) { return $content; ; } |
---|
[4714] | 198 | // |
---|
[4713] | 199 | if ( strtoupper($tpl_name) == 'GALLY') { |
---|
[4714] | 200 | return $content; ; } // Not compliant with Gally |
---|
[4523] | 201 | ///////////////////////////////////////////////////////////////// |
---|
| 202 | If (($conf['LLGBO_SETTINGS'] [1] == 'true' )/* tooltip display */ or ($conf['LLGBO_SETTINGS'] [0] == 'true') /* frame */ ) |
---|
| 203 | {$linkcss = '<link rel="stylesheet" type="text/css" href="'.LLGBO_PATH; |
---|
[4713] | 204 | $template->append('head_elements',$linkcss.'css/gbolook.css">'); |
---|
[4729] | 205 | if ( strtoupper($tpl_name) == 'SIMPLE') { |
---|
| 206 | $template->append('head_elements',"\n".' <STYLE type="text/css">#theImage{margin:auto;overflow: hidden;} </STYLE>');} |
---|
| 207 | } |
---|
| 208 | |
---|
[4713] | 209 | //---------------------------------------------------- |
---|
| 210 | //------- Usemap values ------------- |
---|
| 211 | //---------------------------------------------------- |
---|
[4523] | 212 | If ($conf['LLGBO_SETTINGS'] [3] == 'true' ) // usemap |
---|
[4729] | 213 | { $usemap = ' usemap="#prevnext"' ; |
---|
[4713] | 214 | $imgw = $ThePicture['scaled_width']; |
---|
[4292] | 215 | $imgh = $ThePicture['scaled_height']; |
---|
| 216 | $template->assign(array( |
---|
[4523] | 217 | /* left --> Prev */ 'LEFT_X1' => 0, 'LEFT_Y1' => 0, |
---|
| 218 | 'LEFT_X2' => round($imgw * 0.24), 'LEFT_Y2' => $imgh , |
---|
| 219 | /* up */ 'UP_X1' => round($imgw * 0.24) , 'UP_Y1' => 0, |
---|
| 220 | 'UP_X2' => round($imgw * 0.76), 'UP_Y2' => round($imgh * 0.50), |
---|
| 221 | /* high */ 'HIGH_X1' => round($imgw * 0.24) , 'HIGH_Y1' => round($imgh * 0.50) , |
---|
| 222 | 'HIGH_X2' => round($imgw * 0.76), 'HIGH_Y2' => $imgh, |
---|
| 223 | /* right -> next */ 'RIGHT_X1' => round($imgw * 0.76) , 'RIGHT_Y1' => 0, |
---|
| 224 | 'RIGHT_X2' => $imgw , 'RIGHT_Y2' => $imgh )); |
---|
| 225 | $template->assign( 'USEMAP', 'ok' ); |
---|
[4292] | 226 | |
---|
[4523] | 227 | If ($conf['LLGBO_SETTINGS'] [4] === 'true' ) // usemap and Display Thumb |
---|
[4292] | 228 | { $template->assign(array('NEXTTHUMB' => $swtimg.$next['THUMB_SRC'].'>"', |
---|
| 229 | 'NEXTTHUMBTITLE' => $nextthumb_title, |
---|
| 230 | 'PREVTHUMB' => $swtimg.$prev['THUMB_SRC'].'>"', |
---|
[4523] | 231 | 'PREVTHUMBTITLE' => $prevthumb_title));} |
---|
[4713] | 232 | } // end usemap |
---|
| 233 | |
---|
| 234 | //---------------------------------------------------- |
---|
| 235 | // improve alt |
---|
| 236 | //---------------------------------------------------- |
---|
[4728] | 237 | $alt = $conf['allow_html_descriptions'] ? $ThePicture['name'] : strip_tags($ThePicture['name']); |
---|
[4729] | 238 | /* |
---|
[4713] | 239 | $related_cats = $template->get_template_vars('related_categories'); |
---|
| 240 | if (isset($related_cats)) |
---|
| 241 | {$related_cat = strip_tags($related_cats[0]); |
---|
| 242 | $related_cat = str_replace(' '," ",$related_cat); |
---|
| 243 | $related_cat = str_replace($conf['level_separator'],"-",$related_cat); |
---|
[4728] | 244 | } |
---|
[4729] | 245 | $alt= $related_cat.' '.$alt; |
---|
| 246 | */ |
---|
[4713] | 247 | //----------------------------------------------------------------- |
---|
[4292] | 248 | $template->assign( array( |
---|
[4523] | 249 | 'SRC_IMG' => $ThePicture['image_url'], |
---|
[4292] | 250 | 'WIDTH_IMG' => $ThePicture['scaled_width'], |
---|
[4869] | 251 | 'HEIGHT_IMG' => $ThePicture['scaled_height'], |
---|
[4729] | 252 | 'ALT_IMG' => $alt , |
---|
| 253 | 'MAP_TO_USED' => $usemap |
---|
[4292] | 254 | )); |
---|
| 255 | |
---|
| 256 | If (isset($ThePicture['has_high'])and isset($ThePicture['high_url'])) |
---|
| 257 | { $uuid = uniqid(rand()); |
---|
| 258 | $template->assign( |
---|
| 259 | 'high', array( |
---|
| 260 | 'U_HIGH' => $ThePicture['high_url'] , |
---|
| 261 | 'UUID' => $uuid, ));} |
---|
| 262 | |
---|
[4523] | 263 | If (($conf['LLGBO_SETTINGS'] [5] == 'true' ) /* title on frame */ and ($conf['LLGBO_SETTINGS'] [0] == 'true' )) // display frame |
---|
| 264 | { $template->assign('SHOW_PICTURE_NAME_ON_TITLE', false); |
---|
| 265 | $template->assign('TITLE_FRAME_COLOR', $conf['LLGBO_FRAME'][0]); } |
---|
[4869] | 266 | |
---|
| 267 | // compatibility with extended description |
---|
| 268 | $ThePicture = $template->get_template_vars('current'); |
---|
| 269 | $comment = $template->get_template_vars('COMMENT_IMG'); |
---|
| 270 | if (!isset($comment) ) |
---|
| 271 | {$template->assign( 'COMMENT_IMG' , $ThePicture['comment']);} |
---|
[4713] | 272 | //---------------------------------------------------- |
---|
| 273 | /* HTML frame */ |
---|
| 274 | //---------------------------------------------------- |
---|
[4523] | 275 | If (($conf['LLGBO_SETTINGS'] [0] == 'true') ) |
---|
[4591] | 276 | { $bds = 0; |
---|
[4523] | 277 | $frame_begin =''; |
---|
| 278 | $frame_end=''; |
---|
| 279 | for ($x = 1 ;$x < 32 ; $x =$x +2) |
---|
| 280 | { if ((isset($conf['LLGBO_FRAME'][$x+1])) and ($conf['LLGBO_FRAME'][$x+1] > 0)) // boder value > 0 |
---|
[4591] | 281 | {$frame_begin = '<div id ="llgboframe'.$x.'" style="border: '.$conf['LLGBO_FRAME'][$x+1].'px solid '.$conf['LLGBO_FRAME'][$x].'">'."\n".$frame_begin; |
---|
| 282 | $bds = $bds + $conf['LLGBO_FRAME'][$x+1]; //define border sum |
---|
[4523] | 283 | $frame_end = $frame_end .' </div>'; |
---|
| 284 | } |
---|
| 285 | } |
---|
[4591] | 286 | $frame_width = $ThePicture["scaled_width"] + (2 * $bds); |
---|
| 287 | $frame_height = $ThePicture["scaled_height"] + (2 * $bds); |
---|
[4523] | 288 | $template->assign('FRAME_SIZE','style="width:'.$frame_width .'px; height:'.$frame_height.'px;"'); |
---|
| 289 | $template->assign('FRAME_BEGIN', $frame_begin); |
---|
| 290 | $template->assign('FRAME_END', $frame_end); |
---|
| 291 | // title on frame |
---|
| 292 | If ($conf['LLGBO_SETTINGS'] [5] == 'true' ) // title on frame |
---|
| 293 | {$template->assign( array( 'TITLE_FRAME' => $ThePicture['name'] )); } |
---|
| 294 | } // end frame |
---|
[4713] | 295 | else |
---|
| 296 | // no frame |
---|
[4523] | 297 | {$template->clear_assign('FRAME_BEGIN') ;} |
---|
[4292] | 298 | |
---|
| 299 | $template->set_filenames( array('gbo_content'=> dirname(__FILE__).'/template/picture_content.tpl') ); |
---|
| 300 | return $template->parse( 'gbo_content', true); |
---|
[4523] | 301 | } //end --> MyPictureOptions |
---|
[4292] | 302 | } // End class |
---|
| 303 | |
---|
| 304 | /* trigger à intercepter */ |
---|
| 305 | add_event_handler('loc_begin_page_header', array(&$obj, 'MyBeginheader')); |
---|
| 306 | add_event_handler('loc_end_page_header', array(&$obj, 'Myheader')); |
---|
| 307 | Add_event_handler( 'loc_begin_picture', array(&$obj, 'AutoDisplayMetadata')); |
---|
| 308 | Add_event_handler( 'loc_end_picture', array(&$obj, 'DisplayGboLook')); |
---|
| 309 | add_event_handler('render_element_content', |
---|
| 310 | array(&$obj,'MyPictureOptions'), EVENT_HANDLER_PRIORITY_NEUTRAL-1, 2 ); |
---|
| 311 | add_event_handler('get_admin_plugin_menu_links', array(&$obj, 'plugin_admin_menu') ); |
---|
| 312 | set_plugin_data($plugin['id'], $obj); |
---|
[4603] | 313 | function afficher_tableau($tableau) |
---|
| 314 | { |
---|
| 315 | // on fait une boucle qui lit les éléments du tableau |
---|
| 316 | foreach ($tableau as $cle=>$valeur) |
---|
| 317 | { |
---|
| 318 | // si l'un des éléments est lui même un tableau |
---|
| 319 | // alors on applique la fonction à ce tableau |
---|
| 320 | if(is_array($valeur)) |
---|
| 321 | { |
---|
| 322 | // on affiche le nom de la clé et |
---|
| 323 | // le début d'une liste pour |
---|
| 324 | // décaler le contenu vers la droite |
---|
| 325 | print_r ($cle); |
---|
| 326 | echo ' : <ul>'; |
---|
| 327 | |
---|
| 328 | // ici se réalise la récursivité |
---|
| 329 | // c'est à dire qu'on applique la fonction |
---|
| 330 | // à l'élément en cours car c'est lui aussi un tableau |
---|
| 331 | afficher_tableau($valeur); |
---|
| 332 | |
---|
| 333 | // on ferme la liste |
---|
| 334 | echo '</ul>'; |
---|
| 335 | } |
---|
| 336 | } |
---|
| 337 | } |
---|
[4292] | 338 | ?> |
---|