Beispiel #1
0
/**
 * Helper to get the global layouts
 *
 * @access public
 * @return array
 */
function calibrefx_get_layouts()
{
    _deprecated_function(__FUNCTION__, '2.0');
    return calibrefx_get_all_layouts();
}
Beispiel #2
0
/**
 * html helper function to output layout setting
 *
 * @param array args
 * @return string
 */
function calibrefx_layout_selector($args = array())
{
    /** Merge defaults with user args */
    $args = wp_parse_args($args, array('name' => '', 'selected' => '', 'echo' => true));
    $output = '';
    foreach (calibrefx_get_all_layouts() as $id => $data) {
        $class = $id == $args['selected'] ? 'selected' : '';
        $output .= sprintf('<label title="%1$s" class="box %2$s"><img src="%3$s" alt="%1$s" /><br /> <input type="radio" name="%4$s" id="%5$s" value="%5$s" %6$s /></label>', esc_attr($data['label']), esc_attr($class), esc_url($data['img']), esc_attr($args['name']), esc_attr($id), checked($id, $args['selected'], false));
    }
    $output .= "<div style='clear:both;'></div>";
    /** Echo or Return output */
    if ($args['echo']) {
        echo balanceTags($output);
    } else {
        return $output;
    }
}