Initial commit - Typo3 11.5.41

This commit is contained in:
Matteo Gallo
2026-07-03 17:53:31 +02:00
commit 5ca4743197
6811 changed files with 568848 additions and 0 deletions

View File

@@ -0,0 +1,37 @@
<?php
namespace Brightside\Youtubevideo\Evaluation;
/**
* Class for field value validation/evaluation to be used in 'eval' of TCA
*/
class HoursMinutesSeconds
{
/**
* JavaScript code for client side validation/evaluation
*
* @return string JavaScript code for client side validation/evaluation
*/
public function returnFieldJS()
{
return "
var value = value.replace(/[-|_|,|.||']+/g,':');
var value = value.replace(/[^\d:]+/g,'');
var value = value.replace(/^:|:$/g, '');
var p = value.split(':'),
s = 0, m = 1;
while (p.length > 0) {
s += m * parseInt(p.pop(), 10);
m *= 60;
}
if (s > 0) {
var date = new Date(0);
date.setSeconds(s);
var value = date.toISOString().substr(11, 8);
return value;
} else {
return '';
}
";
}
}