From 26f9c39ae33bc01b0f8c62b4e27f7ee077d0fadc Mon Sep 17 00:00:00 2001 From: brettp Date: Sun, 13 Feb 2011 23:02:40 +0000 Subject: Removed worthless function from previous commit. git-svn-id: http://code.elgg.org/elgg/trunk@8208 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/metastrings.php | 70 ---------------------------------------------- 1 file changed, 70 deletions(-) (limited to 'engine') diff --git a/engine/lib/metastrings.php b/engine/lib/metastrings.php index bcb15c338..958afa1bf 100644 --- a/engine/lib/metastrings.php +++ b/engine/lib/metastrings.php @@ -663,76 +663,6 @@ function elgg_set_metastring_based_object_enabled_by_id($id, $enabled, $type) { return $return; } -/** - * Enables or disables a metastrings-based objects by their entity_guid. - * - * @param int $guid The object's ID - * @param string $enabled Value to set to: yes or no - * @param string $type The type of table to use: metadata or anntations - * @param string $name Optional metastring name. If not set, affects all metadata. - * - * @return bool - */ -function elgg_set_metastring_based_object_enabled_by_guid($guid, $enabled, $type, $name = null) { - $valid_types = array('annotations', 'annotation', 'metadata'); - $guid = (int)$guid; - $entity = get_entity($guid); - - if (!in_array($type, $valid_types)) { - return false; - } - - if (!$entity || !$entity->canEdit()) { - return false; - } - - switch($enabled) { - case true: - case 1: - case 'yes': - $callback = 'elgg_batch_enable_callback'; - break; - - case false: - case 0: - case 'no': - $callback = 'elgg_batch_disable_callback'; - break; - } - - $ashe = access_get_show_hidden_status(); - access_show_hidden_entities(true); - - switch($type) { - case 'annotation': - case 'annotations': - $getter = 'elgg_get_annotations'; - if ($name) { - $options['annotation_name'] = $name; - } - break; - - case 'metadata': - $getter = 'elgg_get_metadata'; - if ($name) { - $options['metadata_name'] = $name; - } - break; - } - - $options = array( - 'guid' => $guid, - 'limit' => 0 - ); - - $batch = new ElggBatch('elgg_get_metadata', $options, 'elgg_batch_disable_callback'); - $r = $batch->callbackResult; - - access_show_hidden_entities($ashe); - - return $r; -} - /** * Runs metastrings-based objects found using $options through $callback * -- cgit v1.2.3