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

PHP unpack_object函数代码示例

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

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



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

示例1: __construct

 public function __construct($name = 'ip', $value)
 {
     $this->ip_parts = array();
     if (!is_array($value)) {
         $value = explode('.', $value);
     }
     if (!isset($value[0])) {
         $value[0] = 0;
     }
     if (!isset($value[1])) {
         $value[1] = 0;
     }
     if (!isset($value[2])) {
         $value[2] = 0;
     }
     if (!isset($value[3])) {
         $value[3] = 0;
     }
     for ($i = 0; $i < 4; $i++) {
         $this->ip_parts[$i] = new CNumericBox($name . '[' . $i . ']', $value[$i], 3);
         if ($i != 3) {
             $this->ip_parts[$i]->tag_end = '';
             $this->ip_parts[$i]->AddAction('OnKeyDown', ' this.maxlength = this.getAttribute("maxlength"); ' . ' this.oldlength = this.value.length; ');
             $this->ip_parts[$i]->AddAction('OnKeyUp', ' if(this.oldlength != this.value.length && this.value.length == this.maxlength) {' . ' var el = this.form.elements["' . $name . '[' . ($i + 1) . ']' . '"];' . ' if(el) { el.focus(); el.select(); }}');
         }
         $this->ip_parts[$i] = unpack_object($this->ip_parts[$i]);
     }
 }
开发者ID:rennhak,项目名称:zabbix,代码行数:28,代码来源:class.cipbox.php


示例2: zbx_jsvalue

function zbx_jsvalue($value)
{
    if (!is_array($value)) {
        if (is_object($value)) {
            return unpack_object($value);
        }
        if (is_string($value)) {
            return '\'' . str_replace('\'', '\\\'', str_replace("\n", '\\n', str_replace("\\", "\\\\", str_replace("\r", '', $value)))) . '\'';
        }
        if (is_null($value)) {
            return 'null';
        }
        return strval($value);
    }
    if (count($value) == 0) {
        return '[]';
    }
    foreach ($value as $id => $v) {
        if (!isset($is_object) && is_string($id)) {
            $is_object = true;
        }
        $value[$id] = (isset($is_object) ? '\'' . $id . '\' : ' : '') . zbx_jsvalue($v);
    }
    if (isset($is_object)) {
        return '{' . implode(',', $value) . '}';
    } else {
        return '[' . implode(',', $value) . ']';
    }
}
开发者ID:rennhak,项目名称:zabbix,代码行数:29,代码来源:js.inc.php


示例3: setTitle

 public function setTitle($value = null)
 {
     if (is_null($value)) {
         $this->title = null;
         return 0;
     }
     $this->title = unpack_object($value);
 }
开发者ID:phedders,项目名称:zabbix,代码行数:8,代码来源:class.cformtable.php


示例4: setTitle

 public function setTitle($value = NULL)
 {
     if (is_null($value)) {
         unset($this->title);
         return 0;
     }
     $this->title = unpack_object($value);
 }
开发者ID:rennhak,项目名称:zabbix,代码行数:8,代码来源:class.cformtable.php


示例5: addItem

 public function addItem($value)
 {
     if (is_array($value)) {
         foreach ($value as $item) {
             array_push($this->items, unpack_object($item));
         }
     } elseif (!is_null($value)) {
         array_push($this->items, unpack_object($value));
     }
 }
开发者ID:TonywalkerCN,项目名称:Zabbix,代码行数:10,代码来源:CJsScript.php


示例6: addItem

 public function addItem($value)
 {
     if (is_object($value)) {
         array_push($this->items, unpack_object($value));
     } elseif (is_string($value)) {
         array_push($this->items, $value);
     } elseif (is_array($value)) {
         foreach ($value as $item) {
             $this->addItem($item);
             // attention, recursion !!!
         }
     } elseif (!is_null($value)) {
         array_push($this->items, unpack_object($value));
     }
     return $this;
 }
开发者ID:quanta-computing,项目名称:debian-packages,代码行数:16,代码来源:class.cobject.php


示例7: __construct

 public function __construct($name = 'visibilitybox', $value = 'yes', $object_name = null, $replace_to = null)
 {
     $action = '';
     if (!is_array($object_name)) {
         $object_name = array($object_name);
     }
     $this->object_name = $object_name;
     $this->replace_to = unpack_object($replace_to);
     foreach ($this->object_name as $obj_name) {
         if (empty($obj_name)) {
             continue;
         }
         $action .= 'visibility_status_changeds(this.checked, ' . zbx_jsvalue($obj_name) . ',' . zbx_jsvalue($this->replace_to) . ');';
     }
     parent::__construct($name, $value, $action, '1');
     insert_javascript_for_visibilitybox();
 }
