function krumo::_string

Render a dump for a string value

@access private @static

Parameters

mixed $data:

string $name:

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

File

krumo/class.krumo.php, line 1254

Class

krumo
Krumo API

Code

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

  <div class="krumo-element<?php

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

      <?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

}