foreach ($enabled_modules as $i => $id) {
    if (!empty($ppb_modules[$id])) {
        $ppb_modules[$id]['priority'] = $i * 2 + 1;
    }
}
if ($enabled_modules) {
    $side = pootlepb_settings('modules-position');
    ?>
	<div id="pootlepb-modules-wrap" class="position-<?php 
    echo $side;
    ?>
">
		<div class="dashicons dashicons-screenoptions" onclick="jQuery(this).parent().toggleClass('toggle')"></div>
		<div id="pootlepb-modules">
			<?php 
    pootlepb_prioritize_array($ppb_modules);
    foreach ($ppb_modules as $module) {
        $id = $module['id'];
        $module = wp_parse_args($module, array('label' => 'Unlabeled Module', 'icon_class' => 'dashicons dashicons-star-filled', 'icon_html' => ''));
        $classes = "mod-{$id}";
        $attr = "";
        if (!empty($module['callback'])) {
            $attr .= " data-callback='{$module['callback']}'";
        }
        if (!empty($module['tab'])) {
            $attr .= " data-tab='{$module['tab']}'";
        }
        if (!empty($module['style_data'])) {
            $attr .= " data-style_data='{$module['style_data']}'";
        }
        if (!empty($module['ActiveClass']) && class_exists($module['ActiveClass'])) {
Esempio n. 2
0
/**
 * Renders row settings fields
 * @param string $tab The tab to render the fields for
 * @since 0.1.0
 */
function pootlepb_row_dialog_fields_output($tab = null)
{
    //Row settings panel fields
    $fields = pootlepb_row_settings_fields();
    //Prioritize array
    pootlepb_prioritize_array($fields);
    foreach ($fields as $field) {
        $key = $field['id'];
        //Skip if current fields doesn't belong to the specified tab
        if (!empty($tab) && $tab != $field['tab']) {
            continue;
        }
        //Output html field
        if ('html' == $field['type']) {
            echo $field['name'];
            continue;
        }
        echo '<div class="field field_' . esc_attr($key) . ' field_type_' . esc_attr($field['type']) . '">';
        echo '<label>' . esc_html($field['name']);
        echo '</label>';
        echo '<span>';
        pootlepb_render_row_settings_field($key, $field);
        echo '</span>';
        if (isset($field['help-text'])) {
            echo '<span class="dashicons dashicons-editor-help tooltip" data-tooltip="' . esc_html($field['help-text']) . '"></span>';
        }
        echo '</div>';
    }
}