mirror of
https://github.com/farmOS/farmOS.git
synced 2024-02-23 11:37:38 +01:00
Coding standards cleanup.
This commit is contained in:
parent
146d43c383
commit
be0ac6103b
|
@ -2,12 +2,13 @@
|
|||
|
||||
/**
|
||||
* @file
|
||||
* Hooks provided by farm_area.
|
||||
*
|
||||
* This file contains no working PHP code; it exists to provide additional
|
||||
* documentation for doxygen as well as to document hooks in the standard
|
||||
* Drupal manner.
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* @defgroup farm_area Farm area module integrations.
|
||||
*
|
||||
|
@ -23,8 +24,8 @@
|
|||
/**
|
||||
* Provide links for farm areas.
|
||||
*
|
||||
* @param $id
|
||||
* The area that links are being generated for.
|
||||
* @param int $id
|
||||
* The area id that links are being generated for.
|
||||
*
|
||||
* @return array
|
||||
* Returns an array of arrays to represent area links.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
/**
|
||||
* @file
|
||||
* farm_area.features.field.inc
|
||||
* Field features for farm_area.
|
||||
*/
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
/**
|
||||
* @file
|
||||
* farm_area.features.inc
|
||||
* Features include file for farm_area.
|
||||
*/
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
/**
|
||||
* @file
|
||||
* farm_area.features.taxonomy.inc
|
||||
* Taxonomy features for farm_area.
|
||||
*/
|
||||
|
||||
/**
|
||||
|
|
|
@ -30,9 +30,9 @@ function farm_area_farm_admin_actions() {
|
|||
/**
|
||||
* Generate area links, sorted by weight.
|
||||
*
|
||||
* @param $id
|
||||
* @param int $id
|
||||
* The area id.
|
||||
* @param $separator
|
||||
* @param string $separator
|
||||
* Characters to use as a separator between links in the returned string.
|
||||
*
|
||||
* @return string
|
||||
|
@ -126,12 +126,14 @@ function farm_area_openlayers_map_preprocess_alter(&$map = array()) {
|
|||
function farm_area_panels_pre_render($panels_display, $renderer) {
|
||||
|
||||
// If this is the Farm Plan panel page, display the areas map.
|
||||
/**
|
||||
$output = '';
|
||||
/*
|
||||
* @todo
|
||||
* Find a better way to identify this panel page. If the title ever
|
||||
* changes, this will stop working.
|
||||
*/
|
||||
if ($panels_display->title == 'Farm Plan') {
|
||||
return views_embed_view('farm_areas', 'block');
|
||||
$output .= views_embed_view('farm_areas', 'block');
|
||||
}
|
||||
return $output;
|
||||
}
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
/**
|
||||
* @file
|
||||
* farm_area.openlayers_maps.inc
|
||||
* Openlayers maps for farm_area.
|
||||
*/
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
/**
|
||||
* @file
|
||||
* farm_area.strongarm.inc
|
||||
* Strongarm variables for farm_area.
|
||||
*/
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
/**
|
||||
* @file
|
||||
* farm_area.views_default.inc
|
||||
* Default Views for farm_area.
|
||||
*/
|
||||
|
||||
/**
|
||||
|
|
|
@ -4,20 +4,29 @@
|
|||
* @file
|
||||
* Field handler to present farm area links.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Field handler to present farm area links.
|
||||
*/
|
||||
class farm_area_handler_field_links extends views_handler_field {
|
||||
|
||||
// Construct the handler.
|
||||
function construct() {
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function construct() {
|
||||
|
||||
// Inherit the parent's construction.
|
||||
parent::construct();
|
||||
|
||||
// Add the term id as an additional field to load to ensure that it is available in this handler.
|
||||
// Add the term id as an additional field to load to ensure that it is
|
||||
// available in this handler.
|
||||
$this->additional_fields['tid'] = 'tid';
|
||||
}
|
||||
|
||||
// Add fields to the query.
|
||||
function query() {
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function query() {
|
||||
|
||||
// Ensure the main table for this field is included.
|
||||
$this->ensure_my_table();
|
||||
|
@ -26,8 +35,10 @@ class farm_area_handler_field_links extends views_handler_field {
|
|||
$this->add_additional_fields();
|
||||
}
|
||||
|
||||
// Render the field.
|
||||
function render($values) {
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function render($values) {
|
||||
|
||||
// Load the term id value.
|
||||
$aid = $this->get_value($values, 'tid');
|
||||
|
@ -38,4 +49,5 @@ class farm_area_handler_field_links extends views_handler_field {
|
|||
// Return the links as a single string, filtered for XSS.
|
||||
return filter_xss($area_links);
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in a new issue