本文整理汇总了PHP中Frame_Decorator::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP Frame_Decorator::__construct方法的具体用法?PHP Frame_Decorator::__construct怎么用?PHP Frame_Decorator::__construct使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Frame_Decorator
的用法示例。
在下文中一共展示了Frame_Decorator::__construct方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: list
/**
* 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";
}
示例2:
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;
}
示例3: array
function __construct(Frame $frame, DOMPDF $dompdf)
{
parent::__construct($frame, $dompdf);
$this->_line_boxes = array(new Line_Box($this));
$this->_counters = array(self::DEFAULT_COUNTER => 0);
$this->_cl = 0;
}
示例4:
/**
* Class constructor
*
* @param Frame $frame the frame to decorate
*/
function __construct(Frame $frame, DOMPDF $dompdf)
{
parent::__construct($frame, $dompdf);
$this->_page_full = false;
$this->_in_table = 0;
$this->_bottom_page_margin = null;
}
示例5: array
function __construct(Frame $frame, DOMPDF $dompdf)
{
parent::__construct($frame, $dompdf);
$this->_lines = array(self::$_initial_line_state);
$this->_counters = array(self::DEFAULT_COUNTER => 0);
$this->_cl = 0;
}
示例6: tempnam
function __construct(Frame $frame, DOMPDF $dompdf)
{
parent::__construct($frame);
$url = $frame->get_node()->getAttribute("src");
if (!DOMPDF_ENABLE_REMOTE && strstr($url, "://")) {
$this->_remote = false;
$this->_image_url = DOMPDF_LIB_DIR . "/res/broken_image.png";
} else {
if (DOMPDF_ENABLE_REMOTE && strstr($url, "://")) {
// Download remote files to a temporary directory
$this->_remote = true;
$this->_image_url = tempnam(DOMPDF_TEMP_DIR, "dompdf_img_");
file_put_contents($this->_image_url, file_get_contents($url));
} else {
$this->_remote = false;
$this->_image_url = build_url($dompdf->get_protocol(), $dompdf->get_host(), $dompdf->get_base_path(), $url);
}
}
if (!is_readable($this->_image_url) || !filesize($this->_image_url)) {
$this->_remote = false;
$this->_image_url = DOMPDF_LIB_DIR . "/res/broken_image.png";
}
// We need to preserve the file extenstion
$i = strrpos($url, ".");
if ($i === false) {
throw new DOMPDF_Exception("Unknown image type: {$url}.");
}
$this->_image_ext = strtolower(substr($url, $i + 1));
}
示例7: array
function __construct(Frame $frame, DOMPDF $dompdf)
{
parent::__construct($frame, $dompdf);
$this->_lines = array(array("frames" => array(), "wc" => 0, "y" => null, "w" => 0, "h" => 0));
$this->_counters = array(self::DEFAULT_COUNTER => 0);
$this->_cl = 0;
}
示例8: 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());
}
示例9: Cellmap
function __construct(Frame $frame)
{
parent::__construct($frame);
$this->_cellmap = new Cellmap($this);
$this->_min_width = null;
$this->_max_width = null;
$this->_state = array();
}
示例10:
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;
}
示例11: Cellmap
/**
* Class constructor
*
* @param Frame $frame the frame to decorate
*/
function __construct(Frame $frame, DOMPDF $dompdf)
{
parent::__construct($frame, $dompdf);
$this->_cellmap = new Cellmap($this);
$this->_min_width = null;
$this->_max_width = null;
$this->_headers = array();
$this->_footers = array();
}
示例12:
function __construct(Frame $frame, DOMPDF $dompdf)
{
parent::__construct($frame, $dompdf);
$style = $this->_frame->get_style();
$style->width = 0;
$style->height = 0;
$style->margin = 0;
$style->padding = 0;
}
示例13: list
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
示例14: list
/**
* 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;
}
示例15: Cellmap
/**
* Class constructor
*
* @param Frame $frame the frame to decorate
* @param DOMPDF $dompdf
*/
function __construct(Frame $frame, DOMPDF $dompdf)
{
parent::__construct($frame, $dompdf);
$this->_cellmap = new Cellmap($this);
if ($frame->get_style()->table_layout === "fixed") {
$this->_cellmap->set_layout_fixed(true);
}
$this->_min_width = null;
$this->_max_width = null;
$this->_headers = array();
$this->_footers = array();
}