static function getAttributesMappingWithViewParameters($oObjectClassIdentifier, $view_parameters)
 {
     $oIni = eZINI::instance("metatag.ini");
     if (!$oIni->hasGroup('AttributesMapping')) {
         eZDebug::writeNotice('metatag.ini AttributesMapping is not defined', 'MetatagFunctionCollection::getAttributesMapping');
         return array();
     }
     $specialMapping = $oIni->variable('AttributesMapping', 'SpecialMapping');
     // On cherche les mappings qui peuvent correspondre
     $selected_mapping = $oObjectClassIdentifier;
     foreach ($view_parameters as $key => $value) {
         $view_parameters_key = "{$key}={$value}";
         foreach ($specialMapping as $mapping) {
             if (strpos($mapping, $view_parameters_key) !== false && strpos($mapping, $oObjectClassIdentifier) !== false) {
                 $selected_mapping = $mapping;
             }
         }
     }
     return MetatagFunctionCollection::getAttributesMapping($selected_mapping);
 }
 function fetchObjectAttributeHTTPInput($http, $base, $contentObjectAttribute)
 {
     if ($http->hasPostVariable($base . "_data_text_" . $contentObjectAttribute->attribute("id") . "_name") && $http->hasPostVariable($base . "_data_text_" . $contentObjectAttribute->attribute("id") . "_description") && $http->hasPostVariable($base . "_data_text_" . $contentObjectAttribute->attribute("id") . "_keyword")) {
         $nameValue = $http->postVariable($base . "_data_text_" . $contentObjectAttribute->attribute("id") . "_name");
         $descriptionValue = $http->postVariable($base . "_data_text_" . $contentObjectAttribute->attribute("id") . "_description");
         $keywordValue = $http->postVariable($base . "_data_text_" . $contentObjectAttribute->attribute("id") . "_keyword");
         $keyword2Value = '';
         if ($http->hasPostVariable($base . "_data_text_" . $contentObjectAttribute->attribute("id") . "_keyword2")) {
             $keyword2Value = $http->postVariable($base . "_data_text_" . $contentObjectAttribute->attribute("id") . "_keyword2");
         }
         //modified by LIU bin begin
         $keywordlinksValues = array();
         if ($http->hasPostVariable("keywordslink1")) {
             $keywordlinksValues = $http->postVariable("keywordslink1");
             array_filter($keywordlinksValues, 'is_string');
             $keywordlinksValues = array_unique($keywordlinksValues);
         }
         $keyword2linksValues = array();
         if ($http->hasPostVariable("keywordslink2")) {
             $keyword2linksValues = $http->postVariable("keywordslink2");
             array_filter($keyword2linksValues, 'is_string');
             $keyword2linksValues = array_unique($keyword2linksValues);
         }
         //modified by LIU bin end
         $tag = new eZMetaTag($nameValue);
         $object = $contentObjectAttribute->object();
         $objectDataMap = $object->datamap();
         $objectClass = $object->contentClassIdentifier();
         $ini = eZINI::instance("metatag.ini");
         // We check if filling on publish is enabled in settings
         if ($ini->hasVariable('AttributesMapping', "FillOnPublish") && $ini->variable('AttributesMapping', "FillOnPublish") == "enabled") {
             $fillOnPublish = true;
         } else {
             $fillOnPublish = false;
         }
         $nameAttributes = null;
         $descriptionAttributes = null;
         $keywordsAttributes = null;
         $attributesMappings = MetatagFunctionCollection::getAttributesMapping($objectClass);
         if (array_key_exists('name', $attributesMappings)) {
             $nameAttributes = $attributesMappings['name'];
         }
         if (array_key_exists('description', $attributesMappings)) {
             $descriptionAttributes = $attributesMappings['description'];
         }
         if (array_key_exists('keywords', $attributesMappings)) {
             $keywordsAttributes = $attributesMappings['keywords'];
         }
         unset($attributesMappings);
         if (empty($nameValue) && $fillOnPublish) {
             foreach ($nameAttributes as $attribute) {
                 if (is_object($objectDataMap[$attribute]) && $objectDataMap[$attribute]->hasContent()) {
                     $tag->setNameFromTextAttribute($objectDataMap[$attribute]);
                     break;
                 }
             }
         }
         if (empty($descriptionValue) && $fillOnPublish) {
             foreach ($descriptionAttributes as $attribute) {
                 if (is_object($objectDataMap[$attribute]) && $objectDataMap[$attribute]->hasContent()) {
                     $tag->setDescriptionFromTextAttribute($objectDataMap[$attribute]);
                     break;
                 }
             }
         } else {
             $tag->setDescription($descriptionValue);
         }
         if (empty($keywordValue) && $fillOnPublish) {
             foreach ($keywordsAttributes as $attribute) {
                 if (is_object($objectDataMap[$attribute]) && $objectDataMap[$attribute]->hasContent()) {
                     $tag->setKeywordsFromTextAttribute($objectDataMap[$attribute]);
                     break;
                 }
             }
         } else {
             $tag->setKeywords($keywordValue);
         }
         //modified by LIU bin begin
         $tag->setKeywords2($keyword2Value);
         $tag->setKeywordslinks($keywordlinksValues);
         $tag->setKeywords2links($keyword2linksValues);
         //modified by LIU bin end
         $contentObjectAttribute->setAttribute("data_text", $tag->xmlString());
         return true;
     }
     return false;
 }