/** * Constructor Box * @param object|string $title title in the header the box * @param boolean $shadow if box has shadow [default value: false] * @param string $style_header style of the header (Box::STYLE_MAIN or Box::STYLE_SECOND) [default value: 1] * @param string $style_content style of the content (Box::STYLE_MAIN or Box::STYLE_SECOND) [default value: 1] * @param string $link heander title link * @param string $id unique id of the box [default value: main_box] * @param string $width width of the box [default value: 100%] * @param string $height height of the box * @param string $move if box can be move [default value: false] */ function __construct($title, $shadow = false, $style_header = '1', $style_content = '1', $link = '', $id = 'main_box', $width = '100%', $height = "", $move = false) { parent::__construct(); if (!isset($title)) { throw new NewException("1 argument for " . get_class($this) . "::__construct() is mandatory", 0, getDebugBacktrace(1)); } $this->is_browser_ie_6 = is_browser_ie_6(); $this->browser_ie_version = get_browser_ie_version(); $this->title = $title; if ($this->is_browser_ie_6) { $this->shadow = false; } else { $this->shadow = $shadow; } $this->style_header = $style_header; $this->style_content = $style_content; $this->link = $link; $this->id = $id; $this->move = $move; $this->width = $width; $this->height = $height; $this->tagH = ""; $this->css3 = $this->getPage()->isCss3Browser(); $this->browser_name = strtolower($browser['browser']); $this->browser_version = $browser['version']; CssInclude::getInstance()->loadCssConfigFileInMemory(false); if (constant("DEFINE_STYLE_BCK_PICTURE_" . strtoupper($this->style_header)) == "") { $this->force_box_with_picture = false; } $this->box_border_color = constant("DEFINE_STYLE_BORDER_TABLE_" . strtoupper($this->style_header)); if (!defined('DEFINE_STYLE_GRADIENT_' . strtoupper($this->style_header))) { define("DEFINE_STYLE_GRADIENT_" . strtoupper($this->style_header), false); } $this->box_gradient = constant("DEFINE_STYLE_GRADIENT_" . strtoupper($this->style_header)); if (!defined('DEFINE_STYLE_OMBRE_COLOR_' . strtoupper($this->style_header))) { define("DEFINE_STYLE_OMBRE_COLOR_" . strtoupper($this->style_header), DEFINE_STYLE_OMBRE_COLOR); } $this->shadow_color = constant("DEFINE_STYLE_OMBRE_COLOR_" . strtoupper($this->style_header)); if (!$this->getPage()->isAjaxPage() && !$this->getPage()->isAjaxLoadPage()) { $this->addCss(BASE_URL . "wsp/css/angle.css.php", "", true); } }
?> launchGeoLocalisation(false); <?php } if (SEND_JS_ERROR_BY_MAIL) { if (defined('SEND_ERROR_BY_MAIL') && SEND_ERROR_BY_MAIL == true && !isLocalDebug()) { ?> $(document).jsErrorHandler(); <?php } } ?> </script> <?php if (is_browser_ie_6() && !isset($_SESSION['WSP_IE6_MSG_' . formalize_to_variable(SITE_NAME)]) && $_SESSION['WSP_IE6_MSG_' . formalize_to_variable(SITE_NAME)] != "ok") { $alternative_browser = ''; $alternative_browser .= '<a href="http://www.mozilla.com/"><img src="' . BASE_URL . 'wsp/img/Firefox_128x128.png" height="60" width="60" border="0" title="Mozilla FireFox"/></a> '; $alternative_browser .= '<a href="http://www.microsoft.com/windows/internet-explorer/"><img src="' . BASE_URL . 'wsp/img/IE_128x128.png" height="60" width="60" border="0" title="Internet Explorer"/></a> '; $alternative_browser .= '<a href="http://www.apple.com/safari/"><img src="' . BASE_URL . 'wsp/img/Safari_128x128.png" height="60" width="60" border="0" title="Safari"/></a> '; $alternative_browser .= '<a href="http://www.google.com/chrome"><img src="' . BASE_URL . 'wsp/img/Chrome_128x128.png" height="60" width="60" border="0" title="Chrome"/></a> '; $alternative_browser .= '<a href="http://www.opera.com/browser/"><img src="' . BASE_URL . 'wsp/img/Opera_128x128.png" height="60" width="60" border="0" title="Opera"/></a> '; $page_object->addObject(new DialogBox(__(NOT_SUPPORTED_BROWSER_TITLE), "<br/>" . __(NOT_SUPPORTED_BROWSER) . $alternative_browser . "<br/>")); $_SESSION['WSP_IE6_MSG_' . formalize_to_variable(SITE_NAME)] = "ok"; } // call current page page if (DEBUG) { $page_object->addLogDebugExecutionTime("Render ..."); } echo str_replace("\n\n", "\n", str_replace("\r", "", str_replace("{#wsp_tab}", "\t", str_replace("\t", "", $page_object->render())))); if (DEBUG) {
/** * Method render * @access public * @param boolean $ajax_render [default value: false] * @return string html code of object DialogBox * @since 1.0.35 */ public function render($ajax_render = false) { $html = ""; $html_content = ""; $js_display_from_url = ""; if (gettype($this->content) == "object" && method_exists($this->content, "render")) { $html_content = $this->content->render(); // Extract JavaScript from HTML include_once dirname(__FILE__) . "/../../includes/utils_ajax.inc.php"; $array_extract_js = extract_javascript($html_content); for ($i = 1; $i < sizeof($array_extract_js); $i++) { if ($this->display_from_url) { $js_display_from_url .= str_replace("//<![CDATA[", "", str_replace("//]]>", "", str_replace("\"", "'", str_replace("\r", "", str_replace("\n", "", $array_extract_js[$i]))))) . " "; } else { new JavaScript("\$(document).ready( function() {" . $array_extract_js[$i] . " } );", true); } } $html_content = $array_extract_js[0]; } else { $html_content = $this->content; } if (get_class($this->content) != "Url") { $tmp_html_content = "<div align=\\'" . $this->align . "\\'"; if ($this->style != "") { $tmp_html_content .= " style=\\'" . $this->style . "\\'"; } $tmp_html_content .= ">" . str_replace("\"", "\\\"", str_replace("'", "\\'", str_replace("\r", "", str_replace("\n", "", $html_content)))) . "</div>"; $html_content = $tmp_html_content; } else { if (find($html_content, "?", 0, 0) > 0) { $html_content .= "&dialogbox_level=" . ($this->dialogbox_indice == "" ? 1 : $this->dialogbox_indice); } else { $html_content .= "?dialogbox_level=" . ($this->dialogbox_indice == "" ? 1 : $this->dialogbox_indice); } } if ($this->display_from_url) { $html .= "javascript:"; } else { $html .= "jQuery(document).ready(function(){ "; } $html .= "var create_div = true;"; if ($this->one_instance) { if (!$this->close_if_instance_exists) { $html .= "if (typeof(wspDialogBox" . $this->dialogbox_indice . ") !== 'undefined') { if (wspDialogBox" . $this->dialogbox_indice . ".dialog('widget').css('display') == 'block') { "; if (get_class($this->content) == "Url") { $html .= "create_div = false;"; } else { $html .= "wspDialogBox" . $this->dialogbox_indice . ".dialog('widget').find('.ui-widget-content').html('" . $html_content . "');"; $html .= "return false;"; } $html .= " } } "; } else { $html .= $this->close()->render(); } } $html .= "if (create_div) {"; $html .= "wspDialogBox" . $this->dialogbox_indice . " = \$('"; $html_div = "<div style=\\'display:hidden;z-index:99999" . $this->dialogbox_indice . ";\\'>"; if (get_class($this->content) != "Url") { $html_div .= $html_content; } else { $html_div .= "<div align=\\'center\\'><img src=\\'" . $this->getPage()->getCDNServerURL() . "wsp/img/loading.gif\\' width=\\'32\\' height=\\'32\\' /></div>"; } if ($this->display_from_url && $GLOBALS['__AJAX_PAGE__'] && !$GLOBALS['__AJAX_LOAD_PAGE__']) { $html_div = str_replace("\\'", "\\\\'", $html_div); } $html .= $html_div; $html .= "</div>').appendTo('body');"; $html .= " } "; if ($this->display_from_url && $js_display_from_url != "") { $html .= $js_display_from_url; } $html .= "wspDialogBox" . $this->dialogbox_indice; if ($this->delay > 0) { $html .= ".delay(" . $this->delay . ").queue(function( nxt ) { \$(this)"; } $html .= ".dialog({ title: '" . addslashes(str_replace("\r", "", str_replace("\n", "", $this->title))) . "'"; $html .= ", close: function() { wspDialogBox" . $this->dialogbox_indice . ".dialog('widget').find('.ui-dialog-content').html(''); wspDialogBox" . $this->dialogbox_indice . ".dialog('widget').remove(); }"; if ($this->desactivate) { $html .= ", modal: true, closeOnEscape: false"; } else { $html .= ", modal: false, closeOnEscape: true"; } if ($this->close_button) { $html .= ", buttons: { '" . addslashes(__(CLOSE)) . "': function() { \$(this).dialog('close');" . $this->close_button_js . " } }"; } $html .= "});"; if (!is_browser_ie_6()) { $html .= "if (create_div) {"; if ($this->width != "") { $html .= "wspDialogBox" . $this->dialogbox_indice . ".dialog('option', 'width', " . $this->width . ");"; } else { $html .= "wspDialogBox" . $this->dialogbox_indice . ".dialog('option', 'minWidth', 350);"; } if ($this->height != "") { $html .= "wspDialogBox" . $this->dialogbox_indice . ".dialog('option', 'height', " . $this->height . ");"; } if ($this->position != "") { if (find($this->position, "[", 0, 0) > 0) { $html .= "wspDialogBox" . $this->dialogbox_indice . ".dialog('option', 'position', " . $this->position . ");"; } else { $html .= "wspDialogBox" . $this->dialogbox_indice . ".dialog('option', 'position', '" . $this->position . "');"; } } else { if ($this->position_x > -1 || $this->position_y > -1) { $html .= "wspDialogBox" . $this->dialogbox_indice . ".dialog('option', 'position', [" . $this->position_x . "," . $this->position_y . "]);"; } } $html .= "}"; } if ($this->desactivate) { $html .= "wspDialogBox" . $this->dialogbox_indice . ".dialog('widget').find('.ui-dialog-titlebar-close').hide();"; } $html .= "setTimeout('LoadPngPicture();', 1);"; if (get_class($this->content) == "Url") { $html .= "wspDialogBox" . $this->dialogbox_indice; if ($this->load_url_delay > 0) { $html .= ".delay(" . $this->load_url_delay . ").queue(function( nxt ) { \$(this)"; } $html .= ".load('" . $html_content . "', {}, "; $html .= "function (response, status, xhr) {"; $html .= "if (status == 'error' && response != '') { wspDialogBox" . $this->dialogbox_indice . " = \$('<div style=\\'display:hidden;z-index:99999" . $this->dialogbox_indice . ";\\'><table><tr><td><img src=\\'" . $this->getPage()->getCDNServerURL() . "wsp/img/warning.png\\' height=\\'24\\' width=\\'24\\' border=\\'0\\' align=\\'absmidlle\\'/></td><td><b>Error</b></td></tr></table>' + response + '</div>').appendTo('body'); }"; $html .= "});"; if ($this->load_url_delay > 0) { $html .= "});"; } } if (!$this->display_from_url) { $html .= "});"; if ($this->delay > 0) { $html .= "});"; } } else { if ($this->delay > 0) { $html .= "});"; } $html .= "return false;"; } $this->object_change = false; return $html; }
/** * Constructor Page */ function __construct() { $this->is_browser_ie_6 = is_browser_ie_6(); $this->is_browser_ie = is_browser_ie(); }
/** * Constructor RoundBox * @param string $style_content style of the content (Box::STYLE_MAIN or Box::STYLE_SECOND) [default value: 1] * @param string $id unique id of the box [default value: main_box] * @param string $width width of the box [default value: 100%] * @param string $height height of the bo * @param string $move if box can be move [default value: false] */ function __construct($style_content = '1', $id = 'main_box', $width = '100%', $height = "", $move = false) { parent::__construct(); $this->is_browser_ie_6 = is_browser_ie_6(); $this->browser_ie_version = get_browser_ie_version(); $this->style_content = $style_content; $this->id = $id; $this->move = $move; $this->width = $width; $this->height = $height; $this->css3 = $this->getPage()->isCss3Browser(); CssInclude::getInstance()->loadCssConfigFileInMemory(false); if (constant("DEFINE_STYLE_BCK_PICTURE_" . strtoupper($this->style_content)) == "") { $this->force_box_with_picture = false; } $this->box_border_color = constant("DEFINE_STYLE_BORDER_TABLE_" . strtoupper($this->style_content)); if (!defined('DEFINE_STYLE_GRADIENT_' . strtoupper($this->style_content))) { define("DEFINE_STYLE_GRADIENT_" . strtoupper($this->style_content), false); } $this->box_gradient = constant("DEFINE_STYLE_GRADIENT_" . strtoupper($this->style_content)); if (!defined('DEFINE_STYLE_OMBRE_COLOR_' . strtoupper($this->style_header))) { define("DEFINE_STYLE_OMBRE_COLOR_" . strtoupper($this->style_header), DEFINE_STYLE_OMBRE_COLOR); } $this->shadow_color = constant("DEFINE_STYLE_OMBRE_COLOR_" . strtoupper($this->style_header)); if (!$this->getPage()->isAjaxPage() && !$this->getPage()->isAjaxLoadPage()) { $this->addCss(BASE_URL . "wsp/css/angle.css.php", "", true); } }