]> git.mxchange.org Git - friendica.git/commitdiff
remove admin view of local directory
authorfriendica <info@friendica.com>
Sun, 18 Mar 2012 05:14:17 +0000 (22:14 -0700)
committerfriendica <info@friendica.com>
Sun, 18 Mar 2012 05:14:17 +0000 (22:14 -0700)
library/tinymce/jscripts/tiny_mce/plugins/bbcode/editor_plugin_src.js
mod/directory.php

index 183f2bc68d3e155a05b7c2e43ec9246738f05fa7..e5f716b297e6cb58e494c2d29b9c341e4939041f 100755 (executable)
                        s = tinymce.trim(s);\r
 \r
                        function rep(re, str) {\r
-\r
-                               //modify code to keep stuff intact within [code][/code] blocks\r
-                               //Waitman Gobble NO WARRANTY\r
-\r
-\r
-                               var o = new Array();\r
-                               var x = s.split("[code]");\r
-                               var i = 0;\r
-\r
-                               var si = "";\r
-                               si = x.shift();\r
-                               si = si.replace(re,str);\r
-                               o.push(si);\r
-\r
-                               for (i = 0; i < x.length; i++) {\r
-                                       var no = new Array();\r
-                                       var j = x.shift();\r
-                                       var g = j.split("[/code]");\r
-                                       no.push(g.shift());\r
-                                       si = g.shift();\r
-                                       si = si.replace(re,str);\r
-                                       no.push(si);\r
-                                       o.push(no.join("[/code]"));\r
-                               }\r
-\r
-                               s = o.join("[code]");\r
-\r
+                               s = s.replace(re, str);\r
                        };\r
