Changeset 29005 for extensions/LLGBO2


Ignore:
Timestamp:
Jul 8, 2014, 1:55:14 PM (10 years ago)
Author:
gbo
Message:

Only 1 setting in database

Location:
extensions/LLGBO2
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • extensions/LLGBO2/admin.php

    r29004 r29005  
    3232// Setup plugin Language
    3333load_language('plugin.lang', LLGBO_PATH);
    34 include_once(LLGBO_PATH.'defaultvalues.php');
    35  
     34include(LLGBO_PATH.'defaultvalues.php');
     35
    3636/* ****************************************************** */
    3737/* Plugin template initialisation for admin panel display */
    3838/* ****************************************************** */
    39 global $template,$prefixeTable,$CF_LLGBO,$lang;
     39global $template,$prefixeTable,$conf,$lang;
    4040$template->assign( 'LLGBO_VERSION' ,LLGBO_VERSION);
    4141$template->assign('LLGBO_PATH',LLGBO_PATH);
     
    5252$page['tab']  =  (isset($_GET['tab'])) ?   $_GET['tab'] : 'settings';
    5353 if ((empty($_POST['submit'])) or  ($page['tab']  != 'settings'))
    54                 {       $disptabframe  =  $CF_LLGBO['frame'];
    55                         $disptabheader =  $CF_LLGBO['manageheader'];
    56                         $disptabtoolt1 =  $CF_LLGBO['tooltipdisp'];
    57                         $disptabtoolt2 =  $CF_LLGBO['exifunderbt'];
     54                {       $disptabframe  =  $conf['LLGBO2']['frame'];
     55                        $disptabheader =  $conf['LLGBO2']['manageheader'];
     56                        $disptabtoolt1 =  $conf['LLGBO2']['tooltipdisp'];
     57                        $disptabtoolt2 =  $conf['LLGBO2']['exifunderbt'];
    5858                }
    5959                        else
  • extensions/LLGBO2/defaultvalues.php

    r28990 r29005  
    33// -------- LLGBO valeurs par défaut        ----
    44// ---------------------------------------------
    5 $default_Main = array(
     5$default_main = array(
    66        'version' => 1,
    77    'frame' => False,
  • extensions/LLGBO2/include/manage_header.php

    r28990 r29005  
    44//----------------------------------------------------
    55if (!isset($page_name)) {$page_name ='index';}
    6 if ($CF_LLGBO['manageheader'])
     6if ($conf['LLGBO2']['manageheader'])
    77        {$no_header = false;
    88        $input= $_SERVER['PHP_SELF'];
     
    1313         
    1414        if  ( strpos( $input,'index') == true )
    15         {       foreach($CF_LLGBO['HD-dispheader'] as $cle  => $valeur)
     15        {       foreach($conf['LLGBO2']['HD-dispheader'] as $cle  => $valeur)
    1616                        { if ($valeur  == false) {
    1717                                        if($cle == 'home' ) {$cle = 'index.php';}
     
    2323         else
    2424        {       
    25                  if (isset($CF_LLGBO['HD-dispheader'][$page_name]) and ($CF_LLGBO['HD-dispheader'][$page_name] == false) ) {$no_header = true;}
     25                 if (isset($conf['LLGBO2']['HD-dispheader'][$page_name]) and ($conf['LLGBO2']['HD-dispheader'][$page_name] == false) ) {$no_header = true;}
    2626        } 
    2727         if ($no_header == true)
  • extensions/LLGBO2/include/manage_picture_content.php

    r28990 r29005  
    66/*      LLGBO Manage Picture_content                       */
    77//----------------------------------------------------
    8         global $template,$conf,$CF_LLGBO;       
     8        global $template,$conf;
    99         
    1010        $template->assign('LLGBO_PATH',LLGBO_PATH);
    1111        include_once(LLGBO_PATH.'/css/sweettitles.css.php');   
    12         $CF_LLGBO['rendercontent']  = false;
     12        $conf['LLGBO2']['rendercontent']  = false;
    1313        //-----------------------------------------------------------------
    1414        // -----------  add CSS tooltip in footer --------------------
    1515        //-----------------------------------------------------------------
    16          If (($CF_LLGBO['tooltipdisp']  )  or  ($CF_LLGBO['exifunderbt']))   
     16         If (($conf['LLGBO2']['tooltipdisp']  )  or  ($conf['LLGBO2']['exifunderbt']))   
    1717                {       $template->append('footer_elements',$sweetcss);
    1818                        $template->append('llgbo', array( 'TOOLTIP' => 'ok' ), true);}
     
    2323         if (!in_array($ext, $conf['picture_ext']))
    2424                                {return $content;}
    25                 $CF_LLGBO['rendercontent'] = true;      // $content ok for update
     25                $conf['LLGBO2']['rendercontent'] = true;        // $content ok for update
    2626               
    2727        //-----------------------------------------------------------------
     
    3232                 $autosize_in_place = $template->get_template_vars('is_automatic_size');
    3333                 $autosize_selected = $template->get_template_vars('automatic_size');
    34                  unset ($CF_LLGBO['PictSizeWH'] );
     34                 unset ($conf['LLGBO2']['PictSizeWH'] );
    3535                        if ((isset($autosize_in_place))  and  (isset($autosize_selected)) )
    36                                 {$CF_LLGBO['PictSizeWH'] =  $element_info['derivatives'][$autosize_selected]->get_size();
     36                                {$conf['LLGBO2']['PictSizeWH'] =  $element_info['derivatives'][$autosize_selected]->get_size();
    3737                                          }
    3838                else
     
    4444//----------------------------------------------------
    4545         
    46         If ($CF_LLGBO['tooltipdisp'] )//   tooltip 
     46        If ($conf['LLGBO2']['tooltipdisp'] )//   tooltip 
    4747        {       $prev = $template->get_template_vars('previous');
    4848                $next  = $template->get_template_vars('next');
     
    5353        }       
    5454       
    55         If (($CF_LLGBO['frame'])   ) //Frame
     55        If (($conf['LLGBO2']['frame'])   ) //Frame
    5656        {       $template->set_prefilter('default_content', 'LLGBO_prefilter_Content_Frame');
    5757        //----------------------------------------------------   
     
    6868                           {$themestyle = 'default';}
    6969                           $frame_end = '';
    70                          foreach ($CF_LLGBO['FR-sizes'] as  $value)
     70                         foreach ($conf['LLGBO2']['FR-sizes'] as  $value)
    7171                                {if ( $value > 0)       // boder value > 0     
    7272                                        {       $frame_end = $frame_end.'</div>';}
  • extensions/LLGBO2/main.inc.php

    r29004 r29005  
    22/*
    33Plugin Name: Look_like_gbo2
    4 Version: 2.7.A
     4Version:  2.7.A
    55Plugin URI: http://phpwebgallery.net/ext/extension_view.php?eid=251
    66Author: GBo
     
    5050function llgbo_init()
    5151{
    52         global $conf,$CF_LLGBO;
    53         load_language('plugin.lang', LLGBO_PATH);
    54 
    55         $CF_LLGBO2settings =  unserialize($conf['LLGBO2settings']);
    56         $CF_LLGBO2tooltip = unserialize($conf['LLGBO2tooltip']);
    57         $CF_LLGBO2frame = unserialize($conf['LLGBO2frame']);
    58         $CF_LLGBO2header = unserialize($conf['LLGBO2header']);
    59         $CF_LLGBO =array_merge((array)$CF_LLGBO2settings, (array)$CF_LLGBO2tooltip,(array) $CF_LLGBO2frame,(array) $CF_LLGBO2header);
    60 }
     52        global $conf;
     53        Load_language('plugin.lang', LLGBO_PATH);
     54                       
     55        $conf['LLGBO2'] =  safe_unserialize($conf['LLGBO2_Settings']);
     56}
    6157
    6258
     
    6662function llgbo_BeginPicture()
    6763/******************************************************************/
    68 {global $CF_LLGBO,$template;
    69         If ($CF_LLGBO['exifunderbt'])  // exif under bt
     64{global $conf,$template;
     65        If ($conf['LLGBO2']['exifunderbt'])  // exif under bt
    7066                {$_GET['metadata'] = 'O';}
    7167               
    72         If ($CF_LLGBO['alwaysdisplayexif'])  //always display metadata
     68        If ($conf['LLGBO2']['alwaysdisplayexif'])  //always display metadata
    7369                {if ( pwg_get_session_var('show_metadata') == null )
    7470                        {  pwg_set_session_var('show_metadata', 1 );     }
     
    8177function llgbo_beginheader()
    8278/******************************************************************/
    83 { global $page,$CF_LLGBO;
    84         If ($CF_LLGBO['exifunderbt'] ) // reset nofollow, noindex
     79{ global $page,$conf;
     80        If ($conf['LLGBO2']['exifunderbt'] ) // reset nofollow, noindex
    8581        { unset ($page['meta_robots']);}
    8682}
     
    9086function llgbo_endHeader()
    9187/******************************************************************/
    92 {global $template,$conf,$CF_LLGBO;
     88{global $template,$conf;
    9389        $page_name = script_basename();
    9490        include_once(LLGBO_PATH.'include/manage_header.php');
     
    10197function  llgbo_EndPicture()
    10298/******************************************************************/
    103 { global $template,$CF_LLGBO,$conf,$page,$lang;
     99{ global $template,$conf,$page,$lang;
    104100        //----------------------------------------------------   
    105101        /*       HTML End  frame   on Picture.tpl       */
    106102        //---------------------------------------------------- 
    107103                       
    108         If (($CF_LLGBO['frame'])    //Frame
    109                  and ($CF_LLGBO['rendercontent'])       )// $content ok for update
     104        If (($conf['LLGBO2']['frame'])    //Frame
     105                 and ($conf['LLGBO2']['rendercontent']) )// $content ok for update
    110106                {       $target = 'picture';
    111107                        if ($page['slideshow'] and $conf['light_slideshow'])
     
    114110                 //$PictSizeWH is not already defined by auto_size     
    115111                  $current= $template->get_template_vars('current');
    116                   if (empty($CF_LLGBO['PictSizeWH']))
    117                                 {$CF_LLGBO['PictSizeWH'] =  $current['selected_derivative']->get_size();}
    118                         $PictSizeWH = $CF_LLGBO['PictSizeWH'];         
     112                  if (empty($conf['LLGBO2']['PictSizeWH']))
     113                                {$conf['LLGBO2']['PictSizeWH'] =  $current['selected_derivative']->get_size();}
     114                        $PictSizeWH = $conf['LLGBO2']['PictSizeWH'];           
    119115                        $frame_width  = $PictSizeWH[0];
    120116                        $frame_height = $PictSizeWH[1];
    121117                        $frame_begin ='';
    122                          foreach ($CF_LLGBO['FR-sizes'] as $cle  => $value)
     118                         foreach ($conf['LLGBO2']['FR-sizes'] as $cle  => $value)
    123119                                { if ( $value > 0)      // boder value > 0     
    124120                                         {      $frame_width = $frame_width + ( 2 * $value);                             
    125121                                                $frame_height = $frame_height + ( 2* $value);
    126                                                 $frame_begin = '<div class="llgboFR" style="border:'.$value.'px solid '.$CF_LLGBO['FR-colors'][$cle].'">'."\n".$frame_begin;
     122                                                $frame_begin = '<div class="llgboFR" style="border:'.$value.'px solid '.$conf['LLGBO2']['FR-colors'][$cle].'">'."\n".$frame_begin;
    127123                                                }
    128124                                }
     
    133129                                 'FRAME_BEGIN' => $frame_begin), true);
    134130                                 
    135                 If ($CF_LLGBO['titleframe'] ) 
     131                If ($conf['LLGBO2']['titleframe'] ) 
    136132                         {  $template->append('llgbo', array(
    137                                          'TITLE_FRAME_COLOR' => $CF_LLGBO['FR-titlecolor'],
     133                                         'TITLE_FRAME_COLOR' => $conf['LLGBO2']['FR-titlecolor'],
    138134                                         'TITLE_FRAME' => $current['name'] ), true);
    139135                                $template->assign('SHOW_PICTURE_NAME_ON_TITLE' , false);
     
    151147                        $u_metadata = $template->get_template_vars('U_METADATA');
    152148                        $swt = "";
    153                          If ($CF_LLGBO['exifunderbt'])  // exif under bt
     149                         If ($conf['LLGBO2']['exifunderbt'])  // exif under bt
    154150                                {  $metadata = $template->get_template_vars('metadata');
    155151                                if (is_array($metadata))
     
    251247        add_event_handler('loc_begin_page_header', 'llgbo_beginheader');
    252248        add_event_handler('loc_end_page_header', 'llgbo_endHeader');
    253         ad_event_handler( 'loc_begin_picture','llgbo_BeginPicture');
    254         add_event_handler( 'loc_end_picture', 'llgbo_EndPicture');
     249        Add_event_handler( 'loc_begin_picture','llgbo_BeginPicture');
     250        Add_event_handler( 'loc_end_picture', 'llgbo_EndPicture');
    255251        add_event_handler('render_element_content', 'llgbo_RenderContent',  EVENT_HANDLER_PRIORITY_NEUTRAL-1, 20  );
    256252}
  • extensions/LLGBO2/maintain.class.php

    r29004 r29005  
    2929class Look_like_gbo2_maintain extends PluginMaintain
    3030{
    31         private $default_Main;
     31        private $default_main;
    3232        private $default_tooltip;
    3333        private $default_frame;
     
    4040include(PHPWG_PLUGINS_PATH . basename(dirname(__FILE__)) . '/' .'defaultvalues.php');
    4141     // variable declared in include       
    42          $this->default_Main = $default_Main;
     42         $this->default_main = $default_main;
    4343         $this->default_tooltip = $default_tooltip;
    4444         $this->default_frame = $default_frame;
     
    5555                global $conf;
    5656// +-----------------------------------------------------------------------+   
    57                 if (empty($conf['LLGBO2settings']))
     57                if (empty($conf['LLGBO2_Settings']))
    5858                        {       if  (isset($conf['LLGBO'])) // compatibility 2.6 --> 2.7
    5959                                        { $Oldvalues = explode("," , $conf['LLGBO']);                   
     
    6262                                                                {$Oldvalues[$cle]  = (boolean)true ;}   else { $Oldvalues[$cle]  = (boolean)false;}
    6363                                                }
    64                                                 $this->default_Main['version']                          =  1;
    65                                                 $this->default_Main['frame']                            =  $Oldvalues[0];
    66                                                 $this->default_Main['tooltipdisp']                      =  $Oldvalues[1];
    67                                                 $this->default_Main['exifunderbt']                      =  $Oldvalues[2];
    68                                                 $this->default_Main['titleframe']                       =  $Oldvalues[5];
    69                                                 $this->default_Main['manageheader']             =  $Oldvalues[6];
    70                                                 $this->default_Main['alwaysdisplayexif']        =  $Oldvalues[10];
     64                                                $this->default_main['version']                          =  1;
     65                                                $this->default_main['frame']                            =  $Oldvalues[0];
     66                                                $this->default_main['tooltipdisp']                      =  $Oldvalues[1];
     67                                                $this->default_main['exifunderbt']                      =  $Oldvalues[2];
     68                                                $this->default_main['titleframe']                       =  $Oldvalues[5];
     69                                                $this->default_main['manageheader']             =  $Oldvalues[6];
     70                                                $this->default_main['alwaysdisplayexif']        =  $Oldvalues[10];
    7171                                                conf_delete_param('LLGBO');  // old values before 2.7
    7272                                        }
    73                                 conf_update_param('LLGBO2settings',serialize($this->default_Main), true);
    74                         }       
     73                       
     74               
    7575// +-----------------------------------------------------------------------+                           
    76                 if (empty($conf['LLGBO2tooltip']))
    77                         {       if  (isset($conf['LLGBOTOOLTIP'])) // compatibility 2.6 --> 2.7
     76                        if  (isset($conf['LLGBOTOOLTIP'])) // compatibility 2.6 --> 2.7
    7877                                        {        $Oldvalues = explode("," , $conf['LLGBOTOOLTIP']);
    7978
     
    8584                                                $this->default_tooltip['TT-textcolor']          = $Oldvalues[5];
    8685                                                       
    87                                                         conf_delete_param('LLGBOTOOLTIP');  // old values before 2.7
     86                                                conf_delete_param('LLGBOTOOLTIP');  // old values before 2.7
    8887                                        }
    89                                 conf_update_param('LLGBO2tooltip',serialize($this->default_tooltip), true);
    90                         }
     88                       
    9189// +-----------------------------------------------------------------------+                           
    92                 if (empty($conf['LLGBO2frame']))       
    93                         { if (isset($conf['LLGBOFRAME']))  // compatibility 2.6 --> 2.7
     90       
     91                        if (isset($conf['LLGBOFRAME']))  // compatibility 2.6 --> 2.7
    9492                                {        $Oldvalues = explode("," , $conf['LLGBOFRAME']);
    9593                                     $i=0;
     
    106104                                        conf_delete_param('LLGBOFRAME');  // old values before 2.7
    107105                                }
    108                                 conf_update_param('LLGBO2frame', serialize($this->default_frame), true);
    109                         }
     106               
    110107// +-----------------------------------------------------------------------+                                   
    111                 if (empty($conf['LLGBO2header']))       
    112                         { if (isset($conf['LLGBOHEADER']))  // compatibility 2.6 --> 2.7
     108       
     109                        if (isset($conf['LLGBOHEADER']))  // compatibility 2.6 --> 2.7
    113110                                {       $Oldvalues = explode("," , $conf['LLGBOHEADER']);
    114111                                        $i = 0;
     
    119116                                        conf_delete_param('LLGBOHEADER');  // old values before 2.7
    120117                                }
    121                                 conf_update_param('LLGBO2header',serialize($this->default_header), true);       
    122                         }
    123 
     118               
     119         $conf['LLGBO2'] =array_merge((array)$this->default_main, (array)$this->default_tooltip,(array) $this->default_frame,(array) $this->default_header);
     120                 print_r($this->default_main);
     121                 conf_update_param('LLGBO2_Settings', $conf['LLGBO2']);
     122                }
    124123        }
    125124
     
    134133// +-----------------------------------------------------------------------+
    135134        function uninstall() { 
    136                 conf_delete_param('LLGBO2settings');
    137                 conf_delete_param('LLGBO2tooltip');
    138                 conf_delete_param('LLGBO2frame');
    139                 conf_delete_param('LLGBO2header');
     135                conf_delete_param('LLGBO2_Settings');
     136       
    140137        }
    141138}
Note: See TracChangeset for help on using the changeset viewer.