You are here

static function krumo::_string in Devel 6

Same name and namespace in other branches
  1. 7 krumo/class.krumo.php \krumo::_string()

* Render a dump for a string value * *

Parameters

mixed $data: * @param string $name * @access private * @static

1 call to krumo::_string()
krumo::_dump in krumo/class.krumo.php
* Dump information about a variable * *

File

krumo/class.krumo.php, line 1212

Class

krumo
Krumo API

Code

static function _string($data, $name) {

  // extra ?
  //
  $_extra = false;
  $_ = $data;
  if (strLen($data) > KRUMO_TRUNCATE_LENGTH) {
    $_ = substr($data, 0, KRUMO_TRUNCATE_LENGTH - 3) . '...';
    $_extra = true;
  }
  ?>
<li class="krumo-child">

	<div class="krumo-element<?php

  echo $_extra ? ' krumo-expand' : '';
  ?>"
		<?php

  if ($_extra) {
    ?> onClick="krumo.toggle(this);"<?php

  }
  ?>
		onMouseOver="krumo.over(this);"
		onMouseOut="krumo.out(this);">

			<?php


  /* DEVEL: added htmlSpecialChars */
  ?>
			<a class="krumo-name"><?php

  echo htmlSpecialChars($name);
  ?></a>
			(<em class="krumo-type">String,
				<strong class="krumo-string-length"><?php

  echo strlen($data);
  ?> characters</strong> </em>)
			<strong class="krumo-string"><?php

  echo htmlSpecialChars($_);
  ?></strong>
			
			<?php


  // callback ?
  //
  if (is_callable($data)) {
    ?>
				<span class="krumo-callback"> |
					(<em class="krumo-type">Callback</em>)
					<strong class="krumo-string"><?php

    echo htmlSpecialChars($_);
    ?>();</strong></span>
				<?php

  }
  ?>
			
	</div>
	
	<?php

  if ($_extra) {
    ?>
	<div class="krumo-nest" style="display:none;">
		<ul class="krumo-node">
			
			<li class="krumo-child">
				<div class="krumo-preview"><?php

    echo htmlSpecialChars($data);
    ?></div>
			</li>
			
		</ul>
	</div>
	<?php

  }
  ?>
</li>
<?php

}