add theme

This commit is contained in:
Tony Volpe
2024-06-18 16:47:10 -04:00
parent 95cb30b884
commit 706f089d5e
408 changed files with 77892 additions and 0 deletions

View File

@@ -0,0 +1,15 @@
<?php
namespace Helpers;
class DateFormatter
{
public static function monthDayYear()
{
return function ($template, $context, $args, $source) {
$dateString = strtotime($context->get($args));
return date("M d, Y", $dateString);
};
}
}

View File

@@ -0,0 +1,15 @@
<?php
namespace Helpers;
class Debug
{
public static function dd()
{
return function ($template, $context, $args, $source) {
$args = $context->get($args);
return "<pre>".print_r($args, true)."</pre>";
};
}
}

View File

@@ -0,0 +1,13 @@
<?php
namespace Helpers;
class Form
{
public static function parseForm()
{
return function ($template, $context, $args, $source) {
return gravity_form($context->get($args), true, true, false, false, true, false, false);
};
}
}

View File

@@ -0,0 +1,53 @@
<?php
namespace Helpers;
class Ratings
{
public static function ratingsStars()
{
return function ($template, $context, $args, $source) {
$numberOfStars = $context->get($args);
if (!is_numeric($numberOfStars)) {
return "The value you passed to this helper is not a number.";
}
$output = "";
for ($i=1; $i <= 5; $i++) {
if ($i <= $numberOfStars) {
$output .= "<i class='bi bi-star-fill'></i>";
} else {
$output .= "<i class='bi bi-star'></i>";
}
}
return $output;
};
}
public static function numberFormatter()
{
return function ($template, $context, $args, $source) {
$totalCount = $context->get($args);
if (!is_numeric($totalCount)) {
return "The value you passed to this helper is not a number.";
}
return number_format($totalCount);
};
}
public static function currencyFormatter()
{
return function ($template, $context, $args, $source) {
$totalCount = $context->get($args);
if ($totalCount === "Free") {
return "Free";
}
if (!is_numeric($totalCount)) {
return "The value you passed to this helper is not a number.";
}
return "$" . number_format($totalCount, 2);
};
}
}

View File

@@ -0,0 +1,40 @@
<?php
namespace Helpers;
class StringFormatter
{
public static function productTitle()
{
return function ($template, $context, $args, $source) {
$productTitle = $context->get($args);
$parts = explode("(", $productTitle);
return trim($parts[0]);
};
}
public static function adminOrderLabel()
{
return function ($template, $context, $args, $source) {
$label = $context->get($args);
if (substr($label, 0, 21) === "Select if this person") {
return "Caretaker is authorized";
}
if ($label === "SESSpromoid") {
return "Promotion ID";
}
if ($label === "SESSpromotion_description") {
return "Promotion Description";
}
if ($label === "SESScoupon_code") {
return "Coupon Code";
}
return $label;
};
}
}