[ Index ]

PHP Cross Reference of Drupal 6 (yi-drupal)

title

Body

[close]

/sites/all/modules/views/includes/ -> view.inc (summary)

(no description)

File Size: 2126 lines (62 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 3 classes

view:: (56 methods):
  view()
  display_objects()
  db_objects()
  set_arguments()
  set_items_per_page()
  set_current_page()
  set_use_pager()
  set_pager_element()
  synchronize_pager()
  set_offset()
  set_use_ajax()
  set_exposed_input()
  get_exposed_input()
  init_display()
  choose_display()
  set_display()
  init_style()
  init_handlers()
  get_base_tables()
  _pre_query()
  substitutions()
  _init_handler()
  render_exposed_form()
  _build_arguments()
  init_query()
  build()
  _build()
  execute()
  render()
  render_field()
  execute_display()
  preview()
  pre_execute()
  post_execute()
  attach_displays()
  execute_hook_menu()
  execute_hook_block()
  access()
  get_title()
  build_title()
  get_url()
  get_path()
  get_breadcrumb()
  is_cacheable()
  start_query_capture()
  end_query_capture()
  load()
  load_views()
  save()
  _save_rows()
  delete()
  export()
  copy()
  clone_view()
  destroy()
  validate()

views_db_object:: (12 methods):
  init()
  save_row()
  load_row()
  export_row()
  add_display()
  generate_display_id()
  new_display()
  add_item()
  get_items()
  get_item()
  set_item()
  set_item_option()

views_display:: (3 methods):
  views_display()
  options()
  views_object_types()


Class: view  - X-Ref

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.

view()   X-Ref
Constructor


display_objects()   X-Ref
Returns a list of the sub-object types used by this view. These types are
stored on the display, and are used in the build process.


db_objects()   X-Ref
Returns the complete list of dependent objects in a view, for the purpose
of initialization and loading/saving to/from the database.

Note: In PHP5 this should be static, but PHP4 doesn't support static
methods.

set_arguments($args)   X-Ref
Set the arguments that come to this view. Usually from the URL
but possibly from elsewhere.


set_items_per_page($items_per_page)   X-Ref
Set the page size for ranged or pager queries


set_current_page($page)   X-Ref
Change/Set the current page for the pager.


set_use_pager($use_pager)   X-Ref
Whether or not the pager should be used.


set_pager_element($pager_element)   X-Ref
The pager element id to use if use_apger is on


synchronize_pager()   X-Ref
Synchronize views pager with global pager variables


set_offset($offset)   X-Ref
How many records to skip. This does not function if use_pager is
set.


set_use_ajax($use_ajax)   X-Ref
Whether or not AJAX should be used. If AJAX is used, paging,
tablesorting and exposed filters will be fetched via an AJAX call
rather than a page refresh.


set_exposed_input($filters)   X-Ref
Set the exposed filters input to an array. If unset they will be taken
from $_GET when the time comes.


get_exposed_input()   X-Ref
Figure out what the exposed input for this view is.


init_display($reset = FALSE)   X-Ref
Set the display for this view and initialize the display handler.


choose_display($displays)   X-Ref
Get the first display that is accessible to the user.

param: $displays

set_display($display_id = NULL)   X-Ref
Set the display as current.

param: $display_id

init_style()   X-Ref
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.

init_handlers()   X-Ref
Acquire and attach all of the handlers.


get_base_tables()   X-Ref
Create a list of base tables eligible for this view. Used primarily
for the UI. Display must be already initialized.


_pre_query()   X-Ref
Run the pre_query() on all active handlers.


substitutions($reset = FALSE)   X-Ref
Get's all the substitutions and store them.


_init_handler($key, $info)   X-Ref
Attach all of the handlers for each type.

param: $key
param: $info

render_exposed_form($block = FALSE)   X-Ref
Render the exposed filter form.

This actually does more than that; because it's using FAPI, the form will
also assign data to the appropriate handlers for use in building the
query.

_build_arguments()   X-Ref
Build all the arguments.


init_query()   X-Ref
Do some common building initialization.


build($display_id = NULL)   X-Ref
Build the query for the view.


_build($key)   X-Ref
Internal method to build an individual set of handlers.


execute($display_id = NULL)   X-Ref
Execute the view's query.


render($display_id = NULL)   X-Ref
Render this view for display.


render_field($field, $row)   X-Ref
Render a specific field via the field ID and the row #.


execute_display($display_id = NULL, $args = array()   X-Ref
Execute the given display, with the given arguments.
To be called externally by whatever mechanism invokes the view,
such as a page callback, hook_block, etc.

This function should NOT be used by anything external as this
returns data in the format specified by the display. It can also
have other side effects that are only intended for the 'proper'
use of the display, such as setting page titles and breadcrumbs.

If you simply want to view the display, use view::preview() instead.

preview($display_id = NULL, $args = array()   X-Ref
Preview the given display, with the given arguments.

To be called externally, probably by an AJAX handler of some flavor.
Can also be called when views are embedded, as this guarantees
normalized output.

pre_execute($args = array()   X-Ref
Run attachments and let the display do what it needs to do prior
to running.


post_execute()   X-Ref
Unset the current view, mostly.


attach_displays()   X-Ref
Run attachment displays for the view.


execute_hook_menu($display_id = NULL, $callbacks = array()   X-Ref
Called to get hook_menu() information from the view and the named display handler.

param: $display_id
param: $callbacks

execute_hook_block($display_id = NULL)   X-Ref
Called to get hook_block information from the view and the
named display handler.


access($displays = NULL, $account = NULL)   X-Ref
Determine if the given user has access to the view. Note that
this sets the display handler if it hasn't been.


get_title()   X-Ref
Get the view's current title. This can change depending upon how it
was built.


build_title()   X-Ref
Force the view to build a title.


get_url($args = NULL, $path = NULL)   X-Ref
Get the URL for the current view.

This URL will be adjusted for arguments.

get_path()   X-Ref
Get the base path used for this view.


get_breadcrumb($set = FALSE)   X-Ref
Get the breadcrumb used for this view.

param: $set

is_cacheable()   X-Ref
Is this view cacheable?


start_query_capture()   X-Ref
Set up query capturing.

db_query() stores the queries that it runs in global $queries,
bit only if dev_query is set to true. In this case, we want
to temporarily override that setting if it's not and we
can do that without forcing a db rewrite by just manipulating
$conf. This is kind of evil but it works.

end_query_capture()   X-Ref
Add the list of queries run during render to buildinfo.


load($arg, $reset = FALSE)   X-Ref
Load a view from the database based upon either vid or name.

This is a static factory method that implements internal caching for
view objects.

param: $arg
param: $reset
return: A view object or NULL if it was not available.

load_views()   X-Ref
Static factory method to load a list of views based upon a $where clause.

Although this method could be implemented to simply iterate over views::load(),
that would be very slow.  Buiding the views externally from unified queries is
much faster.

save()   X-Ref
Save the view to the database. If the view does not already exist,
A vid will be assigned to the view and also returned from this function.


_save_rows($key)   X-Ref
Save a row to the database for the given key, which is one of the
keys from view::db_objects()


delete($clear = TRUE)   X-Ref
Delete the view from the database.


export($indent = '')   X-Ref
Export a view as PHP code.


copy()   X-Ref
Make a copy of this view that has been sanitized of all database IDs
and handlers and other stuff.

I'd call this clone() but it's reserved.

clone_view()   X-Ref
Safely clone a view.

Because views are complicated objects within objects, and PHP loves to
do references to everything, if a View is not properly and safely
cloned it will still have references to the original view, and can
actually cause the original view to point to objects in the cloned
view. This gets ugly fast.

This will completely wipe a view clean so it can be considered fresh.

destroy()   X-Ref
Unset references so that a $view object may be properly garbage
collected.


validate()   X-Ref
Make sure the view is completely valid.

return:

Class: views_db_object  - X-Ref

Base class for views' database objects.

init($init = TRUE)   X-Ref
Initialize this object, setting values from schema defaults.

param: $init

save_row($update = NULL)   X-Ref
Write the row to the database.

param: $update

load_row($data)   X-Ref
Load the object with a row from the database.

This method is separate from the constructor in order to give us
more flexibility in terms of how the view object is built in different
contexts.

param: $data

export_row($identifier = NULL, $indent = '')   X-Ref
Export a loaded row, such as an argument, field or the view itself to PHP code.

param: $identifier
param: $indent

add_display($type = 'page', $title = NULL, $id = NULL)   X-Ref
Add a new display handler to the view, automatically creating an id.

param: $type
param: $title
param: $id
return:

generate_display_id($type)   X-Ref
Generate a display id of a certain plugin type.

param: $type

new_display($type = 'page', $title = NULL, $id = NULL)   X-Ref
Create a new display and a display handler for it.

param: $type
param: $title
param: $id
return:

add_item($display_id, $type, $table, $field, $options = array()   X-Ref
Add an item with a handler to the view.

These items may be fields, filters, sort criteria, or arguments.

get_items($type, $display_id = NULL)   X-Ref
Get an array of items for the current display.


get_item($display_id, $type, $id)   X-Ref
Get the configuration of an item (field/sort/filter/etc) on a given
display.


set_item($display_id, $type, $id, $item)   X-Ref
Get the configuration of an item (field/sort/filter/etc) on a given
display.

Pass in NULL for the $item to remove an item.

set_item_option($display_id, $type, $id, $option, $value)   X-Ref
Set an option on an item.

Use this only if you have just 1 or 2 options to set; if you have
many, consider getting the item, adding the options and doing
set_item yourself.

Class: views_display  - X-Ref

A display type in a view.

This is just the database storage mechanism, and isn't terribly important
to the behavior of the display at all.
views_display($init = TRUE)   X-Ref
No description

options($type, $id, $title)   X-Ref
No description

views_object_types()   X-Ref
Provide a list of views object types used in a view, with some information
about them.




Generated: Mon Jul 9 18:01:44 2012 Cross-referenced by PHPXref 0.7