当前位置: 首页>>代码示例>>PHP>>正文


PHP Zend_Feed_Element::th方法代码示例

本文整理汇总了PHP中Zend_Feed_Element::th方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Feed_Element::th方法的具体用法?PHP Zend_Feed_Element::th怎么用?PHP Zend_Feed_Element::th使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Zend_Feed_Element的用法示例。


在下文中一共展示了Zend_Feed_Element::th方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: _mapFields

 /**
  * Maps Zotero fields to Omeka elements.
  * 
  * @param Zend_Feed_Element $tr
  */
 protected function _mapFields(Zend_Feed_Element $tr)
 {
     // Only map those field nodes that exist in the mapping array.
     if (!array_key_exists($tr['class'], ZoteroImportPlugin::$zoteroFields)) {
         return;
     }
     $fieldName = $tr['class'];
     $fieldNameLocale = $tr->th();
     $fieldMap = ZoteroImportPlugin::$zoteroFields[$fieldName];
     $elementText = $tr->td();
     // Get the element name.
     if ('creator' == $fieldName) {
         foreach ($fieldMap as $zoteroCreatorName => $creatorMap) {
             if (is_array($creatorMap) && $fieldNameLocale == $creatorMap[1]) {
                 $elementName = $creatorMap[0];
                 break;
             } else {
                 if ($fieldNameLocale == $creatorMap) {
                     $elementName = $creatorMap;
                     break;
                 }
             }
         }
         // Only map those creators that exist in the mapping array.
         if (!isset($elementName)) {
             return;
         }
     } else {
         if (is_array($fieldMap) && $fieldNameLocale == $fieldMap[1]) {
             $elementName = $fieldMap[0];
         } else {
             $elementName = $fieldMap;
         }
     }
     // Map to the Zotero element set. Set HTML to true if this is a Note.
     $this->_elementTexts['Zotero'][$elementName][] = array('text' => $elementText, 'html' => 'Note' == $elementName ? true : false);
     // Map unambiguous fields to the Dublin Core element set.
     switch ($elementName) {
         case 'Subject':
             $this->_elementTexts['Dublin Core']['Subject'][] = array('text' => $elementText, 'html' => false);
             break;
         case 'Publisher':
             $this->_elementTexts['Dublin Core']['Publisher'][] = array('text' => $elementText, 'html' => false);
             break;
         case 'Date':
             $this->_elementTexts['Dublin Core']['Date'][] = array('text' => $elementText, 'html' => false);
             break;
         case 'Rights':
             $this->_elementTexts['Dublin Core']['Rights'][] = array('text' => $elementText, 'html' => false);
             break;
         case 'Language':
             $this->_elementTexts['Dublin Core']['Language'][] = array('text' => $elementText, 'html' => false);
             break;
         case 'Contributor':
             $this->_elementTexts['Dublin Core']['Contributor'][] = array('text' => $elementText, 'html' => false);
             break;
             // Map all the Creator types to DC:Creator (except for Contributor).
         // Map all the Creator types to DC:Creator (except for Contributor).
         case 'Creator':
         case 'Attorney Agent':
         case 'Author':
         case 'Book Author':
         case 'Cartographer':
         case 'Cast Member':
         case 'Commenter':
         case 'Composer':
         case 'Contributor':
         case 'Cosponsor':
         case 'Counsel':
         case 'Director':
         case 'Editor':
         case 'Guest':
         case 'Interviewee':
         case 'Interviewer':
         case 'Inventor':
         case 'Performer':
         case 'Podcaster':
         case 'Presenter':
         case 'Producer':
         case 'Programmer':
         case 'Recipient':
         case 'Reviewed Author':
         case 'Scriptwriter':
         case 'Series Editor':
         case 'Sponsor':
         case 'Translator':
         case 'Words By':
             $this->_elementTexts['Dublin Core']['Creator'][] = array('text' => $elementText, 'html' => false);
             break;
             // Map all the Item types to DC:Type.
         // Map all the Item types to DC:Type.
         case 'Item Type':
         case 'Audio File Type':
         case 'Letter Type':
         case 'Manuscript Type':
//.........这里部分代码省略.........
开发者ID:rshiggin,项目名称:omeka-custom-exhibit,代码行数:101,代码来源:ImportProcess.php


注:本文中的Zend_Feed_Element::th方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。