本文整理汇总了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;
}