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 / TextContent.php
TextContent.php
54 lines 1.9 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_TextContent extends IRP_HTMLTag {
5 var $body;
6 public function __construct() {
7 parent::__construct();
8 $this->body='';
9 }
10
11 public function hasTagContent() {
12 return FALSE;
13 }
14 public function append($text) {
15 $this->body.=$text;
16 }
17 public function write(IRP_HTMLContext $context) {
18 global $irp;
19 if($context->isUncuttable() || trim($this->body)=='') {
20 //we dont want to insert nothing inside iframe or table
21 $context->write($this->body);
22 $context->incCounters($this->body);
23 if(defined('IRP_DEBUG_BLOCK') && IRP_DEBUG_BLOCK) {
24 $context->write(sprintf('<sup style="color:red;">&nbsp;{%s/%s,%s}</sup>'
25 , $context->currentWords, $context->wordsThreshold, $context->lastBoxWords));
26 }
27 } else {
28 //here is all text so we have to decide when cut it
29 $text=explode("\n", $this->body);
30 for($i=0; $i<count($text); $i++) {
31 $line=$text[$i];
32 if(trim($line)=='') {
33 $context->writeRelatedBoxIfNeeded();
34 }
35
36 if($i<(count($text)-1)) {
37 $line.="\n";
38 }
39 $context->write($line);
40 $context->incCounters($line);
41 if(trim($line)!='') {
42 if (defined('IRP_DEBUG_BLOCK') && IRP_DEBUG_BLOCK) {
43 $context->write(sprintf('<sup style="color:#008000">&nbsp;{%s/%s,%s}</sup>'
44 , $context->currentWords, $context->wordsThreshold, $context->lastBoxWords));
45 }
46 }
47 }
48 }
49 }
50 public function analyseText(IRP_HTMLContext $context) {
51 $context->incCounters($this->body);
52 }
53 }
54