Overview

Namespaces

  • Apptus
    • ESales
      • Connector
        • Report
        • Time
    • Util
      • Cache
  • PHP
  • Overview
  • Namespace
  • Class
  • Tree
 1:  2:  3:  4:  5:  6:  7:  8:  9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76: 77: 78: 79: 80: 81: 82: 83: 84: 85: 
<?php
namespace Apptus\ESales\Connector;

/**
 * Class used to generate the CSS classes that are required to use automatic notifications or site overlay for web pages.
 *
 * The class has static methods that returns string representations for the CSS classes given a ticket.
 *
 */
class CssClass {
    private static $SITE_OVERLAY = 'eS-panel eS-t-';
    private static $ADDING_TO_CART = 'eS-addingToCart eS-t-';
    private static $CLICK = 'eS-click eS-t-';
    private static $CLICK_AND_SITE_OVERLAY = 'eS-panel eS-click eS-t-';

    private function __construct() {
        // Do nothing
    }

    /**
     * Converts a ticket to CSS classes needed to use site overlay.
     *
     * @param string
     *            The ticket for the eSales panel.
     * @throws \InvalidArgumentException
     * @return string
     *            The CSS classes to use for an element that should be displayed in eSales Managers Site tab.
     */
    public static function forSiteOverlay($ticket) {
        if ($ticket === null) {
            throw new \InvalidArgumentException();
        }
        return self::$SITE_OVERLAY . $ticket;
    }

    /**
     * Converts a ticket to CSS classes for automatic click notifications.
     *
     * @param string
     *            The ticket for the eSales element.
     * @throws \InvalidArgumentException
     * @return string
     *            The CSS classes to use for automatic click notifications.
     */
    public static function forClickNotification($ticket) {
        if ($ticket === null) {
            throw new \InvalidArgumentException();
        }
        return self::$CLICK . $ticket;
    }

    /**
     * Converts a ticket to CSS classes for automatic adding to cart notifications.
     *
     * @param string
     *            The ticket for the eSales product.
     * @throws \InvalidArgumentException
     * @return string
     *            The CSS classes to use for automatic adding to cart notifications.
     */
    public static function forAddingToCartNotification($ticket) {
        if ($ticket === null) {
            throw new \InvalidArgumentException();
        }
        return self::$ADDING_TO_CART . $ticket;
    }

    /**
     * Converts a ticket to CSS classes for automatic click notifications and site overlay.
     *
     * @param string
     *            The ticket for the eSales element.
     * @throws \InvalidArgumentException
     * @return string
     *            The CSS classes to use for an element that should be displayed in eSales Managers Site tab.
     *            The element will also support automatic click notifications.
     */
    public static function forClickNotificationAndSiteOverlay($ticket) {
        if ($ticket === null) {
            throw new \InvalidArgumentException();
        }
        return self::$CLICK_AND_SITE_OVERLAY . $ticket;
    }
}
Apptus ESales Connector PHP API documentation generated by ApiGen