<?php foreach ($_['files'] as $file) { $simple_file_size = simple_file_size($file['size']); $simple_size_color = intval(200 - $file['size'] / (1024 * 1024) * 2); // the bigger the file, the darker the shade of grey; megabytes*2 if ($simple_size_color < 0) { $simple_size_color = 0; } $relative_modified_date = relative_modified_date($file['mtime']); $relative_date_color = round((time() - $file['mtime']) / 60 / 60 / 24 * 14); // the older the file, the brighter the shade of grey; days*14 if ($relative_date_color > 200) { $relative_date_color = 200; } ?> <tr data-file="<?php echo $file['name']; ?> " data-type="<?php echo $file['type'] == 'dir' ? 'dir' : 'file'; ?> " data-mime="<?php echo $file['mime']; ?> " data-size='<?php echo $file['size']; ?> '> <td class="filename svg" style="background-image:url(<?php if ($file['type'] == 'dir') { echo mimetype_icon('dir');
} } ?> <div class="section" id="backgroundjobs"> <h2 class="inlineblock"><?php p($l->t('Cron')); ?> </h2> <?php if ($_['cron_log']) { ?> <p class="cronlog inlineblock"> <?php if ($_['lastcron'] !== false) { $relative_time = relative_modified_date($_['lastcron']); $absolute_time = OC_Util::formatDate($_['lastcron']); if (time() - $_['lastcron'] <= 3600) { ?> <span class="cronstatus success"></span> <span class="crondate" original-title="<?php p($absolute_time); ?> "> <?php p($l->t("Last cron job execution: %s.", [$relative_time])); ?> </span> <?php } else { ?>
public function testRelativeTimeYearsAgo() { $currentTime = 1380703592; $elementTime = $currentTime - 86400 * 365.25 * 2; $result = (string) relative_modified_date($elementTime, $currentTime, false); $this->assertEquals('years ago', $result); $elementTime = $currentTime - 86400 * 365.25 * 3; $result = (string) relative_modified_date($elementTime, $currentTime, false); $this->assertEquals('years ago', $result); }
/** * Return the relative date in relation to today. Returns something like "last hour" or "two month ago" * * @param int $timestamp unix timestamp * @param boolean $dateOnly * @return string human readable interpretation of the timestamp * @since 8.0.0 */ public static function relative_modified_date($timestamp, $dateOnly = false) { return \relative_modified_date($timestamp, null, $dateOnly); }
/** * @brief Return the relative date in relation to today. Returns something like "last hour" or "two month ago" * @param $timestamp unix timestamp * @returns human readable interpretation of the timestamp */ function relative_modified_date($timestamp) { return \relative_modified_date($timestamp); }
p($l->t('Other')); ?> ... </option> </select> </td> <td class="storageLocation"><?php p($user["storageLocation"]); ?> </td> <?php if ($user["lastLogin"] === 0) { $lastLogin = $l->t('never'); $lastLoginDate = $lastLogin; } else { $lastLogin = relative_modified_date($user["lastLogin"]); $lastLoginDate = \OC_Util::formatDate($user["lastLogin"]); } ?> <td class="lastLogin" title="<?php p('<span class="usersLastLoginTooltip">' . $lastLoginDate . '</span>'); ?> "><?php p($lastLogin); ?> </td> <td class="remove"> <?php if ($user['name'] != OC_User::getUser()) { ?> <a href="#" class="action delete" original-title="<?php
?> " title="admin"><?php echo $l->t('Visit'); ?> </a> <a class="name" href="<?php echo $blog['domain']; ?> " title="<?php echo $l->t('Open it in a new window'); ?> " target="_blank">+</a> </td> <td> <?php echo relative_modified_date($blog['registered']); ?> </td> </tr> <?php } ?> <?php } else { ?> <tr><td colspan="3"> <?php echo $l->t('You have no site registered, please check your'); ?> <a class="name" href="<?php echo OC::$CLASSPATH['OC_wordpress_site_list'];