Created
February 22, 2012 16:19
-
-
Save nfreear/1885840 to your computer and use it in GitHub Desktop.
Fix oEmbed core_provider_save/delete, for Drupal 6(.24) - specify 'cache' table / nfreear/ IET-at-OU.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Enable a default provider. | |
| */ | |
| function oembedcore_enable_provider($provider) { | |
| if (!is_object($provider)) { | |
| $provider = oembedcore_provider_load($provider); | |
| } | |
| ctools_include('export'); | |
| ctools_export_set_status('oembedcore_provider', $provider->name, FALSE); | |
| cache_clear_all('oembedcore:providers', 'cache'); //NDF $table='cache' is mandatory. | |
| drupal_goto(); | |
| } | |
| /** | |
| * Disable a default provider. | |
| */ | |
| function oembedcore_disable_provider($provider) { | |
| if (!is_object($provider)) { | |
| $provider = oembedcore_provider_load($provider); | |
| } | |
| ctools_include('export'); | |
| ctools_export_set_status('oembedcore_provider', $provider->name, TRUE); | |
| cache_clear_all('oembedcore:providers', 'cache'); //NDF $table='cache' is mandatory. | |
| drupal_goto(); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Write a provider to the database. | |
| */ | |
| function oembedcore_provider_save(&$provider) { | |
| $update = (isset($provider->pid)) ? array('pid') : array(); | |
| drupal_write_record('oembedcore_provider', $provider, $update); | |
| cache_clear_all('oembedcore:providers', 'cache'); //NDF $table is mandatory. | |
| return $preset; | |
| } | |
| /** | |
| * Remove a provider. | |
| */ | |
| function oembedcore_provider_delete($provider) { | |
| db_query("DELETE FROM {oembedcore_provider} WHERE name = '%s' AND pid = %d", $provider->name, $provider->pid); | |
| cache_clear_all('oembedcore:providers', 'cache'); //NDF $table is mandatory. | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment