Advanced Featured Post Widget', 'administrator', 'advanced-fpw-settings', array(&$this, 'build_options_page')); } /** * * Actually build the option pages * */ function build_options_page() { $eol = "\r\n"; parent::open_page('Advanced Featured Post Widget', __('http://wasistlos.waldemarstoffel.com/plugins-fur-wordpress/advanced-featured-post-widget', self::language_file), 'advanced-featured-post-widget', __('Plugin Support', self::language_file)); _e('Style the links of the widget. If you leave this empty, your theme will style the hyperlinks.', self::language_file); echo '

'.__('Just input something like,', self::language_file).'

'.$eol.'

font-weight: bold;
'.$eol.'color: #0000ff;
'; echo 'text-decoration: underline;'.$eol.'

'.$eol.__('to get fat, blue, underlined links.', self::language_file).$eol.'

'.$eol; echo '

'.__('You most probably have to use "!important" at the end of each line, to make it work.', self::language_file).'

'.$eol; parent::open_form('options.php'); settings_fields('afpw_options'); do_settings_sections('afpw_styles'); submit_button(); if (WP_DEBUG === true) : echo '
'; parent::open_draggable(__('Debug Info', self::language_file), 'debug-info'); echo '
';
			
			var_dump(self::$options);
			
			echo '
'; parent::close_draggable(); echo '
'; endif; parent::close_page(); } /** * * Initialize the admin screen of the plugin * */ function initialize_settings() { register_setting( 'afpw_options', 'afpw_options', array(&$this, 'validate') ); add_settings_section('afpw_settings', __('Styling of the links', self::language_file), array(&$this, 'display_section'), 'afpw_styles'); add_settings_field('afpw_link_style', __('Link style:', self::language_file), array(&$this, 'link_field'), 'afpw_styles', 'afpw_settings'); add_settings_field('afpw_hover_style', __('Hover style:', self::language_file), array(&$this, 'hover_field'), 'afpw_styles', 'afpw_settings'); add_settings_field('afpw_css', __('Widget container:', self::language_file), array(&$this, 'css_field'), 'afpw_styles', 'afpw_settings', array(__('You can enter your own style for the widgets here. This will overwrite the styles of your theme.', self::language_file), __('If you leave this empty, you can still style every instance of the widget individually.', self::language_file))); add_settings_field('afpw_inline', __('Debug:', self::language_file), array(&$this, 'inline_field'), 'afpw_styles', 'afpw_settings', array(__('If you can't reach the dynamical style sheet, you'll have to diplay the styles inline. By clicking here you can do so.', self::language_file))); add_settings_field('afpw_resize', false, array(&$this, 'resize_field'), 'afpw_styles', 'afpw_settings'); } function display_section() { echo '

'.__('Just put some css code here.', self::language_file).'

'; } function link_field() { a5_textarea('link', 'afpw_options[link]', @self::$options['link'], false, array('cols' => 35, 'rows' => 3)); } function hover_field() { a5_textarea('hover', 'afpw_options[hover]', @self::$options['hover'], false, array('cols' => 35, 'rows' => 3)); } function css_field($labels) { echo $labels[0].'
'.$labels[1].'
'; a5_textarea('css', 'afpw_options[css]', @self::$options['afpw_css'], false, array('rows' => 7, 'cols' => 35)); } function inline_field($labels) { a5_checkbox('inline', 'afpw_options[inline]', @self::$options['inline'], $labels[0]); } function resize_field() { a5_resize_textarea(array('link', 'hover', 'css')); } function validate($input) { self::$options['link']=trim($input['link']); self::$options['hover']=trim($input['hover']); self::$options['css']=trim($input['css']); self::$options['inline'] = isset($input['inline']) ? true : NULL; return self::$options; } } // end of class ?>