/* MetaTags
Hooks into MetaTags SiteTree method and adds MetaTags for
Sharing of this page on Social Media (Facebook / Google+)
188307
public function MetaTags(&$tags) {

        $siteConfig = SiteConfig::current_site_config();

        // facebook OpenGraph
        /*
        $tags .= '<meta property="og:locale" content="' . i18n::get_locale() . '" />' . "\n";
        $tags .= '<meta property="og:title" content="' . $this->owner->Title . '" />' . "\n";
        $tags .= '<meta property="og:description" content="' . $this->owner->MetaDescription . '" />' . "\n";
        $tags .= '<meta property="og:url" content=" ' . $this->owner->AbsoluteLink() . ' " />' . "\n";
        $tags .= '<meta property="og:site_name" content="' . $siteConfig->Title . '" />' . "\n";
        $tags .= '<meta property="og:type" content="article" />' . "\n";
        */
        //$tags .= '<meta property="og:image" content="" />' . "\n";

        if (Config::inst()->get('SeoObjectExtension', 'use_webmaster_tag')) {
            $tags .= $siteConfig->GoogleWebmasterMetaTag . "\n";
        }
    }
62843
public CreateNewNoteIntentBuilder addTags(@Nullable ArrayList<String> tags) {
        ArrayList<String> list = mArgs.getStringArrayList(EvernoteIntent.EXTRA_TAG_NAME_LIST);
        if (list == null) {
            list = tags;

        } else if (tags != null) {
            list.addAll(tags);
        }

        return setTags(list);
    }
1179537
private void addExternalResourceTags(StringBuffer sb, CmsContentDefinition definition) {

        Set<String> includedScripts = new HashSet<String>();
        Set<String> includedStyles = new HashSet<String>();
        for (CmsExternalWidgetConfiguration configuration : definition.getExternalWidgetConfigurations()) {
            for (String css : configuration.getCssResourceLinks()) {
                // avoid including the same resource twice
                if (!includedStyles.contains(css)) {
                    sb.append("<link type=\"text/css\" rel=\"stylesheet\" href=\"").append(css).append("\"></link>");
                    includedStyles.add(css);
                }
            }
            for (String script : configuration.getJavaScriptResourceLinks()) {
                // avoid including the same resource twice
                if (!includedScripts.contains(script)) {
                    sb.append("<script type=\"text/javascript\" src=\"").append(script).append("\"></script>");
                    includedScripts.add(script);
                }
            }
        }
    }
406555
protected function addFacebook()
	{
		// Get default Site Name
		$sitename = $this->getConfig('title.sitename');

		// Get value for title tag
		$title = $this->renderTitle();

		// Get value of description
		$description = ($this->description) ? $this->description : $this->getConfig('description');

		// Get Default values in config file
		$admins = $this->getConfig('facebook.admins');
		$page_id = $this->getConfig('facebook.page_id');
		$app_id = $this->getConfig('facebook.app_id');
		$image = $this->getConfig('facebook.image');

		// Check if option is active
		if ($this->getConfig('facebook.active'))
		{
			// Don't override a value set manually
			if (!array_key_exists('fb:page_id', $this->meta['property']))
			{
				$this->addOneMeta('property', 'fb:page_id', $page_id);
			}

			// Don't override a value set manually
			if (!array_key_exists('fb:app_id', $this->meta['property']))
			{
				$this->addOneMeta('property', 'fb:app_id', $app_id);
			}

			// Don't override a value set manually
			if (!array_key_exists('fb:admins', $this->meta['property']))
			{
				$this->addOneMeta('property', 'fb:admins', $admins);
			}

			// Don't override a value set manually + check if file exists
			if (File::isFile(public_path($image)) && !array_key_exists('og:image', $this->meta['property']))
			{
				$this->addOneMeta('property', 'og:image', $image);
			}

			// Don't override a value set manually
			if (!array_key_exists('og:url', $this->meta['property']))
			{
				$this->addOneMeta('property', 'og:url', URL::current());
			}

			// Don't override a value set manually
			if (!array_key_exists('og:type', $this->meta['property']))
			{
				$this->addOneMeta('property', 'og:type', 'website');
			}

			// Don't override a value set manually
			if (!array_key_exists('og:site_name', $this->meta['property']))
			{
				$this->addOneMeta('property', 'og:site_name', $sitename);
			}

			// Don't override a value set manually
			if (!array_key_exists('og:title', $this->meta['property']))
			{
				$this->addOneMeta('property', 'og:title', $title);
			}

			// Don't override a value set manually
			if (!array_key_exists('og:description', $this->meta['property']))
			{
				$this->addOneMeta('property', 'og:description', $description);
			}
		}

		// Option is inactive
		else
		{
			$this->killFacebook();
		}
	}
1033244
public ListTagsLogGroupResult withTags(java.util.Map<String, String> tags) {
        setTags(tags);
        return this;
    }
1256906
public function MetaTags(&$tags)
    {
        $MetaMarkup = array();
        $owner = $this->owner;
        $tagTypes = array(
            'TagTitle',
            'MetaTagCharset',
            'MetaTagGenerator',
            'MetaTagDescription',
            'MetaTagRobots',
            'MetaTagResponsive',
            'MetaTagTwitter',
            'SchemaTagWebsite',
            'SchemaTagBreadcrumbs',
            'SchemaTagContactPoints',
            'SchemaTagLocalBusiness'
        );

        foreach ($tagTypes as $tagType) {
            if ($owner->{$tagType}) {
                $MetaMarkup[] = $owner->{$tagType};
            }
        }

        if(Permission::check('CMS_ACCESS_CMSMain')
        && in_array('CMSPreviewable', class_implements($owner))
        && !$owner instanceof ErrorPage
        && $owner->ID > 0
        ) {
            $MetaMarkup[] = MetaHelper::MetaTag('x-page-id', $owner->ID);
            $MetaMarkup[] = MetaHelper::MetaTag('x-cms-edit-link', $owner->CMSEditLink());
            Requirements::customScript(file_get_contents(BASE_PATH.'/'.BETTERMETA_DIR.'/js/cmseditshortcut.js'));
        }

        $tags = implode("\n", $MetaMarkup);
    }
