* @return string.
 */
function presscore_meta_boxes_advanced_settings_tpl($id = 'dt-advanced')
{
    return sprintf('<div class="hide-if-no-js"><div class="dt_hr"></div><p><a href="#advanced-options" class="dt_advanced">
				<input type="hidden" name="%1$s" data-name="%1$s" value="hide" />
				<span class="dt_advanced-show">%2$s</span>
				<span class="dt_advanced-hide">%3$s</span> 
				%4$s
			</a></p></div><div class="%1$s dt_container hide-if-js"><div class="dt_hr"></div>', esc_attr('' . $id), _x('+ Show', 'backend metabox', 'the7mk2'), _x('- Hide', 'backend metabox', 'the7mk2'), _x('advanced settings', 'backend metabox', 'the7mk2'));
}
// define global metaboxes array
global $DT_META_BOXES;
$DT_META_BOXES = array();
// Get widgetareas
$widgetareas_list = presscore_get_widgetareas_options();
if (!$widgetareas_list) {
    $widgetareas_list = array('none' => _x('None', 'backend metabox', 'the7mk2'));
}
// Ordering settings
$order_options = array('ASC' => _x('ascending', 'backend', 'the7mk2'), 'DESC' => _x('descending', 'backend', 'the7mk2'));
$orderby_options = array('ID' => _x('ID', 'backend', 'the7mk2'), 'author' => _x('author', 'backend', 'the7mk2'), 'title' => _x('title', 'backend', 'the7mk2'), 'date' => _x('date', 'backend', 'the7mk2'), 'name' => _x('name', 'backend', 'the7mk2'), 'modified' => _x('modified', 'backend', 'the7mk2'), 'parent' => _x('parent', 'backend', 'the7mk2'), 'rand' => _x('rand', 'backend', 'the7mk2'), 'comment_count' => _x('comment_count', 'backend', 'the7mk2'), 'menu_order' => _x('menu_order', 'backend', 'the7mk2'));
$yes_no_options = array('1' => _x('Yes', 'backend metabox', 'the7mk2'), '0' => _x('No', 'backend metabox', 'the7mk2'));
$enabled_disabled = array('1' => _x('Enabled', 'backend metabox', 'the7mk2'), '0' => _x('Disabled', 'backend metabox', 'the7mk2'));
// Image settings
$repeat_options = array('repeat' => _x('repeat', 'backend', 'the7mk2'), 'repeat-x' => _x('repeat-x', 'backend', 'the7mk2'), 'repeat-y' => _x('repeat-y', 'backend', 'the7mk2'), 'no-repeat' => _x('no-repeat', 'backend', 'the7mk2'));
$position_x_options = array('center' => _x('center', 'backend', 'the7mk2'), 'left' => _x('left', 'backend', 'the7mk2'), 'right' => _x('right', 'backend', 'the7mk2'));
$position_y_options = array('center' => _x('center', 'backend', 'the7mk2'), 'top' => _x('top', 'backend', 'the7mk2'), 'bottom' => _x('bottom', 'backend', 'the7mk2'));
$load_style_options = array('ajax_pagination' => _x('Pagination & filter with AJAX', 'backend metabox', 'the7mk2'), 'ajax_more' => _x('"Load more" button & filter with AJAX', 'backend metabox', 'the7mk2'), 'lazy_loading' => _x('Lazy loading', 'backend metabox', 'the7mk2'), 'default' => _x('Standard (no AJAX)', 'backend metabox', 'the7mk2'));
$font_size = array('h1' => _x('h1', 'backend metabox', 'the7mk2'), 'h2' => _x('h2', 'backend metabox', 'the7mk2'), 'h3' => _x('h3', 'backend metabox', 'the7mk2'), 'h4' => _x('h4', 'backend metabox', 'the7mk2'), 'h5' => _x('h5', 'backend metabox', 'the7mk2'), 'h6' => _x('h6', 'backend metabox', 'the7mk2'), 'small' => _x('small', 'backend metabox', 'the7mk2'), 'normal' => _x('medium', 'backend metabox', 'the7mk2'), 'big' => _x('large', 'backend metabox', 'the7mk2'));
$accent_custom_color = array('accent' => _x('Accent', 'backend metabox', 'the7mk2'), 'color' => _x('Custom color', 'backend metabox', 'the7mk2'));
/**
 * Add Bulk edit fields.
 *
 */
function presscore_add_bulk_edit_fields($col, $type)
{
    // display for one column
    if (!in_array($col, array('presscore-sidebar'))) {
        return;
    }
    $no_change_option = '<option value="-1">' . _x('&mdash; No Change &mdash;', 'backend bulk edit', 'the7mk2') . '</option>';
    ?>
	<div class="clear"></div>
	<div class="inline-edit-col-left presscore-bulk-actions">
		<fieldset>
			<div class="inline-edit-col">
				<h4><?php 
    _ex('Sidebar and footer options', 'backend bulk edit', 'the7mk2');
    ?>
</h4>
				<div class="inline-edit-group">
					<label class="alignleft">
						<span class="title"><?php 
    _ex('Sidebar layout', 'backend bulk edit', 'the7mk2');
    ?>
</span>
						<?php 
    $sidebar_options = array('left' => _x('Left', 'backend bulk edit', 'the7mk2'), 'right' => _x('Right', 'backend bulk edit', 'the7mk2'), 'disabled' => _x('Disabled', 'backend bulk edit', 'the7mk2'));
    ?>
						<select name="_dt_bulk_edit_sidebar_options">
							<?php 
    echo $no_change_option;
    ?>
							<?php 
    foreach ($sidebar_options as $value => $title) {
        ?>
								<option value="<?php 
        echo $value;
        ?>
"><?php 
        echo $title;
        ?>
</option>
							<?php 
    }
    ?>
						</select>
					</label>

					<label class="alignright">
						<span class="title"><?php 
    _ex('Show footer', 'backend bulk edit', 'the7mk2');
    ?>
</span>
						<?php 
    $show_wf = array(1 => _x('Yes', 'backend bulk edit footer', 'the7mk2'), 0 => _x('No', 'backend bulk edit footer', 'the7mk2'));
    ?>
						<select name="_dt_bulk_edit_show_footer">
							<?php 
    echo $no_change_option;
    ?>
							<?php 
    foreach ($show_wf as $value => $title) {
        ?>
								<option value="<?php 
        echo $value;
        ?>
"><?php 
        echo $title;
        ?>
</option>
							<?php 
    }
    ?>
						</select>
					</label>
				</div>

			<?php 
    if (function_exists('presscore_get_widgetareas_options') && ($wa_list = presscore_get_widgetareas_options())) {
        ?>

				<div class="inline-edit-group">
					<label class="alignleft">
						<span class="title"><?php 
        _ex('Choose sidebar', 'backend bulk edit', 'the7mk2');
        ?>
</span>
						<select name="_dt_bulk_edit_sidebar">
							<?php 
        echo $no_change_option;
        ?>
							<?php 
        foreach ($wa_list as $value => $title) {
            ?>
								<option value="<?php 
            echo esc_attr($value);
            ?>
"><?php 
            echo esc_html($title);
            ?>
</option>
							<?php 
        }
        ?>
						</select>
					</label>

					<label class="alignright">
						<span class="title"><?php 
        _ex('Choose footer', 'backend bulk edit', 'the7mk2');
        ?>
</span>
						<select name="_dt_bulk_edit_footer">
							<?php 
        echo $no_change_option;
        ?>
							<?php 
        foreach ($wa_list as $value => $title) {
            ?>
								<option value="<?php 
            echo esc_attr($value);
            ?>
"><?php 
            echo esc_html($title);
            ?>
</option>
							<?php 
        }
        ?>
						</select>
					</label>
				</div>

			<?php 
    }
    ?>

			</div>
		</fieldset>
	</div>
	<div class="inline-edit-col-center presscore-bulk-actions">

	<?php 
    if ('post' === $type) {
        ?>

		<fieldset>
			<div class="inline-edit-col">
				<h4><?php 
        _ex('Single post options', 'backend bulk edit', 'the7mk2');
        ?>
</h4>
				<div class="inline-edit-group">
					<label class="alignleft">
						<span class="title"><?php 
        _ex('Show thumbnail', 'backend bulk edit', 'the7mk2');
        ?>
</span>
						<select name="_dt_bulk_edit_show_thumbnail">
							<?php 
        echo $no_change_option;
        ?>
							<option value="0"><?php 
        _ex('Yes', 'backend bulk edit', 'the7mk2');
        ?>
</option>
							<option value="1"><?php 
        _ex('No', 'backend bulk edit', 'the7mk2');
        ?>
</option>
						</select>
					</label>
				</div>
			</div>
		</fieldset>

	<?php 
    }
    ?>

	</div>
<?php 
}
/**
 * Add Bulk edit fields.
 *
 */
function presscore_add_bulk_edit_fields($col, $type)
{
    // display for one column
    if (!in_array($col, array('presscore-sidebar'))) {
        return;
    }
    if (!in_array($type, array('page', 'post', 'dt_portfolio'))) {
        return;
    }
    ?>
	<div class="inline-edit-col-right" style="display: inline-block; float: left;">
		<fieldset>
			<div class="inline-edit-col">

				<div class="inline-edit-group">
					<label class="alignleft">
						<span class="title"><?php 
    _ex('Sidebar option', 'backend bulk edit', LANGUAGE_ZONE);
    ?>
</span>
						<?php 
    $sidebar_options = array('left' => _x('Left', 'backend bulk edit', LANGUAGE_ZONE), 'right' => _x('Right', 'backend bulk edit', LANGUAGE_ZONE), 'disabled' => _x('Disabled', 'backend bulk edit', LANGUAGE_ZONE));
    ?>
						<select name="_dt_bulk_edit_sidebar_options">
							<option value="-1"><?php 
    _ex('&mdash; No Change &mdash;', 'backend bulk edit', LANGUAGE_ZONE);
    ?>
</option>
							<?php 
    foreach ($sidebar_options as $value => $title) {
        ?>
								<option value="<?php 
        echo $value;
        ?>
"><?php 
        echo $title;
        ?>
</option>
							<?php 
    }
    ?>
						</select>
					</label>

					<label class="alignright">
						<span class="title"><?php 
    _ex('Widgetized footer', 'backend bulk edit', LANGUAGE_ZONE);
    ?>
</span>
						<?php 
    $show_wf = array(0 => _x('Hide', 'backend bulk edit footer', LANGUAGE_ZONE), 1 => _x('Show', 'backend bulk edit footer', LANGUAGE_ZONE));
    ?>
						<select name="_dt_bulk_edit_show_footer">
							<option value="-1"><?php 
    _ex('&mdash; No Change &mdash;', 'backend bulk edit', LANGUAGE_ZONE);
    ?>
</option>
							<?php 
    foreach ($show_wf as $value => $title) {
        ?>
								<option value="<?php 
        echo $value;
        ?>
"><?php 
        echo $title;
        ?>
</option>
							<?php 
    }
    ?>
						</select>
					</label>
				</div>

			<?php 
    if (function_exists('presscore_get_widgetareas_options') && ($wa_list = presscore_get_widgetareas_options())) {
        ?>

				<div class="inline-edit-group">
					<label class="alignleft">
						<span class="title"><?php 
        _ex('Sidebar', 'backend bulk edit', LANGUAGE_ZONE);
        ?>
</span>
						<select name="_dt_bulk_edit_sidebar">
							<option value="-1"><?php 
        _ex('&mdash; No Change &mdash;', 'backend bulk edit', LANGUAGE_ZONE);
        ?>
</option>
							<?php 
        foreach ($wa_list as $value => $title) {
            ?>
								<option value="<?php 
            echo esc_attr($value);
            ?>
"><?php 
            echo esc_html($title);
            ?>
</option>
							<?php 
        }
        ?>
						</select>
					</label>

					<label class="alignright">
						<span class="title"><?php 
        _ex('Footer', 'backend bulk edit', LANGUAGE_ZONE);
        ?>
</span>
						<select name="_dt_bulk_edit_footer">
							<option value="-1"><?php 
        _ex('&mdash; No Change &mdash;', 'backend bulk edit', LANGUAGE_ZONE);
        ?>
</option>
							<?php 
        foreach ($wa_list as $value => $title) {
            ?>
								<option value="<?php 
            echo esc_attr($value);
            ?>
"><?php 
            echo esc_html($title);
            ?>
</option>
							<?php 
        }
        ?>
						</select>
					</label>
				</div>

			<?php 
    }
    ?>

			</div>
		</fieldset>
	</div>
<?php 
}
/**
 * Handle custom columns.
 *
 */
function presscore_admin_handle_columns($column_name, $id)
{
    static $wa_list = -1;
    if (-1 === $wa_list) {
        $wa_list = presscore_get_widgetareas_options();
    }
    $__none = __('None', 'backend', 'the7mk2');
    switch ($column_name) {
        case 'presscore-thumbs':
            dt_admin_thumbnail($id);
            break;
        case 'presscore-sidebar':
            $wa = get_post_meta($id, '_dt_sidebar_widgetarea_id', true);
            $wa_title = isset($wa_list[$wa]) ? $wa_list[$wa] : $__none;
            echo esc_html($wa_title);
            break;
        case 'presscore-footer':
            $wa = get_post_meta($id, '_dt_footer_widgetarea_id', true);
            $wa_title = isset($wa_list[$wa]) ? $wa_list[$wa] : $__none;
            echo esc_html($wa_title);
            break;
        case 'presscore-slug':
            if ($dt_post = get_post($id)) {
                echo $dt_post->post_name;
            } else {
                echo '&mdash;';
            }
            break;
    }
}