setResource($page); } public function getValue(): string { $resourceCombo = $this->getResource(); if (!$resourceCombo->exists()) { return PageUrlType::CONF_VALUE_PAGE_PATH; } if (!($resourceCombo instanceof MarkupPath)) { LogUtility::msg("The page type is only for page"); return PageUrlType::CONF_VALUE_PAGE_PATH; } $confCanonicalType = $this->getName(); $confDefaultValue = $this->getDefaultValue(); $urlType = SiteConfig::getConfValue($confCanonicalType, $confDefaultValue); if (!in_array($urlType, self::CONF_VALUES)) { LogUtility::msg("The canonical configuration ($confCanonicalType) value ($urlType) is unknown and was set to the default one", LogUtility::LVL_MSG_ERROR, PageUrlPath::PROPERTY_NAME); return $confDefaultValue; } return $urlType; } static public function getTab(): string { return MetaManagerForm::TAB_PAGE_VALUE; } static public function getDescription(): string { return "The type of Url for pages"; } static public function getLabel(): string { return "Page Url"; } static public function getName(): string { return PageUrlType::CONF_CANONICAL_URL_TYPE; } static public function getPersistenceType(): string { return Metadata::PERSISTENT_METADATA; } static public function isMutable(): bool { return true; } /** * @return string */ public function getDefaultValue(): string { return PageUrlType::CONF_CANONICAL_URL_TYPE_DEFAULT; } }