Overview

Packages

  • CONTENIDO
  • Core
    • Authentication
    • Backend
    • Cache
    • CEC
    • Chain
    • ContentType
    • Database
    • Debug
    • Exception
    • Frontend
      • Search
      • URI
      • Util
    • GenericDB
      • Model
    • GUI
      • HTML
    • I18N
    • LayoutHandler
    • Log
    • Security
    • Session
    • Util
    • Validation
    • Versioning
    • XML
  • Module
    • ContentRssCreator
    • ContentSitemapHtml
    • ContentSitemapXml
    • ContentUserForum
    • NavigationTop
    • ScriptCookieDirective
  • mpAutoloaderClassMap
  • None
  • Plugin
    • ContentAllocation
    • CronjobOverview
    • FormAssistant
    • FrontendLogic
    • FrontendUsers
    • Linkchecker
    • ModRewrite
    • Newsletter
    • Repository
      • FrontendNavigation
      • KeywordDensity
    • SearchSolr
    • SmartyWrapper
    • UrlShortener
    • UserForum
    • Workflow
  • PluginManager
  • Setup
    • Form
    • GUI
    • Helper
      • Environment
      • Filesystem
      • MySQL
      • PHP
    • UpgradeJob

Classes

  • cAjaxRequest
  • cAutoload
  • cBackend
  • cEffectiveSetting
  • cGuiScrollListAlltranslations
  • cHTMLValidator
  • cMailer
  • cModuleFileTranslation
  • cModuleHandler
  • cModuleSearch
  • cModuleSynchronizer
  • cModuleTemplateHandler
  • CodeMirror
  • cPasswordRequest
  • cPermission
  • cRegistry
  • cSystemPurge
  • cSystemtest
  • cTinymce4Configuration
  • cTinyMCE4Editor
  • cTinyMCEEditor
  • cWYSIWYGEditor
  • FrontendList
  • HtmlParser
  • TODOBackendList
  • TreeItem
  • UploadList
  • UploadSearchResultList

