Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Sign in
Toggle navigation
V
views_natural_sort
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Insights
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Drupal.org issue queue
Drupal.org issue queue
Security & Compliance
Security & Compliance
Dependency List
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
project
views_natural_sort
Commits
efe22bc0
Commit
efe22bc0
authored
Feb 07, 2016
by
generalredneck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
A little documentation for some functions.
parent
ea124aa9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
59 additions
and
0 deletions
+59
-0
views_natural_sort.admin.inc
views_natural_sort.admin.inc
+3
-0
views_natural_sort.module
views_natural_sort.module
+56
-0
No files found.
views_natural_sort.admin.inc
View file @
efe22bc0
...
...
@@ -4,6 +4,9 @@
* Callbacks for managing Views Natural Sort.
*/
/**
* Views Natural Sort Admin Settings Page callback.
*/
function
views_natural_sort_settings_page
()
{
$content
=
array
(
'settings'
=>
drupal_get_form
(
'views_natural_sort_settings_form'
),
...
...
views_natural_sort.module
View file @
efe22bc0
...
...
@@ -278,6 +278,52 @@ function views_natural_sort_get_transformations($index_entry) {
return
$transformations
;
}
/**
* Retrieve the full list of entities and properties that can be supported.
*
* @return array
* An array of property information keyed by entity machine name. Example:
* array (
* 'node' => array (
* 'type' => array (
* 'base_table' => 'node',
* 'schema_field' => 'type',
* ),
* 'title' => array (
* 'base_table' => 'node',
* 'schema_field' => 'title',
* ),
* 'language' => array (
* 'base_table' => 'node',
* 'schema_field' => 'language',
* ),
* ),
* 'user' => array (
* 'name' => array (
* 'base_table' => 'users',
* 'schema_field' => 'name',
* ),
* 'mail' => array (
* 'base_table' => 'users',
* 'schema_field' => 'mail',
* ),
* 'theme' => array (
* 'base_table' => 'users',
* 'schema_field' => 'theme',
* ),
* ),
* 'file' => array (
* 'name' => array (
* 'base_table' => 'file_managed',
* 'schema_field' => 'filename',
* ),
* 'mime' => array (
* 'base_table' => 'file_managed',
* 'schema_field' => 'filemime',
* ),
* ),
* )
*/
function
views_natural_sort_get_supported_entity_properties
()
{
$supported_properties
=
&
drupal_static
(
__FUNCTION__
,
array
());
if
(
empty
(
$supported_properties
))
{
...
...
@@ -307,6 +353,16 @@ function views_natural_sort_get_supported_entity_properties() {
return
$supported_properties
;
}
/**
* A helper function for creating a VNS record for storage.
*
* @param stdClass $entity
* @param string $entity_type
* @param string $field
*
* @return array
* An array that represents the VNS table row to be inserted.
*/
function
views_natural_sort_entity_to_vns
(
$entity
,
$entity_type
,
$field
)
{
$supported_entity_properties
=
views_natural_sort_get_supported_entity_properties
();
if
(
empty
(
$supported_entity_properties
[
$entity_type
])
||
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment