You are here

interface space in Spaces 6

Same name and namespace in other branches
  1. 5.2 spaces.module \space
  2. 6.2 spaces.module \space

Interface for space objects.

Hierarchy

Expanded class hierarchy of space

All classes that implement space

File

./spaces.module, line 379

View source
interface space {

  /**
   * Core API-related functions
   */
  function __construct($type, $sid = NULL, $is_active = FALSE);
  function save();
  function delete();

  /**
   * Method that defines the feature options available for this space
   * type.
   *
   * @return array
   *   A FormAPI suitable options array of feature options.
   */
  function feature_options();

  /**
   * Method that allows the space type to add to/modify the utility
   * "links" provided to visitors in a space.
   *
   * @param $links
   *   The current space utility links (for use with theme_links) array
   *   passed by reference.
   */
  function links(&$links);

  /**
   * Method that provides a space-type specific check for whether the
   * provided feature is accessible by the current user.
   *
   * @param $feature
   *   The feature identifier string.
   *
   * @return bool
   *   TRUE if the user has access to this feature. FALSE if not.
   */
  function feature_access($feature = NULL);

  /**
   * Method that provides a space-type specific check for whether the
   * the space can be administered by the current user.
   *
   * @return bool
   *   TRUE if the user has admin access to this space. FALSE if not.
   */
  function admin_access();

  /**
   * Master router method that allows the space type to define routing
   * workflow rules. Currently called at the following hooks:
   *
   * hook_menu(), where $may_cache == FALSE
   * hook_nodeapi(), where $op == 'view'
   * hook_form_alter(), when editing a node
   * hook_user(), where $op == 'view'
   *
   * @param $op
   *   The current hook from which the router is being called.
   *   Can be one of the following: 'menu', 'node view', 'node form',
   *   'user view'
   * @param $object
   *   The object relevant to the current $op called. e.g. when
   *   $op == 'node view', $object is the node object.
   * @param $is_active
   *   Boolean for whether this router has been called as part of a
   *   fully instantiated space object. If FALSE, the router should
   *   not assume the space has been fully constructed and should take
   *   the appropriate actions as necessary.
   *
   * @return bool
   *   TRUE to allow the user to pass through. FALSE to return a
   *   drupal_access_denied() page to the user.
   */
  function router($op, $object = NULL, $is_active = TRUE);

  /**
   * Redirect handler that abstracts redirect logic and allows space
   * types to define their own definitions of various spaces concepts.
   *
   * @param $op
   *   The page being redirected to. Currently only $op value is 'home'
   */
  function redirect($op = 'home');

  /**
   * Allows the space type to implement custom form options on the
   * feature/preset form.
   *
   * @return array
   *   A FormAPI element array. It will be included as a child element
   *   of the master space feature form.
   */
  function form();

  /**
   * Validate handler for the space type's custom form.
   *
   * @param $values
   *   The submitted values.
   */
  function validate($values);

  /**
   * Custom submit handler for the space type's custom form. For
   * example, allows the space type to process values in preparation
   * for spaces_save().
   *
   * @param $values
   *   The submitted values.
   *
   * @return array
   *   An array of values.
   */
  function submit($values);

  /**
   * Views filter callback that allows the space type to filter views
   * when it is the current active space.
   *
   * @param $query
   *   The views query object.
   */
  function views_filter($is_active, &$query);

  /**
   * Allows the space type to take additional action when enforcing a
   * preset against the current space.
   *
   * @param $preset
   *   A spaces preset definition.
   */
  function preset_enforce($preset);

}

Members

Namesort descending Modifiers Type Description Overrides
space::admin_access function Method that provides a space-type specific check for whether the the space can be administered by the current user.
space::delete function
space::feature_access function Method that provides a space-type specific check for whether the provided feature is accessible by the current user.
space::feature_options function Method that defines the feature options available for this space type.
space::form function Allows the space type to implement custom form options on the feature/preset form.
space::links function Method that allows the space type to add to/modify the utility "links" provided to visitors in a space.
space::preset_enforce function Allows the space type to take additional action when enforcing a preset against the current space.
space::redirect function Redirect handler that abstracts redirect logic and allows space types to define their own definitions of various spaces concepts.
space::router function Master router method that allows the space type to define routing workflow rules. Currently called at the following hooks:
space::save function
space::submit function Custom submit handler for the space type's custom form. For example, allows the space type to process values in preparation for spaces_save().
space::validate function Validate handler for the space type's custom form.
space::views_filter function Views filter callback that allows the space type to filter views when it is the current active space.
space::__construct function Core API-related functions