Functions

  • addArtspec
  • addSortImages
  • backToMainArea
  • buildArticleSelect
  • buildCategorySelect
  • buildCategorySelectRights
  • buildHeapTable
  • buildStackString
  • buildTree
  • buildUserOrGroupPermsFromRequest
  • callPluginStore
  • cApiCatGetLevelNode
  • cApiImageCheckCachedImageValidity
  • cApiImageCheckImageEditingPosibility
  • cApiImageGetCacheFileName
  • cApiImageGetTargetDimensions
  • cApiImageIsAnimGif
  • cApiImgScale
  • cApiImgScaleGetMD5CacheFile
  • cApiImgScaleHQ
  • cApiImgScaleImageMagick
  • cApiImgScaleLQ
  • cApiIsImageMagickAvailable
  • cApiStrCleanURLCharacters
  • cApiStrNormalizeLineEndings
  • cApiStrRecodeString
  • cApiStrReplaceDiacritics
  • cApiStrTrimAfterWord
  • cApiStrTrimHard
  • cApiStrTrimSentence
  • cDeprecated
  • cDie
  • cError
  • checkLangInClients
  • checkPathInformation
  • cInclude
  • compareUrlStrings
  • conChangeTemplateForCat
  • conCopyArticle
  • conCopyArtLang
  • conCopyContainerConf
  • conCopyContent
  • conCopyMetaTags
  • conCopyTemplateConfiguration
  • conCreateLocationString
  • conDeeperCategoriesArray
  • conDeleteart
  • conEditArt
  • conEditFirstTime
  • conFetchCategoryTree
  • conFlagOnOffline
  • conGenerateCode
  • conGenerateCodeForAllArts
  • conGenerateCodeForAllArtsInCategory
  • conGenerateCodeForAllartsUsingLayout
  • conGenerateCodeForAllartsUsingMod
  • conGenerateCodeForAllArtsUsingTemplate
  • conGenerateCodeForArtInAllCategories
  • conGenerateCodeForClient
  • conGenerateKeywords
  • conGetAvailableMetaTagTypes
  • conGetCategoryArticleId
  • conGetCategoryAssignments
  • conGetContainerConfiguration
  • conGetContentFromArticle
  • conGetHtmlTranslationTable
  • conGetMetaValue
  • conGetTemplateConfigurationIdForArticle
  • conGetTemplateConfigurationIdForCategory
  • conGetTopmostCat
  • conGetUsedModules
  • conHtmlentities
  • conHtmlEntityDecode
  • conHtmlSpecialChars
  • conIsLocked
  • conLock
  • conLockBulkEditing
  • conMakeArticleIndex
  • conMakeCatOnline
  • conMakeInlineScript
  • conMakeOnline
  • conMakeOnlineBulkEditing
  • conMakePublic
  • conMakeStart
  • conMoveArticles
  • conPhp54Check
  • conRemoveOldCategoryArticle
  • conSaveContentEntry
  • conSetCodeFlag
  • conSetCodeFlagBulkEditing
  • conSetMetaValue
  • conSyncArticle
  • copyRightsForElement
  • createBulkEditingFunction
  • createRandomName
  • createRightsForElement
  • cWarning
  • dbGetColumns
  • dbGetIndexes
  • dbGetPrimaryKeyName
  • dbTableExists
  • dbUpgradeTable
  • defineIfNotDefined
  • deleteArtspec
  • deleteRightsForElement
  • deleteSystemProperty
  • displayDatetime
  • emptyLogFile
  • endAndLogTiming
  • extractNumber
  • generateDisplayFilePath
  • generateJs
  • getAllClientsAndLanguages
  • getArtLang
  • getArtspec
  • getAvailableContentTypes
  • getCanonicalDay
  • getCanonicalMonth
  • getDirectorySize
  • getEffectiveSetting
  • getEffectiveSettingsByType
  • getEncodingByLanguage
  • getFileContents
  • getFileInformation
  • getFileType
  • getGroupOrUserName
  • getIDForArea
  • getJsHelpContext
  • getLanguageNamesByClient
  • getLanguagesByClient
  • getmicrotime
  • getNamedFrame
  • getParam
  • getParentAreaId
  • getSearchResults
  • getStrExpandCollapseButton
  • getSystemProperties
  • getSystemPropertiesByType
  • getSystemProperty
  • getTemplateSelect
  • getUplExpandCollapseButton
  • htmldecode
  • htmlentities_iso88592
  • humanReadableSize
  • includePlugins
  • insertEmptyStrRow
  • ipMatch
  • isAlphanumeric
  • isArchive
  • isArtInMultipleUse
  • isFunctionDisabled
  • isGroup
  • isIPv4
  • isRunningFromWeb
  • isStartArticle
  • isUtf8
  • isValidMail
  • langActivateDeactivateLanguage
  • langDeleteLanguage
  • langEditLanguage
  • langGetTextDirection
  • langNewLanguage
  • langRenameLanguage
  • layDeleteLayout
  • layEditLayout
  • machineReadableSize
  • mailLogBulkEditingFunctions
  • mailLogDecodeAddresses
  • markSubMenuItem
  • mask
  • modDeleteModule
  • modEditModule
  • phpInfoToHtml
  • plugin_include
  • prCreateURLNameLocationString
  • prDeleteCacheFileContent
  • prGetCacheFileContent
  • prResolvePathViaCategoryNames
  • prResolvePathViaURLNames
  • prWriteCacheFileContent
  • putFileContents
  • recursiveCopy
  • removeFileInformation
  • renderBackendBreadcrumb
  • renderLabel
  • renderSelectProperty
  • renderTextProperty
  • saveGroupRights
  • saveRights
  • scanDirectory
  • scanPlugins
  • sendEncodingHeader
  • set_magic_quotes_gpc
  • setArtspecDefault
  • setArtspecOnline
  • setSystemProperty
  • showTree
  • startTiming
  • statCreateLocationString
  • statDisplayTopChooser
  • statDisplayYearlyTopChooser
  • statGetAvailableMonths
  • statGetAvailableYears
  • statResetStatistic
  • statsArchive
  • statsDisplayInfo
  • statsOverviewAll
  • statsOverviewTop
  • statsOverviewTopYear
  • statsOverviewYear
  • strAssignTemplate
  • strBuildSqlValues
  • strCheckTreeForErrors
  • strCopyCategory
  • strCopyTree
  • strDeeperCategoriesArray
  • strDeleteCategory
  • strHasArticles
  • strHasStartArticle
  • strMakePublic
  • strMakeVisible
  • strMoveCatTargetallowed
  • strMoveDownCategory
  • strMoveSubtree
  • strMoveUpCategory
  • strNewCategory
  • strNewTree
  • strNextBackwards
  • strNextDeeper
  • strNextDeeperAll
  • strNextPost
  • strOrderedPostTreeList
  • strRemakeTreeTable
  • strRenameCategory
  • strRenameCategoryAlias
  • strSortPrePost
  • strSyncCategory
  • systemHavePerm
  • tplAutoFillModules
  • tplBrowseLayoutForContainers
  • tplcfgDuplicate
  • tplDeleteTemplate
  • tplDuplicateTemplate
  • tplEditTemplate
  • tplGetContainerDefault
  • tplGetContainerMode
  • tplGetContainerName
  • tplGetContainerNumbersInLayout
  • tplGetContainerTypes
  • tplGetInUsedData
  • tplIsTemplateInUse
  • tplPreparseLayout
  • tplProcessSendContainerConfiguration
  • updateClientCache
  • updateFileInformation
  • uplCreateFriendlyName
  • uplDirectoryListRecursive
  • uplGetDirectoriesToExclude
  • uplGetFileExtension
  • uplGetFileIcon
  • uplGetFileTypeDescription
  • uplGetThumbnail
  • uplHasFiles
  • uplHasSubdirs
  • uplmkdir
  • uplRecursiveDBDirectoryList
  • uplRecursiveDirectoryList
  • uplRenameDirectory
  • uplSearch
  • uplSyncDirectory
  • uplSyncDirectoryDBFS
  • Overview
  • Package
  • Class
  • Tree
  • Deprecated
  • Todo
  1: <?php
  2: 
  3: /**
  4:  * This file contains the html parser class.
  5:  *
  6:  * @package Core
  7:  * @subpackage Backend
  8:  * @author Starnetsys, LLC.
  9:  * @copyright Starnetsys, LLC.
 10:  * @link http://starnetsys.com
 11:  */
 12: 
 13: defined('CON_FRAMEWORK') || die('Illegal call: Missing framework initialization - request aborted.');
 14: 
 15: /**
 16:  * Class HtmlParser.
 17:  *
 18:  * To use, create an instance of the class passing HTML text.
 19:  *
 20:  * Then invoke parse() until it's false.
 21:  *
 22:  * When parse() returns true, $_NodeType, $_NodeName $_NodeValue and
 23:  * $_NodeAttributes are updated.
 24:  *
 25:  * Copyright (c) 2003 Starnetsys, LLC. All rights reserved.
 26:  * Redistribution of source must retain this copyright notice.
 27:  *
 28:  * Starnetsys, LLC (http://starnetsys.com) specializes in
 29:  * website design and software consulting
 30:  *
 31:  * @package Core
 32:  * @subpackage Backend
 33:  */
 34: class HtmlParser {
 35: 
 36:     /**
 37:      * Node type ID for elements.
 38:      *
 39:      * @var int
 40:      */
 41:     const NODE_TYPE_ELEMENT = 1;
 42: 
 43:     /**
 44:      * Node type ID for endelements.
 45:      *
 46:      * @var int
 47:      */
 48:     const NODE_TYPE_ENDELEMENT = 2;
 49: 
 50:     /**
 51:      * Node type ID for texts.
 52:      *
 53:      * @var int
 54:      */
 55:     const NODE_TYPE_TEXT = 3;
 56: 
 57:     /**
 58:      * Node type ID for comments.
 59:      *
 60:      * @var int
 61:      */
 62:     const NODE_TYPE_COMMENT = 4;
 63: 
 64:     /**
 65:      * Node type ID when done.
 66:      *
 67:      * @var int
 68:      */
 69:     const NODE_TYPE_DONE = 5;
 70: 
 71:     /**
 72:      * Field iNodeType.
 73:      *
 74:      * May be one of the NODE_TYPE_* constants above.
 75:      *
 76:      * @var int
 77:      */
 78:     protected $_NodeType;
 79: 
 80:     /**
 81:      * Field iNodeName.
 82:      *
 83:      * For elements, it's the name of the element.
 84:      *
 85:      * @var string
 86:      */
 87:     protected $_NodeName = "";
 88: 
 89:     /**
 90:      * Field iNodeValue.
 91:      *
 92:      * For text nodes, it's the text.
 93:      *
 94:      * @var string
 95:      */
 96:     protected $_NodeValue = "";
 97: 
 98:     /**
 99:      * Field iNodeAttributes.
100:      *
101:      * A string-indexed array containing attribute values
102:      * of the current node. Indexes are always lowercase.
103:      *
104:      * @var array
105:      */
106:     protected $_NodeAttributes = array();
107: 
108:     /**
109:      *
110:      * @var string
111:      */
112:     protected $_HtmlText = '';
113: 
114:     /**
115:      *
116:      * @var int
117:      */
118:     protected $_HtmlTextLength;
119: 
120:     /**
121:      *
122:      * @var int
123:      */
124:     protected $_HtmlTextIndex = 0;
125: 
126:     /**
127:      * Constructor to create an instance of this class.
128:      *
129:      * Constructs an HtmlParser instance with the HTML text given.
130:      *
131:      * @param string $HtmlText
132:      */
133:     public function __construct($HtmlText) {
134:         $this->setHtmlText($HtmlText);
135:         $this->setHtmlTextLength(strlen($HtmlText));
136:     }
137: 
138:     /**
139:      * Old constructor.
140:      *
141:      * @deprecated [2016-02-04]
142:      *          This method is deprecated and is not needed any longer.
143:      *          Please use __construct() as constructor function.
144:      * @param string $HtmlText
145:      * @return __construct()
146:      */
147:     public function HtmlParser($HtmlText) {
148:         cDeprecated('This method is deprecated and is not needed any longer. Please use __construct() as constructor function.');
149:         return $this->__construct($HtmlText);
150:     }
151: 
152:     /**
153:      * Set method for HtmlText variable.
154:      *
155:      * @param string $htmlText
156:      * @return string
157:      */
158:     public function setHtmlText($HtmlText) {
159:         return $this->_HtmlText = $HtmlText;
160:     }
161: 
162:     /**
163:      * Set method for HtmlTextLength variable.
164:      *
165:      * @param int $htmlText
166:      * @return int
167:      */
168:     public function setHtmlTextLength($HtmlTextLength) {
169:         return $this->_HtmlTextLength = $HtmlTextLength;
170:     }
171: 
172:     /**
173:      * Set method for HtmlTextIndex variable.
174:      *
175:      * @param int $HtmlTextIndex
176:      * @return int
177:      */
178:     public function setHtmlTextIndex($HtmlTextIndex) {
179:         return $this->_HtmlTextIndex = $HtmlTextIndex;
180:     }
181: 
182:     /**
183:      * Set method for NodeAttributes.
184:      *
185:      * To clear this array please use _clearAttributes function.
186:      *
187:      * @param array $NodeAttributes
188:      * @return bool|array
189:      */
190:     public function _setNodeAttributes($NodeAttributes) {
191: 
192:         if (!is_array($NodeAttributes)) {
193:             return false;
194:         }
195: 
196:         return $this->_NodeAttributes = $NodeAttributes;
197:     }
198: 
199:     /**
200:      * Get method for _HtmlText.
201:      *
202:      * @return string
203:      */
204:     public function getHtmlText() {
205:         return $this->_HtmlText;
206:     }
207: 
208:     /**
209:      * Get method for _HtmlTextLength.
210:      *
211:      * @return int
212:      */
213:     public function getHtmlTextLength() {
214:         return $this->_HtmlTextLength;
215:     }
216: 
217:     /**
218:      * Get method for _NodeType.
219:      *
220:      * @return string
221:      */
222:     public function getNodeType() {
223:         return $this->_NodeType;
224:     }
225: 
226:     /**
227:      * Get method for _NodeName.
228:      *
229:      * @return string
230:      */
231:     public function getNodeName() {
232:         return $this->_NodeName;
233:     }
234: 
235:     /**
236:      * Getmethod for _NodeAttributes.
237:      *
238:      * @return array
239:      */
240:     public function getNodeAttributesArray() {
241:         return $this->_NodeAttributes;
242:     }
243: 
244:     /**
245:      * Get method for _NodeAttributes with specific attribute.
246:      *
247:      * @param string $attribute
248:      * @return string
249:      */
250:     public function getNodeAttributes($attribute) {
251:         return $this->_NodeAttributes[$attribute];
252:     }
253: 
254:     /**
255:      * Get method for _HtmlTextIndex.
256:      *
257:      * @return int
258:      */
259:     public function getHtmlTextIndex() {
260:         return $this->_HtmlTextIndex;
261:     }
262: 
263:     /**
264:      * Increase HtmlTextIndex.
265:      *
266:      * @return bool
267:      */
268:     protected function increaseHtmlTextIndex() {
269:         return $this->_HtmlTextIndex++;
270:     }
271: 
272:     /**
273:      * Method parse.
274:      *
275:      * Parses the next node. Returns false only if the end of the HTML
276:      * text has been reached. Updates values of iNode* fields.
277:      *
278:      * @return bool
279:      */
280:     public function parse() {
281:         $text = $this->_skipToElement();
282:         if ($text != "") {
283:             $this->_NodeType = self::NODE_TYPE_TEXT;
284:             $this->_NodeName = "Text";
285:             $this->_NodeValue = $text;
286:             return true;
287:         }
288:         return $this->_readTag();
289:     }
290: 
291:     /**
292:      * Clear (reset) _NodeAttributes array.
293:      *
294:      * @return array
295:      */
296:     protected function _clearAttributes() {
297:         return $this->_NodeAttributes = array();
298:     }
299: 
300:     /**
301:      *
302:      * @return bool
303:      */
304:     protected function _readTag() {
305:         if ($this->_currentChar() != "<") {
306:             $this->_NodeType = self::NODE_TYPE_DONE;
307:             return false;
308:         }
309: 
310:         $this->_skipInTag("<");
311:         $this->_clearAttributes();
312:         $name = $this->_skipToBlanksInTag();
313:         $pos = strpos($name, "/");
314: 
315:         if ($pos === 0) {
316:             $this->_NodeType = self::NODE_TYPE_ENDELEMENT;
317:             $this->_NodeName = substr($name, 1);
318:             $this->_NodeValue = "";
319:         } else {
320:             if (!$this->_isValidTagIdentifier($name)) {
321:                 $comment = false;
322:                 if ($name == "!--") {
323:                     $rest = $this->_skipToStringInTag("-->");
324:                     if ($rest != "") {
325:                         $this->_NodeType = self::NODE_TYPE_COMMENT;
326:                         $this->_NodeName = "Comment";
327:                         $this->_NodeValue = "<" . $name . $rest;
328:                         $comment = true;
329:                     }
330:                 }
331:                 if (!$comment) {
332:                     $this->_NodeType = self::NODE_TYPE_TEXT;
333:                     $this->_NodeName = "Text";
334:                     $this->_NodeValue = "<" . $name;
335:                 }
336:                 return true;
337:             } else {
338:                 $this->_NodeType = self::NODE_TYPE_ELEMENT;
339:                 $this->_NodeValue = "";
340:                 $nameLength = strlen($name);
341:                 if ($nameLength > 0 && substr($name, $nameLength - 1, 1) == "/") {
342:                     $this->_NodeName = substr($name, 0, $nameLength - 1);
343:                 } else {
344:                     $this->_NodeName = $name;
345:                 }
346:             }
347:         }
348: 
349:         while ($this->_skipBlanksInTag()) {
350:             $attrName = $this->_skipToBlanksOrEqualsInTag();
351:             $NodeAttributes = $this->getNodeAttributesArray();
352: 
353:             if ($attrName != "") {
354: 
355:                 $this->_skipBlanksInTag();
356: 
357:                 if ($this->_currentChar() == "=") {
358:                     $this->_skipEqualsInTag();
359:                     $this->_skipBlanksInTag();
360: 
361:                     $value = $this->_readValueInTag();
362: 
363:                     $NodeAttributes[strtolower($attrName)] = $value;
364:                     $this->_setNodeAttributes($NodeAttributes);
365:                 } else {
366:                     $NodeAttributes[strtolower($attrName)] = "";
367:                     $this->_setNodeAttributes($NodeAttributes);
368:                 }
369:             }
370:         }
371: 
372:         $this->_skipEndOfTag();
373:         return true;
374:     }
375: 
376:     /**
377:      *
378:      * @param string $name
379:      * @return number
380:      */
381:     protected function _isValidTagIdentifier($name) {
382:         return preg_match('/[A-Za-z0-9]+/', $name);
383:     }
384: 
385:     /**
386:      *
387:      * @return bool
388:      */
389:     protected function _skipBlanksInTag() {
390:         return "" != ($this->_skipInTag(array(
391:             " ",
392:             "\t",
393:             "\r",
394:             "\n"
395:         )));
396:     }
397: 
398:     /**
399:      *
400:      * @return string
401:      */
402:     protected function _skipToBlanksOrEqualsInTag() {
403:         return $this->_skipToInTag(array(
404:             " ",
405:             "\t",
406:             "\r",
407:             "\n",
408:             "="
409:         ));
410:     }
411: 
412:     /**
413:      *
414:      * @return string
415:      */
416:     protected function _skipToBlanksInTag() {
417:         return $this->_skipToInTag(array(
418:             " ",
419:             "\t",
420:             "\r",
421:             "\n"
422:         ));
423:     }
424: 
425:     /**
426:      *
427:      * @return string
428:      */
429:     protected function _skipEqualsInTag() {
430:         return $this->_skipInTag(array(
431:             "="
432:         ));
433:     }
434: 
435:     /**
436:      *
437:      * @return string
438:      */
439:     protected function _readValueInTag() {
440:         $ch = $this->_currentChar();
441:         $value = "";
442: 
443:         if ($ch == "\"") {
444:             $this->_skipInTag(array(
445:                 "\""
446:             ));
447:             $value = $this->_skipToInTag(array(
448:                 "\""
449:             ));
450:             $this->_skipInTag(array(
451:                 "\""
452:             ));
453:         } else if ($ch == "\'") {
454:             $this->_skipInTag(array(
455:                 "\'"
456:             ));
457:             $value = $this->_skipToInTag(array(
458:                 "\'"
459:             ));
460:             $this->_skipInTag(array(
461:                 "\'"
462:             ));
463:         } else {
464:             $value = $this->_skipToBlanksInTag();
465:         }
466: 
467:         return $value;
468:     }
469: 
470:     /**
471:      *
472:      * @return number|string
473:      */
474:     protected function _currentChar() {
475:         if ($this->getHtmlTextIndex() >= $this->getHtmlTextLength()) {
476:             return -1;
477:         }
478:         $HtmlText = $this->getHtmlText();
479:         return $HtmlText{$this->getHtmlTextIndex()};
480:     }
481: 
482:     /**
483:      *
484:      * @return bool
485:      */
486:     protected function _moveNext() {
487:         if ($this->getHtmlTextIndex() < $this->getHtmlTextLength()) {
488:             $this->increaseHtmlTextIndex();
489:             return true;
490:         } else {
491:             return false;
492:         }
493:     }
494: 
495:     /**
496:      *
497:      * @return string
498:      */
499:     protected function _skipEndOfTag() {
500:         $sb = "";
501:         if (($ch = $this->_currentChar()) !== -1) {
502:             $match = ($ch == ">");
503:             if (!$match) {
504:                 return $sb;
505:             }
506:             $sb .= $ch;
507:             $this->_moveNext();
508:         }
509:         return $sb;
510:     }
511: 
512:     /**
513:      *
514:      * @param string $chars
515:      * @return string
516:      */
517:     protected function _skipInTag($chars) {
518:         $sb = "";
519:         while (($ch = $this->_currentChar()) !== -1) {
520:             if ($ch == ">") {
521:                 return $sb;
522:             } else {
523:                 $match = false;
524:                 for ($idx = 0; $idx < count($chars); $idx++) {
525:                     if ($ch == $chars[$idx]) {
526:                         $match = true;
527:                         break;
528:                     }
529:                 }
530:                 if (!$match) {
531:                     return $sb;
532:                 }
533:                 $sb .= $ch;
534:                 $this->_moveNext();
535:             }
536:         }
537:         return $sb;
538:     }
539: 
540:     /**
541:      *
542:      * @param string $chars
543:      * @return string
544:      */
545:     protected function _skipToInTag($chars) {
546:         $sb = "";
547:         while (($ch = $this->_currentChar()) !== -1) {
548:             $match = $ch == ">";
549:             if (!$match) {
550:                 for ($idx = 0; $idx < count($chars); $idx++) {
551:                     if ($ch == $chars[$idx]) {
552:                         $match = true;
553:                         break;
554:                     }
555:                 }
556:             }
557:             if ($match) {
558:                 return $sb;
559:             }
560:             $sb .= $ch;
561:             $this->_moveNext();
562:         }
563:         return $sb;
564:     }
565: 
566:     /**
567:      *
568:      * @return string
569:      */
570:     protected function _skipToElement() {
571:         $sb = "";
572:         while (($ch = $this->_currentChar()) !== -1) {
573:             if ($ch == "<") {
574:                 return $sb;
575:             }
576:             $sb .= $ch;
577:             $this->_moveNext();
578:         }
579:         return $sb;
580:     }
581: 
582:     /**
583:      * Returns text between current position and $needle, inclusive, or
584:      * "" if not found.
585:      *
586:      * The current index is moved to a point after the location of
587:      * $needle, or not moved at all if nothing is found.
588:      *
589:      * @param string $needle
590:      * @return string
591:      */
592:     protected function _skipToStringInTag($needle) {
593:         $pos = strpos($this->getHtmlText(), $needle, $this->getHtmlTextIndex());
594:         if ($pos === false) {
595:             return "";
596:         }
597:         $top = $pos + strlen($needle);
598:         $retvalue = substr($this->getHtmlText(), $this->getHtmlTextIndex(), $top - $this->getHtmlTextIndex());
599:         $this->setHtmlTextIndex($top);
600:         return $retvalue;
601:     }
602: }
CMS CONTENIDO 4.9.11 API documentation generated by ApiGen 2.8.0