當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Frame_Decorator類代碼示例

本文整理匯總了PHP中Frame_Decorator的典型用法代碼示例。如果您正苦於以下問題:PHP Frame_Decorator類的具體用法?PHP Frame_Decorator怎麽用?PHP Frame_Decorator使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了Frame_Decorator類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: _render_border

 protected function _render_border(Frame_Decorator $frame, $corner_style = "bevel")
 {
     $cb = $frame->get_containing_block();
     $style = $frame->get_style();
     $bbox = $frame->get_border_box();
     $bp = $frame->get_style()->get_border_properties();
     $widths = array($style->length_in_pt($bp["top"]["width"]), $style->length_in_pt($bp["right"]["width"]), $style->length_in_pt($bp["bottom"]["width"]), $style->length_in_pt($bp["left"]["width"]));
     foreach ($bp as $side => $props) {
         list($x, $y, $w, $h) = $bbox;
         if (!$props["style"] || $props["style"] == "none" || $props["width"] <= 0) {
             continue;
         }
         switch ($side) {
             case "top":
                 $length = $w;
                 break;
             case "bottom":
                 $length = $w;
                 $y += $h;
                 break;
             case "left":
                 $length = $h;
                 break;
             case "right":
                 $length = $h;
                 $x += $w;
                 break;
             default:
                 break;
         }
         $method = "_border_" . $props["style"];
         $this->{$method}($x, $y, $length, $props["color"], $widths, $side, $corner_style);
     }
 }
開發者ID:emeraldstudio,項目名稱:somosmaestros,代碼行數:34,代碼來源:block_renderer.cls.php

示例2: reflow

 function reflow(Frame_Decorator $block = null)
 {
     $frame = $this->_frame;
     $page = $frame->get_root();
     $page->check_forced_page_break($frame);
     if ($page->is_full()) {
         return;
     }
     $style = $frame->get_style();
     $this->_set_content();
     $frame->position();
     $cb = $frame->get_containing_block();
     if (($f = $frame->get_first_child()) && $f instanceof Text_Frame_Decorator) {
         $f_style = $f->get_style();
         $f_style->margin_left = $style->margin_left;
         $f_style->padding_left = $style->padding_left;
         $f_style->border_left = $style->border_left;
     }
     if (($l = $frame->get_last_child()) && $l instanceof Text_Frame_Decorator) {
         $l_style = $l->get_style();
         $l_style->margin_right = $style->margin_right;
         $l_style->padding_right = $style->padding_right;
         $l_style->border_right = $style->border_right;
     }
     if ($block) {
         $block->add_frame_to_line($this->_frame);
     }
     foreach ($frame->get_children() as $child) {
         $child->set_containing_block($cb);
         $child->reflow($block);
     }
 }
開發者ID:EfncoPlugins,項目名稱:web-portal-lite-client-portal-secure-file-sharing-private-messaging,代碼行數:32,代碼來源:inline_frame_reflower.cls.php

示例3: reflow

    function reflow(Frame_Decorator $block = null)
    {
        $frame = $this->_frame;
        $page = $frame->get_root();
        $page->check_forced_page_break($this->_frame);

        if ($page->is_full())
            return;

        $this->_block_parent = /*isset($block) ? $block : */
            $frame->find_block_parent();

        // Left trim the text if this is the first text on the line and we're
        // collapsing white space
//     if ( $this->_block_parent->get_current_line()->w == 0 &&
//          ($frame->get_style()->white_space !== "pre" ||
//           $frame->get_style()->white_space !== "pre-wrap") ) {
//       $frame->set_text( ltrim( $frame->get_text() ) );
//     }

        $frame->position();

        $this->_layout_line();

        if ($block) {
            $block->add_frame_to_line($frame);
        }
    }
開發者ID:rmuyinda,項目名稱:dms-1,代碼行數:28,代碼來源:text_frame_reflower.cls.php

示例4: reflow

 function reflow(Frame_Decorator $block = null)
 {
     $this->_frame->position();
     $this->get_min_max_width();
     if ($block) {
         $block->add_frame_to_line($this->_frame);
     }
 }
開發者ID:EfncoPlugins,項目名稱:web-portal-lite-client-portal-secure-file-sharing-private-messaging,代碼行數:8,代碼來源:image_frame_reflower.cls.php

