public function RenderEditor()
 {
     parent::RenderEditor();
     echo '<div id="cb_controller_editor_fields">';
     $controller = clearbase_get_controller();
     if ($controller instanceof Clearbase_View_Controller) {
         $controller->RenderEditor();
     }
     echo '<div class="waiting-overlay"></div></div>';
 }
Ejemplo n.º 2
0
function clearbase_short_code_handler($atts)
{
    if (empty($atts['id'])) {
        die('shortcode: clearbase must supply a valid gallery id!');
    }
    ob_start();
    $controller = clearbase_get_controller((int) $atts['id']);
    $controller->ShortCode($atts);
    $controller->Enqueue();
    $controller->PreRender();
    $controller->Render();
    $output_string = ob_get_contents();
    ob_end_clean();
    return $output_string;
}
Ejemplo n.º 3
0
/**
 * Gets settings for the specified folder.  If no rules are found, but a parent folder
 * has settings, then the parent folder settings will be returned
 *
 * @param int    $folder_id The folder ID.
 * @return mixed|array|null The folder settings.
 */
function clearbase_get_folder_settings($folder_id = null)
{
    if (!($post = get_post($folder_id))) {
        $post = $GLOBALS['cb_post'];
    }
    $arrpost = isset($post) ? (array) $post : null;
    if (!isset($arrpost) || 'clearbase_folder' != $arrpost['post_type']) {
        return null;
    }
    $settings = null;
    do {
        $controller = clearbase_get_controller($post, false);
        $settings = apply_filters('clearbase_folder_settings', !empty($controller) ? $controller->FolderSettings() : null, $post->ID);
        if (!$settings && isset($post)) {
            $post = 0 == $post->post_parent ? null : get_post($post->post_parent);
        } else {
            $settings['_folder_id'] = $post->ID;
        }
    } while (!$settings && $post);
    return $settings;
}
Ejemplo n.º 4
0
 function widget($args, $instance)
 {
     extract($args);
     echo $before_widget;
     $title = apply_filters('widget_title', $instance['title'], $instance, $this->id_base);
     if ($title) {
         echo $before_title . $title . $after_title;
     }
     $folder_id = $instance['folder_id'];
     $controller = empty($folder_id) || '-1' == $folder_id ? null : clearbase_get_controller($folder_id);
     if (!$controller) {
         echo '<h3>' . __('No FlexSlider Is Selected') . '</h3>';
     } else {
         $controller->Render($folder_id);
     }
     echo $after_widget;
 }
Ejemplo n.º 5
0
function clearbase_get_controller_id($folder_id = null)
{
    $controller = clearbase_get_controller($folder_id);
    return isset($controller) ? $controller->ID() : null;
}
Ejemplo n.º 6
0
    echo '<div class="clearbase-content">';
}
add_action('clearbase_controller_before', 'clearbase_controller_before');
function clearbase_controller_after()
{
    echo '</div>';
}
add_action('clearbase_controller_after', 'clearbase_controller_after');
function clearbase_get_sidebar()
{
    get_sidebar();
}
add_action('clearbase_get_sidebar', 'clearbase_get_sidebar');
function clearbase_get_footer()
{
    get_footer();
}
add_action('clearbase_get_footer', 'clearbase_get_footer');
do_action('clearbase_template_start');
//fire the actions
do_action('clearbase_get_header');
do_action('clearbase_controller_before');
if ($controller = clearbase_get_controller()) {
    $controller->Render();
    do_action("clearbase_controller_{$controller->ID()}_after", $controller);
    do_action('clearbase_controller_after', $controller);
} else {
    echo 'Hello World!';
}
do_action('clearbase_get_sidebar');
do_action('clearbase_get_footer');