This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ load_plugin_textdomain('codecolorer', 'wp-content/plugins/codecolorer'); // NLS include_once('codecolorer.php'); $CodeColorer = new CodeColorer(); $location = get_option('siteurl') . '/wp-admin/admin.php?page=codecolorer/codecolorer-options.php'; // Form Action URI /* Add some default options if they don't exist */ add_option('codecolorer_css_style', $CodeColorer->getDefaultStyle()); add_option('codecolorer_lines_to_scroll', $CodeColorer->getDefaultLinesToScroll()); add_option('codecolorer_width', $CodeColorer->getDefaultWidth()); add_option('codecolorer_height', $CodeColorer->getDefaultHeight()); add_option('codecolorer_line_numbers', false); add_option('codecolorer_disable_keyword_linking', false); add_option('codecolorer_tab_size', 4); add_option('codecolorer_theme', ''); /* Obsolete options */ // add_option('codecolorer_line_height', $CodeColorer->getDefaultLineHeight()); /* Check form submission and update options */ if ('process' == $_POST['stage']) { update_option('codecolorer_css_style', $_POST['codecolorer_css_style']); update_option('codecolorer_lines_to_scroll', intval($_POST['codecolorer_lines_to_scroll'])); update_option('codecolorer_width', intval($_POST['codecolorer_width'])); update_option('codecolorer_height', intval($_POST['codecolorer_height'])); update_option('codecolorer_line_numbers', isset($_POST['codecolorer_line_numbers'])); update_option('codecolorer_disable_keyword_linking', isset($_POST['codecolorer_disable_keyword_linking'])); update_option('codecolorer_tab_site', intval($_POST['codecolorer_tab_size'])); update_option('codecolorer_theme', $_POST['codecolorer_theme']); } /* Get options for form fields */ $codecolorer_css_style = stripslashes(get_option('codecolorer_css_style')); $codecolorer_lines_to_scroll = stripslashes(get_option('codecolorer_lines_to_scroll')); $codecolorer_width = stripslashes(get_option('codecolorer_width')); $codecolorer_height = stripslashes(get_option('codecolorer_height')); $codecolorer_line_numbers = stripslashes(get_option('codecolorer_line_numbers')); $codecolorer_disable_keyword_linking = stripslashes(get_option('codecolorer_disable_keyword_linking')); $codecolorer_tab_size = stripslashes(get_option('codecolorer_tab_size')); $codecolorer_theme = stripslashes(get_option('codecolorer_theme')); ?>