]> git.mxchange.org Git - friendica.git/commitdiff
Code cleanup + standards
authorHypolite Petovan <mrpetovan@gmail.com>
Sat, 25 Mar 2017 05:54:16 +0000 (01:54 -0400)
committerHypolite Petovan <mrpetovan@gmail.com>
Sat, 25 Mar 2017 05:54:16 +0000 (01:54 -0400)
include/oembed.php
view/templates/admin_site.tpl

index a1945894fcaf3fb877ff36c7e2b5a2ec1e0b7e71..d0a2bc8643ae42bedb8a91aa0e9d83cf96ef1e47 100755 (executable)
@@ -17,10 +17,10 @@ function oembed_replacecb($matches){
 
 /**
  * @brief Get data from an URL to embed its content.
- * 
+ *
  * @param string $embedurl The URL from which the data should be fetched.
  * @param bool $no_rich_type If set to true rich type content won't be fetched.
- * 
+ *
  * @return bool|object Returns object with embed content or false if no embedable
  *      content exists
  */
@@ -41,8 +41,8 @@ function oembed_fetch_url($embedurl, $no_rich_type = false){
        // These media files should now be caught in bbcode.php
        // left here as a fallback in case this is called from another source
 
-       $noexts = array("mp3","mp4","ogg","ogv","oga","ogm","webm");
-       $ext = pathinfo(strtolower($embedurl),PATHINFO_EXTENSION);
+       $noexts = array("mp3", "mp4", "ogg", "ogv", "oga", "ogm", "webm");
+       $ext = pathinfo(strtolower($embedurl), PATHINFO_EXTENSION);
 
 
        if (is_null($txt)) {
@@ -85,10 +85,10 @@ function oembed_fetch_url($embedurl, $no_rich_type = false){
                        }
                }
 
-               $txt=trim($txt);
+               $txt = trim($txt);
 
-               if ($txt[0]!="{") {
-                       $txt='{"type":"error"}';
+               if ($txt[0] != "{") {
+                       $txt = '{"type":"error"}';
                } else {        //save in cache
                        $j = json_decode($txt);
                        if ($j->type != "error") {
index fdba195f1770fe29a4a0aa41e31e58947f5331cf..5dfef2b97f85dbc23262f69825629b9dec42c519 100644 (file)
@@ -1,6 +1,6 @@
 <script>
        $(function(){
-               
+
                $("#cnftheme").click(function(){
                        $.colorbox({
                                width: 800,
                                                        data[$(this).attr('name')] = $(this).children(":selected").val();
                                                });
                                                console.log(":)", url, data);
-                                       
+
                                                $.post(url, data, function(data) {
                                                        if(timer) clearTimeout(timer);
                                                        NavUpdate();
                                                        $.colorbox.close();
                                                })
-                                       
+
                                                return false;
                                        });
-                               
+
                                }
                        });
                        return false;
@@ -40,7 +40,7 @@
 </script>
 <div id='adminpage'>
        <h1>{{$title}} - {{$page}}</h1>
-       
+
        <form action="{{$baseurl}}/admin/site" method="post">
     <input type='hidden' name='form_security_token' value='{{$form_security_token}}'>
 
@@ -59,7 +59,7 @@
        {{include file="field_checkbox.tpl" field=$hide_help}}
        {{include file="field_select.tpl" field=$singleuser}}
        <div class="submit"><input type="submit" name="page_site" value="{{$submit|escape:'html'}}" /></div>
-       
+
        <h3>{{$registration}}</h3>
        {{include file="field_input.tpl" field=$register_text}}
        {{include file="field_select.tpl" field=$register_policy}}
@@ -74,7 +74,7 @@
        {{include file="field_input.tpl" field=$maximagelength}}
        {{include file="field_input.tpl" field=$jpegimagequality}}
        <div class="submit"><input type="submit" name="page_site" value="{{$submit|escape:'html'}}" /></div>
-       
+
        <h3>{{$corporate}}</h3>
        {{include file="field_input.tpl" field=$allowed_sites}}
        {{include file="field_input.tpl" field=$allowed_email}}
        {{include file="field_checkbox.tpl" field=$thread_allow}}
        {{include file="field_checkbox.tpl" field=$newuser_private}}
        {{include file="field_checkbox.tpl" field=$enotify_no_content}}
-       {{include file="field_checkbox.tpl" field=$private_addons}}     
+       {{include file="field_checkbox.tpl" field=$private_addons}}
        {{include file="field_checkbox.tpl" field=$disable_embedded}}
        {{include file="field_checkbox.tpl" field=$allow_users_remote_self}}
        <div class="submit"><input type="submit" name="page_site" value="{{$submit|escape:'html'}}" /></div>
-       
+
        <h3>{{$advanced}}</h3>
        {{include file="field_select.tpl" field=$rino}}
        {{include file="field_checkbox.tpl" field=$no_utf}}
        <div class="submit"><input type="submit" name="page_site" value="{{$submit|escape:'html'}}" /></div>
 
        </form>
-       
+
        {{* separate form for relocate... *}}
        <form action="{{$baseurl}}/admin/site" method="post">
        <input type='hidden' name='form_security_token' value='{{$form_security_token}}'>
        <input type="hidden" name="page_site" value="{{$submit|escape:'html'}}">
        <div class="submit"><input type="submit" name="relocate" value="{{$submit|escape:'html'}}" /></div>
        </form>
-       
+
 </div>