1099473
private void addChildElements() {
        for (Node node : nodes) {
        	if(node instanceof NestableNode) {
	            List<Node> nl = ((NestableNode) node).getChildren();
	            for (Node n : nl) {
	                if (!(n instanceof Element)) {
	                    continue;
	                }
	                
	                String tag = selector.getTagName();
	                if (tagEquals(tag, ((Element)n).getNormalizedName()) || tag.equals(Selector.UNIVERSAL_TAG)) {
	                    result.add(n);
	                }
	            }
        	}
        }
    }
963522
public void addMemberTree(Content memberSummaryTree, Content memberTree) {
        if (configuration.allowTag(HtmlTag.SECTION)) {
            HtmlTree htmlTree = HtmlTree.SECTION(getMemberTree(memberTree));
            memberSummaryTree.addContent(htmlTree);
        } else {
            memberSummaryTree.addContent(getMemberTree(memberTree));
        }
    }
1301042
public HtmlDocumentBuilder useTags( String... tags )
    {
        this.tags.clear();
        this.tags.addAll( Arrays.asList( tags ) );
        return this;
    }
706033
function addChildTag(tag, tagName, parent) {
  var cachedTag = parent.tags[tagName]

  // if there are multiple children tags having the same name
  if (cachedTag) {
    // if the parent tags property is not yet an array
    // create it adding the first cached tag
    if (!isArray(cachedTag))
      // don't add the same tag twice
      if (cachedTag !== tag)
        parent.tags[tagName] = [cachedTag]
    // add the new nested tag to the array
    if (!contains(parent.tags[tagName], tag))
      parent.tags[tagName].push(tag)
  } else {
    parent.tags[tagName] = tag
  }
}
62334
def add_tags(self, *tags):
        
        self.tags.extend([
            Tag(name=tag) for tag in tags
        ])
808756
public function MetaTags($includeTitle = true)
    {
        $tags = array();

        if ($includeTitle && strtolower($includeTitle) != 'false') {
            $title = $this->owner->MetaTitle
                ? $this->owner->MetaTitle
                : $this->owner->Title;
            $tags[] = HTML::createTag('title', array(), $title);
        }
        $generator = trim(Config::inst()->get(SiteTree::class, 'meta_generator'));
        if (!empty($generator)) {
            $tags[] = HTML::createTag('meta', array(
                'name' => 'generator',
                'content' => $generator,
            ));
        }

        $charset = ContentNegotiator::config()->uninherited('encoding');
        $tags[] = HTML::createTag('meta', array(
            'http-equiv' => 'Content-Type',
            'content' => 'text/html; charset=' . $charset,
        ));

        if ($this->owner->MetaDescription) {
            $tags[] = HTML::createTag('meta', array(
                'name' => 'description',
                'content' => $this->owner->MetaDescription,
            ));
        }

        $this->owner->extend('updateMetaTagsArray', $tags);
        $tagString = implode("\n", $tags);
        $this->owner->extend('updateMetaTags', $tagString);

        return DBField::create_field('HTMLFragment', $tagString);
    }
497533
public function MetaTags(&$tags)
    {
        if ($code = GoogleAPI::singleton()->getVerificationCode()) {
            
            // Add New Line (if does not exist):
            
            if (!preg_match('/[\n]$/', $tags)) {
                $tags .= "\n";
            }
            
            // Add Verification Code Meta Tag:
            
            $tags .= sprintf(
                "<meta name=\"%s\" content=\"%s\" />\n",
                self::VERIFICATION_TAG_NAME,
                Convert::raw2att($code)
            );
            
        }
    }
103169
def add_meta(self, obj, tags, prompt, verbosity, old_url=None):
        
        for tag in tags:
            keyword = self.trunc(Keyword, prompt, title=tag)
            keyword, created = Keyword.objects.get_or_create_iexact(**keyword)
            obj.keywords.create(keyword=keyword)
            if created and verbosity >= 1:
                print("Imported tag: %s" % keyword)
        if old_url is not None:
            old_path = urlparse(old_url).path
            if not old_path.strip("/"):
                return
            redirect = self.trunc(Redirect, prompt, old_path=old_path)
            redirect['site'] = Site.objects.get_current()
            redirect, created = Redirect.objects.get_or_create(**redirect)
            redirect.new_path = obj.get_absolute_url()
            redirect.save()
            if created and verbosity >= 1:
                print("Created redirect for: %s" % old_url)
304906
public void buildTagInfo(XMLNode node, Content fieldDocTree) {
        writer.addTags((FieldDoc) fields.get(currentFieldIndex), fieldDocTree);
    }
1073969
public void registerTag(String name, FreeMarkerTag tag){
        configuration.setSharedVariable(name, tag);
        userTags.add(tag);
    }
367088
function(tag) {
    var posts = [];
    for (var key in this.posts) {
      if (this.posts[key].tags && this.posts[key].tags.indexOf(tag) !== -1) {
        posts.push(this.posts[key]);
      }
    }
    return posts;
  }