Exemplo n.º 1
0
 /**
  * @abstract Tracks Meta tag information for inclusion later.
  * 
  * @param string $type The type of meta tag.  Acceptable types are `name` and `http-equiv`. 
  * @param string $type_value The $types value (if $type_value='author' then name='author').
  * @param string $content  The content of the `content` attribute of the meta tag ( name='author' content='Justin Johnson').
  * @param string $append Optional. If false, any $content already at $type-$type_value will be overwritten; otherwise,
  * $content will be appended to the existing $type-$type_value pair and separated by $append (default: false).
  * 
  * @return string Returns an empty string for use with GOAT.
  */
 public static function metaInclude($type, $type_value, $content, $append = false)
 {
     $type = strtolower(trim($type));
     $type_value = strtolower(trim($type_value));
     $metaData = ListBuilder::build('meta-inc');
     if (!$metaData) {
         $metaData = array();
     } else {
         $metaData = $metaData[0];
     }
     if (!isset($metaData[$type])) {
         $metaData[$type] = array();
     }
     if ($append !== false && isset($metaData[$type][$type_value])) {
         $metaData[$type][$type_value] = $metaData[$type][$type_value] . $append . $content;
     } else {
         $metaData[$type][$type_value] = $content;
     }
     ListBuilder::remove('meta-inc');
     ListBuilder::add('meta-inc', $metaData);
     return '';
 }