Footer Putter - Version 1.4

Version Description

Added support for HTML5 themes

Download this release

Release Info

Developer powerblogservice
Plugin Icon 128x128 Footer Putter
Version 1.4
Comparing to
See all releases

Code changes from version 1.3 to 1.4

classes/admin.php CHANGED
@@ -4,9 +4,8 @@ class FooterPutterAdmin {
4
  const CODE = 'footer-putter';
5
  const DOMAIN = 'FooterPutter';
6
 
7
- private static $plugin = FOOTER_PUTTER_PLUGIN_NAME;
8
  private static $path = FOOTER_PUTTER_PATH;
9
- private static $slug = FOOTER_PUTTER_PLUGIN_NAME;
10
  private static $screen_id;
11
  private static $initialized = false;
12
 
@@ -18,8 +17,9 @@ class FooterPutterAdmin {
18
  return self::$screen_id;
19
  }
20
 
21
- static function init() {
22
  if (self::$initialized) return true;
 
23
  self::$initialized = true;
24
  add_filter('plugin_action_links',array(self::CLASSNAME, 'plugin_action_links'), 10, 2 );
25
  add_filter('screen_layout_columns', array(self::CLASSNAME, 'screen_layout_columns'), 10, 2);
@@ -46,14 +46,9 @@ class FooterPutterAdmin {
46
 
47
  static function admin_menu() {
48
  self::$screen_id = add_menu_page(FOOTER_PUTTER_FRIENDLY_NAME, FOOTER_PUTTER_FRIENDLY_NAME, 'manage_options',
49
- FOOTER_PUTTER_PLUGIN_NAME, array(self::CLASSNAME,'settings_panel'),plugins_url('images/icon-16.png',dirname(__FILE__)) );
50
  add_submenu_page(FOOTER_PUTTER_PLUGIN_NAME, FOOTER_PUTTER_FRIENDLY_NAME, 'Intro', 'manage_options', FOOTER_PUTTER_PLUGIN_NAME,array(self::CLASSNAME,'settings_panel') );
51
- add_action ('admin_enqueue_scripts',array(self::CLASSNAME, 'enqueue_styles'));
52
  }
53
-
54
- static function enqueue_styles() {
55
- wp_enqueue_style(self::CODE.'-admin', plugins_url('styles/admin.css', dirname(__FILE__)), array(),FOOTER_PUTTER_VERSION);
56
- }
57
 
58
  static function settings_panel() {
59
  $footer_url = FooterCreditsAdmin::get_url();
@@ -98,7 +93,7 @@ The plugins define two widgets:
98
  <ol>
99
  <li>Create a <i>Privacy Policy</i> page with no sidebar and set robots meta as noindex, noarchive.</li>
100
  <li>Create a <i>Terms of Use</i> page with no sidebar and set robots meta as noindex, noarchive.</li>
101
- <li>Create a page with a contact form.</li>
102
  <li>Create a WordPress menu <i>Footer Menu</i> with the above 3 pages.</li>
103
  <li>Go to <a href="{$footer_url}">Footer Credits</a> and update the Site Owner details and set the Footer Hook according to your choice of WordPress theme.</li>
104
  <li>Drag a <i>Footer Copyright Widget</i> into the <i>Custom Footer Widget Area</i> and select the <i>Footer Menu</i> and optional text if you want to have a "Return To Top" link</li>
@@ -111,12 +106,11 @@ The plugins define two widgets:
111
  <p>The footer hook is only required if your theme does not already have a footer widget area into which you can drag the two widgets.</p>
112
 
113
  <p>For some themes, the footer hook is left blank, for others use a WordPress hook such as <i>get_footer</i> or <i>wp_footer</i>,
114
- or use a theme-specific hook such as <i>twentyten_credits</i>, <i>twentyeleven_credits</i>, <i>genesis_footer</i>, <i>pagelines_leaf</i>, etc</p>
115
 
116
  <h3>Getting Help</h3>
117
  <p>Check out the <a href="{$home_url}">Footer Putter Plugin page</a> for more information about the plugin.</p>
118
  ADMIN_PANEL;
119
  }
120
  }
121
- FooterPutterAdmin::init();
122
- ?>
4
  const CODE = 'footer-putter';
5
  const DOMAIN = 'FooterPutter';
6
 
 
7
  private static $path = FOOTER_PUTTER_PATH;
8
+ private static $slug;
9
  private static $screen_id;
10
  private static $initialized = false;
11
 
17
  return self::$screen_id;
18
  }
19
 
20
+ static function init($root) {
21
  if (self::$initialized) return true;
22
+ self::$slug = $root;
23
  self::$initialized = true;
24
  add_filter('plugin_action_links',array(self::CLASSNAME, 'plugin_action_links'), 10, 2 );
25
  add_filter('screen_layout_columns', array(self::CLASSNAME, 'screen_layout_columns'), 10, 2);
46
 
47
  static function admin_menu() {
48
  self::$screen_id = add_menu_page(FOOTER_PUTTER_FRIENDLY_NAME, FOOTER_PUTTER_FRIENDLY_NAME, 'manage_options',
49
+ self::get_slug(), array(self::CLASSNAME,'settings_panel'),plugins_url('images/icon-16.png',dirname(__FILE__)) );
50
  add_submenu_page(FOOTER_PUTTER_PLUGIN_NAME, FOOTER_PUTTER_FRIENDLY_NAME, 'Intro', 'manage_options', FOOTER_PUTTER_PLUGIN_NAME,array(self::CLASSNAME,'settings_panel') );
 
51
  }
 
 
 
 
52
 
53
  static function settings_panel() {
54
  $footer_url = FooterCreditsAdmin::get_url();
93
  <ol>
94
  <li>Create a <i>Privacy Policy</i> page with no sidebar and set robots meta as noindex, noarchive.</li>
95
  <li>Create a <i>Terms of Use</i> page with no sidebar and set robots meta as noindex, noarchive.</li>
96
+ <li>Create a <i>Contact</i> page with a contact form.</li>
97
  <li>Create a WordPress menu <i>Footer Menu</i> with the above 3 pages.</li>
98
  <li>Go to <a href="{$footer_url}">Footer Credits</a> and update the Site Owner details and set the Footer Hook according to your choice of WordPress theme.</li>
99
  <li>Drag a <i>Footer Copyright Widget</i> into the <i>Custom Footer Widget Area</i> and select the <i>Footer Menu</i> and optional text if you want to have a "Return To Top" link</li>
106
  <p>The footer hook is only required if your theme does not already have a footer widget area into which you can drag the two widgets.</p>
107
 
108
  <p>For some themes, the footer hook is left blank, for others use a WordPress hook such as <i>get_footer</i> or <i>wp_footer</i>,
109
+ or use a theme-specific hook such as <i>twentyten_credits</i>, <i>twentyeleven_credits</i>, <i>twentytwelve_credits</i>, <i>genesis_footer</i>, <i>pagelines_leaf</i>, etc</p>
110
 
111
  <h3>Getting Help</h3>
112
  <p>Check out the <a href="{$home_url}">Footer Putter Plugin page</a> for more information about the plugin.</p>
113
  ADMIN_PANEL;
114
  }
115
  }
116
+ ?>
 
classes/footer-credits-admin.php CHANGED
@@ -12,7 +12,7 @@ class FooterCreditsAdmin {
12
  private static $initialized = false;
13
  private static $keys = array('owner', 'site', 'address', 'country', 'telephone',
14
  'email', 'courts', 'updated', 'copyright_start_year', 'return_text', 'return_href', 'return_class',
15
- 'footer_class','footer_hook','footer_remove','footer_filter_hook');
16
  private static $tips = array(
17
  'owner' => array('heading' => 'Owner or Business Name', 'tip' => 'Enter the name of the legal entity that owns and operates the site.'),
18
  'address' => array('heading' => 'Full Address', 'tip' => 'Enter the full address that you want to appear in the footer and the privacy and terms pages.'),
@@ -28,7 +28,8 @@ class FooterCreditsAdmin {
28
  'footer_class' => array('heading' => 'Footer Class' , 'tip' => 'Add any custom class you want to apply to the footer. The plugin comes with a class <i>white</i> that marks the text in the footer white. This is useful where the footer background is a dark color.'),
29
  'footer_hook' => array('heading' => 'Footer Action Hook' , 'tip' => 'The hook where the footer widget area is added to the page. This field is only required if the theme does not already provide a suitable widget area where the footer widgets can be added.'),
30
  'footer_remove' => array('heading' => 'Remove Existing Actions?' , 'tip' => 'Click the checkbox to remove any other actions at the above footer hook. This may stop you getting two footers; one created by your theme and another created by this plugin. For some themes you will check this option as you will typically want to replace the theme footer by the plugin footer.'),
31
- 'footer_filter_hook' => array('heading' => 'Footer Filter Hook' , 'tip' => 'If you want to kill off the footer created by your theme, and your theme allows you to filter the content of the footer, then enter the hook where the theme filters the footer. This may stop you getting two footers; one created by your theme and another created by this plugin.')
 
32
  );
33
  private static $tooltips;
34
 
@@ -40,7 +41,7 @@ class FooterCreditsAdmin {
40
  self::$slug = self::$parenthook . '-' . self::SLUG;
41
  add_filter('screen_layout_columns', array(self::CLASSNAME, 'screen_layout_columns'), 10, 2);
42
  add_action('admin_menu',array(self::CLASSNAME, 'admin_menu'));
43
- self::$tooltips = new FooterTooltip(self::$tips);
44
  }
45
 
46
  private static function get_parenthook(){
@@ -51,7 +52,7 @@ class FooterCreditsAdmin {
51
  return self::$version;
52
  }
53
 
54
- private static function get_slug(){
55
  return self::$slug;
56
  }
57
 
@@ -87,20 +88,8 @@ class FooterCreditsAdmin {
87
  self::$screen_id = add_submenu_page(self::get_parenthook(), __('Footer Credits'), __('Footer Credits'), 'manage_options',
88
  self::get_slug(), array(self::CLASSNAME,'settings_panel'));
89
  add_action('load-'.self::get_screen_id(), array(self::CLASSNAME, 'load_page'));
90
- add_action('admin_print_styles-'.self::get_screen_id(), array(self::CLASSNAME, 'enqueue_styles'));
91
  }
92
 
93
- public static function enqueue_styles() {
94
- wp_enqueue_style(self::CODE, plugins_url('styles/footer-credits.css', dirname(__FILE__)), array(),self::get_version());
95
- wp_enqueue_style(self::CODE.'-admin', plugins_url('styles/admin.css', dirname(__FILE__)), array(),self::get_version());
96
- }
97
-
98
- public static function enqueue_scripts() {
99
- wp_enqueue_script('common');
100
- wp_enqueue_script('wp-lists');
101
- wp_enqueue_script('postbox');
102
- add_action('admin_footer-'.self::get_screen_id(), array(self::CLASSNAME, 'toggle_postboxes'));
103
- }
104
 
105
  public static function load_page() {
106
  $message = isset($_POST['options_update']) ? self::save() : '';
@@ -113,7 +102,21 @@ class FooterCreditsAdmin {
113
  add_meta_box(self::CODE.'-return', __('Return To Top',self::DOMAIN), array(self::CLASSNAME, 'return_panel'), self::get_screen_id(), 'normal', 'core', $callback_params);
114
  add_meta_box(self::CODE.'-example', __('Preview Footer',self::DOMAIN), array(self::CLASSNAME, 'preview_panel'), self::get_screen_id(), 'normal', 'core', $callback_params);
115
  add_meta_box(self::CODE.'-advanced', __('Advanced',self::DOMAIN), array(self::CLASSNAME, 'advanced_panel'), self::get_screen_id(), 'normal', 'core', $callback_params);
116
- add_action ('admin_enqueue_scripts',array(self::CLASSNAME, 'enqueue_scripts'));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
117
  }
118
 
119
  public static function save() {
@@ -224,10 +227,12 @@ RETURN_PANEL;
224
  $tip1 = self::$tooltips->tip('footer_hook');
225
  $tip2 = self::$tooltips->tip('footer_remove');
226
  $tip3 = self::$tooltips->tip('footer_filter_hook');
 
227
  $url = 'http://www.diywebmastery.com/footer-credits-compatible-themes-and-hooks';
228
  $footer_remove = $options['footer_remove'] ? 'checked="checked" ' : '';
 
229
  print <<< ADVANCED_PANEL
230
- <p>You can place the Copyright and Trademark widgets in any existing Widget area. However, if your theme does not have a suitably located Widget Area in the footer then you can create one by specifying the hook
231
  where the Widget Area will be located.</p>
232
  <p>You may use a standard WordPress hook like <i>get_footer</i> or <i>wp_footer</i> or choose a hook that is theme-specific such as <i>twentyten_credits</i>,
233
  <i>twentyeleven_credits</i> or <i>twentytwelve_credits</i>. If you using a Genesis child theme and the theme does not have a suitable widget area then use
@@ -237,6 +242,7 @@ the hook <i>genesis_footer</i> or maybe <i>genesis_after</i>. See what looks bes
237
  <p>If your WordPress theme supplies a filter hook rather than an action hook where it generates the footer, and you want to suppress the theme footer,
238
  then specify the hook below. For example, entering <i>genesis_footer_output</i> will suppress the standard Genesis child theme footer.</p>
239
  <label>{$tip3}</label><input type="text" name="footer_filter_hook" size="30" value="{$options['footer_filter_hook']}" /><br/>
 
240
  ADVANCED_PANEL;
241
  }
242
 
@@ -269,17 +275,4 @@ ADVANCED_PANEL;
269
  <?php
270
  }
271
  }
272
-
273
- class FooterTooltip {
274
- const DOMAIN = "FooterCredits";
275
- private $labels = array();
276
- function __construct($labels) {
277
- $this->labels = $labels;
278
- }
279
- function tip($label) {
280
- $heading = array_key_exists($label,$this->labels) ? __($this->labels[$label]['heading'],self::DOMAIN) : '';
281
- $tip = array_key_exists($label,$this->labels) ? __($this->labels[$label]['tip'],self::DOMAIN) : '';
282
- return sprintf('<a href="#" class="tooltip">%1$s<span>%2$s</span></a>',$heading, $tip);
283
- }
284
- }
285
  ?>
12
  private static $initialized = false;
13
  private static $keys = array('owner', 'site', 'address', 'country', 'telephone',
14
  'email', 'courts', 'updated', 'copyright_start_year', 'return_text', 'return_href', 'return_class',
15
+ 'footer_class','footer_hook','footer_remove','footer_filter_hook','enable_html5');
16
  private static $tips = array(
17
  'owner' => array('heading' => 'Owner or Business Name', 'tip' => 'Enter the name of the legal entity that owns and operates the site.'),
18
  'address' => array('heading' => 'Full Address', 'tip' => 'Enter the full address that you want to appear in the footer and the privacy and terms pages.'),
28
  'footer_class' => array('heading' => 'Footer Class' , 'tip' => 'Add any custom class you want to apply to the footer. The plugin comes with a class <i>white</i> that marks the text in the footer white. This is useful where the footer background is a dark color.'),
29
  'footer_hook' => array('heading' => 'Footer Action Hook' , 'tip' => 'The hook where the footer widget area is added to the page. This field is only required if the theme does not already provide a suitable widget area where the footer widgets can be added.'),
30
  'footer_remove' => array('heading' => 'Remove Existing Actions?' , 'tip' => 'Click the checkbox to remove any other actions at the above footer hook. This may stop you getting two footers; one created by your theme and another created by this plugin. For some themes you will check this option as you will typically want to replace the theme footer by the plugin footer.'),
31
+ 'footer_filter_hook' => array('heading' => 'Footer Filter Hook' , 'tip' => 'If you want to kill off the footer created by your theme, and your theme allows you to filter the content of the footer, then enter the hook where the theme filters the footer. This may stop you getting two footers; one created by your theme and another created by this plugin.'),
32
+ 'enable_html5' => array('heading' => 'Enable HTML5' , 'tip' => 'Use the HTML5 &lt;footer&gt; element for the custom footer widget area.')
33
  );
34
  private static $tooltips;
35
 
41
  self::$slug = self::$parenthook . '-' . self::SLUG;
42
  add_filter('screen_layout_columns', array(self::CLASSNAME, 'screen_layout_columns'), 10, 2);
43
  add_action('admin_menu',array(self::CLASSNAME, 'admin_menu'));
44
+ self::$tooltips = new DIYTooltip(self::$tips);
45
  }
46
 
47
  private static function get_parenthook(){
52
  return self::$version;
53
  }
54
 
55
+ public static function get_slug(){
56
  return self::$slug;
57
  }
58
 
88
  self::$screen_id = add_submenu_page(self::get_parenthook(), __('Footer Credits'), __('Footer Credits'), 'manage_options',
89
  self::get_slug(), array(self::CLASSNAME,'settings_panel'));
90
  add_action('load-'.self::get_screen_id(), array(self::CLASSNAME, 'load_page'));
 
91
  }
92
 
 
 
 
 
 
 
 
 
 
 
 
93
 
94
  public static function load_page() {
95
  $message = isset($_POST['options_update']) ? self::save() : '';
102
  add_meta_box(self::CODE.'-return', __('Return To Top',self::DOMAIN), array(self::CLASSNAME, 'return_panel'), self::get_screen_id(), 'normal', 'core', $callback_params);
103
  add_meta_box(self::CODE.'-example', __('Preview Footer',self::DOMAIN), array(self::CLASSNAME, 'preview_panel'), self::get_screen_id(), 'normal', 'core', $callback_params);
104
  add_meta_box(self::CODE.'-advanced', __('Advanced',self::DOMAIN), array(self::CLASSNAME, 'advanced_panel'), self::get_screen_id(), 'normal', 'core', $callback_params);
105
+ add_action('admin_enqueue_scripts', array(self::CLASSNAME, 'enqueue_styles'));
106
+ add_action('admin_enqueue_scripts',array(self::CLASSNAME, 'enqueue_scripts'));
107
+ }
108
+
109
+ public static function enqueue_styles() {
110
+ wp_enqueue_style(self::CODE, plugins_url('styles/footer-credits.css', dirname(__FILE__)), array(),self::get_version());
111
+ wp_enqueue_style(self::CODE.'-admin', plugins_url('styles/admin.css',dirname(__FILE__)), array(),FOOTER_PUTTER_VERSION);
112
+ wp_enqueue_style(self::CODE.'-tooltip', plugins_url('styles/tooltip.css',dirname(__FILE__)), array(),FOOTER_PUTTER_VERSION);
113
+ }
114
+
115
+ public static function enqueue_scripts() {
116
+ wp_enqueue_script('common');
117
+ wp_enqueue_script('wp-lists');
118
+ wp_enqueue_script('postbox');
119
+ add_action('admin_footer-'.self::get_screen_id(), array(self::CLASSNAME, 'toggle_postboxes'));
120
  }
121
 
122
  public static function save() {
227
  $tip1 = self::$tooltips->tip('footer_hook');
228
  $tip2 = self::$tooltips->tip('footer_remove');
229
  $tip3 = self::$tooltips->tip('footer_filter_hook');
230
+ $tip4 = self::$tooltips->tip('enable_html5');
231
  $url = 'http://www.diywebmastery.com/footer-credits-compatible-themes-and-hooks';
232
  $footer_remove = $options['footer_remove'] ? 'checked="checked" ' : '';
233
+ $enable_html5 = $options['enable_html5'] ? 'checked="checked" ' : '';
234
  print <<< ADVANCED_PANEL
235
+ <p>You can place the Copyright and Trademark widgets in any existing widget area. However, if your theme does not have a suitably located widget area in the footer then you can create one by specifying the hook
236
  where the Widget Area will be located.</p>
237
  <p>You may use a standard WordPress hook like <i>get_footer</i> or <i>wp_footer</i> or choose a hook that is theme-specific such as <i>twentyten_credits</i>,
238
  <i>twentyeleven_credits</i> or <i>twentytwelve_credits</i>. If you using a Genesis child theme and the theme does not have a suitable widget area then use
242
  <p>If your WordPress theme supplies a filter hook rather than an action hook where it generates the footer, and you want to suppress the theme footer,
243
  then specify the hook below. For example, entering <i>genesis_footer_output</i> will suppress the standard Genesis child theme footer.</p>
244
  <label>{$tip3}</label><input type="text" name="footer_filter_hook" size="30" value="{$options['footer_filter_hook']}" /><br/>
245
+ <label>{$tip4}</label><input type="checkbox" name="enable_html5" {$enable_html5}value="1" /><br/>
246
  ADVANCED_PANEL;
247
  }
248
 
275
  <?php
276
  }
277
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
278
  ?>
classes/footer-credits.php CHANGED
@@ -2,10 +2,10 @@
2
  class FooterCredits {
3
  const CLASSNAME = 'FooterCredits'; //name of class - must be same as line above - hard code for performance
4
  const DOMAIN = 'FooterCredits'; //text domain for translation
5
- const CODE = 'footer-credits'; //shortcode
6
  const OPTIONS_NAME = 'footer_credits_options';
7
  const SIDEBAR_ID = 'last-footer';
8
- const VERSION = '1.3';
9
  private static $version;
10
  protected static $options = array();
11
  protected static $defaults = array(
@@ -34,7 +34,8 @@ class FooterCredits {
34
  'footer_class' => '',
35
  'footer_hook' => '',
36
  'footer_remove' => true,
37
- 'footer_filter_hook' => ''
 
38
  );
39
 
40
  private static function get_version(){
@@ -80,14 +81,16 @@ class FooterCredits {
80
  }
81
 
82
  static function register_sidebars() {
83
- if (self::get_option('footer_hook'))
 
84
  register_sidebar( array(
85
  'id' => self::SIDEBAR_ID,
86
- 'name' => __( 'Custom Footer Widget Area', self::CLASSNAME ),
87
  'description' => __( 'Custom footer section for copyright, trademarks, etc', self::CLASSNAME),
88
- 'before_widget' => '<div id="%1$s" class="widget %2$s"><div class="widget-wrap">',
89
- 'after_widget' => '</div></div>'
90
  ) );
 
91
  }
92
 
93
  static function register_widgets() {
@@ -264,9 +267,15 @@ class FooterCredits {
264
 
265
  static function custom_footer() {
266
  if ( is_active_sidebar( self::SIDEBAR_ID) ) {
267
- echo '<div class="custom-footer">';
268
- dynamic_sidebar( self::SIDEBAR_ID );
269
- echo '</div><!-- end .custom-footer -->';
 
 
 
 
 
 
270
  }
271
  }
272
 
@@ -306,6 +315,7 @@ class FooterCredits {
306
  case 'genesis':
307
  self::$defaults['footer_hook'] = 'genesis_footer';
308
  self::$defaults['footer_filter_hook'] = 'genesis_footer_output';
 
309
  break;
310
  case 'graphene':
311
  self::$defaults['footer_hook'] = 'graphene_footer'; break;
@@ -403,5 +413,4 @@ class Footer_Putter_Copyright_Widget extends WP_Widget {
403
  <input id="<?php echo $this->get_field_id('footer_class'); ?>" name="<?php echo $this->get_field_name('footer_class'); ?>" type="text" value="<?php echo $footer_class; ?>" size="10" />
404
  <?php
405
  }
406
- }
407
- FooterCredits::init();
2
  class FooterCredits {
3
  const CLASSNAME = 'FooterCredits'; //name of class - must be same as line above - hard code for performance
4
  const DOMAIN = 'FooterCredits'; //text domain for translation
5
+ const CODE = 'footer-credits'; //element prefix
6
  const OPTIONS_NAME = 'footer_credits_options';
7
  const SIDEBAR_ID = 'last-footer';
8
+ const VERSION = '1.4';
9
  private static $version;
10
  protected static $options = array();
11
  protected static $defaults = array(
34
  'footer_class' => '',
35
  'footer_hook' => '',
36
  'footer_remove' => true,
37
+ 'footer_filter_hook' => '',
38
+ 'enable_html5' => false
39
  );
40
 
41
  private static function get_version(){
81
  }
82
 
83
  static function register_sidebars() {
84
+ if (self::get_option('footer_hook')) {
85
+ $tag = self::get_option('enable_html5') ? 'section' : 'div';
86
  register_sidebar( array(
87
  'id' => self::SIDEBAR_ID,
88
+ 'name' => __( 'Credibility Footer', self::CLASSNAME ),
89
  'description' => __( 'Custom footer section for copyright, trademarks, etc', self::CLASSNAME),
90
+ 'before_widget' => '<'.$tag.' id="%1$s" class="widget %2$s"><div class="widget-wrap">',
91
+ 'after_widget' => '</div></'.$tag.'>'
92
  ) );
93
+ }
94
  }
95
 
96
  static function register_widgets() {
267
 
268
  static function custom_footer() {
269
  if ( is_active_sidebar( self::SIDEBAR_ID) ) {
270
+ if (self::get_option('enable_html5')) {
271
+ echo '<footer class="custom-footer" role="contentinfo" itemscope="" itemtype="http://schema.org/WPFooter">';
272
+ dynamic_sidebar( self::SIDEBAR_ID );
273
+ echo '</footer><!-- end .custom-footer -->';
274
+ } else {
275
+ echo '<div class="custom-footer">';
276
+ dynamic_sidebar( self::SIDEBAR_ID );
277
+ echo '</div><!-- end .custom-footer -->';
278
+ }
279
  }
280
  }
281
 
315
  case 'genesis':
316
  self::$defaults['footer_hook'] = 'genesis_footer';
317
  self::$defaults['footer_filter_hook'] = 'genesis_footer_output';
318
+ self::$defaults['enable_html5'] = function_exists('genesis_html5') && genesis_html5();
319
  break;
320
  case 'graphene':
321
  self::$defaults['footer_hook'] = 'graphene_footer'; break;
413
  <input id="<?php echo $this->get_field_id('footer_class'); ?>" name="<?php echo $this->get_field_name('footer_class'); ?>" type="text" value="<?php echo $footer_class; ?>" size="10" />
414
  <?php
415
  }
416
+ }
 
classes/footer-trademarks-admin.php CHANGED
@@ -7,6 +7,7 @@ class FooterTrademarksAdmin {
7
  const FIELDNAME = 'not_on_404';
8
 
9
  private static $initialized = false;
 
10
  private static $parenthook;
11
  private static $slug;
12
  private static $screen_id;
@@ -14,6 +15,7 @@ class FooterTrademarksAdmin {
14
  public static function init($parent) {
15
  if (self::$initialized) return true;
16
  self::$initialized = true;
 
17
  self::$parenthook = $parent;
18
  self::$slug = self::$parenthook . '-' . self::SLUG;
19
  self::$screen_id = self::$parenthook.'_page_' . self::$slug;
@@ -21,6 +23,10 @@ class FooterTrademarksAdmin {
21
  add_action('admin_menu',array(self::CLASSNAME, 'admin_menu'));
22
  }
23
 
 
 
 
 
24
  private static function get_parenthook(){
25
  return self::$parenthook;
26
  }
@@ -60,7 +66,7 @@ class FooterTrademarksAdmin {
60
  }
61
 
62
  public static function enqueue_styles() {
63
- wp_enqueue_style(self::CODE.'-admin', plugins_url('styles/admin.css', dirname(__FILE__)), array(),GENESIS_CLUB_VERSION);
64
  }
65
 
66
  public static function settings_panel() {
@@ -69,7 +75,7 @@ class FooterTrademarksAdmin {
69
  $screenshot2 = plugins_url('images/add-link-category.jpg',dirname(__FILE__));
70
  $screenshot3 = plugins_url('images/add-link.jpg',dirname(__FILE__));
71
  $linkcat = admin_url('edit-tags.php?taxonomy=link_category');
72
- $linkcat = admin_url('link-add.php');
73
  $widgets = admin_url('widgets.php');
74
  ?>
75
  <div class="wrap">
7
  const FIELDNAME = 'not_on_404';
8
 
9
  private static $initialized = false;
10
+ private static $version;
11
  private static $parenthook;
12
  private static $slug;
13
  private static $screen_id;
15
  public static function init($parent) {
16
  if (self::$initialized) return true;
17
  self::$initialized = true;
18
+ self::$version = FooterCredits::VERSION;
19
  self::$parenthook = $parent;
20
  self::$slug = self::$parenthook . '-' . self::SLUG;
21
  self::$screen_id = self::$parenthook.'_page_' . self::$slug;
23
  add_action('admin_menu',array(self::CLASSNAME, 'admin_menu'));
24
  }
25
 
26
+ private static function get_version(){
27
+ return self::$version;
28
+ }
29
+
30
  private static function get_parenthook(){
31
  return self::$parenthook;
32
  }
66
  }
67
 
68
  public static function enqueue_styles() {
69
+ wp_enqueue_style(self::CODE.'-admin', plugins_url('styles/admin.css', dirname(__FILE__)), array(),self::get_version());
70
  }
71
 
72
  public static function settings_panel() {
75
  $screenshot2 = plugins_url('images/add-link-category.jpg',dirname(__FILE__));
76
  $screenshot3 = plugins_url('images/add-link.jpg',dirname(__FILE__));
77
  $linkcat = admin_url('edit-tags.php?taxonomy=link_category');
78
+ $addlink = admin_url('link-add.php');
79
  $widgets = admin_url('widgets.php');
80
  ?>
81
  <div class="wrap">
classes/tooltip.php ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if (!class_exists('DIYTooltip')) {
3
+ class DIYTooltip {
4
+ const DOMAIN = 'diytooltip';
5
+ private $labels = array();
6
+ private $tabindex;
7
+ function __construct($labels) {
8
+ $this->labels = $labels;
9
+ $this->tabindex = 100;
10
+ }
11
+
12
+ function heading($label) {
13
+ return array_key_exists($label,$this->labels) ? __($this->labels[$label]['heading'],self::DOMAIN) : '';
14
+ }
15
+
16
+ function text($label) {
17
+ return array_key_exists($label,$this->labels) ? __($this->labels[$label]['tip'],self::DOMAIN) : '';
18
+ }
19
+
20
+ function label($label, $text_only=false) {
21
+ return $text_only ? $this->heading($label) : $this->tip($label);
22
+ }
23
+
24
+ function tip($label) {
25
+ $heading = $this->heading($label);
26
+ return $heading ? sprintf('<a href="#" class="diytooltip" tabindex="%3$s">%1$s<span>%2$s</span></a>',
27
+ $heading, $this->text($label), $this->tabindex++) : '';
28
+ }
29
+ }
30
+ }
31
+ ?>
main.php CHANGED
@@ -3,25 +3,33 @@
3
  * Plugin Name: Footer Putter
4
  * Plugin URI: http://www.diywebmastery.com/plugins/footer-putter/
5
  * Description: Put a footer on your site that boosts your credibility with both search engines and human visitors.
6
- * Version: 1.3
7
  * Author: Russell Jamieson
8
  * Author URI: http://www.diywebmastery.com/about/
9
  * License: GPLv2+
10
  * License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
  */
12
- define('FOOTER_PUTTER_VERSION','1.3');
13
  define('FOOTER_PUTTER_FRIENDLY_NAME', 'Footer Putter') ;
14
- define('FOOTER_PUTTER_PLUGIN_NAME', 'footer-putter') ;
15
  define('FOOTER_PUTTER_HOME_URL','http://www.diywebmastery.com/plugins/footer-putter/');
16
- define('FOOTER_CREDITS','FooterCredits');
17
  $dir = dirname(__FILE__) . '/classes/';
18
  require_once($dir . 'footer-credits.php');
19
  require_once($dir . 'footer-trademarks.php');
20
  if (is_admin()) {
 
21
  require_once($dir . 'admin.php');
22
  require_once($dir . 'footer-credits-admin.php');
23
  require_once($dir . 'footer-trademarks-admin.php');
24
- FooterCreditsAdmin::init(FOOTER_PUTTER_PLUGIN_NAME);
25
- FooterTrademarksAdmin::init(FOOTER_PUTTER_PLUGIN_NAME);
26
  }
 
 
 
 
 
 
 
 
 
 
27
  ?>
3
  * Plugin Name: Footer Putter
4
  * Plugin URI: http://www.diywebmastery.com/plugins/footer-putter/
5
  * Description: Put a footer on your site that boosts your credibility with both search engines and human visitors.
6
+ * Version: 1.4
7
  * Author: Russell Jamieson
8
  * Author URI: http://www.diywebmastery.com/about/
9
  * License: GPLv2+
10
  * License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
  */
12
+ define('FOOTER_PUTTER_VERSION','1.4');
13
  define('FOOTER_PUTTER_FRIENDLY_NAME', 'Footer Putter') ;
14
+ define('FOOTER_PUTTER_PLUGIN_NAME', plugin_basename(__DIR__)) ;
15
  define('FOOTER_PUTTER_HOME_URL','http://www.diywebmastery.com/plugins/footer-putter/');
 
16
  $dir = dirname(__FILE__) . '/classes/';
17
  require_once($dir . 'footer-credits.php');
18
  require_once($dir . 'footer-trademarks.php');
19
  if (is_admin()) {
20
+ require_once($dir . 'tooltip.php');
21
  require_once($dir . 'admin.php');
22
  require_once($dir . 'footer-credits-admin.php');
23
  require_once($dir . 'footer-trademarks-admin.php');
 
 
24
  }
25
+
26
+ function footer_putter_init() {
27
+ FooterCredits::init();
28
+ if (is_admin()) {
29
+ FooterPutterAdmin::init(FOOTER_PUTTER_PLUGIN_NAME);
30
+ FooterCreditsAdmin::init(FOOTER_PUTTER_PLUGIN_NAME);
31
+ FooterTrademarksAdmin::init(FOOTER_PUTTER_PLUGIN_NAME);
32
+ }
33
+ }
34
+ add_action ('init', 'footer_putter_init',0); //run before widget init
35
  ?>
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: powerblogservice, diywebmastery
3
  Donate link: http://www.diywebmastery.com/donate/
4
  Tags: footer, copyright, rel=nofollow
5
  Requires at least: 3.0
6
- Tested up to: 3.5
7
- Stable tag: 1.3
8
  License: GPLv2+
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -21,6 +21,7 @@ Put a footer on your site that boosts your credibility with both search engines
21
  * Supports both a single line centred footer and a multi-line right aligned footer
22
  * The Footer hook setting allows you to add the footer in just the right place on themes that do not have suitable widget areas
23
  * Ensures all links in the footer widgets are rel=nofollow in line with best SEO recommendations
 
24
 
25
  == Installation ==
26
 
@@ -37,6 +38,7 @@ Put a footer on your site that boosts your credibility with both search engines
37
 
38
  == Changelog ==
39
 
 
40
  = 1.3 = Pre-configure according to the WordPress theme
41
  = 1.2 = Fix display of telephone number
42
  = 1.1 = Fix link in admin.php from screenshot1.jpg to screenshot-1.jpg
@@ -44,8 +46,8 @@ Put a footer on your site that boosts your credibility with both search engines
44
 
45
  == Upgrade Notice ==
46
 
47
- = 1.3 =
48
- * Optional - Pre-configure settings to make it work with more themes out of the box.
49
 
50
  == Links ==
51
 
3
  Donate link: http://www.diywebmastery.com/donate/
4
  Tags: footer, copyright, rel=nofollow
5
  Requires at least: 3.0
6
+ Tested up to: 3.5.2
7
+ Stable tag: 1.4
8
  License: GPLv2+
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
21
  * Supports both a single line centred footer and a multi-line right aligned footer
22
  * The Footer hook setting allows you to add the footer in just the right place on themes that do not have suitable widget areas
23
  * Ensures all links in the footer widgets are rel=nofollow in line with best SEO recommendations
24
+ * HTML5 support
25
 
26
  == Installation ==
27
 
38
 
39
  == Changelog ==
40
 
41
+ = 1.4 = Added support for HTML5 themes
42
  = 1.3 = Pre-configure according to the WordPress theme
43
  = 1.2 = Fix display of telephone number
44
  = 1.1 = Fix link in admin.php from screenshot1.jpg to screenshot-1.jpg
46
 
47
  == Upgrade Notice ==
48
 
49
+ = 1.4 =
50
+ * Optional - Add HTML5 support.
51
 
52
  == Links ==
53
 
styles/admin.css CHANGED
@@ -1,33 +1,10 @@
1
  div.icon32 { background-image : url(../images/icon-32.png); background-repeat: no-repeat;}
2
  #poststuff { margin-right: 20px; }
 
 
3
  #poststuff input.error, #poststuff select.error { border: 1px solid red; background-color : #FEE; }
4
  #poststuff div#message { margin-left: 10px; display: inline; padding: 10px; }
5
  #poststuff div#message div.updated { margin-left: 30px; padding: 8px; display: inline; }
6
- #poststuff label { display: inline-block; min-width: 200px; margin-right: 10px;}
7
-
8
  .trademark { vertical-align: top; border: 1px dashed whitesmoke; }
9
- .trademark:hover { cursor: move; }
10
-
11
- /* tooltips */
12
- .tooltip {position: relative; cursor: help; display: inline-block; text-decoration: none;
13
- color: #222; outline: none; }
14
- .tooltip span { visibility: hidden; position: absolute; bottom: 25px; left: 50%;
15
- z-index: 999; width: 250px;margin-left: -27px; padding: 10px;border: 2px solid #ccc;
16
- opacity: .9;background-color: #ddd;
17
- background-image: -webkit-linear-gradient(rgba(255,255,255,.5), rgba(255,255,255,0));
18
- background-image: -moz-linear-gradient(rgba(255,255,255,.5), rgba(255,255,255,0));
19
- background-image: -ms-linear-gradient(rgba(255,255,255,.5), rgba(255,255,255,0));
20
- background-image: -o-linear-gradient(rgba(255,255,255,.5), rgba(255,255,255,0));
21
- background-image: linear-gradient(rgba(255,255,255,.5), rgba(255,255,255,0));
22
- -moz-border-radius: 4px;border-radius: 4px;
23
- -moz-box-shadow: 0 1px 2px rgba(0,0,0,.4), 0 1px 0 rgba(255,255,255,.5) inset;
24
- -webkit-box-shadow: 0 1px 2px rgba(0,0,0,.4), 0 1px 0 rgba(255,255,255,.5) inset;
25
- box-shadow: 0 1px 2px rgba(0,0,0,.4), 0 1px 0 rgba(255,255,255,.5) inset;
26
- text-shadow: 0 1px 0 rgba(255,255,255,.4);
27
- }
28
- .tooltip:hover { border: 0; /* IE6 fix */ }
29
- .tooltip:hover span { visibility: visible;}
30
- .tooltip span:before,
31
- .tooltip span:after { content: ""; position: absolute; z-index: 1000; bottom: -7px; left: 5%;margin-left: 8px;
32
- border-top: 8px solid #ddd;border-left: 8px solid transparent;border-right: 8px solid transparent;border-bottom: 0; }
33
- .tooltip span:before {border-top-color: #ccc;bottom: -8px;}
1
  div.icon32 { background-image : url(../images/icon-32.png); background-repeat: no-repeat;}
2
  #poststuff { margin-right: 20px; }
3
+ #poststuff img { max-width : 100%; }
4
+ #poststuff input[type=checkbox] { margin-left: 4px; }
5
  #poststuff input.error, #poststuff select.error { border: 1px solid red; background-color : #FEE; }
6
  #poststuff div#message { margin-left: 10px; display: inline; padding: 10px; }
7
  #poststuff div#message div.updated { margin-left: 30px; padding: 8px; display: inline; }
8
+ #poststuff label { display: inline-block; min-width: 150px; margin-right: 10px;}
 
9
  .trademark { vertical-align: top; border: 1px dashed whitesmoke; }
10
+ .trademark:hover { cursor: move; }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
styles/footer-credits.css CHANGED
@@ -17,8 +17,6 @@
17
  #footer-credits.dark, #footer-credits.dark a, .dark a , .dark a:visited { color : #222222; }
18
  #footer-credits.light, #footer-credits.light a, .light a, .light a:visited { color : #DDDDDD; }
19
  #footer-credits.white, #footer-credits.white a, .white a, .white a:visited { color : white; }
20
-
21
  .widget_footer_trademarks { text-align: center; margin: 10px 0;}
22
  .widget_footer_trademarks a { margin: 10px; }
23
- .widget_footer_trademarks img { border: 0 !important; }
24
-
17
  #footer-credits.dark, #footer-credits.dark a, .dark a , .dark a:visited { color : #222222; }
18
  #footer-credits.light, #footer-credits.light a, .light a, .light a:visited { color : #DDDDDD; }
19
  #footer-credits.white, #footer-credits.white a, .white a, .white a:visited { color : white; }
 
20
  .widget_footer_trademarks { text-align: center; margin: 10px 0;}
21
  .widget_footer_trademarks a { margin: 10px; }
22
+ .widget_footer_trademarks img { border: 0 !important; }
 
styles/tooltip.css ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .diytooltip {position: relative; cursor: help; display: inline-block; text-decoration: none; color: #222; outline: none; }
2
+ .diytooltip span { visibility: hidden; position: absolute; bottom: 30px; left: 50%;
3
+ z-index: 999; width: 230px;margin-left: -17px; padding: 10px;border: 2px solid #ccc;
4
+ opacity: .9;background-color: #ddd;
5
+ background-image: -webkit-linear-gradient(rgba(255,255,255,.5), rgba(255,255,255,0));
6
+ background-image: -moz-linear-gradient(rgba(255,255,255,.5), rgba(255,255,255,0));
7
+ background-image: -ms-linear-gradient(rgba(255,255,255,.5), rgba(255,255,255,0));
8
+ background-image: -o-linear-gradient(rgba(255,255,255,.5), rgba(255,255,255,0));
9
+ background-image: linear-gradient(rgba(255,255,255,.5), rgba(255,255,255,0));
10
+ -moz-border-radius: 4px;border-radius: 4px;
11
+ -moz-box-shadow: 0 1px 2px rgba(0,0,0,.4), 0 1px 0 rgba(255,255,255,.5) inset;
12
+ -webkit-box-shadow: 0 1px 2px rgba(0,0,0,.4), 0 1px 0 rgba(255,255,255,.5) inset;
13
+ box-shadow: 0 1px 2px rgba(0,0,0,.4), 0 1px 0 rgba(255,255,255,.5) inset;
14
+ text-shadow: 0 1px 0 rgba(255,255,255,.4);
15
+ }
16
+ .diytooltip:hover { border: 0; /* IE6 fix */ }
17
+ .diytooltip:hover span { visibility: visible;}
18
+ .diytooltip span:before, .diytooltip span:after {
19
+ content: ""; position: absolute; z-index: 1000; bottom: -7px; left: 50%;margin-left: 8px;
20
+ border-top: 8px solid #ddd;border-left: 8px solid transparent;border-right: 8px solid transparent;border-bottom: 0; }
21
+ .diytooltip span:before {border-top-color: #ccc;bottom: -8px;}