-\r
-\r
-\r
-\r
-                       /* oembed */\r
-                       function _h2b_cb(match) {\r
-                               /*\r
-                               function s_h2b(data) {\r
-                                               match = data;\r
+
+
+
+
+                       /* oembed */
+                       function _h2b_cb(match) {
+                               function s_h2b(data) {
+                                               match = data;
                                }\r
                                $.ajax({\r
-                                       type:"POST",\r
+                                       type:"POST",
                                        url: 'oembed/h2b',\r
-                                       data: {text: match},\r
-                                       async: false,\r
-                                       success: s_h2b,\r
-                                       dataType: 'html'\r
-                               });\r
-                               */\r
-                               \r
-                               var f, g, tof = [], tor = [];\r
-                               var find_spanc = /<span [^>]*class *= *[\"'](?:[^\"']* )*oembed(?: [^\"']*)*[\"'][^>]*>(.*?(?:<span[^>]*>(.*?)<\/span *>)*.*?)<\/span *>/ig;\r
-                               while (f = find_spanc.exec(match)) {\r
-                                       var find_a = /<a([^>]* rel=[\"']oembed[\"'][^>]*)>.*?<\/a *>/ig;\r
-                                       if (g = find_a.exec(f[1])) {\r
-                                               var find_href = /href=[\"']([^\"']*)[\"']/ig;\r
-                                               var m2 = find_href.exec(g[1]);\r
-                                               if (m2[1]) {\r
-                                                       tof.push(f[0]);\r
-                                                       tor.push("[EMBED]" + m2[1] + "[/EMBED]");\r
-                                               }\r
-                                       }\r
-                               }\r
-                               for (var i = 0; i < tof.length; i++) match = match.replace(tof[i], tor[i]);\r
-                               \r
-                               return match;\r
-                       }\r
+                                       data: {text: match},
+                                       async: false,
+                                       success: s_h2b,
+                                       dataType: 'html'
+                               });
+                               return match;
+                       }
                        if (s.indexOf('class="oembed')>=0){\r
                                //alert("request oembed html2bbcode");\r
                                s = _h2b_cb(s);\r
                        }\r
-                       \r
-                       /* /oembed */\r
-\r
+                       
+                       /* /oembed */
+
 \r
                        // example: <strong> to [b]\r
                        rep(/<a class=\"bookmark\" href=\"(.*?)\".*?>(.*?)<\/a>/gi,"[bookmark=$1]$2[/bookmark]");\r
                        rep(/<img.*?src=\"(.*?)\".*?height=\"(.*?)\".*?width=\"(.*?)\".*?\/>/gi,"[img=$3x$2]$1[/img]");\r
                        rep(/<img.*?src=\"(.*?)\".*?width=\"(.*?)\".*?height=\"(.*?)\".*?\/>/gi,"[img=$2x$3]$1[/img]");\r
                        rep(/<img.*?src=\"(.*?)\".*?\/>/gi,"[img]$1[/img]");\r
-\r
-                       rep(/<ul class=\"listbullet\" style=\"list-style-type\: circle\;\">(.*?)<\/ul>/gi,"[list]$1[/list]");\r
-                       rep(/<ul class=\"listnone\" style=\"list-style-type\: none\;\">(.*?)<\/ul>/gi,"[list=]$1[/list]");\r
-                       rep(/<ul class=\"listdecimal\" style=\"list-style-type\: decimal\;\">(.*?)<\/ul>/gi,"[list=1]$1[/list]");\r
-                       rep(/<ul class=\"listlowerroman\" style=\"list-style-type\: lower-roman\;\">(.*?)<\/ul>/gi,"[list=i]$1[/list]");\r
-                       rep(/<ul class=\"listupperroman\" style=\"list-style-type\: upper-roman\;\">(.*?)<\/ul>/gi,"[list=I]$1[/list]");\r
-                       rep(/<ul class=\"listloweralpha\" style=\"list-style-type\: lower-alpha\;\">(.*?)<\/ul>/gi,"[list=a]$1[/list]");\r
-                       rep(/<ul class=\"listupperalpha\" style=\"list-style-type\: upper-alpha\;\">(.*?)<\/ul>/gi,"[list=A]$1[/list]");\r
-                       rep(/<li>(.*?)<\/li>/gi,'[li]$1[/li]');\r
-\r
+
+                       rep(/<ul class=\"listbullet\" style=\"list-style-type\: circle\;\">(.*?)<\/ul>/gi,"[list]$1[/list]");
+                       rep(/<ul class=\"listnone\" style=\"list-style-type\: none\;\">(.*?)<\/ul>/gi,"[list=]$1[/list]");
+                       rep(/<ul class=\"listdecimal\" style=\"list-style-type\: decimal\;\">(.*?)<\/ul>/gi,"[list=1]$1[/list]");
+                       rep(/<ul class=\"listlowerroman\" style=\"list-style-type\: lower-roman\;\">(.*?)<\/ul>/gi,"[list=i]$1[/list]");
+                       rep(/<ul class=\"listupperroman\" style=\"list-style-type\: upper-roman\;\">(.*?)<\/ul>/gi,"[list=I]$1[/list]");
+                       rep(/<ul class=\"listloweralpha\" style=\"list-style-type\: lower-alpha\;\">(.*?)<\/ul>/gi,"[list=a]$1[/list]");
+                       rep(/<ul class=\"listupperalpha\" style=\"list-style-type\: upper-alpha\;\">(.*?)<\/ul>/gi,"[list=A]$1[/list]");
+                       rep(/<li>(.*?)<\/li>/gi,'[li]$1[/li]');
+
                        rep(/<code>(.*?)<\/code>/gi,"[code]$1[/code]");\r
                        rep(/<\/(strong|b)>/gi,"[/b]");\r
                        rep(/<(strong|b)>/gi,"[b]");\r
                _dfrn_bbcode2html : function(s) {\r
                        s = tinymce.trim(s);\r
 \r
-\r
-                        function rep(re, str) {\r
-\r
-                                //modify code to keep stuff intact within [code][/code] blocks\r
-                                //Waitman Gobble NO WARRANTY\r
-\r
-\r
-                                var o = new Array();\r
-                                var x = s.split("[code]");\r
-                                var i = 0;\r
-\r
-                                var si = "";\r
-                                si = x.shift();\r
-                                si = si.replace(re,str);\r
-                                o.push(si);\r
-\r
-                                for (i = 0; i < x.length; i++) {\r
-                                        var no = new Array();\r
-                                        var j = x.shift();\r
-                                        var g = j.split("[/code]");\r
-                                        no.push(g.shift());\r
-                                        si = g.shift();\r
-                                        si = si.replace(re,str);\r
-                                        no.push(si);\r
-                                        o.push(no.join("[/code]"));\r
-                                }\r
-\r
-                                s = o.join("[code]");\r
-\r
-                        };\r
-\r
-\r
-\r
-\r
+                       function rep(re, str) {\r
+                               s = s.replace(re, str);\r
+                       };\r
 \r
                        // example: [b] to <strong>\r
                        rep(/\n/gi,"<br />");\r
                        rep(/\[\/i\]/gi,"</em>");\r
                        rep(/\[u\]/gi,"<u>");\r
                        rep(/\[\/u\]/gi,"</u>");\r
-                       rep(/\[hr\]/gi,"<hr />");\r
+                       rep(/\[hr\]/gi,"<hr />");
                        rep(/\[bookmark=([^\]]+)\](.*?)\[\/bookmark\]/gi,"<a class=\"bookmark\" href=\"$1\">$2</a>");\r
                        rep(/\[url=([^\]]+)\](.*?)\[\/url\]/gi,"<a href=\"$1\">$2</a>");\r
                        rep(/\[url\](.*?)\[\/url\]/gi,"<a href=\"$1\">$1</a>");\r
                        rep(/\[img=(.*?)x(.*?)\](.*?)\[\/img\]/gi,"<img width=\"$1\" height=\"$2\" src=\"$3\" />");\r
                        rep(/\[img\](.*?)\[\/img\]/gi,"<img src=\"$1\" />");\r
-\r
-                       rep(/\[list\](.*?)\[\/list\]/gi, '<ul class="listbullet" style="list-style-type: circle;">$1</ul>');\r
-                       rep(/\[list=\](.*?)\[\/list\]/gi, '<ul class="listnone" style="list-style-type: none;">$1</ul>');\r
-                       rep(/\[list=1\](.*?)\[\/list\]/gi, '<ul class="listdecimal" style="list-style-type: decimal;">$1</ul>');\r
-                       rep(/\[list=i\](.*?)\[\/list\]/gi,'<ul class="listlowerroman" style="list-style-type: lower-roman;">$1</ul>');\r
-                       rep(/\[list=I\](.*?)\[\/list\]/gi, '<ul class="listupperroman" style="list-style-type: upper-roman;">$1</ul>');\r
-                       rep(/\[list=a\](.*?)\[\/list\]/gi, '<ul class="listloweralpha" style="list-style-type: lower-alpha;">$1</ul>');\r
-                       rep(/\[list=A\](.*?)\[\/list\]/gi, '<ul class="listupperalpha" style="list-style-type: upper-alpha;">$1</ul>');\r
-                       rep(/\[li\](.*?)\[\/li\]/gi, '<li>$1</li>');\r
+
+                       rep(/\[list\](.*?)\[\/list\]/gi, '<ul class="listbullet" style="list-style-type: circle;">$1</ul>');
+                       rep(/\[list=\](.*?)\[\/list\]/gi, '<ul class="listnone" style="list-style-type: none;">$1</ul>');
+                       rep(/\[list=1\](.*?)\[\/list\]/gi, '<ul class="listdecimal" style="list-style-type: decimal;">$1</ul>');
+                       rep(/\[list=i\](.*?)\[\/list\]/gi,'<ul class="listlowerroman" style="list-style-type: lower-roman;">$1</ul>');
+                       rep(/\[list=I\](.*?)\[\/list\]/gi, '<ul class="listupperroman" style="list-style-type: upper-roman;">$1</ul>');
+                       rep(/\[list=a\](.*?)\[\/list\]/gi, '<ul class="listloweralpha" style="list-style-type: lower-alpha;">$1</ul>');
+                       rep(/\[list=A\](.*?)\[\/list\]/gi, '<ul class="listupperalpha" style="list-style-type: upper-alpha;">$1</ul>');
+                       rep(/\[li\](.*?)\[\/li\]/gi, '<li>$1</li>');
                        rep(/\[color=(.*?)\](.*?)\[\/color\]/gi,"<span style=\"color: $1;\">$2</span>");\r
                        rep(/\[size=(.*?)\](.*?)\[\/size\]/gi,"<span style=\"font-size: $1;\">$2</span>");\r
                        rep(/\[code\](.*?)\[\/code\]/gi,"<code>$1</code>");\r
                        rep(/\[quote.*?\](.*?)\[\/quote\]/gi,"<blockquote>$1</blockquote>");\r
-\r
-                       /* oembed */\r
-                       function _b2h_cb(match, url) {\r
-                               url = bin2hex(url);\r
-                               function s_b2h(data) {\r
-                                               match = data;\r
-                               }\r
-                               $.ajax({\r
-                                       url: 'oembed/b2h?url=' + url,\r
-                                       async: false,\r
-                                       success: s_b2h,\r
-                                       dataType: 'html'\r
-                               });\r
-                               return match;\r
-                       }\r
-                       s = s.replace(/\[embed\](.*?)\[\/embed\]/gi, _b2h_cb);\r
-                       \r
-                       /* /oembed */\r
+
+                       /* oembed */
+                       function _b2h_cb(match, url) {
+                               url = bin2hex(url);
+                               function s_b2h(data) {
+                                               match = data;
+                               }
+                               $.ajax({
+                                       url: 'oembed/b2h?url=' + url,
+                                       async: false,
+                                       success: s_b2h,
+                                       dataType: 'html'
+                               });
+                               return match;
+                       }
+                       s = s.replace(/\[embed\](.*?)\[\/embed\]/gi, _b2h_cb);
+                       
+                       /* /oembed */
 \r
                        return s; \r
                }\r
index 962188945fd1c8bebfdb6975a1fa26c2eb10d440..7f18bd0268257890214b3fe5b741020e83823501 100755 (executable)
@@ -25,10 +25,6 @@ function directory_post(&$a) {
 
 function directory_content(&$a) {
 
-       $everything = (($a->argc > 1 && $a->argv[1] === 'all' && is_site_admin()) ? true : false);
-       if(x($_SESSION,'submanage') && intval($_SESSION['submanage']))
-               $everything = false;
-
        if((get_config('system','block_public')) && (! local_user()) && (! remote_user())) {
                notice( t('Public access denied.') . EOL);
                return;
@@ -52,12 +48,6 @@ function directory_content(&$a) {
        }
 
        $admin = '';
-       if(is_site_admin()) {
-               if($everything)
-                       $admin =  '<ul><li><div id="directory-admin-link"><a href="' . $a->get_baseurl() . '/directory' . '">' . t('Normal site view') . '</a></div></li></ul>';
-               else
-                       $admin = '<ul><li><div id="directory-admin-link"><a href="' . $a->get_baseurl() . '/directory/all' . '">' . t('Admin - View all site entries') . '</a></div></li></ul>';
-       }
 
        $o .= replace_macros($tpl, array(
                '$search' => $search,
@@ -73,17 +63,14 @@ function directory_content(&$a) {
                $search = dbesc($search);
        $sql_extra = ((strlen($search)) ? " AND MATCH (`profile`.`name`, `user`.`nickname`, `pdesc`, `locality`,`region`,`country-name`,`gender`,`marital`,`sexual`,`about`,`romance`,`work`,`education`,`pub_keywords`,`prv_keywords` ) AGAINST ('$search' IN BOOLEAN MODE) " : "");
 
-       $publish = ((get_config('system','publish_all') || $everything) ? '' : " AND `publish` = 1 " );
+       $publish = ((get_config('system','publish_all')) ? '' : " AND `publish` = 1 " );
 
 
        $r = q("SELECT COUNT(*) AS `total` FROM `profile` LEFT JOIN `user` ON `user`.`uid` = `profile`.`uid` WHERE `is-default` = 1 $publish AND `user`.`blocked` = 0 $sql_extra ");
        if(count($r))
                $a->set_pager_total($r[0]['total']);
 
-       if($everything)
-               $order = " ORDER BY `register_date` DESC ";
-       else
-               $order = " ORDER BY `name` ASC "; 
+       $order = " ORDER BY `name` ASC "; 
 
 
        $r = q("SELECT `profile`.*, `profile`.`uid` AS `profile_uid`, `user`.`nickname`, `user`.`timezone` FROM `profile` LEFT JOIN `user` ON `user`.`uid` = `profile`.`uid` WHERE `is-default` = 1 $publish AND `user`.`blocked` = 0 $sql_extra $order LIMIT %d , %d ",