Skip to content

Commit

Permalink
Class names should be a find/replace of Drupal/Backdrop for sanity.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jen Lampton committed Nov 22, 2016
1 parent c0a0ed8 commit e2fad7c
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 42 deletions.
16 changes: 8 additions & 8 deletions metatag.inc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Metatag primary classes.
*/

interface MetaTagInterface {
interface BackdropMetaTagInterface {

/**
* Constructor
Expand Down Expand Up @@ -32,7 +32,7 @@ interface MetaTagInterface {

}

class MetaTagDefault implements MetaTagInterface {
class BackdropDefaultMetaTag implements BackdropMetaTagInterface {

protected $info;
protected $data = array('value' => '');
Expand Down Expand Up @@ -224,7 +224,7 @@ class MetaTagDefault implements MetaTagInterface {
/**
* Text-based meta tag controller.
*/
class MetaTagText extends MetaTagDefault {
class BackdropTextMetaTag extends BackdropDefaultMetaTag {

/**
* {@inheritdoc}
Expand Down Expand Up @@ -370,7 +370,7 @@ class MetaTagText extends MetaTagDefault {
* Link type meta tag controller.
* <link rel="canonical" href="https://moz.com/blog" />
*/
class MetaTagLink extends MetaTagText {
class BackdropLinkMetaTag extends BackdropTextMetaTag {

/**
* {@inheritdoc}
Expand Down Expand Up @@ -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}
Expand All @@ -428,7 +428,7 @@ class MetaTagTitle extends MetaTagText {
/**
* Multiple value meta tag controller.
*/
class MetaTagList extends MetaTagDefault {
class BackdropListMetaTag extends BackdropDefaultMetaTag {

/**
* {@inheritdoc}
Expand Down Expand Up @@ -481,7 +481,7 @@ class MetaTagList extends MetaTagDefault {
/**
* Date interval meta tag controller.
*/
class MetaTagDateInterval extends MetaTagDefault {
class BackdropDateIntervalMetaTag extends BackdropDefaultMetaTag {

/**
* {@inheritdoc}
Expand Down
54 changes: 27 additions & 27 deletions metatag.metatag.inc
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,15 @@ 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,
);

$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(
Expand All @@ -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(
Expand All @@ -90,31 +90,31 @@ 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,
);

$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 <a href="@google_news">Google News</a>.', array('@google_news' => 'http://support.google.com/news/publisher/bin/answer.py?hl=en&answer=68297')),
'class' => 'MetaTagText',
'class' => 'BackdropTextMetaTag',
'group' => 'advanced',
'weight' => ++$weight,
);

$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 <a href=\"@google_news\">Google News</a>. 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,
);

$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(
Expand All @@ -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 <a href="http://w3c.github.io/webappsec/specs/referrer-policy/">the W3C specifications</a> for further details.'),
'class' => 'MetaTagText',
'class' => 'BackdropTextMetaTag',
'group' => 'advanced',
'select_or_other' => TRUE,
'form' => array(
Expand All @@ -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',
Expand All @@ -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(
Expand All @@ -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,
Expand All @@ -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(
Expand All @@ -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(
Expand All @@ -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,
Expand All @@ -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 <a href="@google_pagination">indicate paginated content</a> 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(
Expand All @@ -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 <a href="@google_pagination">indicate paginated content</a> 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(
Expand All @@ -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,
Expand All @@ -258,39 +258,39 @@ 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"; <a href="http://en.wikipedia.org/wiki/Geotagging#HTML_pages">see Wikipedia for details</a>.'),
'class' => 'MetaTagText',
'class' => 'BackdropTextMetaTag',
'group' => 'advanced',
'weight' => ++$weight,
);

$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,
);

$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,
);

$info['tags']['icbm'] = array(
'label' => t('ICBM'),
'description' => t('Geo-spatial information in "latitude, longitude" format, e.g. "50.167958, -97.133185"; <a href="https://en.wikipedia.org/wiki/ICBM_address">see Wikipedia for details</a>.'),
'class' => 'MetaTagText',
'class' => 'BackdropTextMetaTag',
'group' => 'advanced',
'weight' => ++$weight,
);

$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(
Expand All @@ -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 <a href="@xmlsitemap">XML Sitemap</a> file.', array('@xmlsitemap' => 'https://www.drupal.org/project/xmlsitemap')),
'class' => 'MetaTagDateInterval',
'class' => 'BackdropDateIntervalMetaTag',
'group' => 'advanced',
'weight' => ++$weight,
'devel_generate' => array(
Expand All @@ -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(
Expand All @@ -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(
Expand All @@ -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 <a href=\"@rfc\">RFC-1123</a>-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(
Expand All @@ -345,7 +345,7 @@ function metatag_metatag_info() {
// More advanced meta tags.
$info['tags']['robots'] = array(
'label' => t('Specific directions for robots:'),
'class' => 'MetaTagList',
'class' => 'BackdropListMetaTag',
'group' => 'advanced',
'weight' => ++$weight,
'form' => array(
Expand Down
15 changes: 8 additions & 7 deletions metatag.module
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit e2fad7c

Please sign in to comment.