* */ namespace ComboStrap; use syntax_plugin_combo_tooltip; /** * Class PageProtection handles the protection of page against * public agent such as low quality page or late publication * * @package ComboStrap * * The test are in two separate classes {@link \LowQualityPageTest} * and {@link \PublicationTest} */ class PageProtection { const NAME = "page-protection"; const ACRONYM = "pp"; /** * The possible values */ const CONF_VALUE_ACL = "acl"; const CONF_VALUE_HIDDEN = "hidden"; const CONF_VALUE_ROBOT = "robot"; const CONF_VALUE_FEED = "feed"; const PAGE_PROTECTION_LINK_WARNING = "warning"; const PAGE_PROTECTION_LINK_NORMAL = "normal"; const PAGE_PROTECTION_LINK_LOGIN = "login"; public const DATA_PP_SOURCE = "data-pp-source"; public const DATA_PP_LINK = "data-pp-link"; /** * Add the Javascript snippet * We have created only one because a page * may be of low quality and with a late publication. * To resolve conflict between the two protections, the parameters are the same * and the late publication takes precedence on low quality page */ public static function addPageProtectionSnippet() { Tooltip::addToolTipSnippetIfNeeded(); PluginUtility::getSnippetManager()->attachJavascriptFromComponentId(self::NAME); } }