aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/metastrings.php
diff options
context:
space:
mode:
Diffstat (limited to 'engine/lib/metastrings.php')
-rw-r--r--engine/lib/metastrings.php70
1 files changed, 0 insertions, 70 deletions
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
@@ -664,76 +664,6 @@ function elgg_set_metastring_based_object_enabled_by_id($id, $enabled, $type) {
}
/**
- * 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
*
* @warning Unlike elgg_get_metastring_based_objects() this will not accept an