function __construct(&$owner) { parent::__construct($owner, get_class($this), __('Teaser Settings', XF_TEXTDOMAIN)); $this->options[] = new xtreme_option_select_optgroup($this, false, 'subcolumns', __('Layout:', XF_TEXTDOMAIN), 0, xtreme_get_subcolumns_array(), __('Columns', XF_TEXTDOMAIN)); for ($i = 1; $i <= 5; $i++) { $this->options[] = new xtreme_option_select_pair($this, false, 'txtalign_' . $i, sprintf(__('Area %d Textalignment (from left to right):', XF_TEXTDOMAIN), $i), 'left', xtreme_left_center_right()); } $this->options[] = new xtreme_option_select($this, false, 'tag_before_widget', __('Tag before Widget:', XF_TEXTDOMAIN), 'div', array('ul', 'div')); $this->options[] = new xtreme_option_select($this, false, 'tag_before_title', __('Tag before Title:', XF_TEXTDOMAIN), 'h5', array('h3', 'h4', 'h5', 'h6', 'div')); $this->options[] = new xtreme_option_bool($this, false, 'syncheight', __('Use Syncheight Script:', XF_TEXTDOMAIN), false); $this->options[] = new xtreme_option_select($this, false, 'html5_tag', __('HTML5 Tag:', XF_TEXTDOMAIN), 'section', xtreme_html5_tags()); }
function xtreme_register_dynamic_sidebars() { $containers = array('teaser' => false, 'footer' => false); $layouts = get_option(XF_LAYOUTS); $html5 = xtreme_is_html5(); if (!$html5) { $el = 'div'; } else { $el = 'section'; } if (current_theme_supports('xtreme-image-header-area')) { register_sidebar(array('name' => __('Image Header Area', XF_TEXTDOMAIN), 'id' => 'image-header-area', 'description' => __('Additional Header Widget Area to be used primary with "Xtreme Media Flex Slider" for Image Headers', XF_TEXTDOMAIN), 'before_widget' => '<div id="%1$s" class="widget %2$s ym-cbox">', 'after_widget' => '</div>', 'before_title' => '<h3 class="widget-title">', 'after_title' => '</h3>')); } foreach ((array) $layouts as $layout) { if (!is_array($layouts)) { return; } if ($layout['use_teaser']['value'] === true) { $containers['teaser'] = true; } if ($layout['use_footer']['value'] === true) { $containers['footer'] = true; } } $options = get_option(XF_OPTIONS); foreach ($containers as $container => $value) { if ($value === true) { $need = (int) $options['xc_' . $container]['subcolumns']['value']; if (!$html5) { $tag_before_widget = $options['xc_' . $container]['tag_before_widget']['value']; } else { $tag_before_widget = 'section'; } $tag_title = $options['xc_' . $container]['tag_before_title']['value']; $tag_next = ""; $tag_next_end = ""; if ($tag_before_widget == 'ul') { $tag_next = '<li>'; $tag_next_end = '</li>'; } $subcols = xtreme_get_subcolumns_array(); $count = $subcols[$need]['group']; for ($i = 1; $i <= $count; $i++) { $wid = $container . '-widget-area-' . $i; register_sidebar(array('name' => sprintf('%s Widget Area %s', ucfirst($container), $i), 'id' => $wid, 'description' => sprintf(__('The %s widget area %s', XF_TEXTDOMAIN), $container, $i), 'before_widget' => '<' . $tag_before_widget . ' id="%1$s" class="widget %2$s ym-cbox">' . $tag_next, 'after_widget' => $tag_next_end . '</' . $tag_before_widget . '>', 'before_title' => '<' . $tag_title . ' class="widget-title">', 'after_title' => '</' . $tag_title . '>')); } } } foreach (array('header', 'siteinfo') as $box) { if ((int) $options['xc_' . $box]['columns']['value'] === 1 && (int) $options['xc_' . $box]['widget_area']['value'] === 1) { register_sidebar(array('name' => sprintf(__('%s Column 1', XF_TEXTDOMAIN), ucfirst($box)), 'id' => $box . '-col1', 'description' => sprintf(__('%1s in your %2s.', XF_TEXTDOMAIN), __('Column 1', XF_TEXTDOMAIN), $box), 'before_widget' => '<' . $el . ' id="%1$s" class="widget %2$s ym-cbox">', 'after_widget' => '</' . $el . '>', 'before_title' => '<h4 class="widget-title">', 'after_title' => '</h4>')); } } register_sidebar(array('name' => __('Widgetized Homepage', XF_TEXTDOMAIN), 'id' => 'widgetized-homepage', 'description' => __('Widget area on the Widgetized Homepage Template', XF_TEXTDOMAIN), 'before_widget' => '<' . $el . ' id="%1$s" class="widget %2$s ym-cbox">', 'after_widget' => '</' . $el . '>', 'before_title' => '<h3 class="widget-title">', 'after_title' => '</h3>')); if (!$html5) { $t = xtreme_get_sidebar_tag(); if ($t === 'ul') { $elem = 'li'; $sb3 = 'div'; } else { $elem = 'div'; $sb3 = 'div'; } } else { $elem = 'section'; $sb3 = 'section'; } register_sidebar(array('name' => __('Sidebar One', XF_TEXTDOMAIN), 'id' => 'sidebar-one', 'description' => __('Sidebar One', XF_TEXTDOMAIN), 'before_widget' => '<' . $elem . ' id="%1$s" class="widget %2$s ym-cbox">', 'after_widget' => '</' . $elem . '>', 'before_title' => '<' . xtreme_get_sidebar_headline_tag() . ' class="widget-title">', 'after_title' => '</' . xtreme_get_sidebar_headline_tag() . '>')); register_sidebar(array('name' => __('Sidebar Two', XF_TEXTDOMAIN), 'id' => 'sidebar-two', 'description' => __('Sidebar Two', XF_TEXTDOMAIN), 'before_widget' => '<' . $elem . ' id="%1$s" class="widget %2$s ym-cbox">', 'after_widget' => '</' . $elem . '>', 'before_title' => '<' . xtreme_get_sidebar_headline_tag() . ' class="widget-title">', 'after_title' => '</' . xtreme_get_sidebar_headline_tag() . '>')); register_sidebar(array('name' => __('Sidebar Three Top', XF_TEXTDOMAIN), 'id' => 'sidebar-three-top', 'description' => __('Sidebar Three Top', XF_TEXTDOMAIN), 'before_widget' => '<' . $sb3 . ' id="%1$s" class="widget %2$s ym-cbox">', 'after_widget' => '</' . $sb3 . '>', 'before_title' => '<' . xtreme_get_sidebar_headline_tag() . ' class="widget-title">', 'after_title' => '</' . xtreme_get_sidebar_headline_tag() . '>')); register_sidebar(array('name' => __('Sidebar Three Bottom Left', XF_TEXTDOMAIN), 'id' => 'sidebar-three-bottom-left', 'description' => __('Sidebar Three Bottom Left', XF_TEXTDOMAIN), 'before_widget' => '<' . $sb3 . ' id="%1$s" class="widget %2$s ym-cbox">', 'after_widget' => '</' . $sb3 . '>', 'before_title' => '<' . xtreme_get_sidebar_headline_tag() . ' class="widget-title">', 'after_title' => '</' . xtreme_get_sidebar_headline_tag() . '>')); register_sidebar(array('name' => __('Sidebar Three Bottom Right', XF_TEXTDOMAIN), 'id' => 'sidebar-three-bottom-right', 'description' => __('Sidebar Three Bottom Right', XF_TEXTDOMAIN), 'before_widget' => '<' . $sb3 . ' id="%1$s" class="widget %2$s ym-cbox">', 'after_widget' => '</' . $sb3 . '>', 'before_title' => '<' . xtreme_get_sidebar_headline_tag() . ' class="widget-title">', 'after_title' => '</' . xtreme_get_sidebar_headline_tag() . '>')); do_action('xtreme_childtheme_sidebars'); }