Index: /extensions/LLGBO2/admin/llgbo_admin.php =================================================================== --- /extensions/LLGBO2/admin/llgbo_admin.php (revision 4523) +++ /extensions/LLGBO2/admin/llgbo_admin.php (revision 4524) @@ -28,4 +28,44 @@ // *************************************** if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); +include_once(PHPWG_ROOT_PATH.'admin/include/tabsheet.class.php'); +$my_base_url = get_admin_plugin_menu_link(__FILE__); +// Setup plugin Language +load_language('plugin.lang', LLGBO_PATH); +// +-----------------------------------------------------------------------+ +// | Tabssheet +// +-----------------------------------------------------------------------+ +if (!isset($_GET['tab'])) + { $page['tab'] = 'manage';} + else + {$page['tab'] = $_GET['tab'];} + +$tabsheet = new tabsheet(); +$tabsheet->add('manage', + l10n('llgbo_M_manage'), + $my_base_url.'&tab=manage'); +$tabsheet->add('tooltip', + l10n('llgbo_M_tooltip'), + $my_base_url.'&tab=tooltip'); +If ($page['tab'] == 'manage') + {if (!isset($_POST['llgbo_frame']) ) + {$conf['LLGBO_SETTINGS'][0] = 'false';} + else + {$conf['LLGBO_SETTINGS'][0]= $_POST['llgbo_frame'];}} + +if ($conf['LLGBO_SETTINGS'][0] == 'true') +{$tabsheet->add('frame', + l10n('llgbo_M_frame'), + $my_base_url.'&tab=frame');} + + + +$tabsheet->assign(); +if ($page['tab'] == 'manage') +{$template->set_filenames( array('llgbo_admin_content' => dirname(__FILE__).'/llgbo_adminsettings.tpl') );} +if ($page['tab'] == 'tooltip') +{$template->set_filenames( array('llgbo_admin_content' => dirname(__FILE__).'/llgbo_admintooltip.tpl') );} +if ($page['tab'] == 'frame' ) +{$template->set_filenames( array('llgbo_admin_content' => dirname(__FILE__).'/llgbo_adminframe.tpl') );} +$tabsheet->select($page['tab']); /* ****************************************************** */ /* Plugin template initialisation for admin panel display */ @@ -36,103 +76,188 @@ $template->clear_assign('LLGBOINFO'); // Load configuration settings from database -$conf_LLGBO = explode("," , $conf['LLGBO']); - -// Setup plugin Language -load_language('plugin.lang', LLGBO_PATH); + + +$template->append('head_elements', + ' + + + +'); + // Update configuration settings in database -if ( isset($_POST['submit']) ) -{ -if (!isset($_POST['llgbo_frame'])) {$_POST['llgbo_frame'] = 'false';} -if (!isset($_POST['llgbo_tooltip'])) {$_POST['llgbo_tooltip'] = 'false';} -if (!isset($_POST['llgbo_exifunderbt'])) {$_POST['llgbo_exifunderbt'] = 'false';} -if (!isset($_POST['llgbo_usemap'])) {$_POST['llgbo_usemap'] = 'false';} -if (!isset($_POST['llgbo_usemap_thumb'])) {$_POST['llgbo_usemap_thumb'] = 'false';} -if (!isset($_POST['llgbo_title_frame'])) {$_POST['llgbo_title_frame'] = 'false';} -if (!isset($_POST['llgbo_header'])) {$_POST['llgbo_header'] = 'false';} -if (!isset($_POST['llgbo_maintain_header'])) {$_POST['llgbo_maintain_header'] = '';} -if (!isset($_POST['llgbo_allinfo'])) {$_POST['llgbo_allinfo'] = 'false';} -if (!isset($_POST['llgbo_default_navthumb'])) {$_POST['llgbo_default_navthumb'] = 'false';} -if (!isset($_POST['llgbo_always_displayexif'])) {$_POST['llgbo_always_displayexif'] = 'true';} - $param_llgbo = array($_POST['llgbo_frame'], - $_POST['llgbo_tooltip'], - $_POST['llgbo_exifunderbt'], - $_POST['llgbo_usemap'], - $_POST['llgbo_usemap_thumb'], - $_POST['llgbo_title_frame'], - $_POST['llgbo_header'], - $_POST['llgbo_maintain_header'], - $_POST['llgbo_allinfo'], - $_POST['llgbo_default_navthumb'], - $_POST['llgbo_always_displayexif'], - ); - $llgbo_new_value = implode ("," , $param_llgbo); - $query = ' -UPDATE ' . CONFIG_TABLE . ' - SET value="' . $llgbo_new_value . '" - WHERE param="LLGBO" - LIMIT 1'; - pwg_query($query); - - $template->assign('LLGBOINFO','llgbo_info'); - -// Reload settings for correct display after update -$conf['LLGBO']= $llgbo_new_value; -} - -$conf_LLGBO = explode("," , $conf['LLGBO']); -// template setting -if ($conf_LLGBO[0] == 'true') -{$template->assign( 'LLGBO_FRAME' , 'true');} - else -{$template->assign( 'LLGBO_FRAME' , 'false');} -if ($conf_LLGBO[1] == 'true') -{$template->assign( 'LLGBO_TOOLTIP' , 'true');} - else - {$template->assign( 'LLGBO_TOOLTIP' , "false");} - -if ($conf_LLGBO[2] == 'true') -{$template->assign('LLGBO_EXIFUNDERBT' , 'true');} - else - {$template->assign( 'LLGBO_EXIFUNDERBT' , "false");} - -if ($conf_LLGBO[3] == 'true') - {$template->assign( array( 'LLGBO_USEMAP' => 'true'));} - else - { $template->assign( array( 'LLGBO_USEMAP' => "false"));} - - if ($conf_LLGBO[4] == 'true') - {$template->assign( array( 'LLGBO_USEMAP_THUMB' => 'true'));} - else - { $template->assign( array( 'LLGBO_USEMAP_THUMB' => "false"));} - - if ($conf_LLGBO[5] == 'true') -{ $template->assign( array( 'LLGBO_TITLE_FRAME' => 'true'));} - else -{ $template->assign( array( 'LLGBO_TITLE_FRAME' => "false"));} - -if ($conf_LLGBO[6] == 'true') -{ $template->assign( array( 'LLGBO_HEADER' => 'true'));} - else - { $template->assign( array( 'LLGBO_HEADER' => "false"));} - - $template->assign(array( 'LLGBO_MAINTAIN_HEADER' => $conf_LLGBO[7])); - - if ($conf_LLGBO[8] == 'true') -{ $template->assign(array( 'LLGBO_ALLINFO' => 'true'));} - else -{ $template->assign( array( 'LLGBO_ALLINFO' => "false"));} - -if ($conf_LLGBO[9] == 'true') -{ $template->assign(array( 'LLGBO_DEFAULT_NAVTHUMB' => 'true'));} - else - { $template->assign(array( 'LLGBO_DEFAULT_NAVTHUMB' => "false"));} - -if ($conf_LLGBO[10] == 'true') -{ $template->assign(array( 'LLGBO_ALWAYS_DISPLAYEXIF' => 'true'));} - else - { $template->assign(array( 'LLGBO_ALWAYS_DISPLAYEXIF' => "false"));} - -$template->set_filenames( array('llgbo_admin_content' => dirname(__FILE__).'/llgbo_admin.tpl') ); + ////// SETTINGS +if (($page['tab'] == 'manage') or ( !isset($_GET['tab']))){ + if ( isset($_POST['submit']) ) + { + if (!isset($_POST['llgbo_frame'])) {$_POST['llgbo_frame'] = 'false';} + if (!isset($_POST['llgbo_tooltip'])) {$_POST['llgbo_tooltip'] = 'false';} + if (!isset($_POST['llgbo_exifunderbt'])) {$_POST['llgbo_exifunderbt'] = 'false';} + if (!isset($_POST['llgbo_usemap'])) {$_POST['llgbo_usemap'] = 'false';} + if (!isset($_POST['llgbo_usemap_thumb'])) {$_POST['llgbo_usemap_thumb'] = 'false';} + if (!isset($_POST['llgbo_title_frame'])) {$_POST['llgbo_title_frame'] = 'false';} + if (!isset($_POST['llgbo_header'])) {$_POST['llgbo_header'] = 'false';} + if (!isset($_POST['llgbo_maintain_header'])) {$_POST['llgbo_maintain_header'] = '';} + if (!isset($_POST['llgbo_allinfo'])) {$_POST['llgbo_allinfo'] = 'false';} + if (!isset($_POST['llgbo_default_navthumb'])) {$_POST['llgbo_default_navthumb'] = 'false';} //9 } + $param_llgbo = array($_POST['llgbo_frame'], + $_POST['llgbo_tooltip'], $_POST['llgbo_exifunderbt'], + $_POST['llgbo_usemap'], $_POST['llgbo_usemap_thumb'], + $_POST['llgbo_title_frame'], $_POST['llgbo_header'], + $_POST['llgbo_maintain_header'], $_POST['llgbo_allinfo'], + $_POST['llgbo_default_navthumb'] + ); + $llgbo_new_value = implode ("," , $param_llgbo); + $query = ' + UPDATE ' . CONFIG_TABLE . ' + SET value="'.$llgbo_new_value. '" + WHERE param="LLGBO" + LIMIT 1'; + pwg_query($query); + $template->assign('LLGBOINFO','llgbo_info'); + $conf['LLGBO_SETTINGS'] = explode ("," ,$llgbo_new_value); + } + + // Reload settings for correct display after update + if ($conf['LLGBO_SETTINGS'][0] == 'true') + {$template->assign( 'LLGBO_FRAME' , 'true');} else {$template->assign( 'LLGBO_FRAME' , 'false');} + if ($conf['LLGBO_SETTINGS'][1] == 'true') + {$template->assign( 'LLGBO_TOOLTIP_DISP' , 'true');} else {$template->assign( 'LLGBO_TOOLTIP_DISP' , "false");} + if ($conf['LLGBO_SETTINGS'][2] == 'true') + {$template->assign('LLGBO_EXIFUNDERBT' , 'true');} else {$template->assign( 'LLGBO_EXIFUNDERBT' , "false");} + if ($conf['LLGBO_SETTINGS'][3] == 'true') + {$template->assign( array( 'LLGBO_USEMAP' => 'true'));} else { $template->assign( array( 'LLGBO_USEMAP' => "false"));} + if ($conf['LLGBO_SETTINGS'][4] == 'true') + {$template->assign( array( 'LLGBO_USEMAP_THUMB' => 'true'));} else { $template->assign( array( 'LLGBO_USEMAP_THUMB' => "false"));} + if ($conf['LLGBO_SETTINGS'][5] == 'true') + {$template->assign( array( 'LLGBO_TITLE_FRAME' => 'true'));} else { $template->assign( array( 'LLGBO_TITLE_FRAME' => "false"));} + if ($conf['LLGBO_SETTINGS'][6] == 'true') + {$template->assign( array( 'LLGBO_HEADER' => 'true'));} else { $template->assign( array( 'LLGBO_HEADER' => "false"));} + $template->assign(array( 'LLGBO_MAINTAIN_HEADER' => $conf['LLGBO_SETTINGS'][7])); + if ($conf['LLGBO_SETTINGS'][8] == 'true') + {$template->assign(array( 'LLGBO_ALLINFO' => 'true'));} else { $template->assign( array( 'LLGBO_ALLINFO' => "false"));} + if ($conf['LLGBO_SETTINGS'][9] == 'true') + {$template->assign(array( 'LLGBO_DEFAULT_NAVTHUMB' => 'true'));} else { $template->assign(array( 'LLGBO_DEFAULT_NAVTHUMB' => "false"));} +} +/////////////////////////////////////////////////////////////////////////////////////// +//// TOOLTIP +/////////////////////////////////////////////////////////////////////////////////////// +if ($page['tab'] == 'tooltip') { + if ( isset($_POST['save']) or isset($_POST['preview'])) + { + if (!isset($_POST['llgbo_tooltip_width'])) {$_POST['llgbo_tooltip_width'] = '150';} + if (!isset($_POST['llgbo_tooltip_size'])) {$_POST['llgbo_tooltip_size'] = '2';} + if (!isset($_POST['llgbo_tooltip_bordercolor'])) {$_POST['llgbo_tooltip_bordercolor'] = '#fff';} + if (!isset($_POST['llgbo_tooltip_backgroundcolor'])) {$_POST['llgbo_tooltip_backgroundcolor'] = '#000';} + if (!isset($_POST['llgbo_tooltip_titlecolor'])) {$_POST['llgbo_tooltip_titlecolor'] = '#c92';} + if (!isset($_POST['llgbo_tooltip_color'])) {$_POST['llgbo_tooltip_color'] = '#dadada';} + + $param_llgbo_tooltip = array( + $_POST['llgbo_tooltip_width'], $_POST['llgbo_tooltip_size'] , + $_POST['llgbo_tooltip_bordercolor'], $_POST['llgbo_tooltip_backgroundcolor'], + $_POST['llgbo_tooltip_titlecolor'], $_POST['llgbo_tooltip_color']); + $llgbo_newtooltip_value = implode ("," , $param_llgbo_tooltip); + + if ( isset($_POST['save']) ) + { $query = ' + UPDATE ' . CONFIG_TABLE . ' + SET value="'.$llgbo_newtooltip_value.'" + WHERE param="LLGBOTOOLTIP" + LIMIT 1'; + pwg_query($query); + $template->assign('LLGBOINFO','llgbo_info'); + } + $conf['LLGBO_TOOLTIP'] = explode ("," ,$llgbo_newtooltip_value); + } + // Reload settings for correct display after update + if (isset($conf['LLGBO_TOOLTIP'][0])) {$template->assign(array( 'LLGBO_TOOLTIP_WIDTH' => $conf['LLGBO_TOOLTIP'][0]));} + if (isset($conf['LLGBO_TOOLTIP'][1])) {$template->assign(array( 'LLGBO_TOOLTIP_SIZE' => $conf['LLGBO_TOOLTIP'][1]));} + if (isset($conf['LLGBO_TOOLTIP'][2])) {$template->assign(array( 'LLGBO_TOOLTIP_BORDERCOLOR' => $conf['LLGBO_TOOLTIP' ][2]));} + if (isset($conf['LLGBO_TOOLTIP'][3])) {$template->assign(array( 'LLGBO_TOOLTIP_BACKGROUNDCOLOR' => $conf['LLGBO_TOOLTIP'][3]));} + if (isset($conf['LLGBO_TOOLTIP'][4])) {$template->assign(array( 'LLGBO_TOOLTIP_TITLECOLOR' => $conf['LLGBO_TOOLTIP'][4]));} + if (isset($conf['LLGBO_TOOLTIP'][5])) {$template->assign(array( 'LLGBO_TOOLTIP_COLOR' => $conf['LLGBO_TOOLTIP'][5]));} +} + +/////////////////////////////////////////////// +///// FRAME +///////////////////////////////////////////////// +if ($page['tab'] == 'frame') { + if ( isset($_POST['save']) or isset($_POST['preview'])) + { + if (!isset($_POST['llgbo_title_frame_color'])) {$_POST['llgbo_title_frame_color'] = '#16195f';} + for ($i = 0 ;$i < 16 ; $i++) + { if (!isset($_POST['llgbo_frame_bdcolor'.$i])) {$_POST['llgbo_frame_bdcolor'.$i] = '#fff' ;} + if (!isset($_POST['llgbo_frame_bdsize'.$i])) {$_POST['llgbo_frame_bdsize'.$i] = '1' ;} + } + + $param_llgbo_frame = array( + $_POST['llgbo_title_frame_color'], + $_POST['llgbo_frame_bdcolor0'], $_POST['llgbo_frame_bdsize0'], + $_POST['llgbo_frame_bdcolor1'], $_POST['llgbo_frame_bdsize1'], + $_POST['llgbo_frame_bdcolor2'], $_POST['llgbo_frame_bdsize2'], + $_POST['llgbo_frame_bdcolor3'], $_POST['llgbo_frame_bdsize3'], + $_POST['llgbo_frame_bdcolor4'], $_POST['llgbo_frame_bdsize4'], + $_POST['llgbo_frame_bdcolor5'], $_POST['llgbo_frame_bdsize5'], + $_POST['llgbo_frame_bdcolor6'], $_POST['llgbo_frame_bdsize6'], + $_POST['llgbo_frame_bdcolor7'], $_POST['llgbo_frame_bdsize7'], + $_POST['llgbo_frame_bdcolor8'], $_POST['llgbo_frame_bdsize8'], + $_POST['llgbo_frame_bdcolor9'], $_POST['llgbo_frame_bdsize9'], + $_POST['llgbo_frame_bdcolor10'], $_POST['llgbo_frame_bdsize10'], + $_POST['llgbo_frame_bdcolor11'], $_POST['llgbo_frame_bdsize11'], + $_POST['llgbo_frame_bdcolor12'], $_POST['llgbo_frame_bdsize12'], + $_POST['llgbo_frame_bdcolor13'], $_POST['llgbo_frame_bdsize13'], + $_POST['llgbo_frame_bdcolor14'], $_POST['llgbo_frame_bdsize14'], + $_POST['llgbo_frame_bdcolor15'], $_POST['llgbo_frame_bdsize15'] + ); + $llgbo_newframe_value = implode ("," , $param_llgbo_frame); + + if ( isset($_POST['save']) ) + { + $query = ' + UPDATE ' . CONFIG_TABLE . ' + SET value="'.$llgbo_newframe_value.'" + WHERE param="LLGBOFRAME" + LIMIT 1'; + pwg_query($query); + $template->assign('LLGBOINFO','llgbo_info'); + } + $conf['LLGBO_FRAME'] = explode ("," ,$llgbo_newframe_value ); + +} + // FRAME + if (isset($conf['LLGBO_FRAME'][0])) {$template->assign(array( 'LLGBO_TITLE_FRAME_COLOR' => $conf['LLGBO_FRAME'][0]));} + for ($i = 0 ;$i < 16 ; $i++) + { $x = 1 + ( 2 * $i); + if (isset($conf['LLGBO_FRAME'][$x])) {$template->assign(array( 'LLGBO_FRAME_BDCOLOR'.$i => $conf['LLGBO_FRAME'][$x]));} + if (isset($conf['LLGBO_FRAME'][$x+1])) {$template->assign(array( 'LLGBO_FRAME_BDSIZE'.$i => $conf['LLGBO_FRAME'][$x+1]));} + } +/// re draw frame after update + Draw_frame(); +} + $template->assign_var_from_handle( 'ADMIN_CONTENT', 'llgbo_admin_content'); +////////////////////////// +function Draw_frame() + {global $conf ,$template; + $bd = 0; + $frame_begin =''; + $frame_end=''; + + for ($i = 0 ;$i < 16 ; $i++) + { $x = 1 + ( 2 * $i); + + if ((isset($conf['LLGBO_FRAME'][$x+1])) and ($conf['LLGBO_FRAME'][$x+1] > 0)) + { $frame_begin = '
{'llgbo_samples'|@translate}
+