From 2d37f6701b838f6ab001e46271ada2e515617d09 Mon Sep 17 00:00:00 2001 From: Jen Lampton Date: Tue, 22 Nov 2016 00:08:45 -0800 Subject: [PATCH] Class names should be a find/replace of Drupal/Backdrop for sanity. --- metatag.inc | 16 +++++++------- metatag.metatag.inc | 52 ++++++++++++++++++++++----------------------- metatag.module | 15 +++++++------ 3 files changed, 42 insertions(+), 41 deletions(-) diff --git a/metatag.inc b/metatag.inc index 80cc248..5ef96e3 100644 --- a/metatag.inc +++ b/metatag.inc @@ -4,7 +4,7 @@ * Metatag primary classes. */ -interface MetaTagInterface { +interface BackdropMetaTagInterface { /** * Constructor @@ -32,7 +32,7 @@ interface MetaTagInterface { } -class MetaTagDefault implements MetaTagInterface { +class BackdropDefaultMetaTag implements BackdropMetaTagInterface { protected $info; protected $data = array('value' => ''); @@ -224,7 +224,7 @@ class MetaTagDefault implements MetaTagInterface { /** * Text-based meta tag controller. */ -class MetaTagText extends MetaTagDefault { +class BackdropTextMetaTag extends BackdropDefaultMetaTag { /** * {@inheritdoc} @@ -370,7 +370,7 @@ class MetaTagText extends MetaTagDefault { * Link type meta tag controller. * */ -class MetaTagLink extends MetaTagText { +class BackdropLinkMetaTag extends BackdropTextMetaTag { /** * {@inheritdoc} @@ -405,10 +405,10 @@ class MetaTagLink extends MetaTagText { /** * Title meta tag controller. * - * This extends MetaTagText as we need to alter variables in + * This extends BackdropTextMetaTag as we need to alter variables in * template_preprocess_page() rather than output a normal meta tag. */ -class MetaTagTitle extends MetaTagText { +class BackdropTitleMetaTag extends BackdropTextMetaTag { /** * {@inheritdoc} @@ -428,7 +428,7 @@ class MetaTagTitle extends MetaTagText { /** * Multiple value meta tag controller. */ -class MetaTagList extends MetaTagDefault { +class BackdropListMetaTag extends BackdropDefaultMetaTag { /** * {@inheritdoc} @@ -481,7 +481,7 @@ class MetaTagList extends MetaTagDefault { /** * Date interval meta tag controller. */ -class MetaTagDateInterval extends MetaTagDefault { +class BackdropDateIntervalMetaTag extends BackdropDefaultMetaTag { /** * {@inheritdoc} diff --git a/metatag.metatag.inc b/metatag.metatag.inc index ffd0511..4fe354f 100644 --- a/metatag.metatag.inc +++ b/metatag.metatag.inc @@ -56,7 +56,7 @@ function metatag_metatag_info() { $info['tags']['title'] = array( 'label' => t('Page title'), 'description' => t("The text to display in the title bar of web browsers. May also be used as the title for a bookmark."), - 'class' => 'MetaTagTitle', + 'class' => 'BackdropTitleMetaTag', 'group' => 'basic', 'weight' => ++$weight, ); @@ -64,7 +64,7 @@ function metatag_metatag_info() { $info['tags']['description'] = array( 'label' => t('Description'), 'description' => t("A concise summary of the page's content, preferably 150 characters or less. May be used by in search results."), - 'class' => 'MetaTagText', + 'class' => 'BackdropTextMetaTag', 'group' => 'basic', 'weight' => ++$weight, 'form' => array( @@ -77,7 +77,7 @@ function metatag_metatag_info() { $info['tags']['abstract'] = array( 'label' => t('Abstract'), 'description' => t("A oncise summary of the page's content, preferably 150 characters or less. May be used for archiving purposes."), - 'class' => 'MetaTagText', + 'class' => 'BackdropTextMetaTag', 'group' => 'basic', 'weight' => ++$weight, 'form' => array( @@ -90,7 +90,7 @@ function metatag_metatag_info() { $info['tags']['keywords'] = array( 'label' => t('Keywords'), 'description' => t("A comma-separated list of keywords about the page. This meta tag is nolonger supported by most search engines."), - 'class' => 'MetaTagText', + 'class' => 'BackdropTextMetaTag', 'group' => 'advanced', 'weight' => ++$weight, ); @@ -98,7 +98,7 @@ function metatag_metatag_info() { $info['tags']['news_keywords'] = array( 'label' => t('Google News Keywords'), 'description' => t('A comma-separated list of keywords about the page. This meta tag is used as an indicator in Google News.', array('@google_news' => 'http://support.google.com/news/publisher/bin/answer.py?hl=en&answer=68297')), - 'class' => 'MetaTagText', + 'class' => 'BackdropTextMetaTag', 'group' => 'advanced', 'weight' => ++$weight, ); @@ -106,7 +106,7 @@ function metatag_metatag_info() { $info['tags']['standout'] = array( 'label' => t('Google Standout'), 'description' => t("Highlight standout journalism on the web, especially for breaking news; used as an indicator in Google News. Warning: Don't abuse it, to be used a maximum of 7 times per calendar week!", array('@google_news' => 'https://support.google.com/news/publisher/answer/191283?hl=en&ref_topic=2484650')), - 'class' => 'MetaTagText', + 'class' => 'BackdropTextMetaTag', 'group' => 'advanced', 'weight' => ++$weight, ); @@ -114,7 +114,7 @@ function metatag_metatag_info() { $info['tags']['rating'] = array( 'label' => t('Content rating'), 'description' => t('Used to indicate the intended audience for the content.'), - 'class' => 'MetaTagText', + 'class' => 'BackdropTextMetaTag', 'group' => 'advanced', 'select_or_other' => TRUE, 'form' => array( @@ -134,7 +134,7 @@ function metatag_metatag_info() { $info['tags']['referrer'] = array( 'label' => t('Referrer policy'), 'description' => t('Indicate to search engines and other page scrapers whether or not links should be followed. See the W3C specifications for further details.'), - 'class' => 'MetaTagText', + 'class' => 'BackdropTextMetaTag', 'group' => 'advanced', 'select_or_other' => TRUE, 'form' => array( @@ -154,7 +154,7 @@ function metatag_metatag_info() { $info['tags']['generator'] = array( 'label' => t('Generator'), 'description' => t("Describes the name and version number of the software or publishing tool used to create the page."), - 'class' => 'MetaTagText', + 'class' => 'BackdropTextMetaTag', 'header' => 'X-Generator', 'context' => array('global'), 'group' => 'advanced', @@ -164,7 +164,7 @@ function metatag_metatag_info() { $info['tags']['rights'] = array( 'label' => t('Rights'), 'description' => t("Details about intellectual property, such as copyright or trademarks; does not automatically protect the site's content or intellectual property."), - 'class' => 'MetaTagText', + 'class' => 'BackdropTextMetaTag', 'group' => 'advanced', 'weight' => ++$weight, 'replaces' => array( @@ -175,7 +175,7 @@ function metatag_metatag_info() { $info['tags']['image_src'] = array( 'label' => t('Image'), 'description' => t("An image associated with this page, for use as a thumbnail in social networks and other services."), - 'class' => 'MetaTagLink', + 'class' => 'BackdropLinkMetaTag', 'group' => 'advanced', 'weight' => ++$weight, 'image' => TRUE, @@ -187,7 +187,7 @@ function metatag_metatag_info() { $info['tags']['canonical'] = array( 'label' => t('Canonical URL'), 'description' => t("Preferred page location or URL to help eliminate duplicate content for search engines."), - 'class' => 'MetaTagLink', + 'class' => 'BackdropLinkMetaTag', 'group' => 'advanced', 'weight' => ++$weight, 'devel_generate' => array( @@ -198,7 +198,7 @@ function metatag_metatag_info() { $info['tags']['shortlink'] = array( 'label' => t('Shortlink URL'), 'description' => t('A brief URL, often created by a URL shortening service.'), - 'class' => 'MetaTagLink', + 'class' => 'BackdropLinkMetaTag', 'group' => 'advanced', 'weight' => ++$weight, 'replaces' => array( @@ -212,7 +212,7 @@ function metatag_metatag_info() { $info['tags']['original-source'] = array( 'label' => t('Original Source'), 'description' => '', - 'class' => 'MetaTagText', + 'class' => 'BackdropTextMetaTag', 'group' => 'advanced', 'description' => t("Used to indicate the URL that broke the story, and can link to either an internal URL or an external source. If the full URL is not known it is acceptable to use a partial URL or just the domain name."), 'weight' => ++$weight, @@ -224,7 +224,7 @@ function metatag_metatag_info() { $info['tags']['prev'] = array( 'label' => t('Previous page URL'), 'description' => t('Used for paginated content. Meet Google recommendations to indicate paginated content by providing URL with rel="prev" link.', array('@google_pagination' => 'https://support.google.com/webmasters/answer/1663744')), - 'class' => 'MetaTagLink', + 'class' => 'BackdropLinkMetaTag', 'group' => 'advanced', 'weight' => ++$weight, 'devel_generate' => array( @@ -235,7 +235,7 @@ function metatag_metatag_info() { $info['tags']['next'] = array( 'label' => t('Next page URL'), 'description' => t('Used for paginated content. Meet Google recommendations to indicate paginated content by providing URL with rel="next" link.', array('@google_pagination' => 'https://support.google.com/webmasters/answer/1663744')), - 'class' => 'MetaTagLink', + 'class' => 'BackdropLinkMetaTag', 'group' => 'advanced', 'weight' => ++$weight, 'devel_generate' => array( @@ -246,7 +246,7 @@ function metatag_metatag_info() { $info['tags']['content-language'] = array( 'label' => t('Content language'), 'description' => t("Used to define this page's language code. May be the two letter language code, e.g. \"de\" for German, or the two letter code with a dash and the two letter ISO country code, e.g. \"de-AT\" for German in Austria. Still used by Bing."), - 'class' => 'MetaTagText', + 'class' => 'BackdropTextMetaTag', 'group' => 'advanced', 'weight' => ++$weight, 'is_language' => TRUE, @@ -258,7 +258,7 @@ function metatag_metatag_info() { $info['tags']['geo.position'] = array( 'label' => t('Geo position'), 'description' => t('Geo-spatial information in "latitude;longitude" format, e.g. "50.167958;-97.133185"; see Wikipedia for details.'), - 'class' => 'MetaTagText', + 'class' => 'BackdropTextMetaTag', 'group' => 'advanced', 'weight' => ++$weight, ); @@ -266,7 +266,7 @@ function metatag_metatag_info() { $info['tags']['geo.placename'] = array( 'label' => t('Geo place name'), 'description' => t("A location's formal name."), - 'class' => 'MetaTagText', + 'class' => 'BackdropTextMetaTag', 'group' => 'advanced', 'weight' => ++$weight, ); @@ -274,7 +274,7 @@ function metatag_metatag_info() { $info['tags']['geo.region'] = array( 'label' => t('Geo region'), 'description' => t("A location's two-letter international country code, with an optional two-letter region, e.g. \"US-NH\" for New Hampshire in the USA."), - 'class' => 'MetaTagText', + 'class' => 'BackdropTextMetaTag', 'group' => 'advanced', 'weight' => ++$weight, ); @@ -282,7 +282,7 @@ function metatag_metatag_info() { $info['tags']['icbm'] = array( 'label' => t('ICBM'), 'description' => t('Geo-spatial information in "latitude, longitude" format, e.g. "50.167958, -97.133185"; see Wikipedia for details.'), - 'class' => 'MetaTagText', + 'class' => 'BackdropTextMetaTag', 'group' => 'advanced', 'weight' => ++$weight, ); @@ -290,7 +290,7 @@ function metatag_metatag_info() { $info['tags']['refresh'] = array( 'label' => t('Refresh'), 'description' => t('The number of seconds to wait before refreshing the page. May also force redirect to another page using the format "5; url=http://example.com/", which would be triggered after five seconds.'), - 'class' => 'MetaTagText', + 'class' => 'BackdropTextMetaTag', 'group' => 'advanced', 'weight' => ++$weight, 'element' => array( @@ -301,7 +301,7 @@ function metatag_metatag_info() { $info['tags']['revisit-after'] = array( 'label' => t('Revisit After'), 'description' => t('Tell search engines when to index the page again. Very few search engines support this tag, it is more useful to use an XML Sitemap file.', array('@xmlsitemap' => 'https://www.drupal.org/project/xmlsitemap')), - 'class' => 'MetaTagDateInterval', + 'class' => 'BackdropDateIntervalMetaTag', 'group' => 'advanced', 'weight' => ++$weight, 'devel_generate' => array( @@ -312,7 +312,7 @@ function metatag_metatag_info() { $info['tags']['pragma'] = array( 'label' => t('Pragma'), 'description' => t('Used to control whether a browser caches a specific page locally. Little used today. Should be used in conjunction with the Cache-Control meta tag.'), - 'class' => 'MetaTagText', + 'class' => 'BackdropTextMetaTag', 'group' => 'advanced', 'weight' => ++$weight, 'element' => array( @@ -323,7 +323,7 @@ function metatag_metatag_info() { $info['tags']['cache-control'] = array( 'label' => t('Cache-Control'), 'description' => t('Used to control whether a browser caches a specific page locally. Little used today. Should be used in conjunction with the Pragma meta tag.'), - 'class' => 'MetaTagText', + 'class' => 'BackdropTextMetaTag', 'group' => 'advanced', 'weight' => ++$weight, 'element' => array( @@ -334,7 +334,7 @@ function metatag_metatag_info() { $info['tags']['expires'] = array( 'label' => t('Expires'), 'description' => t("Control when the browser's internal cache of the current page should expire. The date must to be an RFC-1123-compliant date string that is represented in Greenwich Mean Time (GMT), e.g. 'Thu, 01 Sep 2016 00:12:56 GMT'. Set to '0' to stop the page being cached entirely.", array('@rfc' => 'http://www.csgnetwork.com/timerfc1123calc.html')), - 'class' => 'MetaTagText', + 'class' => 'BackdropTextMetaTag', 'weight' => ++$weight, 'group' => 'advanced', 'devel_generate' => array( diff --git a/metatag.module b/metatag.module index a1f9f9a..865bda3 100644 --- a/metatag.module +++ b/metatag.module @@ -35,17 +35,18 @@ function metatag_config_info() { function metatag_autoload_info() { return array( // The main classes. - 'MetaTagInterface' => 'metatag.inc', - 'MetaTagDefault' => 'metatag.inc', - 'MetaTagText' => 'metatag.inc', - 'MetaTagLink' => 'metatag.inc', - 'MetaTagTitle' => 'metatag.inc', - 'MetaTagList' => 'metatag.inc', - 'MetaTagDateInterval' => 'metatag.inc', + 'BackdropMetaTagInterface' => 'metatag.inc', + 'BackdropDefaultMetaTag' => 'metatag.inc', + 'BackdropTextMetaTag' => 'metatag.inc', + 'BackdropLinkMetaTag' => 'metatag.inc', + 'BackdropTitleMetaTag' => 'metatag.inc', + 'BackdropListMetaTag' => 'metatag.inc', + 'BackdropDateIntervalMetaTag' => 'metatag.inc', // Tests. 'MetatagTestHelper' => 'tests/metatag.helper.test', 'MetatagCoreUnitTest' => 'tests/metatag.unit.test', // Basic tag testing. + 'MetatagTagsTestBase' => 'tests/metatag.tags.test', 'MetatagTagsTest' => 'tests/metatag.tags.test', // Core entities. 'MetatagCoreNodeTest' => 'tests/metatag.node.test',