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.'
'.__('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) : self::open_tab(); self::sortable('deep-down', self::debug_info(self::$options, __('Debug Info', self::language_file))); self::close_tab(); 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_compress', __('Compress Style Sheet:', self::language_file), array($this, 'compress_field'), 'afpw_styles', 'afpw_settings', array(__('Click here to compress the style sheet.', 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 display the styles inline. By clicking here you can do so.', self::language_file))); if (self::$options['inline']) add_settings_field('afpw_priority', __('Priority of the inline style:', self::language_file), array($this, 'priority_field'), 'afpw_styles', 'afpw_settings', array(__('This only affects inline styles. Some other plugins could be using the same selectors as this one. In that case, writing your's later in the code might help.', self::language_file))); $cachesize = count(self::$options['cache']); $entry = ($cachesize > 1) ? __('entries', self::language_file) : __('entry', self::language_file); if ($cachesize > 0) add_settings_field('afpw_reset', sprintf(__('Empty cache (%d %s):', self::language_file), $cachesize, $entry), array($this, 'reset_field'), 'afpw_styles', 'afpw_settings', array(__('You can empty the plugin's cache here, if necessary.', 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].'