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


PHP clsTinyButStrong::f_Xml_AttFind方法代码示例

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


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

示例1: TbsPicPrepare

 function TbsPicPrepare(&$Txt, &$Loc, $IsCaching)
 {
     if (isset($Loc->PrmLst['pic_prepared'])) {
         return true;
     }
     if (isset($Loc->PrmLst['att'])) {
         return $this->RaiseError('Parameter att is used with parameter ope=changepic in the field [' . $Loc->FullName . ']. changepic will be ignored');
     }
     $backward = true;
     if (isset($Loc->PrmLst['tagpos'])) {
         $s = $Loc->PrmLst['tagpos'];
         if ($s == 'before') {
             $backward = false;
         } elseif ($s == 'inside') {
             if ($this->ExtType == 'openxml') {
                 $backward = false;
             }
         }
     }
     // Find the target attribute
     $att = false;
     if ($this->ExtType === 'odf') {
         $att = 'draw:image#xlink:href';
     } elseif ($this->ExtType === 'openxml') {
         $att = $this->OpenXML_FirstPicAtt($Txt, $Loc->PosBeg, $backward);
         if ($att === false) {
             return $this->RaiseError('Parameter ope=changepic used in the field [' . $Loc->FullName . '] has failed to found the picture.');
         }
     } else {
         return $this->RaiseError('Parameter ope=changepic used in the field [' . $Loc->FullName . '] is not supported with the current document type.');
     }
     // Move the field to the attribute
     // This technical works with cached fields because already cached fields are placed before the picture.
     $prefix = $backward ? '' : '+';
     $Loc->PrmLst['att'] = $prefix . $att;
     clsTinyButStrong::f_Xml_AttFind($Txt, $Loc, true);
     // Delete parameter att to prevent TBS from another processing
     unset($Loc->PrmLst['att']);
     // Get picture dimension information
     if (isset($Loc->PrmLst['adjust'])) {
         $FieldLen = 0;
         if ($this->ExtType === 'odf') {
             $Loc->otbsDim = $this->TbsPicGetDim_ODF($Txt, $Loc->PosBeg, false, $Loc->PosBeg, $FieldLen);
         } else {
             if (strpos($att, 'v:imagedata') !== false) {
                 $Loc->otbsDim = $this->TbsPicGetDim_OpenXML_vml($Txt, $Loc->PosBeg, false, $Loc->PosBeg, $FieldLen);
             } else {
                 $Loc->otbsDim = $this->TbsPicGetDim_OpenXML_dml($Txt, $Loc->PosBeg, false, $Loc->PosBeg, $FieldLen);
             }
         }
     }
     // Set the original picture to empty
     if (isset($Loc->PrmLst['unique']) && $Loc->PrmLst['unique']) {
         // Get the value in the template
         $Value = substr($Txt, $Loc->PosBeg, $Loc->PosEnd - $Loc->PosBeg + 1);
         if ($this->ExtType === 'odf') {
             $InternalPicPath = $Value;
         } elseif ($this->ExtType === 'openxml') {
             $InternalPicPath = $this->OpenXML_GetInternalPicPath($Value);
             if ($InternalPicPath === false) {
                 $this->RaiseError('The picture to merge with field [' . $Loc->FullName . '] cannot be found. Value=' . $Value);
             }
         }
         // Set the picture file to empty
         $this->FileReplace($InternalPicPath, '', TBSZIP_STRING, false);
     }
     $Loc->PrmLst['pic_prepared'] = true;
     return true;
 }
开发者ID:andrecun,项目名称:mhsln_ibc_v2,代码行数:69,代码来源:tbs_plugin_opentbs.php


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