示例5: _render_outline

 protected function _render_outline(Frame_Decorator $frame, $corner_style = "bevel")
 {
     $style = $frame->get_style();
     $props = array("width" => $style->outline_width, "style" => $style->outline_style, "color" => $style->outline_color);
     if (!$props["style"] || $props["style"] === "none" || $props["width"] <= 0) {
         return;
     }
     $bbox = $frame->get_border_box();
     $offset = $style->length_in_pt($props["width"]);
     $pattern = $this->_get_dash_pattern($props["style"], $offset);
     if (in_array($props["style"], array("solid", "dashed", "dotted"))) {
         $bbox[0] -= $offset / 2;
         $bbox[1] -= $offset / 2;
         $bbox[2] += $offset;
         $bbox[3] += $offset;
         list($x, $y, $w, $h) = $bbox;
         $this->_canvas->rectangle($x, $y, $w, $h, $props["color"], $offset, $pattern);
         return;
     }
     $bbox[0] -= $offset;
     $bbox[1] -= $offset;
     $bbox[2] += $offset * 2;
     $bbox[3] += $offset * 2;
     $method = "_border_" . $props["style"];
     $widths = array_fill(0, 4, $props["width"]);
     $sides = array("top", "right", "left", "bottom");
     foreach ($sides as $side) {
         list($x, $y, $w, $h) = $bbox;
         switch ($side) {
             case "top":
                 $length = $w;
                 break;
             case "bottom":
                 $length = $w;
                 $y += $h;
                 break;
             case "left":
                 $length = $h;
                 break;
             case "right":
                 $length = $h;
                 $x += $w;
                 break;
             default:
                 break;
         }
         $this->{$method}($x, $y, $length, $props["color"], $widths, $side, $corner_style);
     }
 }
開發者ID:EfncoPlugins,項目名稱:web-portal-lite-client-portal-secure-file-sharing-private-messaging,代碼行數:49,代碼來源:block_renderer.cls.php

示例6: __construct

 /**
  * Class constructor
  *
  * @param Frame $frame the bullet frame to decorate
  * @param DOMPDF $dompdf the document's dompdf object
  */
 function __construct(Frame $frame, DOMPDF $dompdf)
 {
     $style = $frame->get_style();
     $url = $style->list_style_image;
     $frame->get_node()->setAttribute("src", $url);
     $this->_img = new Image_Frame_Decorator($frame, $dompdf);
     parent::__construct($this->_img, $dompdf);
     list($width, $height) = dompdf_getimagesize($this->_img->get_image_url());
     // Resample the bullet image to be consistent with 'auto' sized images
     // See also Image_Frame_Reflower::get_min_max_width
     // Tested php ver: value measured in px, suffix "px" not in value: rtrim unnecessary.
     $this->_width = (double) rtrim($width, "px") * 72 / DOMPDF_DPI;
     $this->_height = (double) rtrim($height, "px") * 72 / DOMPDF_DPI;
     //If an image is taller as the containing block/box, the box should be extended.
     //Neighbour elements are overwriting the overlapping image areas.
     //Todo: Where can the box size be extended?
     //Code below has no effect.
     //See block_frame_reflower _calculate_restricted_height
     //See generated_frame_reflower, Dompdf:render() "list-item", "-dompdf-list-bullet"S.
     //Leave for now
     //if ($style->min_height < $this->_height ) {
     //  $style->min_height = $this->_height;
     //}
     //$style->height = "auto";
 }
開發者ID:agashish,項目名稱:test_new,代碼行數:31,代碼來源:list_bullet_image_frame_decorator.cls.php

示例7: reflow

    function reflow(Frame_Decorator $block = null)
    {
        $frame = $this->_frame;

        // Check if a page break is forced
        $page = $frame->get_root();
        $page->check_forced_page_break($frame);

        if ($page->is_full())
            return;

        $style = $frame->get_style();

        // Generated content
        $this->_set_content();

        $frame->position();

        $cb = $frame->get_containing_block();

        // Add our margin, padding & border to the first and last children
        if (($f = $frame->get_first_child()) && $f instanceof Text_Frame_Decorator) {
            $f_style = $f->get_style();
            $f_style->margin_left = $style->margin_left;
            $f_style->padding_left = $style->padding_left;
            $f_style->border_left = $style->border_left;
        }

        if (($l = $frame->get_last_child()) && $l instanceof Text_Frame_Decorator) {
            $l_style = $l->get_style();
            $l_style->margin_right = $style->margin_right;
            $l_style->padding_right = $style->padding_right;
            $l_style->border_right = $style->border_right;
        }

        if ($block) {
            $block->add_frame_to_line($this->_frame);
        }

        // Set the containing blocks and reflow each child.  The containing
        // block is not changed by line boxes.
        foreach ($frame->get_children() as $child) {
            $child->set_containing_block($cb);
            $child->reflow($block);
        }
    }
開發者ID:rmuyinda,項目名稱:dms-1,代碼行數:46,代碼來源:inline_frame_reflower.cls.php

示例8: __construct

 function __construct(Frame $frame, DOMPDF $dompdf)
 {
     $style = $frame->get_style();
     $url = $style->list_style_image;
     $frame->get_node()->setAttribute("src", $url);
     $this->_img = new Image_Frame_Decorator($frame, $dompdf);
     parent::__construct($this->_img, $dompdf);
     list($width, $height) = dompdf_getimagesize($this->_img->get_image_url());
     $this->_width = (double) rtrim($width, "px") * 72 / DOMPDF_DPI;
     $this->_height = (double) rtrim($height, "px") * 72 / DOMPDF_DPI;
 }
開發者ID:EfncoPlugins,項目名稱:web-portal-lite-client-portal-secure-file-sharing-private-messaging,代碼行數:11,代碼來源:list_bullet_image_frame_decorator.cls.php

示例9: __construct

 /**
  * Class constructor
  *
  * @param Frame $frame the bullet frame to decorate
  * @param DOMPDF $dompdf the document's dompdf object
  */
 function __construct(Frame $frame, DOMPDF $dompdf)
 {
     $url = $frame->get_style()->list_style_image;
     $frame->get_node()->setAttribute("src", $url);
     $this->_img = new Image_Frame_Decorator($frame, $dompdf);
     parent::__construct($this->_img, $dompdf);
     list($width, $height) = getimagesize($this->_img->get_image_url());
     // Resample the bullet image to be consistent with 'auto' sized images
     $this->_width = (double) rtrim($width, "px") * 72 / DOMPDF_DPI;
     $this->_height = (double) rtrim($height, "px") * 72 / DOMPDF_DPI;
 }
開發者ID:SkMamtajuddin,項目名稱:bamboo-invoice,代碼行數:17,代碼來源:list_bullet_image_frame_decorator.cls.php

示例10: move

 function move($offset_x, $offset_y, $ignore_self = false)
 {
     list($x, $y) = $this->_frame->get_position();
     if (!$ignore_self) {
         $this->_frame->set_position($x + $offset_x, $y + $offset_y);
     }
     foreach ($this->_frame->get_children() as $child) {
         $child->move($offset_x, $offset_y);
     }
 }
開發者ID:alvarobfdev,項目名稱:applog,代碼行數:10,代碼來源:positioner.cls.php

示例11: list

 /**
  * Class constructor
  *
  * @param Frame $frame the frame to decorate
  * @param DOMPDF $dompdf the document's dompdf object (required to resolve relative & remote urls)
  */
 function __construct(Frame $frame, DOMPDF $dompdf)
 {
     global $_dompdf_warnings;
     parent::__construct($frame, $dompdf);
     $url = $frame->get_node()->getAttribute("src");
     list($this->_image_url, $this->_image_ext) = Image_Cache::resolve_url($url, $dompdf->get_protocol(), $dompdf->get_host(), $dompdf->get_base_path());
 }
開發者ID:emeraldstudio,項目名稱:somosmaestros,代碼行數:13,代碼來源:image_frame_decorator.cls.php

示例12: copy

 function copy(DomNode $node)
 {
     $deco = parent::copy($node);
     $deco->_cellmap->set_columns($this->_cellmap->get_columns());
     $deco->_cellmap->lock_columns();
     return $deco;
 }
開發者ID:EfncoPlugins,項目名稱:web-portal-lite-client-portal-secure-file-sharing-private-messaging,代碼行數:7,代碼來源:table_frame_decorator.cls.php

示例13: reset

 function reset()
 {
     parent::reset();
     $this->_lines = array(array("frames" => array(), "wc" => 0, "y" => null, "w" => 0, "h" => 0));
     $this->_counters = array(self::DEFAULT_COUNTER => 0);
     $this->_cl = 0;
 }
開發者ID:sgrove,項目名稱:cothinker,代碼行數:7,代碼來源:block_frame_decorator.cls.php

示例14: reset

 function reset()
 {
     parent::reset();
     $this->_line_boxes = array(new Line_Box($this));
     $this->_counters = array(self::DEFAULT_COUNTER => 0);
     $this->_cl = 0;
 }
開發者ID:practo,項目名稱:dompdf,代碼行數:7,代碼來源:block_frame_decorator.cls.php

示例15: reset

 function reset()
 {
     parent::reset();
     $this->_lines = array(self::$_initial_line_state);
     $this->_counters = array(self::DEFAULT_COUNTER => 0);
     $this->_cl = 0;
 }
開發者ID:rodolfobais,項目名稱:proylectura,代碼行數:7,代碼來源:block_frame_decorator.cls.php


注:本文中的Frame_Decorator類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。