Changeset 29049 for extensions/LLGBO2/include
- Timestamp:
- Jul 16, 2014, 9:28:35 PM (10 years ago)
- Location:
- extensions/LLGBO2/include
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/LLGBO2/include/manage_header.php
r29005 r29049 3 3 /* LLGBO Manage header */ 4 4 //---------------------------------------------------- 5 global $template,$conf; 6 $page_name = script_basename(); 5 7 if (!isset($page_name)) {$page_name ='index';} 6 8 if ($conf['LLGBO2']['manageheader']) 7 9 {$no_header = false; 8 $input= $_SERVER['PHP_SELF']; 9 if ($conf['question_mark_in_urls'] == true) 10 { foreach($_GET as $cle =>$valeur) 11 {$input= $input.$cle ;} 12 } 13 14 if ( strpos( $input,'index') == true ) 15 { foreach($conf['LLGBO2']['HD-dispheader'] as $cle => $valeur) 16 { if ($valeur == false) { 17 if($cle == 'home' ) {$cle = 'index.php';} 18 if (strpos( $input, $cle) == true ) 19 {$no_header = true;} 20 } 21 } 22 } 23 else 24 { 25 if (isset($conf['LLGBO2']['HD-dispheader'][$page_name]) and ($conf['LLGBO2']['HD-dispheader'][$page_name] == false) ) {$no_header = true;} 26 } 27 if ($no_header == true) 28 {$template->append('head_elements','<!-- llgbo -->'."\n".'<STYLE type="text/css">'."\n".'#theHeader{display: none}'."\n".'header_msgs {position:static}'."\n".'</STYLE>');} 10 $input= $_SERVER['PHP_SELF']; 11 if ($conf['question_mark_in_urls'] == true) 12 { foreach($_GET as $cle =>$valeur) 13 {$input= $input.$cle ;} 14 } 15 16 if ( strpos( $input,'index') == true ) 17 { foreach($conf['LLGBO2']['HD-dispheader'] as $cle => $valeur) 18 { if ($valeur == false) { 19 if($cle == 'home' ) {$cle = 'index.php';} 20 if (strpos( $input, $cle) == true ) 21 {$no_header = true;} 22 } 23 } 24 } 25 else 26 { if (isset($conf['LLGBO2']['HD-dispheader'][$page_name]) and ($conf['LLGBO2']['HD-dispheader'][$page_name] == false) ) {$no_header = true;} 27 } 28 if ($no_header == true) 29 {$template->append('head_elements','<!-- llgbo no header-->'."\n".'<STYLE type="text/css">'."\n".'#theHeader{display: none}'."\n".'header_msgs {position:static}'."\n".'</STYLE>');} 29 30 } 30 31 ?> -
extensions/LLGBO2/include/manage_picture_content.php
r29019 r29049 2 2 function llgbo_RenderContent($content,$element_info) 3 3 /******************************************************************/ 4 { 5 //---------------------------------------------------- 6 /* LLGBO Manage Picture_content */ 7 //---------------------------------------------------- 4 { //---------------------------------------------------- 5 /* LLGBO Manage Picture_content */ 6 //---------------------------------------------------- 8 7 global $template,$conf; 9 10 8 $template->assign('LLGBO_PATH',LLGBO_PATH); 11 9 include_once(LLGBO_PATH.'/css/sweettitles.css.php'); 12 13 10 //----------------------------------------------------------------- 14 11 // ----------- add CSS tooltip in footer -------------------- 15 12 //----------------------------------------------------------------- 16 If (($conf['LLGBO2']['tooltipdisp'] ) or ($conf['LLGBO2']['exifunderbt']))13 if (($conf['LLGBO2']['tooltipdisp'] ) or ($conf['LLGBO2']['exifunderbt'])) 17 14 { $template->append('footer_elements',$sweetcss); 18 15 $template->append('llgbo', array( 'TOOLTIP' => 'ok' ), true);} … … 20 17 // Frame is only available on picture extension 21 18 //----------------------------------------------------------------- 22 unset ($conf['LLGBO2'][' rendercontent']);19 unset ($conf['LLGBO2']['is-picture']); 23 20 $ext = get_extension($element_info['path']); 24 21 if (!in_array($ext, $conf['picture_ext'])) 25 22 {return $content;} 26 $conf['LLGBO2']['rendercontent'] = true; // $content ok for update 27 23 24 $conf['LLGBO2']['is-picture'] = true; // $content ok for update 25 $update_tpl = false ; 28 26 //----------------------------------------------------------------- 29 27 // AN OTHER PLUGIN IS WORKING -> GO BACK 30 28 //----------------------------------------------------------------- 31 29 if ( !empty($content) ) 32 { // 2.6 paticular case automatic size management 33 $autosize_on = $template->get_template_vars('is_automatic_size'); 34 if (empty($autosize_on) ) 35 {return $content;} 36 30 { // 2.6 paticular case automatic size management and Modus 31 $autosize_on = $template->get_template_vars('is_automatic_size'); 32 $current = $template->get_template_vars('current'); // modus 33 if ((empty ($current['selected_derivative'])) and (empty($autosize_on) )) 34 {return $content;} 35 } 36 //----------------------------------------------------------------- 37 if (($conf['LLGBO2']['frame']) ) //Frame 38 { $deriv_type = pwg_get_session_var('picture_deriv', $conf['derivative_default_size']); 39 $PictSizeWH = $element_info['derivatives'][$deriv_type]->get_size(); // default conf 40 37 41 $autosize_type = $template->get_template_vars('automatic_size'); 38 unset ($conf['LLGBO2']['PictSizeWH'] ); 39 if (isset($autosize_type)) 40 {$conf['LLGBO2']['PictSizeWH'] = $element_info['derivatives'][$autosize_type]->get_size(); 41 } 42 } 43 42 43 if (isset($autosize_type)) // auto size 44 { $PictSizeWH = $element_info['derivatives'][$autosize_type]->get_size(); 45 $update_tpl = true ;} 46 47 if (isset($current['selected_derivative'])) // modus 48 { $PictSizeWH = $current['selected_derivative']->get_size(); 49 $update_tpl = true ;} 50 51 // -- Css Theme adaptation 52 $themeconf = $template->get_template_vars('themeconf'); 53 if (file_exists(LLGBO_PATH."css/llgbo_content_".$themeconf['id'].".css")) // no css file dedicated for this theme 54 { $themestyle = $themeconf['id'];} 55 else 56 {$themestyle = 'default';} 57 // -- Frame build 58 $frame_begin = ''; 59 $frame_border =0; 60 $frame_end = '</div>'."\n".' <!-- end LLGBO frame -->'."\n"; 61 foreach ($conf['LLGBO2']['FR-sizes'] as $cle => $value) 62 { if ( $value > 0) // boder value > 0 63 { $frame_border = $frame_border + ( 2 * $value); 64 $frame_begin = '<div class="llgboFR" style="border:'.$value.'px solid '.$conf['LLGBO2']['FR-colors'][$cle].'">'."\n".$frame_begin; 65 $frame_end = '</div>'.$frame_end; 66 } 67 } 68 $frame_begin ="\n".'<!-- Begin LLGBO frame -->'."\n".$frame_begin; 69 $PictSizeWH[0] = $PictSizeWH[0] + $frame_border; 70 $PictSizeWH[1] = $PictSizeWH[1] + $frame_border; 71 $frame_size = "\n".'<div id="llgbo0" class="llgbo" style="border:0 ;width:'.$PictSizeWH[0].'px; height:'.$PictSizeWH[1].'px;">'; 72 73 if ($conf['LLGBO2']['titleframe']) { 74 $frame_title = "\n".'<!-- Begin LLGBO -->'."\n".'<span id="llgboh2" style ="background:transparent;z-index:3;color:'.$conf['LLGBO2']['FR-titlecolor'].'">'.$element_info['name'].'</span>'; 75 } 76 77 $template->append('llgbo', array( 78 'FRAME_TITLE' => $frame_title, 79 'FRAME_SIZE' => $frame_size , 80 'FRAME_BEGIN' => $frame_begin, 81 'FRAME_END' => $frame_end, 82 'GBOCSS' => LLGBO_PATH."css/llgbo_content_".$themestyle.".css" ), true); 83 84 $template->set_prefilter('default_content', 'LLGBO_prefilter_Content_Frame'); 85 } // end frame 44 86 //---------------------------------------------------- 45 87 //------- Tooltip ------------- 46 88 //---------------------------------------------------- 47 48 If ($conf['LLGBO2']['tooltipdisp'] )// tooltip 89 if ($conf['LLGBO2']['tooltipdisp'] )// tooltip 49 90 { $prev = $template->get_template_vars('previous'); 50 91 $next = $template->get_template_vars('next'); … … 53 94 if (isset($next)){$template->append('next', array('TITLE_ESC' => $next['TITLE_ESC'].$swtimg.$next['THUMB_SRC'].'>'),TRUE);} 54 95 $template->append('llgbo', array('tooltipCSS' => $sweetcss), true); 55 } 56 57 If (($conf['LLGBO2']['frame']) ) //Frame 58 { $template->set_prefilter('default_content', 'LLGBO_prefilter_Content_Frame'); 59 //---------------------------------------------------- 60 /* HTML End frame on Picture_content */ 61 //---------------------------------------------------- 62 $csstheme = 'default'; 63 $themeconf = $template->get_template_vars('themeconf'); 64 // dedicated Css by parent theme 65 if (isset ($themeconf['parent'])) 66 { $themestyle = $themeconf['parent'];} 67 If (file_exists(LLGBO_PATH."css/llgbo_content_".$themeconf['id'].".css")) // no css file dedicated for this theme 68 { $themestyle = $themeconf['id'];} 69 else 70 {$themestyle = 'default';} 71 $frame_end = ''; 72 73 foreach ($conf['LLGBO2']['FR-sizes'] as $value) 74 {if ( $value > 0) // boder value > 0 75 { $frame_end = $frame_end.'</div>';} 76 } 77 78 $template->append('llgbo', array( 79 'FRAME_END' => $frame_end, 80 'GBOCSS' => LLGBO_PATH."css/llgbo_content_".$themestyle.".css" ), true); 81 82 } // end frame 83 // 2.6 paticular case automatic size management 84 if ((isset($autosize_on)) and (isset ($autosize_type)) ) 85 { return $template->parse( 'default_content', true);} 96 } 97 // 2.6 paticular case automatic size and modus management 98 if ($update_tpl) 99 {return $template->parse( 'default_content', true);} 86 100 87 101 } //end --> llgbo_RenderContent 88 102 103 /******************************************************************/ 104 function LLGBO_prefilter_Content_Frame($content, $smarty) 105 /******************************************************************/ 106 { // add frame on picture_content TPL 107 // -------------------------------------- 108 $patern = '/'.'<img(.*)id="theMainImage"(.*)>'.'/'; 109 $replacement = $replacement.'{$llgbo.FRAME_TITLE}'.'{$llgbo.FRAME_SIZE}'.'{$llgbo.FRAME_BEGIN}'."\n".'<img $1 id="theMainImage" $2> '.'{$llgbo.FRAME_END}'; 110 $content = preg_replace($patern, $replacement, $content); 111 return $content; 112 } 89 113 ?>
Note: See TracChangeset
for help on using the changeset viewer.