[ Index ]

PHP Cross Reference of Drupal 6 (gatewave)

title

Body

[close]

/sites/all/modules/project/release/ -> project_release.module (summary)

Constants for the possible values of {project_release_nodes}.update_status.

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

Defines 65 functions

  project_release_init()
  project_release_menu()
  project_release_menu_alter()
  project_release_access()
  project_release_node_info()
  project_release_form()
  project_release_node_form_validate()
  project_release_load()
  project_release_insert()
  project_release_update()
  project_release_check_supported_versions()
  project_release_compute_update_status()
  project_release_delete()
  project_release_file_delete()
  project_release_get_version_format()
  _project_release_validate_format_string()
  project_release_get_version()
  project_release_view()
  project_release_load_file()
  theme_project_release_download_file()
  project_release_get_releases()
  project_release_compatibility_list()
  project_release_form_alter()
  project_release_alter_project_form()
  project_release_alter_release_form()
  project_release_nodeapi()
  project_release_project_nodeapi()
  project_release_project_nodeapi_load()
  project_release_project_nodeapi_insert()
  project_release_project_nodeapi_delete()
  project_release_release_nodeapi()
  project_release_get_current_recommended()
  project_release_find_latest_releases()
  project_release_query_releases_by_branch()
  theme_project_release_project_download_table()
  project_release_project_page_link_alter()
  theme_project_release_table_overview()
  project_release_table()
  theme_project_release_download_table_row()
  theme_project_release_download_text_recommended()
  theme_project_release_download_text_supported()
  theme_project_release_download_text_snapshot()
  theme_project_release_download_text_unsupported()
  project_release_taxonomy()
  project_release_get_api_taxonomy()
  _project_release_get_api_vid()
  project_release_get_release_type_vocabulary()
  _project_release_get_release_type_vid()
  project_release_exists()
  theme_project_release_download_link()
  project_release_file_download()
  project_release_flush_caches()
  project_release_pick_project_page()
  project_release_theme()
  theme_project_release_node_form_version_elements()
  project_release_token_list()
  project_release_token_values()
  project_release_use_taxonomy()
  project_release_help()
  _project_release_taxonomy_help()
  project_release_views_api()
  project_release_get_version_extra_weight_map()
  project_release_update_status()
  theme_project_release_update_status_icon()
  project_release_preprocess_views_view_table()

Functions
Functions that are not part of a class:

project_release_init()   X-Ref
Implementation of hook_init().


project_release_menu()   X-Ref
Implementation of hook_menu()


project_release_menu_alter(&$callbacks)   X-Ref
Implementation of hook_menu_alter().


project_release_access($op, $node, $account)   X-Ref
Implementation of hook_access().


project_release_node_info()   X-Ref
Implementation of hook_node_info().


project_release_form(&$release, &$form_state)   X-Ref
Implement of hook_form() for project_release nodes.


project_release_node_form_validate(&$form, &$form_state)   X-Ref
Validation callback for project release node forms.


project_release_load($node)   X-Ref
Implementation of hook_load().


project_release_insert($node)   X-Ref
Implementation of hook_insert().

param: $node

project_release_update($node)   X-Ref
Implementation of hook_update().

param: $node

project_release_check_supported_versions($pid, $tid, $major, $delete)   X-Ref
Verifies the data for supported release versions, and updates if necessary.

param: $pid
param: $tid
param: $major
param: $delete
return:

project_release_compute_update_status($pid, $api_tid, $major)   X-Ref
Compute the {project_release_nodes}.update_status values for a given branch.

For any given release node, there are three possible status values for if
if the release needs an update or not:
- 'current' (PROJECT_RELEASE_UPDATE_STATUS_CURRENT): It's the currently
recommended release (without extra), or the latest possible release
(including betas, rcs, etc). There is no need to upgrade this release at
this time, it's the most up-to-date available.
- 'not-current' (PROJECT_RELEASE_UPDATE_STATUS_NOT_CURRENT): Any release
older than the recommended release, or any older release with extra from
the same major/minor/patch as the latest release.
- 'not-secure' (PROJECT_RELEASE_UPDATE_STATUS_NOT_SECURE): Any release
older than the latest security update on this branch is considered not
secure. Releases are only marked 'not-secure' on sites that define the
'project_release_security_update_tid' variable.

