function view::init_style

Same name in other branches
  1. 7.x-3.x includes/view.inc \view::init_style()

Find and initialize the style plugin.

Note that arguments may have changed which style plugin we use, so check the view object first, then ask the display handler.

3 calls to view::init_style()
view::build in includes/view.inc
Build the query for the view.
view::get_title in includes/view.inc
Get the view's current title. This can change depending upon how it was built.
view::render in includes/view.inc
Render this view for a certain display.

File

includes/view.inc, line 490

Class

view
An object to contain all of the data to generate a view, plus the member functions to build the view query, execute the query and render the output.

Code

function init_style() {
    if (isset($this->style_plugin)) {
        return is_object($this->style_plugin);
    }
    if (!isset($this->plugin_name)) {
        $this->plugin_name = $this->display_handler
            ->get_option('style_plugin');
        $this->style_options = $this->display_handler
            ->get_option('style_options');
    }
    $this->style_plugin = views_get_plugin('style', $this->plugin_name);
    if (empty($this->style_plugin)) {
        return FALSE;
    }
    // init the new style handler with data.
    $this->style_plugin
        ->init($this, $this->display[$this->current_display], $this->style_options);
    return TRUE;
}