<?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";
'$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'),
);
}
/**
- * 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);
}
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.
*
*/
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')),
// 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);
}