For example, if 1.2.2 is the recommended release, 1.2.1 was a security
update, and 1.2.2-beta2 is the latest release, here would be the following
update status values for various releases:
- 1.2.2-beta2: 'current'     (since it's the latest release)
- 1.2.2-beta1: 'not-current' (since beta2 is available)
- 1.2.2: 'current'           (recommended release, latest without "extra")
- 1.2.2-rc1: 'not-current'   (since 1.2.2 official is out)
- 1.2.1: 'not-current'
- 1.2.1-beta1: 'not-secure'  (since 1.2.1 official was a security update)
- 1.2.0: 'not-secure'

This status is recorded in the {project_release_nodes}.update_status column
in the database. Whenever a release is created, updated, or deleted, we
need to inspect all the other releases on the same branch to potentially
modify the update_status column as needed.

This function walks through all the records in the {project_release_nodes}
table matching the given branch (API compatibility term ID and major
version) for a specified project in version order (as determined by
project_release_query_releases_by_branch() which sorts by version_minor,
version_patch, version_extra_weight and finally version_extra), and
compares them with that branch's latest release, recommended release, and
latest security release to compute their update status. If the release is
the latest or recommended, it's 'current'. Otherwise, it's 'not-current'
if we haven't passed a security update yet, or 'not-secure' once we find a
security update.

param: $pid
param: $api_tid
param: $major
return:

project_release_delete($node)   X-Ref
Implementation of hook_delete().


project_release_file_delete($file)   X-Ref
Deletes release files.

param: $file

project_release_get_version_format($project)   X-Ref
Returns the version format string for a given project


_project_release_validate_format_string($form_values, $element)   X-Ref
Validates a version format string. Only alphanumeric characters and
[-_.] are allowed. Calls form_set_error() on error, else returns.

param: $form_values Array of form values passed to validate hook.
param: $element The name of the form element for the format string.

project_release_get_version($version, $project = NULL)   X-Ref
Returns the formatted version string for a given version object.

param: $version
param: $project
return:

project_release_view($node, $teaser = FALSE, $page = FALSE)   X-Ref
Implementation of hook_view().


project_release_load_file($fid)   X-Ref
No description

theme_project_release_download_file($file, $download_link = TRUE)   X-Ref
No description

project_release_get_releases($project, $nodes = TRUE, $sort_by = 'version', $filter_by = 'all', $rids = array()   X-Ref
Get an array of release nodes

param: $project
param: $nodes
param: $sort_by
param: $filter_by
param: $rids
return:

project_release_compatibility_list()   X-Ref
Returns a listing of all active project release compatibility terms
in the system.


project_release_form_alter(&$form, &$form_state, $form_id)   X-Ref
Implementation of hook_form_alter().


project_release_alter_project_form(&$form)   X-Ref
Alters the project_project node form to add release settings.


project_release_alter_release_form(&$form, &$form_state)   X-Ref
Alters the project_release node form to handle the API taxonomy.
If the vocabulary is empty, this removes the form elements.


project_release_nodeapi(&$node, $op, $arg)   X-Ref
hook_nodeapi() implementation. This just decides what type of node
is being passed, and calls the appropriate type-specific hook.


project_release_project_nodeapi(&$node, $op, $arg)   X-Ref
hook_nodeapi implementation specific to "project_project" nodes
(from the project.module)


project_release_project_nodeapi_load(&$node)   X-Ref
Loads project_release fields into the project node object.


project_release_project_nodeapi_insert(&$node)   X-Ref
Insert release information about a project node.


project_release_project_nodeapi_delete(&$node)   X-Ref
Deletes release information when a project is deleted.


project_release_release_nodeapi(&$node, $op, $arg)   X-Ref
hook_nodeapi implementation specific to "project_release" nodes.

We use hook_nodeapi() for our own node type to trigger some code that has
to happen after taxonomy_nodeapi() runs.  project_release already has to be
weighted heavier than taxonomy for other things to work.


project_release_get_current_recommended($project_nid, $api_tid, $recommended_major = NULL, $type = 'recommended')   X-Ref
Fetch information about the current releases for a given project.

This just queries the {project_release_supported_versions} table for either
the latest release or the recommended release, and retrieves data about
that release from the {node} and {project_release_nodes} tables. To
actually recompute the latest and recommended releases for a given branch,
you must use project_release_find_latest_releases().

param: $project_nid
param: $api_tid
param: $recommended_major
param: $type
return:

project_release_find_latest_releases($project_nid, $api_tid, $major, $access = FALSE)   X-Ref
Finds the latest and recommended releases for a given project and branch.

The "latest" release just means the published release node with the highest
version string. The "recommended" release is the published release node
with the highest version string that doesn't have a "version_extra" field
(e.g. "beta1"). If all releases on the given branch have "extra", then the
recommended release will be the same as the latest release.

param: $project_nid
param: $api_tid
param: $major
param: $access
return:

project_release_query_releases_by_branch($project_nid, $api_tid, $major, $access = FALSE)   X-Ref
Build a query for releases on a given branch, ordered by version.

param: $project_nid
param: $api_tid
param: $major
param: $access
return:

theme_project_release_project_download_table($node)   X-Ref
Theme the appropriate release download table for a project node.


project_release_project_page_link_alter(&$links, $node)   X-Ref
Implemenation of hook_project_page_link_alter().

Note:  This is *not* an implementation of hook_link_alter().

theme_project_release_table_overview($project, $table_type, $release_type, $title, $print_size)   X-Ref
Theme function that calls project_release_table().

The main purpose of this theme wrapper function is to make it easier
to display a different kind of table (for example, $tabel_type=all)
from the project_page_overview() function in project.module.

The parameters are described at project_release_table().


project_release_table($project, $table_type = 'recommended', $release_type = 'all', $title = NULL, $print_size = TRUE, $check_edit = TRUE)   X-Ref
Generate a table of releases for a given project.

param: $project
param: $table_type
param: $release_type
param: $title
param: $print_size
param: $check_edit

theme_project_release_download_table_row($release, $recommended = false, $can_edit = false, $print_size = true)   X-Ref
Helper function to return an individual row for the download table.

param: $release
param: $recommended
param: $can_edit
param: $print_size

theme_project_release_download_text_recommended($release, $text_type)   X-Ref
Return the message text for recommended releases in the download table.

param: $release
param: $text_type

theme_project_release_download_text_supported($release, $text_type)   X-Ref
Return the message text for supported releases in the download table.


theme_project_release_download_text_snapshot($release, $text_type)   X-Ref
Return the message text for snapshot releases in the download table.


theme_project_release_download_text_unsupported($release, $text_type)   X-Ref
Return the message text for snapshot releases in the download table.


project_release_taxonomy($op, $type, $array = NULL)   X-Ref
Implementation of hook_taxonomy().


project_release_get_api_taxonomy()   X-Ref
If taxonomy is enabled, returns the taxonomy tree for the
API compatibility vocabulary, otherwise, it returns false.


_project_release_get_api_vid()   X-Ref
Returns the vocabulary id for project release API


project_release_get_release_type_vocabulary()   X-Ref
Return the taxonomy tree for the release type vocabulary (if any).

If taxonomy is disabled, this returns false.

_project_release_get_release_type_vid()   X-Ref
Return the vocabulary id for project release type.


project_release_exists($version)   X-Ref
No description

theme_project_release_download_link($filepath, $link_text = NULL, $as_array = FALSE)   X-Ref
Generates the appropriate download link for a give file path. This
function takes the 'project_release_download_base' setting into
account, so it should be used everywhere a download link is made.

param: $filepath
param: $link_text
param: $as_array
return:

project_release_file_download($filename)   X-Ref
Implementation of hook_file_download().

param: $filename
return:

project_release_flush_caches()   X-Ref
Implementation of hook_flush_caches().


project_release_pick_project_page($type_name)   X-Ref
Menu callback to select a project when creating a new release.


project_release_theme()   X-Ref
Implementation of hook_theme().


theme_project_release_node_form_version_elements($form)   X-Ref
No description

project_release_token_list($type)   X-Ref
Implement hook_token_list() (from token.module)


project_release_token_values($type = 'all', $object = NULL)   X-Ref
Implement hook_token_values() (from token.module).


project_release_use_taxonomy()   X-Ref
Determines taxonomy-specific functionality for releases.


project_release_help($section)   X-Ref
Implementation of hook_help().


_project_release_taxonomy_help($vid = 0, $vocab_link = TRUE)   X-Ref
Prints help message for release compatibility vocabulary configuration.

param: $vid
param: $vocab_link

project_release_views_api()   X-Ref
Implementation of hook_views_api().


project_release_get_version_extra_weight_map()   X-Ref
Return the mapping of version_extra prefixes to version_extra_weight values.

This mapping allows project_release to use SQL to sort releases by version,
even though direct string comparison doesn't work for the kinds of version
strings people might use (for example "1.0-unstable1" should be lower than
"1.0-alpha3", even though "u" comes higher in the alphabet than "a"). This
is similar to the logic version_compare() performs, only using this weight
field, we can do the comparison in SQL instead of in PHP.

return:

project_release_update_status($status = NULL)   X-Ref
Get the human-readable update status string, or an array of all statuses.

param: $status
return:

theme_project_release_update_status_icon($status)   X-Ref
Render HTML for an icon approrpriate for the given release update status.

param: $status
return:

project_release_preprocess_views_view_table($variables)   X-Ref
Implement hook_preprocess_views_view_table().

Handles the logic for conditionally adding row classes based on release
update_status, and has a hack for hiding the update_status column entirely
on the project_release_download_table view if there's nothing to see.



Generated: Thu Mar 24 11:18:33 2011 Cross-referenced by PHPXref 0.7