Changeset 4524


Ignore:
Timestamp:
Dec 19, 2009, 9:04:48 PM (14 years ago)
Author:
EXFTB
Message:

version 2.0.i

Location:
extensions/LLGBO2/admin
Files:
3 added
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/LLGBO2/admin/llgbo_admin.php

    r4293 r4524  
    2828// ***************************************
    2929if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
     30include_once(PHPWG_ROOT_PATH.'admin/include/tabsheet.class.php');
     31$my_base_url = get_admin_plugin_menu_link(__FILE__);
     32// Setup plugin Language
     33load_language('plugin.lang', LLGBO_PATH);
     34// +-----------------------------------------------------------------------+
     35// |                            Tabssheet
     36// +-----------------------------------------------------------------------+
     37if (!isset($_GET['tab']))
     38   { $page['tab'] = 'manage';}
     39   else
     40 {$page['tab'] = $_GET['tab'];}
     41
     42$tabsheet = new tabsheet();
     43$tabsheet->add('manage',
     44               l10n('llgbo_M_manage'),
     45              $my_base_url.'&tab=manage');
     46$tabsheet->add('tooltip',
     47               l10n('llgbo_M_tooltip'),
     48               $my_base_url.'&tab=tooltip');
     49If ($page['tab'] == 'manage')                     
     50        {if (!isset($_POST['llgbo_frame'])   )
     51                {$conf['LLGBO_SETTINGS'][0] = 'false';}         
     52                else
     53                {$conf['LLGBO_SETTINGS'][0]= $_POST['llgbo_frame'];}}
     54                   
     55if ($conf['LLGBO_SETTINGS'][0] == 'true')
     56{$tabsheet->add('frame',
     57               l10n('llgbo_M_frame'),
     58               $my_base_url.'&tab=frame');}
     59
     60
     61
     62$tabsheet->assign();
     63if ($page['tab'] == 'manage')
     64{$template->set_filenames( array('llgbo_admin_content' => dirname(__FILE__).'/llgbo_adminsettings.tpl') );}
     65if ($page['tab'] == 'tooltip')
     66{$template->set_filenames( array('llgbo_admin_content' => dirname(__FILE__).'/llgbo_admintooltip.tpl') );}
     67if ($page['tab'] == 'frame' )
     68{$template->set_filenames( array('llgbo_admin_content' => dirname(__FILE__).'/llgbo_adminframe.tpl') );}
     69$tabsheet->select($page['tab']);
    3070/* ****************************************************** */
    3171/* Plugin template initialisation for admin panel display */
     
    3676$template->clear_assign('LLGBOINFO');
    3777// Load configuration settings from database
    38 $conf_LLGBO = explode("," , $conf['LLGBO']);
    39 
    40 // Setup plugin Language
    41 load_language('plugin.lang', LLGBO_PATH);
     78
     79
     80$template->append('head_elements',
     81                   '<script type="text/javascript" src="./plugins/look_like_gbo2/farbtastic/farbtastic.js"></script>
     82<link rel="stylesheet" type="text/css"
     83      href="./plugins/look_like_gbo2/farbtastic/farbtastic.css" />
     84<link rel="stylesheet" type="text/css"
     85      href="./plugins/look_like_gbo2/css/look_like_gbo2_admin.css" />
     86<! --- LLGBO tooltip css-->
     87<style type="text/css">
     88#toolTip {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}
     89#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}
     90#toolTip title {color:'.$conf['LLGBO_TOOLTIP'][4].';text-align:center;padding:0 0 3px 0;font-weight:bold}
     91</style>');
     92
    4293 
    4394// Update configuration settings in database
    44 if ( isset($_POST['submit']) )
    45 
    46 if (!isset($_POST['llgbo_frame'])) {$_POST['llgbo_frame'] = 'false';}
    47 if (!isset($_POST['llgbo_tooltip'])) {$_POST['llgbo_tooltip'] = 'false';} 
    48 if (!isset($_POST['llgbo_exifunderbt'])) {$_POST['llgbo_exifunderbt'] = 'false';} 
    49 if (!isset($_POST['llgbo_usemap'])) {$_POST['llgbo_usemap'] = 'false';}
    50 if (!isset($_POST['llgbo_usemap_thumb'])) {$_POST['llgbo_usemap_thumb'] = 'false';}
    51 if (!isset($_POST['llgbo_title_frame'])) {$_POST['llgbo_title_frame'] = 'false';}   
    52 if (!isset($_POST['llgbo_header'])) {$_POST['llgbo_header'] = 'false';}
    53 if (!isset($_POST['llgbo_maintain_header'])) {$_POST['llgbo_maintain_header'] = '';}
    54 if (!isset($_POST['llgbo_allinfo'])) {$_POST['llgbo_allinfo'] = 'false';}
    55 if (!isset($_POST['llgbo_default_navthumb'])) {$_POST['llgbo_default_navthumb'] = 'false';}
    56 if (!isset($_POST['llgbo_always_displayexif'])) {$_POST['llgbo_always_displayexif'] = 'true';} 
    57  $param_llgbo = array($_POST['llgbo_frame'],
    58             $_POST['llgbo_tooltip'],
    59             $_POST['llgbo_exifunderbt'],
    60             $_POST['llgbo_usemap'],
    61                         $_POST['llgbo_usemap_thumb'],
    62             $_POST['llgbo_title_frame'],
    63                         $_POST['llgbo_header'],
    64                         $_POST['llgbo_maintain_header'],
    65                         $_POST['llgbo_allinfo'],
    66                         $_POST['llgbo_default_navthumb'],
    67                         $_POST['llgbo_always_displayexif'],
    68                 );               
    69         $llgbo_new_value = implode ("," , $param_llgbo);
    70         $query = '
    71 UPDATE ' . CONFIG_TABLE . '
    72   SET value="' . $llgbo_new_value . '"
    73   WHERE param="LLGBO"
    74   LIMIT 1';
    75         pwg_query($query);
    76 
    77  $template->assign('LLGBOINFO','llgbo_info');
    78 
    79 // Reload settings for correct display after update
    80 $conf['LLGBO']= $llgbo_new_value;
    81 }
    82 
    83 $conf_LLGBO = explode("," , $conf['LLGBO']);
    84 // template setting
    85 if ($conf_LLGBO[0] == 'true')
    86 {$template->assign( 'LLGBO_FRAME' , 'true');}
    87  else
    88 {$template->assign( 'LLGBO_FRAME' , 'false');}
    89 if ($conf_LLGBO[1] == 'true')
    90 {$template->assign( 'LLGBO_TOOLTIP' , 'true');}
    91  else
    92  {$template->assign( 'LLGBO_TOOLTIP' , "false");}
    93  
    94 if ($conf_LLGBO[2]  == 'true')
    95 {$template->assign('LLGBO_EXIFUNDERBT' , 'true');}
    96  else
    97  {$template->assign( 'LLGBO_EXIFUNDERBT' , "false");}
    98  
    99 if ($conf_LLGBO[3]  == 'true')
    100  {$template->assign( array( 'LLGBO_USEMAP' => 'true'));}
    101  else
    102  { $template->assign( array( 'LLGBO_USEMAP' => "false"));}
    103  
    104  if ($conf_LLGBO[4]  == 'true')
    105  {$template->assign( array( 'LLGBO_USEMAP_THUMB' => 'true'));}
    106  else
    107  { $template->assign( array( 'LLGBO_USEMAP_THUMB' => "false"));}
    108  
    109  if ($conf_LLGBO[5]  == 'true')
    110 { $template->assign( array( 'LLGBO_TITLE_FRAME' => 'true'));}
    111  else
    112 {  $template->assign( array( 'LLGBO_TITLE_FRAME' => "false"));}
    113 
    114 if ($conf_LLGBO[6] == 'true')
    115 { $template->assign( array( 'LLGBO_HEADER' => 'true'));}
    116  else
    117  { $template->assign( array( 'LLGBO_HEADER' => "false"));}
    118  
    119  $template->assign(array( 'LLGBO_MAINTAIN_HEADER' => $conf_LLGBO[7]));
    120  
    121  if ($conf_LLGBO[8]  == 'true')
    122 { $template->assign(array( 'LLGBO_ALLINFO' => 'true'));}
    123  else
    124 {  $template->assign( array( 'LLGBO_ALLINFO' => "false"));}
    125 
    126 if ($conf_LLGBO[9] == 'true')
    127 { $template->assign(array( 'LLGBO_DEFAULT_NAVTHUMB' => 'true'));}
    128  else
    129  { $template->assign(array( 'LLGBO_DEFAULT_NAVTHUMB' => "false"));}
    130  
    131 if ($conf_LLGBO[10] == 'true')
    132 { $template->assign(array( 'LLGBO_ALWAYS_DISPLAYEXIF' => 'true'));}
    133  else
    134  { $template->assign(array( 'LLGBO_ALWAYS_DISPLAYEXIF' => "false"));}
    135  
    136 $template->set_filenames( array('llgbo_admin_content' => dirname(__FILE__).'/llgbo_admin.tpl') );
     95        ////// SETTINGS
     96if (($page['tab'] == 'manage') or   ( !isset($_GET['tab']))){
     97        if ( isset($_POST['submit']) ) 
     98        { 
     99        if (!isset($_POST['llgbo_frame'])) {$_POST['llgbo_frame'] = 'false';}
     100        if (!isset($_POST['llgbo_tooltip'])) {$_POST['llgbo_tooltip'] = 'false';} 
     101        if (!isset($_POST['llgbo_exifunderbt'])) {$_POST['llgbo_exifunderbt'] = 'false';} 
     102        if (!isset($_POST['llgbo_usemap'])) {$_POST['llgbo_usemap'] = 'false';}
     103        if (!isset($_POST['llgbo_usemap_thumb'])) {$_POST['llgbo_usemap_thumb'] = 'false';}
     104        if (!isset($_POST['llgbo_title_frame'])) {$_POST['llgbo_title_frame'] = 'false';}   
     105        if (!isset($_POST['llgbo_header'])) {$_POST['llgbo_header'] = 'false';}
     106        if (!isset($_POST['llgbo_maintain_header'])) {$_POST['llgbo_maintain_header'] = '';}
     107        if (!isset($_POST['llgbo_allinfo'])) {$_POST['llgbo_allinfo'] = 'false';}
     108        if (!isset($_POST['llgbo_default_navthumb'])) {$_POST['llgbo_default_navthumb'] = 'false';} //9 }
     109         $param_llgbo = array($_POST['llgbo_frame'],
     110                                $_POST['llgbo_tooltip'],             $_POST['llgbo_exifunderbt'],
     111                                $_POST['llgbo_usemap'],                 $_POST['llgbo_usemap_thumb'],
     112                                $_POST['llgbo_title_frame'],                    $_POST['llgbo_header'],
     113                                $_POST['llgbo_maintain_header'],                        $_POST['llgbo_allinfo'],
     114                                $_POST['llgbo_default_navthumb']       
     115                        );               
     116        $llgbo_new_value = implode ("," , $param_llgbo);
     117        $query = '
     118        UPDATE ' . CONFIG_TABLE . '
     119          SET value="'.$llgbo_new_value. '"
     120          WHERE param="LLGBO"
     121          LIMIT 1';
     122                        pwg_query($query);
     123                         $template->assign('LLGBOINFO','llgbo_info');
     124                         $conf['LLGBO_SETTINGS'] = explode ("," ,$llgbo_new_value);
     125        }
     126
     127 // Reload settings for correct display after update
     128        if ($conf['LLGBO_SETTINGS'][0] == 'true')
     129          {$template->assign( 'LLGBO_FRAME' , 'true');} else {$template->assign( 'LLGBO_FRAME' , 'false');}
     130        if ($conf['LLGBO_SETTINGS'][1] == 'true')
     131          {$template->assign( 'LLGBO_TOOLTIP_DISP' , 'true');}  else  {$template->assign( 'LLGBO_TOOLTIP_DISP' , "false");}
     132        if ($conf['LLGBO_SETTINGS'][2]  == 'true')
     133          {$template->assign('LLGBO_EXIFUNDERBT' , 'true');}  else  {$template->assign( 'LLGBO_EXIFUNDERBT' , "false");}
     134        if ($conf['LLGBO_SETTINGS'][3]  == 'true')
     135          {$template->assign( array( 'LLGBO_USEMAP' => 'true'));}  else  { $template->assign( array( 'LLGBO_USEMAP' => "false"));}
     136        if ($conf['LLGBO_SETTINGS'][4]  == 'true')
     137          {$template->assign( array( 'LLGBO_USEMAP_THUMB' => 'true'));}  else  { $template->assign( array( 'LLGBO_USEMAP_THUMB' => "false"));}
     138        if ($conf['LLGBO_SETTINGS'][5]  == 'true')
     139          {$template->assign( array( 'LLGBO_TITLE_FRAME' => 'true'));}  else {  $template->assign( array( 'LLGBO_TITLE_FRAME' => "false"));}
     140        if ($conf['LLGBO_SETTINGS'][6] == 'true')
     141          {$template->assign( array( 'LLGBO_HEADER' => 'true'));}  else  { $template->assign( array( 'LLGBO_HEADER' => "false"));}
     142        $template->assign(array( 'LLGBO_MAINTAIN_HEADER' => $conf['LLGBO_SETTINGS'][7]));
     143        if ($conf['LLGBO_SETTINGS'][8]  == 'true')
     144          {$template->assign(array( 'LLGBO_ALLINFO' => 'true'));}  else {  $template->assign( array( 'LLGBO_ALLINFO' => "false"));}
     145        if ($conf['LLGBO_SETTINGS'][9] == 'true')
     146          {$template->assign(array( 'LLGBO_DEFAULT_NAVTHUMB' => 'true'));}  else  { $template->assign(array( 'LLGBO_DEFAULT_NAVTHUMB' => "false"));}
     147}
     148///////////////////////////////////////////////////////////////////////////////////////
     149//// TOOLTIP           
     150///////////////////////////////////////////////////////////////////////////////////////
     151if ($page['tab'] == 'tooltip') {
     152        if ( isset($_POST['save'])  or isset($_POST['preview'])) 
     153        { 
     154        if (!isset($_POST['llgbo_tooltip_width'])) {$_POST['llgbo_tooltip_width'] = '150';} 
     155                if (!isset($_POST['llgbo_tooltip_size'])) {$_POST['llgbo_tooltip_size'] = '2';}   
     156                if (!isset($_POST['llgbo_tooltip_bordercolor'])) {$_POST['llgbo_tooltip_bordercolor'] = '#fff';}   
     157                if (!isset($_POST['llgbo_tooltip_backgroundcolor'])) {$_POST['llgbo_tooltip_backgroundcolor'] = '#000';} 
     158                if (!isset($_POST['llgbo_tooltip_titlecolor'])) {$_POST['llgbo_tooltip_titlecolor'] = '#c92';} 
     159                if (!isset($_POST['llgbo_tooltip_color'])) {$_POST['llgbo_tooltip_color'] = '#dadada';}   
     160                 
     161                 $param_llgbo_tooltip = array(
     162                                        $_POST['llgbo_tooltip_width'],                  $_POST['llgbo_tooltip_size'] , 
     163                                        $_POST['llgbo_tooltip_bordercolor'],    $_POST['llgbo_tooltip_backgroundcolor'],
     164                                        $_POST['llgbo_tooltip_titlecolor'],             $_POST['llgbo_tooltip_color']);         
     165                $llgbo_newtooltip_value = implode ("," , $param_llgbo_tooltip);
     166               
     167                if ( isset($_POST['save']) )
     168                                 {   $query = '
     169                                UPDATE ' . CONFIG_TABLE . '
     170                                  SET value="'.$llgbo_newtooltip_value.'"
     171                                  WHERE param="LLGBOTOOLTIP"
     172                                  LIMIT 1';
     173                                                pwg_query($query);
     174                                 $template->assign('LLGBOINFO','llgbo_info');
     175                                 }
     176                $conf['LLGBO_TOOLTIP'] = explode ("," ,$llgbo_newtooltip_value);
     177        }
     178 // Reload settings for correct display after update
     179 if (isset($conf['LLGBO_TOOLTIP'][0])) {$template->assign(array( 'LLGBO_TOOLTIP_WIDTH' => $conf['LLGBO_TOOLTIP'][0]));}
     180 if (isset($conf['LLGBO_TOOLTIP'][1])) {$template->assign(array( 'LLGBO_TOOLTIP_SIZE' => $conf['LLGBO_TOOLTIP'][1]));}
     181 if (isset($conf['LLGBO_TOOLTIP'][2])) {$template->assign(array( 'LLGBO_TOOLTIP_BORDERCOLOR' => $conf['LLGBO_TOOLTIP' ][2]));}
     182 if (isset($conf['LLGBO_TOOLTIP'][3])) {$template->assign(array( 'LLGBO_TOOLTIP_BACKGROUNDCOLOR' => $conf['LLGBO_TOOLTIP'][3]));}
     183 if (isset($conf['LLGBO_TOOLTIP'][4])) {$template->assign(array( 'LLGBO_TOOLTIP_TITLECOLOR' => $conf['LLGBO_TOOLTIP'][4]));}
     184 if (isset($conf['LLGBO_TOOLTIP'][5])) {$template->assign(array( 'LLGBO_TOOLTIP_COLOR' => $conf['LLGBO_TOOLTIP'][5]));}
     185}
     186
     187///////////////////////////////////////////////
     188/////              FRAME
     189/////////////////////////////////////////////////
     190if ($page['tab'] == 'frame') {
     191        if ( isset($_POST['save'])  or isset($_POST['preview'])) 
     192        { 
     193        if (!isset($_POST['llgbo_title_frame_color'])) {$_POST['llgbo_title_frame_color'] = '#16195f';} 
     194         for ($i = 0   ;$i < 16  ; $i++)
     195                {       if (!isset($_POST['llgbo_frame_bdcolor'.$i])) {$_POST['llgbo_frame_bdcolor'.$i] = '#fff' ;}   
     196                        if (!isset($_POST['llgbo_frame_bdsize'.$i])) {$_POST['llgbo_frame_bdsize'.$i] = '1' ;}
     197                }
     198         
     199         $param_llgbo_frame = array(           
     200                                $_POST['llgbo_title_frame_color'],
     201                                $_POST['llgbo_frame_bdcolor0'],                 $_POST['llgbo_frame_bdsize0'],
     202                                $_POST['llgbo_frame_bdcolor1'],                 $_POST['llgbo_frame_bdsize1'], 
     203                                $_POST['llgbo_frame_bdcolor2'],                 $_POST['llgbo_frame_bdsize2'],
     204                                $_POST['llgbo_frame_bdcolor3'],                 $_POST['llgbo_frame_bdsize3'],
     205                                $_POST['llgbo_frame_bdcolor4'],                 $_POST['llgbo_frame_bdsize4'],
     206                                $_POST['llgbo_frame_bdcolor5'],                 $_POST['llgbo_frame_bdsize5'],
     207                                $_POST['llgbo_frame_bdcolor6'],                 $_POST['llgbo_frame_bdsize6'],
     208                                $_POST['llgbo_frame_bdcolor7'],                 $_POST['llgbo_frame_bdsize7'],
     209                                $_POST['llgbo_frame_bdcolor8'],                 $_POST['llgbo_frame_bdsize8'],
     210                                $_POST['llgbo_frame_bdcolor9'],                 $_POST['llgbo_frame_bdsize9'],
     211                                $_POST['llgbo_frame_bdcolor10'],                $_POST['llgbo_frame_bdsize10'],
     212                                $_POST['llgbo_frame_bdcolor11'],                $_POST['llgbo_frame_bdsize11'],
     213                                $_POST['llgbo_frame_bdcolor12'],                $_POST['llgbo_frame_bdsize12'],
     214                                $_POST['llgbo_frame_bdcolor13'],                $_POST['llgbo_frame_bdsize13'],
     215                                $_POST['llgbo_frame_bdcolor14'],                $_POST['llgbo_frame_bdsize14'],
     216                                $_POST['llgbo_frame_bdcolor15'],                $_POST['llgbo_frame_bdsize15']
     217                        );               
     218                        $llgbo_newframe_value = implode ("," , $param_llgbo_frame);
     219       
     220                if ( isset($_POST['save']) )
     221                         {
     222                         $query = '
     223                        UPDATE ' . CONFIG_TABLE . '
     224                          SET value="'.$llgbo_newframe_value.'"
     225                          WHERE param="LLGBOFRAME"
     226                          LIMIT 1';
     227                                pwg_query($query);
     228                $template->assign('LLGBOINFO','llgbo_info');
     229                }
     230                $conf['LLGBO_FRAME'] = explode ("," ,$llgbo_newframe_value );
     231       
     232}
     233 // FRAME
     234           if (isset($conf['LLGBO_FRAME'][0])) {$template->assign(array( 'LLGBO_TITLE_FRAME_COLOR' => $conf['LLGBO_FRAME'][0]));}
     235         for ($i = 0   ;$i < 16  ; $i++)
     236                { $x = 1 + ( 2 * $i);
     237                        if (isset($conf['LLGBO_FRAME'][$x])) {$template->assign(array( 'LLGBO_FRAME_BDCOLOR'.$i => $conf['LLGBO_FRAME'][$x]));}
     238                        if (isset($conf['LLGBO_FRAME'][$x+1])) {$template->assign(array( 'LLGBO_FRAME_BDSIZE'.$i => $conf['LLGBO_FRAME'][$x+1]));}
     239                }
     240///  re draw frame after update
     241  Draw_frame();
     242}
     243
    137244$template->assign_var_from_handle( 'ADMIN_CONTENT', 'llgbo_admin_content');
     245//////////////////////////
     246function Draw_frame()
     247        {global $conf ,$template;
     248        $bd = 0;
     249        $frame_begin ='';
     250        $frame_end='';
     251               
     252        for ($i = 0   ;$i < 16  ; $i++)
     253        { $x = 1 + ( 2 * $i);
     254
     255        if ((isset($conf['LLGBO_FRAME'][$x+1])) and  ($conf['LLGBO_FRAME'][$x+1] > 0))
     256        {  $frame_begin = '<div id="gbo'.$i.'"  style="border: '.$conf['LLGBO_FRAME'][$x+1].'px solid '.$conf['LLGBO_FRAME'][$x].'">'."\n".$frame_begin;
     257         $frame_end = $frame_end .' </div>';      }
     258
     259         }
     260        $template->assign('FRAME_BEGIN', $frame_begin);
     261        $template->assign('FRAME_END', $frame_end);
     262        }
    138263?>
Note: See TracChangeset for help on using the changeset viewer.