开发者ID:songyuanjie,项目名称:zabbix-stats,代码行数:17,代码来源:class.cvisibilitybox.php


示例8: toString

 public function toString()
 {
     $content = array();
     if (!is_null($this->header)) {
         $header_div = new CDiv($this->header, 'formElement_header');
         $content[] = $header_div;
     }
     if (!is_null($this->body)) {
         $body_div = new CDiv($this->body, 'formElement_body');
         $content[] = $body_div;
     }
     if (!is_null($this->footer)) {
         $footer_div = new CDiv($this->footer, 'formElement_footer');
         $content[] = $footer_div;
     }
     $main_div = new CDiv($content, 'formElement');
     return unpack_object($main_div);
 }
开发者ID:songyuanjie,项目名称:zabbix-stats,代码行数:18,代码来源:class.cformelement.php


示例9: insert_show_color_picker_javascript

function insert_show_color_picker_javascript()
{
    global $SHOW_COLOR_PICKER_SCRIPT_ISERTTED;
    if ($SHOW_COLOR_PICKER_SCRIPT_ISERTTED) {
        return;
    }
    $SHOW_COLOR_PICKER_SCRIPT_ISERTTED = true;
    $table = '';
    $table .= '<table cellspacing="0" cellpadding="1">';
    $table .= '<tr>';
    /* gray colors */
    foreach (array('0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'b', 'C', 'D', 'E', 'F') as $c) {
        $color = $c . $c . $c . $c . $c . $c;
        $table .= '<td>' . unpack_object(new CColorCell(null, $color, 'set_color(\\\'' . $color . '\\\')')) . '</td>';
    }
    $table .= '</tr>';
    /* other colors */
    $colors = array(array('r' => 0, 'g' => 0, 'b' => 1), array('r' => 0, 'g' => 1, 'b' => 0), array('r' => 1, 'g' => 0, 'b' => 0), array('r' => 0, 'g' => 1, 'b' => 1), array('r' => 1, 'g' => 0, 'b' => 1), array('r' => 1, 'g' => 1, 'b' => 0));
    $brigs = array(array(0 => '0', 1 => '3'), array(0 => '0', 1 => '4'), array(0 => '0', 1 => '5'), array(0 => '0', 1 => '6'), array(0 => '0', 1 => '7'), array(0 => '0', 1 => '8'), array(0 => '0', 1 => '9'), array(0 => '0', 1 => 'A'), array(0 => '0', 1 => 'B'), array(0 => '0', 1 => 'C'), array(0 => '0', 1 => 'D'), array(0 => '0', 1 => 'E'), array(0 => '3', 1 => 'F'), array(0 => '6', 1 => 'F'), array(0 => '9', 1 => 'F'), array(0 => 'C', 1 => 'F'));
    foreach ($colors as $c) {
        $table .= '<tr>';
        foreach ($brigs as $br) {
            $r = $br[$c['r']];
            $g = $br[$c['g']];
            $b = $br[$c['b']];
            $color = $r . $r . $g . $g . $b . $b;
            $table .= '<td>' . unpack_object(new CColorCell(null, $color, 'set_color(\\\'' . $color . '\\\')')) . '</td>';
        }
        $table .= '</tr>';
    }
    $table .= '</table>';
    $cancel = '<span onclick="javascript:hide_color_picker();" class="link">' . S_CANCEL . '</span>';
    $script = 'var color_picker = null;
				var curr_lbl = null;
				var curr_txt = null;' . "\n";
    $script .= "var color_table = '" . $table . $cancel . "'\n";
    insert_js($script);
    print '<script type="text/javascript" src="js/color_picker.js"></script>';
    zbx_add_post_js('create_color_picker();');
}
开发者ID:phedders,项目名称:zabbix,代码行数:40,代码来源:class.ccolor.php


示例10: addItem

 public function addItem($value)
 {
     if (is_object($value)) {
         array_push($this->items, unpack_object($value));
     } else {
         if (is_string($value)) {
             array_push($this->items, str_replace(array('<', '>', '"'), array('&lt;', '&gt;', '&quot;'), $value));
             //				array_push($this->items,htmlspecialchars($value));
         } else {
             if (is_array($value)) {
                 foreach ($value as $item) {
                     $this->addItem($item);
                     // Attention, recursion !!!
                 }
             } else {
                 if (!is_null($value)) {
                     array_push($this->items, unpack_object($value));
                 }
             }
         }
     }
 }
开发者ID:phedders,项目名称:zabbix,代码行数:22,代码来源:class.cobject.php


示例11: addItem

 public function addItem($value)
 {
     if (is_object($value)) {
         array_push($this->items, unpack_object($value));
     } else {
         if (is_string($value)) {
             array_push($this->items, zbx_htmlstr($value));
             //				array_push($this->items,htmlspecialchars($value));
         } else {
             if (is_array($value)) {
                 foreach ($value as $item) {
                     $this->addItem($item);
                     // Attention, recursion !!!
                 }
             } else {
                 if (!is_null($value)) {
                     array_push($this->items, unpack_object($value));
                 }
             }
         }
     }
 }
开发者ID:songyuanjie,项目名称:zabbix-stats,代码行数:22,代码来源:class.cobject.php


示例12: toString

 public function toString()
 {
     $tab = $this->get();
     return unpack_object($tab);
 }
开发者ID:TonywalkerCN,项目名称:Zabbix,代码行数:5,代码来源:CWidget.php


示例13: setHint

 /**
  * Adds a hint box to the element.
  *
  * @param string|array|CTag		$text				Hint content.
  * @param string				$span_class			Wrap the content in a span element and assign this class
  *													to the span.
  * @param bool					$freeze_on_click	If set to true, it will be possible to "freeze" the hint box
  *													via a mouse click.
  * @param string				$styles				Custom css styles.
  *													Syntax:
  *														property1: value1; property2: value2; property(n): value(n)
  *
  * @return bool
  */
 public function setHint($text, $span_class = '', $freeze_on_click = true, $styles = '')
 {
     if (empty($text)) {
         return $this;
     }
     encodeValues($text);
     $text = unpack_object($text);
     $this->onMouseover('hintBox.HintWraper(event, this, ' . zbx_jsvalue($text) . ', "' . $span_class . '", "' . $styles . '");');
     if ($freeze_on_click) {
         $this->onClick('hintBox.showStaticHint(event, this, ' . zbx_jsvalue($text) . ', "' . $span_class . '", false, "' . $styles . '");');
     }
     return $this;
 }
开发者ID:jbfavre,项目名称:debian-zabbix,代码行数:27,代码来源:CTag.php


示例14: insert_show_color_picker_javascript

function insert_show_color_picker_javascript()
{
    global $SHOW_COLOR_PICKER_SCRIPT_INSERTED;
    if ($SHOW_COLOR_PICKER_SCRIPT_INSERTED) {
        return;
    }
    $SHOW_COLOR_PICKER_SCRIPT_INSERTED = true;
    $table = [];
    // gray colors
    $row = [];
    foreach (['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'] as $c) {
        $color = $c . $c . $c . $c . $c . $c;
        $row[] = (new CColorCell(null, $color))->setTitle('#' . $color)->onClick('set_color("' . $color . '");');
    }
    $table[] = (new CDiv($row))->addClass(ZBX_STYLE_COLOR_PICKER);
    // other colors
    $colors = [['r' => 0, 'g' => 0, 'b' => 1], ['r' => 0, 'g' => 1, 'b' => 0], ['r' => 1, 'g' => 0, 'b' => 0], ['r' => 0, 'g' => 1, 'b' => 1], ['r' => 1, 'g' => 0, 'b' => 1], ['r' => 1, 'g' => 1, 'b' => 0]];
    $brigs = [[0 => '0', 1 => '3'], [0 => '0', 1 => '4'], [0 => '0', 1 => '5'], [0 => '0', 1 => '6'], [0 => '0', 1 => '7'], [0 => '0', 1 => '8'], [0 => '0', 1 => '9'], [0 => '0', 1 => 'A'], [0 => '0', 1 => 'B'], [0 => '0', 1 => 'C'], [0 => '0', 1 => 'D'], [0 => '0', 1 => 'E'], [0 => '3', 1 => 'F'], [0 => '6', 1 => 'F'], [0 => '9', 1 => 'F'], [0 => 'C', 1 => 'F']];
    foreach ($colors as $c) {
        $row = [];
        foreach ($brigs as $br) {
            $r = $br[$c['r']];
            $g = $br[$c['g']];
            $b = $br[$c['b']];
            $color = $r . $r . $g . $g . $b . $b;
            $row[] = (new CColorCell(null, $color))->setTitle('#' . $color)->onClick('set_color("' . $color . '");');
        }
        $table[] = (new CDiv($row))->addClass(ZBX_STYLE_COLOR_PICKER);
    }
    $cancel = (new CSpan())->addClass(ZBX_STYLE_OVERLAY_CLOSE_BTN)->onClick('javascript: hide_color_picker();');
    $tmp = [$cancel, $table];
    insert_js('var color_picker = null,' . "\n" . 'curr_lbl = null,' . "\n" . 'curr_txt = null,' . "\n" . 'color_table = ' . zbx_jsvalue(unpack_object($tmp)) . "\n");
    zbx_add_post_js('create_color_picker();');
}
开发者ID:jbfavre,项目名称:debian-zabbix,代码行数:34,代码来源:js.inc.php


示例15: setHint

 /**
  * Adds a hint box to the elemt.
  *
  * @param string|array|CTag     $text       hint content
  * @param string                $spanClass  wrap the content in a span element and assign a this class to the span
  * @param bool                  $byClick    if set to true, it will be possible to "freeze" the hint box via a mouse
  *                                          click
  *
  * @return bool
  */
 public function setHint($text, $spanClass = '', $byClick = true)
 {
     if (empty($text)) {
         return false;
     }
     encodeValues($text);
     $text = unpack_object($text);
     $this->addAction('onmouseover', 'hintBox.HintWraper(event, this, ' . zbx_jsvalue($text) . ', "' . $spanClass . '");');
     if ($byClick) {
         $this->addAction('onclick', 'hintBox.showStaticHint(event, this, ' . zbx_jsvalue($text) . ', "' . $spanClass . '");');
     }
     return true;
 }
开发者ID:TonywalkerCN,项目名称:Zabbix,代码行数:23,代码来源:CTag.php


示例16: insert_show_color_picker_javascript

function insert_show_color_picker_javascript()
{
    global $SHOW_COLOR_PICKER_SCRIPT_ISERTTED;
    if ($SHOW_COLOR_PICKER_SCRIPT_ISERTTED) {
        return;
    }
    $SHOW_COLOR_PICKER_SCRIPT_ISERTTED = true;
    $table = new CTable();
    // gray colors
    $row = array();
    foreach (array('0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F') as $c) {
        $color = $c . $c . $c . $c . $c . $c;
        $row[] = new CColorCell(null, $color, 'set_color("' . $color . '");');
    }
    $table->addRow($row);
    // other colors
    $colors = array(array('r' => 0, 'g' => 0, 'b' => 1), array('r' => 0, 'g' => 1, 'b' => 0), array('r' => 1, 'g' => 0, 'b' => 0), array('r' => 0, 'g' => 1, 'b' => 1), array('r' => 1, 'g' => 0, 'b' => 1), array('r' => 1, 'g' => 1, 'b' => 0));
    $brigs = array(array(0 => '0', 1 => '3'), array(0 => '0', 1 => '4'), array(0 => '0', 1 => '5'), array(0 => '0', 1 => '6'), array(0 => '0', 1 => '7'), array(0 => '0', 1 => '8'), array(0 => '0', 1 => '9'), array(0 => '0', 1 => 'A'), array(0 => '0', 1 => 'B'), array(0 => '0', 1 => 'C'), array(0 => '0', 1 => 'D'), array(0 => '0', 1 => 'E'), array(0 => '3', 1 => 'F'), array(0 => '6', 1 => 'F'), array(0 => '9', 1 => 'F'), array(0 => 'C', 1 => 'F'));
    foreach ($colors as $c) {
        $row = array();
        foreach ($brigs as $br) {
            $r = $br[$c['r']];
            $g = $br[$c['g']];
            $b = $br[$c['b']];
            $color = $r . $r . $g . $g . $b . $b;
            $row[] = new CColorCell(null, $color, 'set_color("' . $color . '");');
        }
        $table->addRow($row);
    }
    $cancel = new CSpan(_('Cancel'), 'link');
    $cancel->setAttribute('onclick', 'javascript: hide_color_picker();');
    $tmp = array($table, $cancel);
    $script = '
		var color_picker = null;
		var curr_lbl = null;
		var curr_txt = null;
		var color_table = ' . zbx_jsvalue(unpack_object($tmp)) . "\n";
    insert_js($script);
    zbx_add_post_js('create_color_picker();');
}
开发者ID:quanta-computing,项目名称:debian-packages,代码行数:40,代码来源:js.inc.php


示例17: CDiv

$fs_icon = null;
if (isset($elementid) && $element) {
    if (infavorites('web.favorite.screenids', $elementid, 'screenid')) {
        $icon = new CDiv(SPACE, 'iconminus');
        $icon->addOption('title', S_REMOVE_FROM . ' ' . S_FAVORITES);
        $icon->addAction('onclick', new CScript("javascript: rm4favorites('screenid','" . $elementid . "',0);"));
    } else {
        $icon = new CDiv(SPACE, 'iconplus');
        $icon->addOption('title', S_ADD_TO . ' ' . S_FAVORITES);
        $icon->addAction('onclick', new CScript("javascript: add2favorites('screenid','" . $elementid . "');"));
    }
    $icon->addOption('id', 'addrm_fav');
    $url = '?elementid=' . $elementid . ($_REQUEST['fullscreen'] ? '' : '&fullscreen=1');
    $url .= url_param('groupid') . url_param('hostid');
    $fs_icon = new CDiv(SPACE, 'fullscreen');
    $fs_icon->addOption('title', $_REQUEST['fullscreen'] ? S_NORMAL . ' ' . S_VIEW : S_FULLSCREEN);
    $fs_icon->addAction('onclick', new CScript("javascript: document.location = '" . $url . "';"));
}
if (2 == $_REQUEST['fullscreen']) {
    echo unpack_object($p_elements);
} else {
    $screens_hat = create_hat(S_SCREENS_BIG, $p_elements, array($icon, $fs_icon), 'hat_screens');
    $screens_hat->Show();
}
$scroll_div = new CDiv();
$scroll_div->addOption('id', 'scroll_cntnr');
$scroll_div->addOption('style', 'border: 0px #CC0000 solid; height: 25px; width: 800px;');
$scroll_div->show();
$jsmenu = new CPUMenu(null, 170);
$jsmenu->InsertJavaScript();
include_once 'include/page_footer.php';
开发者ID:rennhak,项目名称:zabbix,代码行数:31,代码来源:screens.php


示例18: setHint

 public function setHint($text, $width = '', $class = '')
 {
     if (empty($text)) {
         return false;
     }
     insert_showhint_javascript();
     $text = unpack_object($text);
     if ($width != '' || $class != '') {
         $code = "show_hint_ext(this,event,'" . $text . "','" . $width . "','" . $class . "');";
     } else {
         $code = "show_hint(this,event,'" . $text . "');";
     }
     $this->addAction('onMouseOver', $code);
     $this->addAction('onMouseMove', 'update_hint(this,event);');
 }
开发者ID:rennhak,项目名称:zabbix,代码行数:15,代码来源:class.ctag.php


示例19: setHint

 public function setHint($text, $width = '', $class = '', $byclick = true)
 {
     if (empty($text)) {
         return false;
     }
     $text = unpack_object($text);
     $this->addAction('onmouseover', "javascript: hintBox.showOver(event,this," . zbx_jsvalue($text) . ",'" . $width . "','" . $class . "');");
     $this->addAction('onmouseout', "javascript: hintBox.hideOut(event,this);");
     if ($byclick) {
         $this->addAction('onclick', "javascript: hintBox.onClick(event,this," . zbx_jsvalue($text) . ",'" . $width . "','" . $class . "');");
     }
 }
开发者ID:songyuanjie,项目名称:zabbix-stats,代码行数:12,代码来源:class.ctag.php


示例20: show_messages


//.........这里部分代码省略.........
    if (!empty($api_errors)) {
        error($api_errors);
    }
    if (isset($msg)) {
        switch ($page['type']) {
            case PAGE_TYPE_IMAGE:
                array_push($message, array('text' => $msg, 'color' => !$bool ? array('R' => 255, 'G' => 0, 'B' => 0) : array('R' => 34, 'G' => 51, 'B' => 68), 'font' => 2));
                $width = max($width, ImageFontWidth(2) * zbx_strlen($msg) + 1);
                $height += imagefontheight(2) + 1;
                break;
            case PAGE_TYPE_XML:
                echo htmlspecialchars($msg) . "\n";
                break;
                //				case PAGE_TYPE_JS: break;
            //				case PAGE_TYPE_JS: break;
            case PAGE_TYPE_HTML:
            default:
                $msg_tab = new CTable($msg, $bool ? 'msgok' : 'msgerr');
                $msg_tab->setCellPadding(0);
                $msg_tab->setCellSpacing(0);
                $row = array();
                $msg_col = new CCol(bold($msg), 'msg_main msg');
                $msg_col->setAttribute('id', 'page_msg');
                $row[] = $msg_col;
                if (isset($ZBX_MESSAGES) && !empty($ZBX_MESSAGES)) {
                    $msg_details = new CDiv(S_DETAILS, 'blacklink');
                    $msg_details->setAttribute('onclick', "javascript: ShowHide('msg_messages', IE?'block':'table');");
                    $msg_details->setAttribute('title', S_MAXIMIZE . '/' . S_MINIMIZE);
                    array_unshift($row, new CCol($msg_details, 'clr'));
                }
                $msg_tab->addRow($row);
                $msg_tab->show();
                $img_space = new CImg('images/general/tree/zero.gif', 'space', '100', '2');
                break;
        }
    }
    if (isset($ZBX_MESSAGES) && !empty($ZBX_MESSAGES)) {
        if ($page['type'] == PAGE_TYPE_IMAGE) {
            $msg_font = 2;
            foreach ($ZBX_MESSAGES as $msg) {
                if ($msg['type'] == 'error') {
                    array_push($message, array('text' => $msg['message'], 'color' => array('R' => 255, 'G' => 55, 'B' => 55), 'font' => $msg_font));
                } else {
                    array_push($message, array('text' => $msg['message'], 'color' => array('R' => 155, 'G' => 155, 'B' => 55), 'font' => $msg_font));
                }
                $width = max($width, imagefontwidth($msg_font) * zbx_strlen($msg['message']) + 1);
                $height += imagefontheight($msg_font) + 1;
            }
        } else {
            if ($page['type'] == PAGE_TYPE_XML) {
                foreach ($ZBX_MESSAGES as $msg) {
                    echo '[' . $msg['type'] . '] ' . $msg['message'] . "\n";
                }
            } else {
                $lst_error = new CList(null, 'messages');
                foreach ($ZBX_MESSAGES as $msg) {
                    $lst_error->addItem($msg['message'], $msg['type']);
                    $bool = $bool && 'error' != zbx_strtolower($msg['type']);
                }
                //message scroll if needed
                $msg_show = 6;
                $msg_count = count($ZBX_MESSAGES);
                if ($msg_count > $msg_show) {
                    $msg_count = $msg_show;
                    $msg_count = $msg_count * 16;
                    $lst_error->setAttribute('style', 'height: ' . $msg_count . 'px;');
                }
                $tab = new CTable(null, $bool ? 'msgok' : 'msgerr');
                $tab->setCellPadding(0);
                $tab->setCellSpacing(0);
                $tab->setAttribute('id', 'msg_messages');
                $tab->setAttribute('style', 'width: 100%;');
                if (isset($msg_tab) && $bool) {
                    $tab->setAttribute('style', 'display: none;');
                }
                $tab->addRow(new CCol($lst_error, 'msg'));
                $tab->Show();
                //---
            }
        }
        $ZBX_MESSAGES = null;
    }
    if (!is_null($img_space)) {
        print unpack_object($img_space);
    }
    if ($page['type'] == PAGE_TYPE_IMAGE && count($message) > 0) {
        $width += 2;
        $height += 2;
        $canvas = imagecreate($width, $height);
        imagefilledrectangle($canvas, 0, 0, $width, $height, imagecolorallocate($canvas, 255, 255, 255));
        foreach ($message as $id => $msg) {
            $message[$id]['y'] = 1 + (isset($previd) ? $message[$previd]['y'] + $message[$previd]['h'] : 0);
            $message[$id]['h'] = imagefontheight($msg['font']);
            imagestring($canvas, $msg['font'], 1, $message[$id]['y'], $msg['text'], imagecolorallocate($canvas, $msg['color']['R'], $msg['color']['G'], $msg['color']['B']));
            $previd = $id;
        }
        imageOut($canvas);
        imagedestroy($canvas);
    }
}
开发者ID:songyuanjie,项目名称:zabbix-stats,代码行数:101,代码来源:config.inc.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP unprepare_message函数代码示例发布时间:2022-05-23
下一篇:
PHP unpack函数代码示例发布时间: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