?> <span id="removing-widget"><?php _ex('Deactivate', 'removing-widget'); ?> <span></span></span></h3> </div> <div class="widget-holder"> <div class="sidebar-description"> <p class="description"><?php _e('To activate a widget drag it to a sidebar or click on it. To deactivate a widget and delete its settings, drag it back.'); ?> </p> </div> <div id="widget-list"> <?php wp_list_widgets(); ?> </div> <br class='clear' /> </div> <br class="clear" /> </div> <?php $theme_sidebars = array(); foreach ($wp_registered_sidebars as $sidebar => $registered_sidebar) { if (false !== strpos($registered_sidebar['class'], 'inactive-sidebar') || 'orphaned_widgets' == substr($sidebar, 0, 16)) { $wrap_class = 'widgets-holder-wrap'; if (!empty($registered_sidebar['class'])) { $wrap_class .= ' ' . $registered_sidebar['class']; }
function bizzthemes_layout() { global $wpdb, $wp_version, $wp_registered_widget_updates, $wp_registered_sidebars, $wp_registered_widgets, $bizz_package, $sidebars_widgets; // Permissions Check if (!current_user_can('edit_theme_options')) { wp_die(__('Cheatin’ uh?', 'bizzthemes')); } // WordPress Administration Widgets API load_template(ABSPATH . 'wp-admin/includes/widgets.php'); // These are the widgets grouped by sidebar /* $sidebars_widgets = wp_get_sidebars_widgets(); if ( empty( $sidebars_widgets ) ) $sidebars_widgets = wp_get_widget_defaults(); */ // Show inactive widgets $user = get_current_user_id(); $screenopt = get_user_meta($user, 'templates_screen_options', true); // Mobile if (wp_is_mobile()) { wp_enqueue_script('jquery-touch-punch'); } // Do sidebar action do_action('sidebar_admin_setup'); // options header bizzthemes_options_header($options_title = __('Template Builder', 'bizzthemes'), $toggle = false); if (isset($messages)) { foreach ($messages as $message) { echo $message . "\n"; } } // register the inactive_widgets area as sidebar register_sidebar(array('name' => __('Inactive Widgets', 'bizzthemes'), 'id' => 'wp_inactive_widgets', 'class' => 'inactive-sidebar', 'description' => __('Drag widgets here to remove them from the sidebar but keep their settings.', 'bizzthemes'), 'before_widget' => '', 'after_widget' => '', 'before_title' => '', 'after_title' => '', 'grid' => '')); if (function_exists('retrieve_widgets')) { retrieve_widgets(); } do_action('widgets_admin_page'); ?> <div class="manage-templates manage-menus<?php if (!isset($_REQUEST['tab'])) { echo ' disabled'; } ?> "> <div class="label-templates"><?php _e('Select a template to edit:', 'bizzthemes'); ?> </div> <div class="select-templates"> <a href="#" class="dropdown-toggle menu-select"> <span dir="ltr"><?php echo bizz_tabs_active(); ?> </span> <span class="templates-toggle"></span> </a> <div class="dropdown-menu menu-tabs"> <?php bizz_tabs_list(); ?> </div> </div> <a href="#" class="bizzhelp templates-help" onclick="return template_help_toggle();">?</a> </div> <div id="widget-frame" class="clearfix"> <div class="widget-liquid-left<?php if (!isset($_REQUEST['tab'])) { echo ' liquid-left-disabled'; } ?> "> <div id="widgets-left"> <div id="available-widgets" class="widgets-holder-wrap"> <div class="sidebar-name"> <div class="sidebar-name-arrow"><br /></div> <h3><?php _e('Available Widgets', 'bizzthemes'); ?> <span id="removing-widget"><?php _e('Deactivate', 'bizzthemes'); ?> <span></span></span></h3> </div> <div class="widget-holder"> <p class="description"> <?php _e('Drag widgets from here to a template on the right to activate them. Drag widgets back here to deactivate them and delete their settings.', 'bizzthemes'); ?> </p> <div id="widget-list"> <?php wp_list_widgets(); ?> </div> <br class='clear' /> </div> </div> <?php if (isset($screenopt['inactive_widgets'])) { foreach ($wp_registered_sidebars as $sidebar => $registered_sidebar) { if (false !== strpos($registered_sidebar['class'], 'inactive-sidebar') || 'orphaned_widgets' == substr($sidebar, 0, 16)) { $wrap_class = 'widgets-holder-wrap closed'; if (!empty($registered_sidebar['class'])) { $wrap_class .= ' sidebar-' . $registered_sidebar['class']; } ?> <div id="inactive-widgets" class="<?php echo esc_attr($wrap_class); ?> "> <div class="sidebar-name"> <div class="sidebar-name-arrow"><br /></div> <h3><?php echo esc_html($registered_sidebar['name']); ?> <span class="spinner"></span> </h3> </div> <div class="widget-holder inactive"> <?php wp_list_widget_controls($sidebar); ?> <br class="clear" /> </div> </div> <?php } } } ?> </div> </div> <div class="widget-liquid-right<?php if (!isset($_REQUEST['tab'])) { echo ' liquid-right-disabled'; } ?> "> <div id="widgets-right"> <div id="post-body-content" class="meta-box-sortables"> <div class="metabox-holder sortme<?php if (!isset($_REQUEST['tab'])) { echo ' sortme-disabled'; } ?> "> <?php // conditions and items (administration tabs) isset($_REQUEST['condition']) ? $bizz_condition = $_REQUEST['condition'] : ($bizz_condition = 'is_index'); isset($_REQUEST['id']) ? $bizz_item = $_REQUEST['id'] : ($bizz_item = 'all'); isset($_REQUEST['tab']) ? $bizz_tab = $_REQUEST['tab'] : ($bizz_tab = 'is_index'); isset($_REQUEST['subtab']) ? $bizz_subtab = $_REQUEST['subtab'] : ($bizz_subtab = 'all'); isset($_REQUEST['subtabsub']) ? $bizz_subtabsub = $_REQUEST['subtabsub'] : ($bizz_subtabsub = 'all'); // define condition logic $condition_logic['bizz_tab'] = $bizz_tab; $condition_logic['bizz_subtab'] = $bizz_subtab; $condition_logic['bizz_subtabsub'] = $bizz_subtabsub; $condition_logic['bizz_condition'] = $bizz_condition; $condition_logic['bizz_item'] = $bizz_item; // bake condition and item echo "\t<input type=\"hidden\" class=\"cond_item\" name=\"empty\" value=\"empty\" />\n"; echo "\t<input type=\"hidden\" class=\"cond_item\" name=\"condition\" value=\"{$bizz_condition}\" />\n"; echo "\t<input type=\"hidden\" class=\"cond_item\" name=\"item\" value=\"{$bizz_item}\" />\n"; echo "\t<input type=\"hidden\" class=\"cond_item\" name=\"empty\" value=\"empty\" />\n"; echo "\t<input type=\"hidden\" class=\"empty_parent\" name=\"empty\" value=\"empty\" />\n"; echo "\t<input type=\"hidden\" class=\"is_parent\" name=\"parent\" value=\"true\" />\n"; echo "\t<input type=\"hidden\" class=\"not_parent\" name=\"parent\" value=\"false\" />\n"; echo "\t<input type=\"hidden\" class=\"cond_item\" name=\"empty\" value=\"empty\" />\n"; echo "\t<input type=\"hidden\" class=\"empty_parent\" name=\"empty\" value=\"empty\" />\n"; echo "\t<input type=\"hidden\" class=\"is_enabled\" name=\"show\" value=\"true\" />\n"; echo "\t<input type=\"hidden\" class=\"not_enabled\" name=\"show\" value=\"false\" />\n"; $widget_logic = bizz_frame_widget_logic($condition_logic); #widget logic // print_r($widget_logic); // print_r('<br/><br/>'); $grid_logic = bizz_frame_grid_logic($condition_logic); #grid logic // print_r($grid_logic); // print_r('<br/><br/>'); $main_area_exists = array_key_exists("main_area", $grid_logic) ? true : false; #main area exists? // loop through registred grids $i = 0; foreach ($grid_logic as $container => $registered_container) { $closed = ' closed'; if ($main_area_exists && $registered_container['id'] == 'main_area' && $registered_container['show'] == 'true') { $next = $i; } elseif ($main_area_exists && $registered_container['id'] == 'main_area' && $registered_container['show'] == 'false') { $next = $i + 1; } elseif (!$main_area_exists) { $next = 0; } // close if (isset($next) && $next == $i) { $closed = ''; } // show if ($registered_container['show'] == 'true') { $box = ' enabled-box'; $taction = __('Disable', 'bizzthemes'); $show = 'true'; # show grid } elseif (!isset($_REQUEST['tab'])) { $box = ' enabled-box'; $taction = __('Disable', 'bizzthemes'); $show = 'true'; # show grid } else { $box = ' disabled-box closed'; $taction = __('Enable', 'bizzthemes'); $show = 'false'; # hide grid } // hide enable/disable for first builder page if (!isset($_REQUEST['tab'])) { $taction = ''; } ?> <div class="postbox container-area<?php echo $box . $closed; ?> "> <div class="sidebar-name-arrow container-arrow" title="<?php _e('Click to toggle', 'bizzthemes'); ?> "><br /></div> <h3 class="container-name"> <span class="label"><?php echo esc_html($registered_container['name']); ?> </span> <span class="current"><?php _e('disabled', 'bizzthemes'); ?> </span> <span class="spinner"></span> <span class="title-action"><a href="#"><?php echo $taction; ?> </a></span> </h3> <div class="widget-holder"> <div class="row-fluid"> <?php bizz_grid_tree($registered_container['grids']); ?> </div><!-- END .row-fluid --> </div><!-- END .widget-holder --> <input type="hidden" class="accepted" name="<?php echo $registered_container['id']; ?> [id]" value="<?php echo $registered_container['id']; ?> " /> <input type="hidden" class="accepted" name="<?php echo $registered_container['id']; ?> [name]" value="<?php echo $registered_container['name']; ?> " /> <input type="hidden" class="accepted" name="<?php echo $registered_container['id']; ?> [show]" value="<?php echo $show; ?> " /> <input type="hidden" class="accepted" name="<?php echo $registered_container['id']; ?> [condition]" value="<?php isset($_REQUEST['condition']) ? esc_attr_e($_REQUEST['condition']) : esc_attr_e('is_index'); ?> " /> <input type="hidden" class="accepted" name="<?php echo $registered_container['id']; ?> [item]" value="<?php isset($_REQUEST['id']) ? esc_attr_e($_REQUEST['id']) : esc_attr_e('all'); ?> " /> </div><!-- END .container-area --> <?php $i++; } ?> </div><!-- /.metabox-holder --> </div><!-- /#post-body-content --> </div> </div> </div> <form action="" method="post"><?php wp_nonce_field('save-sidebar-widgets', '_wpnonce_widgets', false); ?> </form> <div class="clear"><!----></div> <?php if (isset($_REQUEST['tab'])) { ?> <div id="bcollapse-menu" class="hide-if-no-js clearfix"><div id="bcollapse-button"><div></div></div><span><?php esc_html_e('Collapse menu', 'bizzthemes'); ?> </span></div> <?php } ?> <br /> <?php // options footer bizzthemes_options_footer(); do_action('sidebar_admin_page'); }
<input type="submit" value="<?php _e('Show'); ?> " class="button-secondary" /> </div> </div> </form> <div id="widget-content" class="widget-liquid-left-holder"> <div id="available-widgets" class="widget-liquid-left"> <?php wp_list_widgets($show, $widget_search); // This lists all the widgets for the query ( $show, $search ) ?> <div class="nav"> <p class="pagenav"> <?php echo $page_links; ?> </p> </div> </div> </div> <form id="widget-controls" action="" method="post">
<?php foreach ( $wp_registered_sidebars as $sidebar_id => $registered_sidebar ) : $sidebar_id = attribute_escape( $sidebar_id ); ?> <option value='<?php echo $sidebar_id; ?>'<?php selected( $sidebar_id, $sidebar ); ?>><?php echo wp_specialchars( $registered_sidebar['name'] ); ?></option> <?php endforeach; ?> </select> <input type="submit" value="<?php _e('Show' ); ?>" class="button-secondary" /> </div> </div> </form> <div id="widget-content" class="widget-liquid-left-holder"> <div id="available-widgets" class="widget-liquid-left"> <?php wp_list_widgets( $show, $widget_search ); // This lists all the widgets for the query ( $show, $search ) ?> <div class="nav"> <p class="pagenav"> <?php echo $page_links; ?> </p> </div> </div> </div> <form id="widget-controls" action="" method="post"> <div id="current-widgets-head" class="widget-liquid-right"> <div id="sidebar-info"> <p><?php echo $sidebar_info_text; ?></p>
/** * Generate HTML for meta box * * @method sidebar_admin_metabox * @global Object $post * @return void */ public static function sidebar_admin_metabox() { ?> <div id="widget-list" class="voce-post-meta-widget column-1"> <strong><?php _e('Available Widgets'); ?> </strong> <p class="description"><?php _e('Drag widgets from here to widget areas to activate them.'); ?> </p> <?php wp_list_widgets(); ?> </div> <?php wp_nonce_field('save-sidebar-widgets', '_wpnonce_widgets', false); ?> <div class="clear"></div> <?php }
function display_layout_detail($layout_id, $post_ID) { $i = 1; $update = array('layout_id' => $layout_id, 'post_ID' => $post_ID, 'zones' => array()); require_once ABSPATH . 'wp-admin/includes/widgets.php'; global $wp_registered_widget_updates, $wp_registered_sidebars, $sidebars_widgets, $wp_registered_widgets; $this->register_zones_as_sidebars(); $sidebars_widgets = wp_get_sidebars_widgets(); if (empty($sidebars_widgets)) { $sidebars_widgets = wp_get_widget_defaults(); } ?> <h4><?php _e("Select a zone and drag a widget", BAOL_PL_TEXTDOMAIN); ?> </h4> <div id="widget-list" class="float-break clear"> <?php wp_list_widgets(); ?> </div> <div class="details clear"> <ul><?php foreach ($this->registered_layouts[$layout_id]['zones'] as $i => $zone) { register_sidebar(array('name' => $zone, 'id' => 'zone-' . $i . '-page-' . $post_ID, 'before_widget' => '<div id="%1$s" class="widget zone %2$s">', 'after_widget' => '</div>', 'before_title' => '<h2 class="widgettitle">', 'after_title' => '</h2>')); $update['zones'][] = 'zone-' . $i . '-page-' . $post_ID; ?> <li><a href="#zone-<?php echo $i; ?> -panel"><span><?php echo $zone; ?> </span></a></li><?php } $this->current_layout = $this->set_current_layout($post_ID, $update); ?> </ul><?php foreach ($this->registered_layouts[$layout_id]['zones'] as $i => $zone) { ?> <div id="zone-<?php echo $i; ?> -panel"> <div class="widgets-zone-sortables zone-name"> <?php wp_list_widget_controls('zone-' . $i . '-page-' . $post_ID); ?> </div> </div><?php } ?> </div> <div style="display:none !important"> <?php foreach ($wp_registered_sidebars as $sidebar => $registered_sidebar) { if (in_array($sidebar, $update['zones'])) { continue; } wp_list_widget_controls($sidebar); } ?> </div><?php }
*/ do_action( 'widgets_admin_page' ); ?> <div class="widget-liquid-left"> <div id="widgets-left"> <div id="available-widgets" class="widgets-holder-wrap"> <div class="sidebar-name"> <div class="sidebar-name-arrow"><br /></div> <h3><?php _e('Available Widgets'); ?> <span id="removing-widget"><?php _ex('Deactivate', 'removing-widget'); ?> <span></span></span></h3> </div> <div class="widget-holder"> <div class="sidebar-description"> <p class="description"><?php _e('To activate a widget drag it to a sidebar or click on it. To deactivate a widget and delete its settings, drag it back.'); ?></p> </div> <div id="widget-list"> <?php wp_list_widgets(); ?> </div> <br class='clear' /> </div> <br class="clear" /> </div> <?php $theme_sidebars = array(); foreach ( $wp_registered_sidebars as $sidebar => $registered_sidebar ) { if ( false !== strpos( $registered_sidebar['class'], 'inactive-sidebar' ) || 'orphaned_widgets' == substr( $sidebar, 0, 16 ) ) { $wrap_class = 'widgets-holder-wrap'; if ( !empty( $registered_sidebar['class'] ) ) $wrap_class .= ' ' . $registered_sidebar['class'];
/** * The content for the content section. * * @since Client Dash 1.4 */ public function block_output() { // Check to see if any plugin modifications have been made, and notify the user $active_plugins = get_option('active_plugins'); $cd_active_plugins = get_option('cd_active_plugins'); if ($active_plugins != $cd_active_plugins) { $dashboard_link = get_admin_url(); $dashboard_link = add_query_arg('cd_update_dash', 'true', $dashboard_link); $dashboard_link = "<a href='{$dashboard_link}'>Dashboard</a>"; $this->error_nag("Hate to bother you, but one or more plugins has been activated / deactivated. Could you please visit the {$dashboard_link} to refresh the available widgets?"); return; } // WP API for widgets; required for use require_once ABSPATH . 'wp-admin/includes/widgets.php'; // From wp-admin/widgets.php. Modified for CD use. ?> <div id="cd-widgets"> <div class="widget-liquid-left"> <div id="widgets-left"> <div id="available-widgets" class="widgets-holder-wrap"> <div class="sidebar-name"> <div class="sidebar-name-arrow"><br/></div> <h3><?php _e('Available Widgets'); ?> <span id="removing-widget"><?php _ex('Deactivate', 'removing-widget'); ?> <span></span></span></h3> </div> <div class="widget-holder"> <div class="sidebar-description"> <p class="description"><?php _e('To activate a widget drag it to a sidebar or click on it. To deactivate a widget and delete its settings, drag it back.'); ?> </p> </div> <div id="widget-list"> <?php wp_list_widgets(); ?> </div> <br class='clear'/> </div> <br class="clear"/> </div> </div> </div> <div class="widget-liquid-right"> <div id="widgets-right" class="single-sidebar"> <div class="sidebars-column-1"> <?php $i = 0; foreach ($this->sidebars as $sidebar) { $wrap_class = 'widgets-holder-wrap'; if (!empty($registered_sidebar['class'])) { $wrap_class .= ' sidebar-' . $registered_sidebar['class']; } if ($i > 0) { $wrap_class .= ' closed'; } ?> <div class="<?php echo esc_attr($wrap_class); ?> "> <?php wp_list_widget_controls($sidebar['id'], $sidebar['name']); ?> </div> <?php $i++; } ?> </div> </div> </div> <form action="" method="post"> <?php wp_nonce_field('save-sidebar-widgets', '_wpnonce_widgets', false); ?> </form> <br class="clear"/> <div class="widgets-chooser"> <ul class="widgets-chooser-sidebars"></ul> <div class="widgets-chooser-actions"> <button class="button-secondary"><?php _e('Cancel'); ?> </button> <button class="button-primary"><?php _e('Add Widget'); ?> </button> </div> </div> </div> <?php }