]> git.mxchange.org Git - friendica.git/blobdiff - include/text.php
API: Better use "about" instead of "pdesc"
[friendica.git] / include / text.php
index 9a3d24bd1ec82fbe7febade1a9d6239b54727c51..cbba8d0c5b501065c3ff451e14706be4ec9704a9 100644 (file)
@@ -1,14 +1,17 @@
 <?php
-
+/**
+ * @file include/text.php
+ */
 use Friendica\App;
+use Friendica\Content\Feature;
 use Friendica\Content\Smilies;
 use Friendica\Core\Config;
 use Friendica\Core\PConfig;
 use Friendica\Core\System;
 use Friendica\Database\DBM;
+use Friendica\Util\Map;
 
 require_once "include/friendica_smarty.php";
-require_once "include/map.php";
 require_once "mod/proxy.php";
 require_once "include/conversation.php";
 
@@ -1046,7 +1049,7 @@ function search($s, $id = 'search-box', $url = 'search', $save = false, $aside =
                        '$action_url' => $url,
                        '$search_label' => t('Search'),
                        '$save_label' => t('Save'),
-                       '$savedsearch' => feature_enabled(local_user(),'savedsearch'),
+                       '$savedsearch' => Feature::isEnabled(local_user(),'savedsearch'),
                        '$search_hint' => t('@name, !forum, #tags, content'),
                );
 
@@ -1065,17 +1068,14 @@ function search($s, $id = 'search-box', $url = 'search', $save = false, $aside =
 }
 
 /**
- * Check if $x is a valid email string
+ * @brief Check for a valid email string
  *
- * @param string $x
+ * @param string $email_address
  * @return boolean
  */
-function valid_email($x){
-
-       /// @TODO Removed because Fabio told me so.
-       //if (Config::get('system','disable_email_validation'))
-       //      return true;
-       return preg_match('/^[_a-zA-Z0-9\-\+]+(\.[_a-zA-Z0-9\-\+]+)*@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)+$/', $x);
+function valid_email($email_address)
+{
+       return preg_match('/^[_a-zA-Z0-9\-\+]+(\.[_a-zA-Z0-9\-\+]+)*@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)+$/', $email_address);
 }
 
 
@@ -1115,40 +1115,6 @@ function get_poke_verbs() {
        return $arr;
 }
 
-/**
- * Load moods
- * @return array index is mood, value is translated mood
- * @hook mood_verbs moods array
- */
-function get_mood_verbs() {
-
-       $arr = array(
-               'happy'      => t('happy'),
-               'sad'        => t('sad'),
-               'mellow'     => t('mellow'),
-               'tired'      => t('tired'),
-               'perky'      => t('perky'),
-               'angry'      => t('angry'),
-               'stupefied'  => t('stupified'),
-               'puzzled'    => t('puzzled'),
-               'interested' => t('interested'),
-               'bitter'     => t('bitter'),
-               'cheerful'   => t('cheerful'),
-               'alive'      => t('alive'),
-               'annoyed'    => t('annoyed'),
-               'anxious'    => t('anxious'),
-               'cranky'     => t('cranky'),
-               'disturbed'  => t('disturbed'),
-               'frustrated' => t('frustrated'),
-               'motivated'  => t('motivated'),
-               'relaxed'    => t('relaxed'),
-               'surprised'  => t('surprised'),
-       );
-
-       call_hooks('mood_verbs', $arr);
-       return $arr;
-}
-
 /**
  * @brief Translate days and months names.
  *
@@ -1175,7 +1141,7 @@ function day_translate($s) {
  */
 function day_short_translate($s) {
        $ret = str_replace(array('Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'),
-               array(t('Mon'), t('Tue'), t('Wed'), t('Thu'), t('Fri'), t('Sat'), t('Sund')),
+               array(t('Mon'), t('Tue'), t('Wed'), t('Thu'), t('Fri'), t('Sat'), t('Sun')),
                $s);
        $ret = str_replace(array('Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov','Dec'),
                array(t('Jan'), t('Feb'), t('Mar'), t('Apr'), t('May'), ('Jun'), t('Jul'), t('Aug'), t('Sep'), t('Oct'), t('Nov'), t('Dec')),
@@ -1406,7 +1372,7 @@ function prepare_body(&$item, $attach = false, $preview = false) {
 
        // Map.
        if (strpos($s, '<div class="map">') !== false && x($item, 'coord')) {
-               $x = generate_map(trim($item['coord']));
+               $x = Map::byCoordinates(trim($item['coord']));
                if ($x) {
                        $s = preg_replace('/\<div class\=\"map\"\>/', '$0' . $x, $s);
                }
@@ -1735,7 +1701,7 @@ function array_xmlify($val){
 
 
 /**
- * transorm link href and img src from relative to absolute
+ * transform link href and img src from relative to absolute
  *
  * @param string $text
  * @param string $base base url