diff options
| author | brettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2011-02-11 21:46:49 +0000 | 
|---|---|---|
| committer | brettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2011-02-11 21:46:49 +0000 | 
| commit | a81349c36e1747d63c8bbbe93894dcd0dfec3be5 (patch) | |
| tree | dd39ec53f4688d389c44d3f6e363e7dabd54540c | |
| parent | 8b3043568f128db9f5748b791c36a2091c53f2a0 (diff) | |
| download | elgg-a81349c36e1747d63c8bbbe93894dcd0dfec3be5.tar.gz elgg-a81349c36e1747d63c8bbbe93894dcd0dfec3be5.tar.bz2  | |
Moved list_entities_from_annotation_count_by_metadata() to deprecated-18.php.
git-svn-id: http://code.elgg.org/elgg/trunk@8119 36083f99-b078-4883-b0ff-0f9b5a30f544
| -rw-r--r-- | engine/lib/annotations.php | 2 | ||||
| -rw-r--r-- | engine/lib/deprecated-1.8.php | 74 | 
2 files changed, 76 insertions, 0 deletions
diff --git a/engine/lib/annotations.php b/engine/lib/annotations.php index 1b3567050..58e83f21e 100644 --- a/engine/lib/annotations.php +++ b/engine/lib/annotations.php @@ -674,6 +674,8 @@ function elgg_list_entities_from_annotation_calculation($options) {   * @param boolean $pagination     Display pagination   * @param string  $orderdir       'desc' or 'asc'   * + * @deprecate 1.8 Use elgg_list_entities_from_annotation_calculation(). + *   * @return string Formatted entity list   */  function list_entities_from_annotation_count_by_metadata($entity_type = "", $entity_subtype = "", diff --git a/engine/lib/deprecated-1.8.php b/engine/lib/deprecated-1.8.php index cae6d1776..86a0f91de 100644 --- a/engine/lib/deprecated-1.8.php +++ b/engine/lib/deprecated-1.8.php @@ -3385,4 +3385,78 @@ $timelower = 0, $timeupper = 0) {  	return elgg_deprecated_annotation_calculation($entity_guid, $entity_type, $entity_subtype,  			$name, $value, $value_type, $owner_guid, $timelower, $timeupper, $sum); +} + + +/** + * Lists entities by the totals of a particular kind of annotation AND + * the value of a piece of metadata + * + * @param string  $entity_type    Type of entity. + * @param string  $entity_subtype Subtype of entity. + * @param string  $name           Name of annotation. + * @param string  $mdname         Metadata name + * @param string  $mdvalue        Metadata value + * @param int     $limit          Maximum number of results to return. + * @param int     $owner_guid     Owner. + * @param int     $group_guid     Group container. Currently only supported if entity_type is object + * @param boolean $asc            Whether to list in ascending or descending order (default: desc) + * @param boolean $fullview       Whether to display the entities in full + * @param boolean $listtypetoggle Can the 'gallery' view can be displayed (default: no) + * @param boolean $pagination     Display pagination + * @param string  $orderdir       'desc' or 'asc' + * + * @deprecate 1.8 Use elgg_list_entities_from_annotation_calculation(). + * + * @return string Formatted entity list + */ +function list_entities_from_annotation_count_by_metadata($entity_type = "", $entity_subtype = "", +$name = "", $mdname = '', $mdvalue = '', $limit = 10, $owner_guid = 0, $group_guid = 0, +$asc = false, $fullview = true, $listtypetoggle = false, $pagination = true, $orderdir = 'desc') { + +	$msg = 'list_entities_from_annotation_count_by_metadata() is deprecated by elgg_list_entities_from_annotation_calculation().'; + +	elgg_deprecated_notice($msg, 1.8); + +	$options = array(); + +	$options['calculation'] = 'sum'; + +	if ($entity_type) { +		$options['types'] = $entity_type; +	} + +	if ($entity_subtype) { +		$options['subtypes'] = $entity_subtype; +	} + +	$options['annotation_names'] = $name; + +	if ($mdname) { +		$options['metadata_name'] = $mdname; +	} + +	if ($mdvalue) { +		$options['metadata_value'] = $mdvalue; +	} + +	if ($owner_guid) { +		if (is_array($owner_guid)) { +			$options['owner_guids'] = $owner_guid; +		} else { +			$options['owner_guid'] = $owner_guid; +		} +	} + +	$options['full_view'] = $fullview; + +	$options['list_type_toggle'] = $listtypetoggle; + +	$options['pagination'] = $pagination; + +	$options['limit'] = $limit; + +	$options['order_by'] = "calculated $orderdir"; + +	return elgg_get_entities_from_annotation_calculation($options);  }
\ No newline at end of file  | 
