aboutsummaryrefslogtreecommitdiffstats
path: root/addon/oembed/oembed.php
diff options
context:
space:
mode:
authorFriendika <info@friendika.com>2011-06-30 15:31:25 -0700
committerFriendika <info@friendika.com>2011-06-30 15:31:25 -0700
commit4f1213b69f12e6df2350cd21c6de06128a03411d (patch)
treecb68ecdcadb886e15cc502b633ca71b874740e55 /addon/oembed/oembed.php
parent8819c73ba1ae1cbf19d2c517a87d30104d1a5da1 (diff)
parent7778dbb67b2c033473b0da9b34df01d28162b5ee (diff)
downloadvolse-hubzilla-4f1213b69f12e6df2350cd21c6de06128a03411d.tar.gz
volse-hubzilla-4f1213b69f12e6df2350cd21c6de06128a03411d.tar.bz2
volse-hubzilla-4f1213b69f12e6df2350cd21c6de06128a03411d.zip
Merge pull request #132 from fabrixxm/master
Some works on addons and other
Diffstat (limited to 'addon/oembed/oembed.php')
-rw-r--r--addon/oembed/oembed.php28
1 files changed, 10 insertions, 18 deletions
diff --git a/addon/oembed/oembed.php b/addon/oembed/oembed.php
index 7e677fd6f..880e4992f 100644
--- a/addon/oembed/oembed.php
+++ b/addon/oembed/oembed.php
@@ -25,9 +25,9 @@ function oembed_uninstall() {
function oembed_settings_post($a,$b){
if(! local_user())
return;
- if (isset($_POST['oembed-submit'])){
- set_pconfig(local_user(), 'oembed', 'use_for_youtube', (isset($_POST['oembed_use_for_youtube'])? intval($_POST['oembed_use_for_youtube']):0));
- notice( t('OEmbed settings updated') . EOL);
+ 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);
}
}
@@ -36,21 +36,13 @@ function oembed_settings(&$a,&$o) {
return;
$uofy = intval(get_pconfig(local_user(), 'oembed', 'use_for_youtube' ));
- $o.='
- <div class="settings-block">
- <h3 class="settings-heading">OEmbed</h3>
- <div id="settings-username-wrapper">
- <label for="oembed_use_for_youtube">'
- .t('Use OEmbed for YouTube videos: ')
- .'</label><input type="checkbox" id="oembed_use_for_youtube" name="oembed_use_for_youtube" value="1"'
- . ($uofy==1?'checked="true"':'')
- .' />
- </div>
- <div id="settings-username-end"></div>
- <div class="settings-submit-wrapper">
- <input type="submit" value="'.t('Submit').'" class="settings-submit" name="oembed-submit" />
- </div>
- </div>';
+ $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, ""),
+ ));
+
}