• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP Frame类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中Frame的典型用法代码示例。如果您正苦于以下问题:PHP Frame类的具体用法?PHP Frame怎么用?PHP Frame使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了Frame类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: render

 function render(Frame $frame)
 {
     $style = $frame->get_style();
     list($x, $y, $w, $h) = $frame->get_padding_box();
     $this->_set_opacity($frame->get_opacity($style->opacity));
     // Draw our background, border and content
     if (($bg = $style->background_color) !== "transparent") {
         $this->_canvas->filled_rectangle($x, $y, $w, $h, $bg);
     }
     if (($url = $style->background_image) && $url !== "none") {
         $this->_background_image($url, $x, $y, $w, $h, $style);
     }
     $this->_render_border($frame);
     $this->_render_outline($frame);
     if (DEBUG_LAYOUT && DEBUG_LAYOUT_BLOCKS) {
         $this->_debug_layout($frame->get_border_box(), "red");
         if (DEBUG_LAYOUT_PADDINGBOX) {
             $this->_debug_layout($frame->get_padding_box(), "red", array(0.5, 0.5));
         }
     }
     if (DEBUG_LAYOUT && DEBUG_LAYOUT_LINES && $frame->get_decorator()) {
         foreach ($frame->get_decorator()->get_line_boxes() as $line) {
             $frame->_debug_layout(array($line->x, $line->y, $line->w, $line->h), "orange");
         }
     }
 }
开发者ID:enderochoa,项目名称:tortuga,代码行数:26,代码来源:block_renderer.cls.php


示例2: render

 function render(Frame $frame)
 {
     $style = $frame->get_style();
     $bullet_style = $style->list_style_type;
     $bullet_size = List_Bullet_Frame_Decorator::BULLET_SIZE;
     $line_height = $style->length_in_pt($style->line_height, $frame->get_containing_block("w"));
     $fill = false;
     switch ($bullet_style) {
         default:
         case "disc":
             $fill = true;
         case "circle":
             if (!$fill) {
                 $fill = false;
             }
             list($x, $y) = $frame->get_position();
             $x += $bullet_size / 2;
             $y += $line_height / 2 + $bullet_size / 4;
             $r = $bullet_size / 4;
             $this->_canvas->circle($x, $y, $r, $style->color, null, null, $fill);
             break;
         case "square":
             list($x, $y) = $frame->get_position();
             $w = $bullet_size / 2;
             $x += $bullet_size / 2 - $w / 2;
             $y += $line_height / 2;
             $this->_canvas->filled_rectangle($x, $y, $w, $w, $style->color);
             break;
     }
 }
开发者ID:andrewroth,项目名称:c4c_intranet,代码行数:30,代码来源:list_bullet_renderer.cls.php


示例3: _build_tree_r

 protected function _build_tree_r(DomNode $node)
 {
     $frame = new Frame($node);
     $id = $frame->get_id();
     $this->_registry[$id] = $frame;
     if (!$node->hasChildNodes()) {
         return $frame;
     }
     $children = array();
     for ($i = 0; $i < $node->childNodes->length; $i++) {
         $children[] = $node->childNodes->item($i);
     }
     foreach ($children as $child) {
         $node_name = mb_strtolower($child->nodeName);
         if (in_array($node_name, self::$_HIDDEN_TAGS)) {
             if ($node_name !== "head" && $node_name !== "style") {
                 $child->parentNode->removeChild($child);
             }
             continue;
         }
         if ($node_name === "#text" && $child->nodeValue == "") {
             $child->parentNode->removeChild($child);
             continue;
         }
         if ($node_name === "img" && $child->getAttribute("src") == "") {
             $child->parentNode->removeChild($child);
             continue;
         }
         $frame->append_child($this->_build_tree_r($child), false);
     }
     return $frame;
 }
开发者ID:EfncoPlugins,项目名称:web-portal-lite-client-portal-secure-file-sharing-private-messaging,代码行数:32,代码来源:frame_tree.cls.php


