]> git.mxchange.org Git - friendica.git/blobdiff - include/text.php
regenerated credits.txt
[friendica.git] / include / text.php
index a738a281f58423c15d4efc80e1241185548cc2a6..73c441e26aaaabd8c47d0c46a552214d9c2d07a4 100644 (file)
@@ -19,11 +19,11 @@ function replace_macros($s,$r) {
 
        $stamp1 = microtime(true);
 
-       // "middleware": inject variables into templates
-       call_hooks("template_vars", $r);
-
-
        $a = get_app();
+       
+       // pass $baseurl to all templates
+       $r['$baseurl'] = $a->get_baseurl();
+       
 
        $t = $a->template_engine();
        try {
@@ -943,6 +943,9 @@ function micropro($contact, $redirect = false, $class = '', $textmode = false) {
        if($class)
                $class = ' ' . $class;
 
+       if ($contact["addr"] == "")
+               $contact["addr"] = $contact["url"];
+
        $url = $contact['url'];
        $sparkle = '';
        $redir = false;
@@ -966,7 +969,7 @@ function micropro($contact, $redirect = false, $class = '', $textmode = false) {
                        . (($click) ? ' fakelink' : '') . '" '
                        . (($redir) ? ' target="redir" ' : '')
                        . (($url) ? ' href="' . $url . '"' : '') . $click
-                       . '" title="' . $contact['name'] . ' [' . $contact['url'] . ']" alt="' . $contact['name']
+                       . '" title="' . $contact['name'] . ' [' . $contact['addr'] . ']" alt="' . $contact['name']
                        . '" >'. $contact['name'] . '</a></div>' . "\r\n";
        }
        else {
@@ -974,7 +977,7 @@ function micropro($contact, $redirect = false, $class = '', $textmode = false) {
                        . (($click) ? ' fakelink' : '') . '" '
                        . (($redir) ? ' target="redir" ' : '')
                        . (($url) ? ' href="' . $url . '"' : '') . $click . ' ><img class="contact-block-img' . $class . $sparkle . '" src="'
-                       . proxy_url($contact['micro'], false, PROXY_SIZE_THUMB) . '" title="' . $contact['name'] . ' [' . $contact['url'] . ']" alt="' . $contact['name']
+                       . proxy_url($contact['micro'], false, PROXY_SIZE_THUMB) . '" title="' . $contact['name'] . ' [' . $contact['addr'] . ']" alt="' . $contact['name']
                        . '" /></a></div>' . "\r\n";
        }
 }}
@@ -1024,8 +1027,9 @@ if(! function_exists('valid_email')) {
  */
 function valid_email($x){
 
-       if(get_config('system','disable_email_validation'))
-               return true;
+       // Removed because Fabio told me so.
+       //if(get_config('system','disable_email_validation'))
+       //      return true;
 
        if(preg_match('/^[_a-zA-Z0-9\-\+]+(\.[_a-zA-Z0-9\-\+]+)*@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)+$/',$x))
                return true;
@@ -1742,50 +1746,6 @@ function unamp($s) {
 }}
 
 
-
-
-if(! function_exists('lang_selector')) {
-/**
- * get html for language selector
- * @global string $lang
- * @return string
- * @template lang_selector.tpl
- */
-function lang_selector() {
-       global $lang;
-
-       $langs = glob('view/*/strings.php');
-
-       $lang_options = array();
-       $selected = "";
-
-       if(is_array($langs) && count($langs)) {
-               $langs[] = '';
-               if(! in_array('view/en/strings.php',$langs))
-                       $langs[] = 'view/en/';
-               asort($langs);
-               foreach($langs as $l) {
-                       if($l == '') {
-                               $lang_options[""] = t('default');
-                               continue;
-                       }
-                       $ll = substr($l,5);
-                       $ll = substr($ll,0,strrpos($ll,'/'));
-                       $selected = (($ll === $lang && (x($_SESSION, 'language'))) ? $ll : $selected);
-                       $lang_options[$ll]=$ll;
-               }
-       }
-
-       $tpl = get_markup_template("lang_selector.tpl");
-       $o = replace_macros($tpl, array(
-               '$title' => t('Select an alternate language'),
-               '$langs' => array($lang_options, $selected),
-
-       ));
-       return $o;
-}}
-
-
 if(! function_exists('return_bytes')) {
 /**
  * return number of bytes in size (K, M, G)