PluginProbe
Tracking Code Manager / 2.3.0
Tracking Code Manager v2.3.0
2.8.0 2.7.0 trunk 1.11.8 1.11.9 1.12.0 1.12.1 1.12.2 1.12.3 1.4 1.5 2.0.0 2.0.1 2.0.13 2.0.14 2.0.15 2.0.16 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 2.0.7 2.1.0 2.2.0 All 29 releases
tracking-code-manager / includes / classes / html / BehaviourTag.php
BehaviourTag.php
52 lines 1.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 if (!defined('ABSPATH')) exit;
3
4 class IRP_BehaviourTag extends IRP_HTMLTag {
5
6 var $allowBoxBefore=FALSE;
7 var $allowBoxAfter=FALSE;
8 var $skipWordsCount=FALSE;
9 var $ensureUncuttable=FALSE;
10 var $ensureWithoutPreviousBox=FALSE;
11 var $ensureWithoutNextBox=FALSE;
12
13 public function write(IRP_HTMLContext $context) {
14 $w=$context->skipWordsCount;
15 $context->skipWordsCount=$this->skipWordsCount;
16
17 if($this->ensureWithoutPreviousBox) {
18 //if present remove the last related box
19 $args=array('last'=>TRUE);
20 $context->popRelatedBox($args);
21 }
22 if($this->allowBoxBefore) {
23 $context->writeRelatedBoxIfNeeded();
24 }
25
26 if($this->ensureUncuttable) {
27 $previous=$context->isUncuttable();
28 $context->setUncuttable(TRUE);
29 }
30 parent::write($context);
31 if($this->ensureUncuttable) {
32 $context->setUncuttable($previous);
33 }
34
35 if($this->allowBoxAfter) {
36 $context->writeRelatedBoxIfNeeded();
37 }
38 if($this->ensureWithoutNextBox) {
39 $context->setWithoutNextBox();
40 }
41
42 $context->skipWordsCount=$w;
43 }
44 public function analyseText(IRP_HTMLContext $context) {
45 if($this->skipWordsCount) {
46 return;
47 }
48
49 parent::analyseText($context);
50 }
51 }
52