示例4: apply_page_style

 function apply_page_style(Frame $frame, $page_number)
 {
     $style = $frame->get_style();
     $page_styles = $style->get_stylesheet()->get_page_styles();
     // http://www.w3.org/TR/CSS21/page.html#page-selectors
     if (count($page_styles) > 1) {
         $odd = $page_number % 2 == 1;
         $first = $page_number == 1;
         $style = clone $page_styles["base"];
         // FIXME RTL
         if ($odd && isset($page_styles[":right"])) {
             $style->merge($page_styles[":right"]);
         }
         if ($odd && isset($page_styles[":odd"])) {
             $style->merge($page_styles[":odd"]);
         }
         // FIXME RTL
         if (!$odd && isset($page_styles[":left"])) {
             $style->merge($page_styles[":left"]);
         }
         if (!$odd && isset($page_styles[":even"])) {
             $style->merge($page_styles[":even"]);
         }
         if ($first && isset($page_styles[":first"])) {
             $style->merge($page_styles[":first"]);
         }
         $frame->set_style($style);
     }
 }
开发者ID:alvarobfdev,项目名称:applog,代码行数:29,代码来源:page_frame_reflower.cls.php


示例5: render

 function render(Frame $frame)
 {
     if (!DOMPDF_ENABLE_JAVASCRIPT) {
         return;
     }
     $this->insert($frame->get_node()->nodeValue);
 }
开发者ID:darshanmodi2010,项目名称:dompdf,代码行数:7,代码来源:javascript_embedder.cls.php


示例6: render

 function render(Frame $frame)
 {
     if (!$this->_dompdf->get_option("enable_javascript")) {
         return;
     }
     $this->insert($frame->get_node()->nodeValue);
 }
开发者ID:skyosev,项目名称:OpenCart-Overclocked,代码行数:7,代码来源:javascript_embedder.cls.php


示例7: __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


示例8: translate_attributes

 static function translate_attributes(Frame $frame)
 {
     $node = $frame->get_node();
     $tag = $node->tagName;
     if (!isset(self::$__ATTRIBUTE_LOOKUP[$tag])) {
         return;
     }
     $valid_attrs = self::$__ATTRIBUTE_LOOKUP[$tag];
     $attrs = $node->attributes;
     $style = rtrim($node->getAttribute(self::$_style_attr), "; ");
     if ($style != "") {
         $style .= ";";
     }
     foreach ($attrs as $attr => $attr_node) {
         if (!isset($valid_attrs[$attr])) {
             continue;
         }
         $value = $attr_node->value;
         $target = $valid_attrs[$attr];
         // Look up $value in $target, if $target is an array:
         if (is_array($target)) {
             if (isset($target[$value])) {
                 $style .= " " . self::_resolve_target($node, $target[$value], $value);
             }
         } else {
             // otherwise use target directly
             $style .= " " . self::_resolve_target($node, $target, $value);
         }
     }
     if (!is_null($style)) {
         $style = ltrim($style);
         $node->setAttribute(self::$_style_attr, $style);
     }
 }
开发者ID:fredcido,项目名称:simuweb,代码行数:34,代码来源:attribute_translator.cls.php


示例9: __construct

  function __construct(Frame $frame, DOMPDF $dompdf) {
    if ( !$frame->is_text_node() )
      throw new DOMPDF_Exception("Text_Decorator can only be applied to #text nodes.");

    parent::__construct($frame, $dompdf);
    $this->_text_spacing = null;
  }
开发者ID:hendrosteven,项目名称:f3-template,代码行数:7,代码来源:text_frame_decorator.cls.php


