5 use DateTime as PHPDateTime;
 
   64         return self::normalizeTime(
$time)->getTimestamp();
 
   77             if (
$time instanceof ElggDateTime) {
 
   80                 $dt = 
new ElggDateTime(
$time->format(PHPDateTime::RFC3339_EXTENDED));
 
   82                 $dt = 
new ElggDateTime();
 
   87                 $dt = 
new ElggDateTime();
 
   89         } 
catch (\Exception $e) {
 
  110         foreach (
$args as $arg) {
 
  115             if (is_object($arg) && isset($arg->id)) {
 
  116                 $ids[] = (int) $arg->id;
 
  117             } 
elseif (is_array($arg)) {
 
  118                 foreach ($arg as $a) {
 
  119                     $el_ids = self::normalizeIds($a);
 
  120                     $ids = array_merge($ids, $el_ids);
 
  122             } 
elseif (is_numeric($arg)) {
 
  125                 $arg = print_r($arg, 
true);
 
  130         return array_unique($ids);
 
  147         foreach (
$args as $arg) {
 
  152             if (is_object($arg) && isset($arg->guid)) {
 
  153                 $guids[] = (int) $arg->guid;
 
  154             } 
elseif (is_array($arg)) {
 
  155                 foreach ($arg as $a) {
 
  156                     $el_guids = self::normalizeGuids($a);
 
  159             } 
elseif (is_numeric($arg)) {
 
  162                 $arg = print_r($arg, 
true);
 
  167         return array_unique(
$guids);
 
  179         return [ViewsService::OUTPUT_KEY => 
''];
 
  213         if (!is_numeric($n)) {
 
  218         $negative = abs($n) !== $n;
 
  221         $decimal_separator = substr(
elgg_echo(
'number_counter:decimal_separator'), 0, 1);
 
  225             $n = self::numberFormat($n, $decimals);
 
  228             $n = self::numberFormat($n / 1000, $decimals);
 
  229             $text_key = 
'number_counter:view:thousand';
 
  230         } 
elseif ($n < 1000000000) {
 
  232             $n = self::numberFormat($n / 1000000, $decimals);
 
  233             $text_key = 
'number_counter:view:million';
 
  234         } 
elseif ($n < 1000000000000) {
 
  236             $n = self::numberFormat($n / 1000000000, $decimals);
 
  237             $text_key = 
'number_counter:view:billion';
 
  240             $n = self::numberFormat($n / 1000000000000, $decimals);
 
  241             $text_key = 
'number_counter:view:trillion';
 
  244         if (stristr($n, $decimal_separator) !== 
false) {
 
  246             $parts = explode($decimal_separator, $n);
 
  247             $parts[1] = rtrim($parts[1], 0);
 
  249             $n = implode($decimal_separator, array_filter($parts));
 
  253         $n = $negative ? 
"-{$n}" : $n;
 
  255         return $text_key ? 
elgg_echo($text_key, [$n]) : $n;
 
  268     public static function numberFormat(
float $number, 
int $decimals = 0): string {
 
  269         $decimal_separator = substr(
elgg_echo(
'number_counter:decimal_separator'), 0, 1);
 
  270         $thousands_separator = substr(
elgg_echo(
'number_counter:thousands_separator'), 0, 1);
 
  272         return number_format($number, $decimals, $decimal_separator, $thousands_separator);
 
$guids
Activates all specified installed and inactive plugins.
if(! $annotation instanceof ElggAnnotation) $time
Extension of the DateTime class to support formatting a date using the locale.
Functions for use as event handlers or other situations where you need a globally accessible callable...
static getNull()
Return null.
static normalizeGuids(... $args)
Flatten an array of data into an array of GUIDs.
static getTrue()
Return true.
static normalizeIds(... $args)
Prepare IDs.
static getArray()
Return empty array.
static shortFormatOutput($n, int $decimals=0)
Use to convert large positive numbers in to short form like 1K, 1M, 1B or 1T Example: shortFormatOutp...
static normalizeTimestamp($time)
Returns timestamp value of the time representation.
static numberFormat(float $number, int $decimals=0)
Format a number with grouped thousands using language specific separators.
static isEmpty($value)
Check if a value isn't empty, but allow 0 and '0'.
static preventViewOutput()
Return array with __view_output set to prevent view output during view_vars event.
static normalizeTime($time)
Returns DateTime object based on time representation.
static getFalse()
Return false.
const ELGG_ENTITIES_ANY_VALUE
Constant to request the value of a parameter be ignored in elgg_get_*() functions.
if($item instanceof \ElggEntity) elseif($item instanceof \ElggRiverItem) elseif($item instanceof \ElggRelationship) elseif(is_callable([ $item, 'getType']))
$args
Some servers don't allow PHP to check the rewrite, so try via AJAX.
elgg_echo(string $message_key, array $args=[], string $language='')
Elgg language module Functions to manage language and translations.
if(parse_url(elgg_get_site_url(), PHP_URL_PATH) !=='/') if(file_exists(elgg_get_root_path() . 'robots.txt'))
Set robots.txt.