-- change element_vars ui-theme-css in gui_digitize (customized-css doesn't work correct in mapbender 2.7.3)
update gui_element_vars set var_value = '../extensions/jquery-ui-1.7.2.custom/css/smoothness/jquery-ui-1.7.2.custom.css' 
where fkey_gui_id = 'gui_digitize' and var_name = 'jq_ui_theme';

-- legend_url in e_content for printPDF template print
UPDATE gui_element SET e_content = '<div id="printPDF_working_bg"></div><div id="printPDF_working"><img src="../img/indicator_wheel.gif" style="padding:10px 0 0 10px">Generating PDF</div><div id="printPDF_input"><form id="printPDF_form" action="../print/printFactory.php"><div id="printPDF_selector"></div><div class="print_option"><input type="hidden" id="opacity" name="opacity" value=""/><input type="hidden" id="map_url" name="map_url" value=""/><input type="hidden" id="overview_url" name="overview_url" value=""/><input type="hidden" id="legend_url" name="legend_url" value=""/><input type="hidden" id="map_scale" name="map_scale" value=""/><input type="hidden" name="measured_x_values" /><input type="hidden" name="measured_y_values" /><br /></div><div class="print_option" id="printPDF_formsubmit"><input id="submit" type="submit" value="Print"><br /></div></form><div id="printPDF_result"></div></div>' WHERE e_id = 'printPDF' and fkey_gui_id = 'template_print';

-- add new element vars for resizemapSize to gui2
INSERT INTO gui_element_vars(fkey_gui_id, fkey_e_id, var_name, var_value, context, var_type) VALUES('gui2', 'resizeMapsize', 'max_height', '700', 'define a max mapframe width (units pixel) f.e. 700 or false' ,'var');
INSERT INTO gui_element_vars(fkey_gui_id, fkey_e_id, var_name, var_value, context, var_type) VALUES('gui2', 'resizeMapsize', 'max_width', '700', 'define a max mapframe width (units pixel) f.e. 700 or false' ,'var');

-- printPDF: new element_var legendColumns for element printPDF
INSERT INTO gui_element_vars(fkey_gui_id, fkey_e_id, var_name, var_value, context, var_type)
SELECT gui_element.fkey_gui_id,
'printPDF', 'legendColumns', '2', 'define number of columns on legendpage' ,'php_var' from gui_element
WHERE
gui_element.e_id = 'printPDF' AND
gui_element.fkey_gui_id
NOT IN (SELECT fkey_gui_id FROM gui_element_vars WHERE fkey_e_id = 'printPDF' AND var_name = 'legendColumns');

-- printPDF: new element_var printLegend for element printPDF
INSERT INTO gui_element_vars(fkey_gui_id, fkey_e_id, var_name, var_value, context, var_type)
SELECT gui_element.fkey_gui_id, 'printPDF', 'printLegend', 'true', 'define whether the legend should be printed or not' ,'php_var' 
from gui_element
WHERE
gui_element.e_id = 'printPDF' AND
gui_element.fkey_gui_id
NOT IN (SELECT fkey_gui_id FROM gui_element_vars WHERE fkey_e_id = 'printPDF' AND var_name = 'printLegend');
