diff options
author | Friendika <info@friendika.com> | 2011-09-25 01:59:14 -0700 |
---|---|---|
committer | Friendika <info@friendika.com> | 2011-09-25 01:59:14 -0700 |
commit | 4846d114a84b0c7da64501ea89a635d24e403a1d (patch) | |
tree | 565923c7932ef7fffa4e22482fce48ddb9f133e4 /addon/oembed | |
parent | 6a9e22550d82595c4341290ca26e3afc5fe6300f (diff) | |
download | volse-hubzilla-4846d114a84b0c7da64501ea89a635d24e403a1d.tar.gz volse-hubzilla-4846d114a84b0c7da64501ea89a635d24e403a1d.tar.bz2 volse-hubzilla-4846d114a84b0c7da64501ea89a635d24e403a1d.zip |
project fork
Diffstat (limited to 'addon/oembed')
-rw-r--r-- | addon/oembed/oembed.js | 6 | ||||
-rw-r--r-- | addon/oembed/oembed.php | 89 | ||||
-rw-r--r-- | addon/oembed/oembed.png | bin | 417 -> 0 bytes | |||
-rw-r--r-- | addon/oembed/settings.tpl | 7 |
4 files changed, 0 insertions, 102 deletions
diff --git a/addon/oembed/oembed.js b/addon/oembed/oembed.js deleted file mode 100644 index f8e957413..000000000 --- a/addon/oembed/oembed.js +++ /dev/null @@ -1,6 +0,0 @@ -function oembed(){ - var reply = prompt("$oembed_message:"); - if(reply && reply.length) { - tinyMCE.execCommand('mceInsertRawHTML',false, "[embed]"+reply+"[/embed]" ); - } -} diff --git a/addon/oembed/oembed.php b/addon/oembed/oembed.php deleted file mode 100644 index 880e4992f..000000000 --- a/addon/oembed/oembed.php +++ /dev/null @@ -1,89 +0,0 @@ -<?php -/** - * Name: OEmbed - * Description: OEmbed is a format for allowing an embedded representation of a URL on third party sites http://www.oembed.com/ - * Version: 1.2 - * Author: Fabio Comuni <http://kirgroup.com/profile/fabrix> - */ - -require_once('include/oembed.php'); - -function oembed_install() { - register_hook('jot_tool', 'addon/oembed/oembed.php', 'oembed_hook_jot_tool'); - register_hook('page_header', 'addon/oembed/oembed.php', 'oembed_hook_page_header'); - register_hook('plugin_settings', 'addon/oembed/oembed.php', 'oembed_settings'); - register_hook('plugin_settings_post', 'addon/oembed/oembed.php', 'oembed_settings_post'); -} - -function oembed_uninstall() { - unregister_hook('jot_tool', 'addon/oembed/oembed.php', 'oembed_hook_jot_tool'); - unregister_hook('page_header', 'addon/oembed/oembed.php', 'oembed_hook_page_header'); - unregister_hook('plugin_settings', 'addon/oembed/oembed.php', 'oembed_settings'); - unregister_hook('plugin_settings_post', 'addon/oembed/oembed.php', 'oembed_settings_post'); -} - -function oembed_settings_post($a,$b){ - if(! local_user()) - return; - if (x($_POST,'oembed-submit')){ - set_pconfig(local_user(), 'oembed', 'use_for_youtube', (x($_POST,'oembed_use_for_youtube')? intval($_POST['oembed_use_for_youtube']):0)); - info( t('OEmbed settings updated') . EOL); - } -} - -function oembed_settings(&$a,&$o) { - if(! local_user()) - return; - $uofy = intval(get_pconfig(local_user(), 'oembed', 'use_for_youtube' )); - - $t = file_get_contents( dirname(__file__). "/settings.tpl" ); - $o .= replace_macros($t, array( - '$submit' => t('Submit'), - '$title' => "OEmbed", - '$useoembed' => array('oembed_use_for_youtube', t('Use OEmbed for YouTube videos'), $uofy, ""), - )); - -} - - -function oembed_hook_page_header($a, &$b){ - $a->page['htmlhead'] .= sprintf('<script src="%s/oembed/oembed.js"></script>', $a->get_baseurl()); -} - - -function oembed_hook_jot_tool($a, &$b) { - $b .= ' - <div class="tool-wrapper" style="display: $visitor;" > - <img class="tool-link" src="addon/oembed/oembed.png" alt="Embed" title="Embed" onclick="oembed();" /> - </div> - '; -} - - -function oembed_module() { - return; -} - -function oembed_init(&$a) { - if ($a->argv[1]=='oembed.js'){ - $tpl = file_get_contents('addon/oembed/oembed.js'); - echo replace_macros($tpl, array( - '$oembed_message' => t('URL to embed:'), - )); - } - - if ($a->argv[1]=='b2h'){ - $url = array( "", trim(hex2bin($_GET['url']))); - echo oembed_replacecb($url); - } - - if ($a->argv[1]=='h2b'){ - $text = trim(hex2bin($_GET['text'])); - echo oembed_html2bbcode($text); - } - - killme(); - -} - -?> diff --git a/addon/oembed/oembed.png b/addon/oembed/oembed.png Binary files differdeleted file mode 100644 index 6fc3794bb..000000000 --- a/addon/oembed/oembed.png +++ /dev/null diff --git a/addon/oembed/settings.tpl b/addon/oembed/settings.tpl deleted file mode 100644 index 5a65ef8e5..000000000 --- a/addon/oembed/settings.tpl +++ /dev/null @@ -1,7 +0,0 @@ -<div class="settings-block"> - <h3 class="settings-heading">$title</h3> - {{ inc field_checkbox.tpl with $field=$useoembed }}{{ endinc }} - <div class="settings-submit-wrapper"> - <input type="submit" value="$submit" class="settings-submit" name="oembed-submit" /> - </div> -</div> |