'; if ($url) echo $eol.$tab.''; echo $eol.$tab.'

'.$plugin_name.' '.__('Settings').'

'.$eol; } static function open_form($action) { $eol = "\r\n"; echo $eol.'
'.$eol; } static function close_page() { $eol = "\r\n"; $tab = "\t"; echo $eol.$tab.'
'.$eol.''.$eol; } /** * * Building the menu for the tabs * */ static function nav_menu($args) { $eol = "\r\n"; $tab = "\t"; extract ($args); echo ''.$eol; } /** * * Opening and closing the tabs, columns etc. * */ static function open_tab($columns = false) { $eol = "\r\n"; $n = ($columns) ? '-'.$columns : ''; $columns = ($columns) ? ' columns-'.$columns : ''; echo $eol.'
'.$eol.'
'.$eol.'
'; } static function close_tab() { $eol = "\r\n"; echo $eol.'
'.$eol.'
'.$eol.'
'.$eol; } /** * * Wrapping sections into postboxes * */ static function postbox($label, $id, $sections ) { if (!is_array($sections)) $sections = array($sections); $postbox = self::open_postbox($label, $id); ob_start(); foreach ($sections as $section) do_settings_sections($section); $postbox .= ob_get_contents(); ob_end_clean(); $postbox .= self::close_postbox(); return $postbox; } /** * * Opening and closing the postboxes * */ static function open_postbox($label, $id, $closed = false) { $eol = "\r\n"; $tab = "\t"; $dtab = $tab.$tab; $class = (false === $closed) ? '' : ' closed'; $output = $eol.'
'.$eol.$tab.'
'.$eol.$dtab.'
'.$eol.$tab.'
'.$eol.$tab; $output .= $eol.'

'.$eol.$dtab.''.$label.''.$eol.$tab.'

'.$eol.$tab.'
'.$eol.$tab; return $output; } static function close_postbox() { $eol = "\r\n"; return $eol.'
'.$eol.'
'; } /** * * Wrapping postboxes into sortables * */ static function sortable($id, $postboxes) { if (!is_array($postboxes)) $postboxes = array($postboxes); $sortable = self::open_sortable($id); foreach ($postboxes as $postbox) : $sortable .= $postbox; endforeach; $sortable .= self::close_sortable(); echo $sortable; } /** * * Opening and closing the postboxes * */ static function open_sortable($id) { $eol = "\r\n"; $tab = "\t"; $output = $eol.'
'.$eol.$tab; return $output; } static function close_sortable() { return "\r\n
"; } /** * * Changing to the next column * */ static function column($n) { $eol = "\r\n"; echo $eol.''.$eol.'
'; } /** * * Wrapping sections in containers * */ static function wrap_section($section_id, $atts = false) { $eol = "\r\n"; $tab = "\t"; $attributes = ''; if (false !== $atts) : foreach ($atts as $attribute => $value) $attributes .= ' '.$attribute.'="'.$value.'"'; endif; echo $eol.''.$eol.$tab; do_settings_sections($section_id); echo $eol.'
'.$eol; } /** * * Wrapping elements into html tags * */ static function tag_it($element, $tag, $indent = false, $atts = false, $echo = false) { $eol = "\r\n"; $tab = "\t"; $attributes = ''; if (false !== $atts) : foreach ($atts as $attribute => $value) $attributes .= ' '.$attribute.'="'.$value.'"'; endif; $item = $eol; if (false != $indent) : for ($i = 0; $i <= $indent; $i++) $item .= $tab; endif; $item .= '<'.$tag.$attributes.'>'.$element.''; if (false === $echo) return $item; echo $item; } /** * * Wrapping fields in unordered lists * * uses tag_it function * */ static function list_it($fields, $header = false, $atts = false, $list_atts = false, $echo = true) { $eol = "\r\n"; $list = ''; $list_items = ''; if (false != $header) $list .= $header.$eol; foreach ($fields as $field) $list_items .= self::tag_it($field, 'li', 1, $list_atts); $list .= self::tag_it($list_items, 'ul', $atts); if (false === $echo) return $list; echo $list; } /** * * Putting the clear both div * * uses tag_it function * */ static function clear_it($echo = true) { $clear_both = self::tag_it('', 'div', false, array('style' => 'clear: both;')); if (false === $echo) return $clear_both; echo $clear_both; } /** * * Output options for debugging * */ static function debug_info($options, $label) { $postbox = self::open_postbox($label, 'debug-info', true); ob_start(); var_dump($options); $options = ob_get_contents(); ob_end_clean(); $postbox .= self::tag_it($options, 'pre', 1); $postbox .= self::close_postbox(); return $postbox; } /** * * Output help box * */ static function help_box($text, $label) { $eol = "\r\n"; $tab = "\t"; $postbox = self::open_postbox($label, sanitize_key($label)); $postbox .= $text; $postbox .= self::close_postbox(); return $postbox; } /** * * Output donation box * */ static function donation_box($text, $label, $paypal = false, $flattr = false) { $eol = "\r\n"; $tab = "\t"; $postbox = self::open_postbox($label, 'donations'); $postbox .= $text; if ($paypal) : $postbox .= '
'.$eol.$tab.''.$eol.$tab; $postbox .= ''.$eol.$tab; $postbox .= ''.$eol.$tab; $postbox .= ''.$eol.$tab.'
'.$eol.$tab; endif; if ($flattr) : $postbox .= $eol.$tab.''.$eol.$tab; $postbox .= 'Flattr this'.$eol.$tab; endif; $postbox .= self::close_postbox(); return $postbox; } } // A5_OptionPage ?>