示例10: render

 /**
  * Render frames recursively
  *
  * @param Frame $frame the frame to render
  */
 function render(Frame $frame)
 {
     global $_dompdf_debug;
     if ($_dompdf_debug) {
         echo $frame;
         flush();
     }
     $display = $frame->get_style()->display;
     switch ($display) {
         case "block":
         case "list-item":
         case "inline-block":
         case "table":
         case "table-row-group":
         case "table-header-group":
         case "table-footer-group":
         case "inline-table":
             $this->_render_frame("block", $frame);
             break;
         case "inline":
             if ($frame->get_node()->nodeName === "#text") {
                 $this->_render_frame("text", $frame);
             } else {
                 $this->_render_frame("inline", $frame);
             }
             break;
         case "table-cell":
             $this->_render_frame("table-cell", $frame);
             break;
         case "-dompdf-list-bullet":
             $this->_render_frame("list-bullet", $frame);
             break;
         case "-dompdf-image":
             $this->_render_frame("image", $frame);
             break;
         case "none":
             $node = $frame->get_node();
             if ($node->nodeName === "script") {
                 if ($node->getAttribute("type") === "text/php" || $node->getAttribute("language") === "php") {
                     // Evaluate embedded php scripts
                     $this->_render_frame("php", $frame);
                 } elseif ($node->getAttribute("type") === "text/javascript" || $node->getAttribute("language") === "javascript") {
                     // Insert JavaScript
                     $this->_render_frame("javascript", $frame);
                 }
             }
             // Don't render children, so skip to next iter
             return;
         default:
             break;
     }
     // Check for begin frame callback
     $this->_check_callbacks("begin_frame", $frame);
     foreach ($frame->get_children() as $child) {
         $this->render($child);
     }
     // Check for end frame callback
     $this->_check_callbacks("end_frame", $frame);
 }
开发者ID:NeCkEr,项目名称:CRUDGrid,代码行数:64,代码来源:renderer.cls.php


示例11: __construct

 function __construct(Frame $frame)
 {
     if ($frame->get_node()->nodeName != "#text") {
         throw new DOMPDF_Exception("Text_Decorator can only be applied to #text nodes.");
     }
     parent::__construct($frame);
     $this->_text_spacing = null;
 }
开发者ID:andrewroth,项目名称:c4c_intranet,代码行数:8,代码来源:text_frame_decorator.cls.php


示例12: copy

 function copy(DomNode $node)
 {
     $frame = new Frame($node);
     $frame->set_style(clone $this->_frame->get_original_style());
     $deco = Frame_Factory::decorate_frame($frame);
     $deco->set_root($this->_root);
     return $deco;
 }
开发者ID:andrewroth,项目名称:c4c_intranet,代码行数:8,代码来源:frame_decorator.cls.php


示例13: deep_copy

 function deep_copy()
 {
     $frame = new Frame($this->get_node()->cloneNode());
     $frame->set_style(clone $this->_frame->get_original_style());
     $deco = Frame_Factory::decorate_frame($frame, $this->_dompdf);
     $deco->set_root($this->_root);
     foreach ($this->get_children() as $child) {
         $deco->append_child($child->deep_copy());
     }
     return $deco;
 }
开发者ID:EfncoPlugins,项目名称:web-portal-lite-client-portal-secure-file-sharing-private-messaging,代码行数:11,代码来源:frame_decorator.cls.php


示例14: __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


示例15: __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


示例16: showFrame

 public function showFrame()
 {
     $idFrame = $this->data->id;
     $report = MApp::getService('fnbr20', '', 'reportframe');
     $frame = new Frame($idFrame);
     $this->data->frame->entry = $frame->getEntryObject();
     $this->data->fe = $report->getFEData($idFrame);
     $this->data->frame->entry->description = $report->decorate($this->data->frame->entry->description, $this->data->fe['styles']);
     $this->data->relations = $report->getRelations($frame);
     $this->render();
 }
开发者ID:elymatos,项目名称:expressive_fnbr,代码行数:11,代码来源:FrameController.php


示例17: render

 function render(Frame $frame)
 {
     $style = $frame->get_style();
     list($x, $y, $w, $h) = $frame->get_padding_box();
     // Draw our background, border and content
     if (($bg = $style->background_color) !== "transparent") {
         $this->_canvas->filled_rectangle($x, $y, $w, $h, $style->background_color);
     }
     if (($url = $style->background_image) && $url !== "none") {
         $this->_background_image($url, $x, $y, $w, $h, $style);
     }
     $this->_render_border($frame);
 }
开发者ID:emeraldstudio,项目名称:somosmaestros,代码行数:13,代码来源:block_renderer.cls.php


示例18: getTitle

 public function getTitle($idLanguage = '')
 {
     $criteria = $this->getCriteria()->select('lu.name luName, name, lu.idLu')->orderBy('name');
     Base::relation($criteria, 'lu', 'subcorpus', 'rel_hassubcorpus');
     $criteria->where("idSubCorpus = {$this->idSubCorpus}");
     $result = $criteria->asQuery()->getResult();
     $frame = new Frame();
     $criteriaFrame = $frame->getCriteria()->select('frame.entries.name as name');
     Base::Relation($criteriaFrame, 'lu', 'frame', 'rel_evokes');
     Base::entryLanguage($criteriaFrame);
     $criteriaFrame->where("lu.idLu = '{$result[0]['idLu']}'");
     $resultFrame = $criteriaFrame->asQuery()->getResult();
     return $resultFrame[0]['name'] . '.' . $result[0]['luName'] . '  [' . $result[0]['name'] . ']';
 }
开发者ID:elymatos,项目名称:expressive_fnbr,代码行数:14,代码来源:SubcorpusRepository.php


示例19: testBuild700000

 /**
  * @memcheck
  */
 public function testBuild700000()
 {
     $frame = new Frame();
     $frame->withBody(str_pad("x", 700000, "x"));
     $frame->withOpcode(Frame::OP_BINARY);
     $frame->withMasking("mask");
     $parsed = Frame::parse($frame->build());
     $this->assertEquals(str_pad("x", 700000, "x"), $parsed->getBody());
     $this->assertEquals(Frame::OP_BINARY, $frame->getOpcode());
     $this->assertFalse($frame->getFinalFlag());
     $this->assertTrue($frame->hasMasking());
     $this->assertEquals("mask", $frame->getMasking());
 }
开发者ID:php-ion,项目名称:php-ion,代码行数:16,代码来源:FrameTest.php


示例20: render

 function render(Frame $frame)
 {
     $style = $frame->get_style();
     list($x, $y, $w, $h) = $frame->get_border_box();
     $this->_set_opacity($frame->get_opacity($style->opacity));
     if ($frame->get_node()->nodeName === "body") {
         $h = $frame->get_containing_block("h") - $style->length_in_pt(array($style->margin_top, $style->padding_top, $style->border_top_width, $style->border_bottom_width, $style->padding_bottom, $style->margin_bottom), $style->width);
     }
     if (($bg = $style->background_color) !== "transparent") {
         $this->_canvas->filled_rectangle($x, $y, $w, $h, $bg);
     }
     if (($url = $style->background_image) && $url !== "none") {
         $this->_background_image($url, $x, $y, $w, $h, $style);
     }
     $this->_render_border($frame);
     $this->_render_outline($frame);
     if (DEBUG_LAYOUT && DEBUG_LAYOUT_BLOCKS) {
         $this->_debug_layout($frame->get_border_box(), "red");
         if (DEBUG_LAYOUT_PADDINGBOX) {
             $this->_debug_layout($frame->get_padding_box(), "red", array(0.5, 0.5));
         }
     }
     if (DEBUG_LAYOUT && DEBUG_LAYOUT_LINES && $frame->get_decorator()) {
         foreach ($frame->get_decorator()->get_line_boxes() as $line) {
             $frame->_debug_layout(array($line->x, $line->y, $line->w, $line->h), "orange");
         }
     }
 }
开发者ID:EfncoPlugins,项目名称:web-portal-lite-client-portal-secure-file-sharing-private-messaging,代码行数:28,代码来源:block_renderer.cls.php



注:本文中的Frame类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP FrameResponseObject类代码示例发布时间:2022-05-23
下一篇:
PHP Fox类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap