示例#1
0
/**
 * Class CssInclude
 *
 * WebSite-PHP : PHP Framework 100% object (http://www.website-php.com)
 * Copyright (c) 2009-2015 WebSite-PHP.com
 * PHP versions >= 5.2
 *
 * Licensed under The MIT License
 * Redistributions of files must retain the above copyright notice.
 * 
 * @author      Emilien MOREL <*****@*****.**>
 * @link        http://www.website-php.com
 * @copyright   WebSite-PHP.com 12/05/2015
 * @version     1.2.13
 * @access      public
 * @since       1.0.23
 */
function CssIncludeComparator($a, $b)
{
    $array_put_css_to_begin = CssInclude::getInstance()->getArrayCssToBegin();
    $array_put_css_to_end = CssInclude::getInstance()->getArrayCssToEnd();
    // put to begin array_css_to_begin css
    if (sizeof($array_put_css_to_begin) > 0) {
        $a_array_index = array_search(str_replace(BASE_URL, "", $a), $array_put_css_to_begin);
        $b_array_index = array_search(str_replace(BASE_URL, "", $b), $array_put_css_to_begin);
        if ($a_array_index !== false && $b_array_index !== false) {
            if ($a_array_index < $b_array_index) {
                return -1;
            } else {
                return 1;
            }
        }
        if ($a_array_index !== false) {
            return -1;
        }
        if ($b_array_index !== false) {
            return 1;
        }
    }
    // put to end array_css_to_end css
    if (sizeof($array_put_css_to_end) > 0) {
        $a_array_index = array_search(str_replace(BASE_URL, "", $a), $array_put_css_to_end);
        $b_array_index = array_search(str_replace(BASE_URL, "", $b), $array_put_css_to_end);
        if ($a_array_index !== false && $b_array_index !== false) {
            if ($a_array_index < $b_array_index) {
                return -1;
            } else {
                return 1;
            }
        }
        if ($a_array_index !== false) {
            return 1;
        }
        if ($b_array_index !== false) {
            return -1;
        }
    }
    // normal use of comparator
    if ($a == $b) {
        return 0;
    }
    return $a < $b ? -1 : 1;
}
示例#2
0
         $conditional_comment = CssInclude::getInstance()->getConditionalComment($i);
         if ($conditional_comment != "") {
             echo "<!--[if " . $conditional_comment . "]>\n\t\t\t\t";
         }
         if (find($css, ".css.php") > 0 && CssInclude::getInstance()->getCssConfigFile() != "") {
             $css .= "?conf_file=" . CssInclude::getInstance()->getCssConfigFile();
         }
         echo "loadDynamicCSS('" . str_replace(BASE_URL, $cdn_server_url, $css) . "');\n";
         if ($conditional_comment != "") {
             echo "\t\t\t<![endif]-->\n";
         }
     }
 }
 if ($combine_css != "") {
     if (find($combine_css, ".php.css") > 0 && CssInclude::getInstance()->getCssConfigFile() != "") {
         $combine_css .= "?conf_file=" . CssInclude::getInstance()->getCssConfigFile();
     }
     echo "\t\t\tloadDynamicCSS('" . $cdn_server_url . "combine-css/" . str_replace("/", "|", $combine_css) . "');\n";
 }
 $combine_js = "";
 $array_js = JavaScriptInclude::getInstance()->get(true);
 foreach ($array_js as $i => $script) {
     if (JavaScriptInclude::getInstance()->getCombine($i)) {
         if ($combine_js != "") {
             $combine_js .= ",";
         }
         $combine_js .= str_replace(BASE_URL . "wsp/js/", "", str_replace(BASE_URL . "js/", "", $script));
     } else {
         echo "\t\t\t";
         $conditional_comment = JavaScriptInclude::getInstance()->getConditionalComment($i);
         if ($conditional_comment != "") {
示例#3
0
 /**
  * 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);
     }
 }
示例#4
0
 /**
  * Method setHeaderClass
  * @access public
  * @param string $class [default value: 1]
  * @param boolean $default_border_style [default value: true]
  * @return RowTable
  * @since 1.0.36
  */
 public function setHeaderClass($class = "1", $default_border_style = true)
 {
     CssInclude::getInstance()->loadCssConfigFileInMemory();
     if (is_numeric($class)) {
         $this->is_header_row = true;
         if ($default_border_style && $class > 0) {
             $this->setBorderPredefinedStyle($class);
         }
     }
     $this->setClass($class);
     if ($GLOBALS['__PAGE_IS_INIT__']) {
         $this->object_change = true;
     }
     return $this;
 }
 /**
  * Method addCss
  * @access protected
  * @param mixed $css_url 
  * @param string $conditional_comment 
  * @param boolean $conbine [default value: false]
  * @since 1.0.59
  */
 protected function addCss($css_url, $conditional_comment = '', $conbine = false)
 {
     $this->array_css[] = $css_url;
     CssInclude::getInstance()->add($css_url, $conditional_comment, $conbine);
 }
示例#6
0
 /**
  * Method printStaticDebugMessage
  * @access static
  * @param string|object $debug_msg 
  * @since 1.0.59
  */
 public static function printStaticDebugMessage($debug_msg)
 {
     // print the debug
     $GLOBALS['__ERROR_DEBUG_PAGE__'] = true;
     if ($GLOBALS['__DEBUG_PAGE_IS_PRINTING__'] == false) {
         $GLOBALS['__DEBUG_PAGE_IS_PRINTING__'] = true;
         if (gettype($debug_msg) == "object") {
             if (get_class($debug_msg) == "NewException") {
                 $debug_msg = NewException::generateErrorMessage($debug_msg->code, $debug_msg->message, $debug_msg->file, $debug_msg->line);
             } else {
                 $debug_msg = echo_r($debug_msg);
             }
         }
         if ($GLOBALS['__AJAX_PAGE__'] == false || $GLOBALS['__AJAX_LOAD_PAGE__'] == true && $_GET['mime'] == "text/html") {
             $_POST['debug'] = $debug_msg;
             $_GET['p'] = "error-debug";
             try {
                 if (!defined('FORCE_SERVER_NAME') || FORCE_SERVER_NAME == "") {
                     if ($_SERVER['SERVER_PORT'] == 443) {
                         $from_url = "https://" . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];
                     } else {
                         $port = "";
                         if ($_SERVER['SERVER_PORT'] != 80 && $_SERVER['SERVER_PORT'] != "") {
                             $port = ":" . $_SERVER['SERVER_PORT'];
                         }
                         $from_url = "http://" . $_SERVER['SERVER_NAME'] . $port . $_SERVER['REQUEST_URI'];
                     }
                 } else {
                     $from_url = "http://" . FORCE_SERVER_NAME . $_SERVER['REQUEST_URI'];
                 }
                 $_GET['from_url'] = $from_url;
                 require_once dirname(__FILE__) . "/../../pages/error/error-debug.php";
                 $debug_page = new ErrorDebug(self::$trace !== false ? true : false);
                 if (method_exists($debug_page, "InitializeComponent")) {
                     $debug_page->InitializeComponent();
                 }
                 if (method_exists($debug_page, "Load")) {
                     $debug_page->Load();
                 }
                 $debug_page->loadAllVariables();
                 $__PAGE_IS_INIT__ = true;
                 $debug_page->executeCallback();
                 if (method_exists($debug_page, "Loaded")) {
                     $debug_page->Loaded();
                 }
                 $http_type = "";
                 $split_request_uri = explode("\\?", $_SERVER['REQUEST_URI']);
                 if (!defined('FORCE_SERVER_NAME') || FORCE_SERVER_NAME == "") {
                     if ($_SERVER['SERVER_PORT'] == 443) {
                         $http_type = "https://";
                         $current_url = str_replace("//", "/", $_SERVER['SERVER_NAME'] . substr($split_request_uri[0], 0, strrpos($split_request_uri[0], "/")) . "/");
                     } else {
                         $port = "";
                         if ($_SERVER['SERVER_PORT'] != 80 && $_SERVER['SERVER_PORT'] != "") {
                             $port = ":" . $_SERVER['SERVER_PORT'];
                         }
                         $http_type = "http://";
                         $current_url = str_replace("//", "/", $_SERVER['SERVER_NAME'] . $port . substr($split_request_uri[0], 0, strrpos($split_request_uri[0], "/")) . "/");
                     }
                 } else {
                     $http_type = "http://";
                     $current_url = str_replace("//", "/", FORCE_SERVER_NAME . substr($split_request_uri[0], 0, strrpos($split_request_uri[0], "/")) . "/");
                 }
                 // define the base URL of the website
                 $my_base_url = "";
                 $array_cwd = explode('/', str_replace('\\', '/', getcwd()));
                 $wsp_folder_name = $array_cwd[sizeof($array_cwd) - 1];
                 // Detect base URL with the root folder of wsp
                 $array_current_url = explode('/', $current_url);
                 for ($i = sizeof($array_current_url) - 2; $i >= 0; $i--) {
                     if ($array_current_url[$i] == $wsp_folder_name) {
                         $my_base_url = $http_type;
                         for ($j = 0; $j <= $i; $j++) {
                             $my_base_url .= $array_current_url[$j] . "/";
                         }
                         break;
                     }
                 }
                 if ($my_base_url == "") {
                     if (!defined('FORCE_SERVER_NAME') || FORCE_SERVER_NAME == "") {
                         // If not find root folder then test if there is an alias
                         $array_script_name = explode('/', $_SERVER['SCRIPT_NAME']);
                         unset($array_script_name[sizeof($array_script_name) - 1]);
                         $alias_path = implode('/', $array_script_name);
                         if ($alias_path != "") {
                             // Alias detected
                             $my_base_url = $http_type . $array_current_url[0] . $alias_path . "/";
                         } else {
                             // No Alias detected
                             $my_base_url = $http_type . $array_current_url[0] . "/";
                         }
                     } else {
                         if (strtoupper(substr(FORCE_SERVER_NAME, 0, 7)) == "HTTP://" || strtoupper(substr(FORCE_SERVER_NAME, 0, 8)) == "HTTPS://") {
                             $my_base_url = FORCE_SERVER_NAME . "/";
                         } else {
                             $my_base_url = $http_type . FORCE_SERVER_NAME . "/";
                         }
                     }
                 }
                 $my_site_base_url = $my_base_url;
                 header("Content-Type: text/html");
                 echo "<html><head><title>Debug Error - " . utf8encode(SITE_NAME) . "</title>\n";
                 $jquery_style = "";
                 if (DEFINE_STYLE_JQUERY != "") {
                     $jquery_style = DEFINE_STYLE_JQUERY;
                 }
                 echo "<link type=\"text/css\" rel=\"StyleSheet\" href=\"" . $my_site_base_url . "combine-css/styles.php.css,angle.php.css,jquery" . JQUERY_UI_VERSION . "|" . $jquery_style . "|jquery-ui-" . JQUERY_UI_VERSION . ".custom.css";
                 if (trim(CssInclude::getInstance()->getCssConfigFile()) != "") {
                     echo "?conf_file=" . CssInclude::getInstance()->getCssConfigFile();
                 }
                 echo "\" media=\"screen\" />\n";
                 echo "<script type=\"text/javascript\" src=\"" . $my_site_base_url . "combine-js/jquery|jquery-" . JQUERY_VERSION . ".min.js,jquery|jquery-ui-" . JQUERY_UI_VERSION . ".custom.min.js,jquery.cookie.js,pngfix.js,utils.js\"></script>\n";
                 echo "<script type=\"text/javascript\" src=\"" . $my_site_base_url . "combine-js/jquery.backstretch.min.js,jquery.cookie.js\"></script>\n";
                 echo "<meta name=\"Robots\" content=\"noindex, nofollow\" />\n";
                 echo "<base href=\"" . $my_site_base_url . "\" />\n";
                 echo "</head><body>\n";
                 echo $debug_page->render();
                 if ($GLOBALS['__AJAX_LOAD_PAGE__'] == true && $GLOBALS['__AJAX_LOAD_PAGE_ID__'] != "") {
                     echo "<script type=\"text/javascript\">\n";
                     echo "lauchJavascriptPage_" . $GLOBALS['__AJAX_LOAD_PAGE_ID__'] . " = function() {\n";
                     echo "\t\$('#idLoadPageLoadingPicture" . $GLOBALS['__AJAX_LOAD_PAGE_ID__'] . "').attr('style', 'display:none;');\n";
                     echo "\t\$('#idLoadPageContent" . $GLOBALS['__AJAX_LOAD_PAGE_ID__'] . "').attr('style', 'display:block;');\n";
                     echo "};\n";
                     echo "\twaitForJsScripts(" . $GLOBALS['__AJAX_LOAD_PAGE_ID__'] . ");\n";
                     echo "\tLoadPngPicture();\n";
                     echo "</script>\n";
                 }
                 echo "</body></html>\n";
             } catch (Exception $e) {
                 echo $e->getMessage();
                 NewException::sendErrorByMail($debug_msg);
             }
         } else {
             header('HTTP/1.1 500 Internal Server Error');
             if (defined('SEND_ERROR_BY_MAIL') && SEND_ERROR_BY_MAIL == true && !isLocalDebug()) {
                 if (self::$trace !== false) {
                     // standard msg "administrator is notified"
                     echo __(ERROR_DEBUG_MAIL_SENT);
                 } else {
                     // no trace in the debug information
                     echo utf8encode($debug_msg);
                 }
             } else {
                 echo utf8encode($debug_msg);
             }
             NewException::sendErrorByMail($debug_msg);
             exit;
         }
     }
 }
示例#7
0
 /**
  * Method activateOnOffStyle
  * @access public
  * @return CheckBox
  * @since 1.0.89
  */
 public function activateOnOffStyle()
 {
     $this->on_off_style = true;
     JavaScriptInclude::getInstance()->add(BASE_URL . "wsp/js/iphone-style-checkboxes.js", "", true);
     CssInclude::getInstance()->add(BASE_URL . "wsp/css/iphone-style-checkboxes.css", "", true);
     return $this;
 }
示例#8
0
 /**
  * Method includeJsAndCssFromObjectToPage
  * Use to add JS and CSS to the page when Object never load on init, but load dynamically (on DialogBox, Map, ...)
  * @access public
  * @param string $str_object 
  * @since 1.0.33
  */
 public function includeJsAndCssFromObjectToPage($str_object)
 {
     $this->create_object_to_get_css_js = true;
     if (find($str_object, "(", 0, 0) > 0) {
         eval("\$temp_obj = new " . $str_object . ";");
     } else {
         $temp_obj = new $str_object();
     }
     $js_array = $temp_obj->getJavaScriptArray();
     for ($i = 0; $i < sizeof($js_array); $i++) {
         JavaScriptInclude::getInstance()->add($js_array[$i]);
     }
     $css_array = $temp_obj->getCssArray();
     for ($i = 0; $i < sizeof($css_array); $i++) {
         CssInclude::getInstance()->add($css_array[$i]);
     }
     $this->create_object_to_get_css_js = false;
 }
示例#9
0
 public function Load()
 {
     parent::$PAGE_TITLE = __(CONFIGURE_CSS);
     if ($this->jquery_version == "JQUERY_UI_VERSION") {
         $this->jquery_version = "1.8.14";
     }
     JavaScriptInclude::getInstance()->add(BASE_URL . "wsp/js/wsp-admin.js", "", true);
     JavaScriptInclude::getInstance()->add(BASE_URL . "wsp/js/jquery.backstretch.min.js", "", true);
     CssInclude::getInstance()->loadCssConfigFileInMemory();
     //Admin
     $table = new Table();
     $table->setDefaultValign(RowTable::VALIGN_TOP);
     $construction_page = new Object(__(PAGE_IN_CONSTRUCTION));
     $table->addRow($construction_page->setClass("warning"))->setColspan(2);
     $form = new Form($this);
     $table_form = new Table();
     $table_form->addRow();
     $this->background_body = new ColorPicker($form);
     $this->background_body->setValue(DEFINE_STYLE_BCK_BODY)->hash(true)->setWidth(200);
     $this->background_body->disableAjaxWaitMessage()->onChange("changeBackgroundBody")->setAjaxEvent();
     $table_form->addRowColumns(__(EDT_BACKGROUND_BODY) . ":&nbsp;", $this->background_body);
     $this->color_body = new ColorPicker($form);
     $this->color_body->setValue(DEFINE_STYLE_COLOR_BODY)->hash(true)->setWidth(200);
     $this->color_body->disableAjaxWaitMessage()->onChange("changeColorBody")->setAjaxEvent();
     $table_form->addRowColumns(__(EDT_COLOR_BODY) . ":&nbsp;", $this->color_body);
     $table_form->addRow();
     $this->link_color = new ColorPicker($form);
     $this->link_color->setValue(DEFINE_STYLE_LINK_COLOR)->hash(true)->setWidth(200);
     $this->link_color->disableAjaxWaitMessage()->onChange("changeLinkColor")->setAjaxEvent();
     $table_form->addRowColumns(__(EDT_LINK_COLOR) . ":&nbsp;", $this->link_color);
     $this->link_hover_color = new ColorPicker($form);
     $this->link_hover_color->setValue(DEFINE_STYLE_LINK_HOVER_COLOR)->hash(true)->setWidth(200);
     $this->link_hover_color->disableAjaxWaitMessage()->onChange("changeLinkHoverColor")->setAjaxEvent();
     $table_form->addRowColumns(__(EDT_LINK_HOVER_COLOR) . ":&nbsp;", $this->link_hover_color);
     $table_form->addRow();
     $this->bck_body_pic = new TextBox($form);
     $this->bck_body_pic->setValue(DEFINE_STYLE_BCK_BODY_PIC)->setWidth(200);
     $this->bck_body_pic->disableAjaxWaitMessage()->onChange("changeBackgroundBody")->setAjaxEvent();
     $table_form->addRowColumns(__(EDT_BCK_BODY_PIC) . ":&nbsp;", $this->bck_body_pic);
     $this->bck_body_pic_repeat = new ComboBox($form);
     $this->bck_body_pic_repeat->addItem("", "&nbsp;", DEFINE_STYLE_BCK_BODY_PIC_REPEAT == "" ? true : false);
     $this->bck_body_pic_repeat->addItem("repeat", "repeat", DEFINE_STYLE_BCK_BODY_PIC_REPEAT == "repeat" ? true : false);
     $this->bck_body_pic_repeat->addItem("repeat-x", "repeat-x", DEFINE_STYLE_BCK_BODY_PIC_REPEAT == "repeat-x" ? true : false);
     $this->bck_body_pic_repeat->addItem("repeat-y", "repeat-y", DEFINE_STYLE_BCK_BODY_PIC_REPEAT == "repeat-y" ? true : false);
     $this->bck_body_pic_repeat->addItem("no-repeat", "no-repeat", DEFINE_STYLE_BCK_BODY_PIC_REPEAT == "no-repeat" ? true : false);
     $this->bck_body_pic_repeat->disableAjaxWaitMessage()->onChange("changeBackgroundBody")->setAjaxEvent()->setWidth(200);
     if ($this->bck_body_pic->getValue() == "") {
         $this->bck_body_pic_repeat->setValue("");
         $this->bck_body_pic_repeat->disable();
     }
     $table_form->addRowColumns(__(EDT_BCK_BODY_PIC_REPEAT) . ":&nbsp;", $this->bck_body_pic_repeat);
     $body_pic_pos = "";
     $body_pic_pos_more = "";
     if (strtolower(DEFINE_STYLE_BCK_BODY_PIC_POSITION) == "stretch") {
         $body_pic_pos = strtolower(DEFINE_STYLE_BCK_BODY_PIC_POSITION);
     } else {
         if (DEFINE_STYLE_BCK_BODY_PIC_POSITION != "") {
             $tmp_array = split(' ', DEFINE_STYLE_BCK_BODY_PIC_POSITION);
             for ($i = 0; $i < sizeof($tmp_array); $i++) {
                 if (is_numeric(trim(str_replace("px", "", str_replace("%", "", $tmp_array[$i]))))) {
                     $body_pic_pos_more .= $tmp_array[$i] . " ";
                 } else {
                     $body_pic_pos .= $tmp_array[$i] . " ";
                 }
             }
             $body_pic_pos = strtolower(trim($body_pic_pos));
             $body_pic_pos_more = trim($body_pic_pos_more);
         }
     }
     $this->bck_body_pic_position = new ComboBox($form);
     $this->bck_body_pic_position->addItem("", "&nbsp;", $body_pic_pos == "" ? true : false);
     $this->bck_body_pic_position->addItem("stretch", "stretch", $body_pic_pos == "stretch" ? true : false);
     $this->bck_body_pic_position->addItem("left top", "left top", $body_pic_pos == "left top" ? true : false);
     $this->bck_body_pic_position->addItem("left", "left center", $body_pic_pos == "left" ? true : false);
     $this->bck_body_pic_position->addItem("left bottom", "left bottom", $body_pic_pos == "left bottom" ? true : false);
     $this->bck_body_pic_position->addItem("right top", "right top", $body_pic_pos == "right top" ? true : false);
     $this->bck_body_pic_position->addItem("right", "right center", $body_pic_pos == "right" ? true : false);
     $this->bck_body_pic_position->addItem("right bottom", "right bottom", $body_pic_pos == "right bottom" ? true : false);
     $this->bck_body_pic_position->addItem("top", "center top", $body_pic_pos == "top" ? true : false);
     $this->bck_body_pic_position->addItem("center", "center center", $body_pic_pos == "center" ? true : false);
     $this->bck_body_pic_position->addItem("bottom", "center bottom", $body_pic_pos == "bottom" ? true : false);
     $this->bck_body_pic_position->disableAjaxWaitMessage()->onChange("changeBackgroundBody")->setAjaxEvent()->setWidth(120);
     if ($this->bck_body_pic->getValue() == "") {
         $this->bck_body_pic_position->setValue("");
         $this->bck_body_pic_position->disable();
     }
     $this->bck_body_pic_position_more = new TextBox($form);
     $this->bck_body_pic_position_more->setValue($body_pic_pos_more);
     $this->bck_body_pic_position_more->disableAjaxWaitMessage()->onChange("changeBackgroundBody")->setAjaxEvent()->setWidth(77);
     if ($this->bck_body_pic->getValue() == "") {
         $this->bck_body_pic_position_more->setValue("");
         $this->bck_body_pic_position_more->disable();
     }
     $table_form->addRowColumns(__(EDT_BCK_BODY_PIC_POSITION) . ":&nbsp;", new Object($this->bck_body_pic_position, $this->bck_body_pic_position_more));
     $table_form->addRow();
     $this->style_jquery = new ComboBox($form);
     if (!defined('DEFINE_STYLE_JQUERY') || DEFINE_STYLE_JQUERY == "") {
         $define_style_jquery = "smoothness";
     } else {
         $define_style_jquery = DEFINE_STYLE_JQUERY;
     }
     $dirname = dirname(__FILE__) . "/../../../wsp/css/jquery" . $this->jquery_version . "/";
     $files = scandir($dirname);
     for ($i = 0; $i < sizeof($files); $i++) {
         $file = $files[$i];
         if ($file != '.' && $file != '..' && $file != '.svn' && is_dir($dirname . $file)) {
             $this->style_jquery->addItem($file, $file, $define_style_jquery == $file ? true : false);
         }
     }
     $this->style_jquery->disableAjaxWaitMessage()->onChange("changeStyleJquery")->setAjaxEvent()->setWidth(200);
     $table_form->addRowColumns(__(EDT_STYLE_JQUERY) . ":&nbsp;", $this->style_jquery);
     $table_form->addRow();
     $this->style_font = new ComboBox($form, "style_font", 200);
     $this->style_font->addItem("Arial", "Arial", DEFINE_STYLE_FONT == "Arial" ? true : false);
     $this->style_font->addItem("Times New Roman", "Times New Roman", DEFINE_STYLE_FONT == "Times New Roman" ? true : false);
     $this->style_font->addItem("Verdana", "Verdana", DEFINE_STYLE_FONT == "Verdana" ? true : false);
     $this->style_font->addItem("Cantarell", "Cantarell", DEFINE_STYLE_FONT == "Cantarell" ? true : false);
     $this->style_font->addItem("Cardo", "Cardo", DEFINE_STYLE_FONT == "Cardo" ? true : false);
     $this->style_font->addItem("Comic Sans MS", "Comic Sans MS", DEFINE_STYLE_FONT == "Comic Sans MS" ? true : false);
     $this->style_font->addItem("Courier", "Courier", DEFINE_STYLE_FONT == "Courier" ? true : false);
     $this->style_font->addItem("Courier New", "Courier New", DEFINE_STYLE_FONT == "Courier New" ? true : false);
     $this->style_font->addItem("Crimson Text", "Crimson Text", DEFINE_STYLE_FONT == "Crimson Text" ? true : false);
     $this->style_font->addItem("Droid Sans", "Droid Sans", DEFINE_STYLE_FONT == "Droid Sans" ? true : false);
     $this->style_font->addItem("Droid Sans Mono", "Droid Sans Mono", DEFINE_STYLE_FONT == "Droid Sans Mono" ? true : false);
     $this->style_font->addItem("Droid Serif", "Droid Serif", DEFINE_STYLE_FONT == "Droid Serif" ? true : false);
     $this->style_font->addItem("IM Fell", "IM Fell", DEFINE_STYLE_FONT == "IM Fell" ? true : false);
     $this->style_font->addItem("Impact", "Impact", DEFINE_STYLE_FONT == "Impact" ? true : false);
     $this->style_font->addItem("Inconsolata", "Inconsolata", DEFINE_STYLE_FONT == "Inconsolata" ? true : false);
     $this->style_font->addItem("Lobster", "Lobster", DEFINE_STYLE_FONT == "Lobster" ? true : false);
     $this->style_font->addItem("Molengo", "Molengo", DEFINE_STYLE_FONT == "Molengo" ? true : false);
     $this->style_font->addItem("Monaco", "Monaco", DEFINE_STYLE_FONT == "Monaco" ? true : false);
     $this->style_font->addItem("Nobile", "Nobile", DEFINE_STYLE_FONT == "Nobile" ? true : false);
     $this->style_font->addItem("Old Standard TT", "Old Standard TT", DEFINE_STYLE_FONT == "Old Standard TT" ? true : false);
     $this->style_font->addItem("Reenie Beanie", "Reenie Beanie", DEFINE_STYLE_FONT == "Reenie Beanie" ? true : false);
     $this->style_font->addItem("Tangerine", "Tangerine", DEFINE_STYLE_FONT == "Tangerine" ? true : false);
     $this->style_font->addItem("Vollkorn", "Vollkorn", DEFINE_STYLE_FONT == "Vollkorn" ? true : false);
     $this->style_font->addItem("Yanone Kaffeesatz", "Yanone Kaffeesatz", DEFINE_STYLE_FONT == "Yanone Kaffeesatz" ? true : false);
     $this->style_font->disableAjaxWaitMessage()->onChange("changeStyleFont")->setAjaxEvent();
     $table_form->addRowColumns(__(EDT_STYLE_FONT) . ":&nbsp;", $this->style_font);
     $this->style_font_serif = new ComboBox($form);
     $this->style_font_serif->addItem("serif", "serif", DEFINE_STYLE_FONT_SERIF == "serif" ? true : false);
     $this->style_font_serif->addItem("sans serif", "sans serif", DEFINE_STYLE_FONT_SERIF == "sans serif" || DEFINE_STYLE_FONT_SERIF == "" ? true : false);
     $this->style_font_serif->addItem("monospace", "monospace", DEFINE_STYLE_FONT_SERIF == "monospace" ? true : false);
     $this->style_font_serif->disableAjaxWaitMessage()->onChange("changeStyleFont")->setAjaxEvent()->setWidth(200);
     $table_form->addRowColumns(__(EDT_STYLE_FONT_SERIF) . ":&nbsp;", $this->style_font_serif);
     $this->style_font_size = new TextBox($form);
     $validation = new LiveValidation();
     $font_size = DEFINE_STYLE_FONT_SIZE;
     if ($font_size == "") {
         $font_size = "10pt";
     }
     $this->style_font_size->setValue(str_replace("pt", "", $font_size))->setWidth(200);
     $this->style_font_size->disableAjaxWaitMessage()->onChange("changeStyleFontSize")->setAjaxEvent();
     $table_form->addRowColumns(__(EDT_FONT_SIZE) . ":&nbsp;", $this->style_font_size->setLiveValidation($validation->addValidateNumericality(true)));
     $table_form->addRow();
     $this->nb_define_style_bck = new ComboBox($form);
     for ($i = 1; $i <= 99; $i++) {
         $this->nb_define_style_bck->addItem($i, $i, !$this->nb_define_style_bck->isChanged() && $i == NB_DEFINE_STYLE_BCK ? true : false);
     }
     $this->nb_define_style_bck->onChange("changeNbDefineStyleBck")->setAjaxEvent();
     $this->nb_define_style_bck->onFormIsChangedJs("alert('" . __(WARNING_CHANGE_PLEASE_SAVE) . "');return false;", true);
     $table_form->addRowColumns(__(CMB_NB_PREDEFINE_STYLE) . ":&nbsp;", $this->nb_define_style_bck->setWidth(50));
     $table_form->addRow();
     $this->current_style_display = new ComboBox($form);
     $this->current_style_display->onFormIsChangedJs("alert('" . __(WARNING_CHANGE_PLEASE_SAVE) . "');return false;", true);
     for ($i = 1; $i <= $this->nb_define_style_bck->getValue(); $i++) {
         $this->current_style_display->addItem($i, $i);
     }
     if ($this->current_style_display->getValue() == "") {
         $this->current_style_display->setSelectedIndex(0);
     }
     $this->current_style_display->onChange("changeCurrentStyleBck")->setAjaxEvent();
     $table_form->addRowColumns(__(CMB_CURRENT_PREDEFINE_STYLE) . ":&nbsp;", $this->current_style_display->setWidth(50));
     $this->current_style_val = $this->current_style_display->getValue();
     for ($i = 1; $i <= $this->nb_define_style_bck->getValue(); $i++) {
         $this->array_round_box_1[] = '.AngleRond' . $i;
         $this->array_round_box_1[] = '.AngleRond' . $i . 'Ombre';
         $this->array_font[] = '.table_' . $i;
         $this->array_font[] = '.table_' . $i . '_bckg';
         $this->array_font[] = '.bckg_' . $i;
         $this->array_font[] = '.header_' . $i . '_bckg';
         $this->array_font[] = '.header_' . $i . '_bckg a';
         $this->array_font[] = '.header_' . $i . '_bckg_a a';
         $this->array_font[] = '.header_' . $i . '_bckg a:hover';
         $this->array_font[] = '.table_' . $i . '_bckg a, a.box_style_' . $i . ':link';
         $this->array_font[] = '.table_' . $i . '_bckg a:hover, a.box_style_' . $i . ':hover';
     }
     $this->background_picture_1 = new ComboBox($form);
     $this->background_picture_1->addItem("", __(NO_PICTURE));
     if (constant("DEFINE_STYLE_BCK_PICTURE_" . $this->current_style_val) != "") {
         $this->background_picture_1->addItem(str_replace("../img/", "img/", str_replace("../wsp/img/", "wsp/img/", constant("DEFINE_STYLE_BCK_PICTURE_" . $this->current_style_val))), constant("DEFINE_STYLE_BCK_PICTURE_" . $this->current_style_val) . " (" . __(CURRENT_PICTURE) . ")", true);
     }
     if ($handle = opendir(dirname(__FILE__) . "/../../../wsp/img/round_bgd/")) {
         while (false !== ($file = readdir($handle))) {
             if (is_file(dirname(__FILE__) . "/../../../wsp/img/round_bgd/" . $file)) {
                 $this->background_picture_1->addItem("wsp/img/round_bgd/" . $file, $file, constant("DEFINE_STYLE_BCK_PICTURE_" . $this->current_style_val) == "img/round_bgd/" . $file ? true : false);
             }
         }
         closedir($handle);
     }
     $this->background_picture_1->onChange("changeBackgroundPicture1")->setAjaxEvent()->disableAjaxWaitMessage();
     $table_form->addRowColumns(__(CMB_BCK_PICTURE_1, $this->current_style_val) . ":&nbsp;", $this->background_picture_1->setWidth(200));
     $this->background_1_header = new ColorPicker($form);
     $this->background_1_header->setValue(constant("DEFINE_STYLE_BCK_" . $this->current_style_val . "_HEADER"))->hash(true)->setWidth(200);
     $this->background_1_header->disableAjaxWaitMessage()->onChange("changeBackground1Header")->setAjaxEvent();
     $table_form->addRowColumns(__(EDT_BCK_1_HEADER, $this->current_style_val) . ":&nbsp;", $this->background_1_header);
     $this->border_table_1 = new ColorPicker($form);
     $this->border_table_1->setValue(constant("DEFINE_STYLE_BORDER_TABLE_" . $this->current_style_val))->hash(true)->setWidth(200);
     $this->border_table_1->disableAjaxWaitMessage()->onChange("changeBorderTable1")->setAjaxEvent();
     $table_form->addRowColumns(__(EDT_BCK_BORDER_TABLE_1, $this->current_style_val) . ":&nbsp;", $this->border_table_1);
     $this->color_1_header = new ColorPicker($form);
     $this->color_1_header->setValue(constant("DEFINE_STYLE_COLOR_" . $this->current_style_val . "_HEADER"))->hash(true)->required(false)->setWidth(200);
     $this->color_1_header->disableAjaxWaitMessage()->onChange("changeColor1Header")->setAjaxEvent();
     $table_form->addRowColumns(__(EDT_COLOR_1_HEADER, $this->current_style_val) . ":&nbsp;", $this->color_1_header);
     $this->style1_header_link = new ColorPicker($form);
     $this->style1_header_link->setValue(constant("DEFINE_STYLE_COLOR_" . $this->current_style_val . "_HEADER_LINK"))->hash(true)->required(false)->setWidth(200);
     if ($this->color_1_header->getValue() != "") {
         $this->style1_header_link->forceEmptyValue();
     }
     $this->style1_header_link->disableAjaxWaitMessage()->onChange("change1HeaderLink")->setAjaxEvent();
     $table_form->addRowColumns(__(EDT_COLOR_1_HEADER_LINK, $this->current_style_val) . ":&nbsp;", $this->style1_header_link);
     $this->style1_header_link_hover = new ColorPicker($form);
     $this->style1_header_link_hover->setValue(constant("DEFINE_STYLE_COLOR_" . $this->current_style_val . "_HEADER_LINK_HOVER"))->hash(true)->required(false)->setWidth(200);
     if ($this->style1_header_link->getValue() == "") {
         $this->style1_header_link_hover->disable();
         $this->style1_header_link_hover->forceEmptyValue();
     }
     $this->style1_header_link_hover->disableAjaxWaitMessage()->onChange("change1HeaderLinkHover")->setAjaxEvent();
     $table_form->addRowColumns(__(EDT_COLOR_1_HEADER_LINK_HOVER, $this->current_style_val) . ":&nbsp;", $this->style1_header_link_hover);
     $this->background_1 = new ColorPicker($form);
     $this->background_1->setValue(constant("DEFINE_STYLE_BCK_" . $this->current_style_val))->hash(true)->setWidth(200);
     $this->background_1->disableAjaxWaitMessage()->onChange("changeBackground1")->setAjaxEvent();
     $table_form->addRowColumns(__(EDT_BCK_1, $this->current_style_val) . ":&nbsp;", $this->background_1);
     $this->color_1 = new ColorPicker($form);
     $this->color_1->setValue(constant("DEFINE_STYLE_COLOR_" . $this->current_style_val))->hash(true)->setWidth(200);
     $this->color_1->disableAjaxWaitMessage()->onChange("changeColor1")->setAjaxEvent();
     $table_form->addRowColumns(__(EDT_COLOR_1, $this->current_style_val) . ":&nbsp;", $this->color_1);
     $this->style1_color_link = new ColorPicker($form);
     $this->style1_color_link->setValue(constant("DEFINE_STYLE_COLOR_" . $this->current_style_val . "_LINK"))->hash(true)->required(false)->setWidth(200);
     if ($this->color_1->getValue() != "") {
         $this->style1_color_link->forceEmptyValue();
     }
     $this->style1_color_link->disableAjaxWaitMessage()->onChange("change1ColorLink")->setAjaxEvent();
     $table_form->addRowColumns(__(EDT_COLOR_1_LINK, $this->current_style_val) . ":&nbsp;", $this->style1_color_link);
     $this->style1_color_link_hover = new ColorPicker($form);
     $this->style1_color_link_hover->setValue(constant("DEFINE_STYLE_COLOR_" . $this->current_style_val . "_LINK_HOVER"))->hash(true)->required(false)->setWidth(200);
     if ($this->style1_color_link->getValue() == "") {
         $this->style1_color_link_hover->disable();
         $this->style1_color_link_hover->forceEmptyValue();
     }
     $this->style1_color_link_hover->disableAjaxWaitMessage()->onChange("change1ColorLinkHover")->setAjaxEvent();
     $table_form->addRowColumns(__(EDT_COLOR_1_LINK_HOVER, $this->current_style_val) . ":&nbsp;", $this->style1_color_link_hover);
     $this->style_gradient = new CheckBox($form);
     if (constant("DEFINE_STYLE_GRADIENT_" . $this->current_style_val) == true) {
         $this->style_gradient->setChecked();
     }
     $this->style_gradient->activateOnOffStyle();
     $this->style_gradient->disableAjaxWaitMessage()->onChange("changeGradient")->setAjaxEvent();
     $table_form->addRowColumns(__(EDT_STYLE_GRADIENT, $this->current_style_val) . ":&nbsp;", $this->style_gradient);
     $this->color_shadow = new ColorPicker($form);
     if (DEFINE_STYLE_BCK_PICTURE_1 != "" && DEFINE_STYLE_BCK_PICTURE_SECOND != "") {
         $this->color_shadow->disable();
     }
     $this->color_shadow->setValue(constant("DEFINE_STYLE_OMBRE_COLOR_" . $this->current_style_val))->hash(true)->setWidth(200);
     $this->color_shadow->disableAjaxWaitMessage()->onChange("changeColorShadow")->setAjaxEvent();
     $table_form->addRowColumns(__(EDT_COLOR_SHADOW, $this->current_style_val) . ":&nbsp;", $this->color_shadow);
     $table_form->addRow();
     if (!defined('DEFINE_STYLE_COLOR_UPLOAD_PROGRESS_BAR')) {
         define("DEFINE_STYLE_COLOR_UPLOAD_PROGRESS_BAR", "#448ebb");
     }
     $this->style_upload_progress_bar = new ColorPicker($form);
     $this->style_upload_progress_bar->setValue(DEFINE_STYLE_COLOR_UPLOAD_PROGRESS_BAR)->hash(true)->setWidth(200);
     $table_form->addRowColumns(__(EDT_COLOR_UPLOAD_PROGRESS_BAR) . ":&nbsp;", $this->style_upload_progress_bar);
     $table_form->addRow();
     if (!defined('DEFINE_STYLE_BACKCOLOR_SCROLL_TO_TOP')) {
         define("DEFINE_STYLE_BACKCOLOR_SCROLL_TO_TOP", "#F00001");
     }
     $this->style_scroll_to_top = new ColorPicker($form);
     $this->style_scroll_to_top->setValue(DEFINE_STYLE_BACKCOLOR_SCROLL_TO_TOP)->hash(true)->setWidth(200);
     $table_form->addRowColumns(__(EDT_BACKCOLOR_SCROLL_TO_TOP) . ":&nbsp;", $this->style_scroll_to_top);
     $this->activateScrollToTop();
     $table_form->addRow();
     $btnValidate = new Button($form);
     $btnValidate->setValue(__(BTN_VALIDATE))->onClick("configureCss");
     $table_form->addRowColumns($btnValidate)->setColumnColspan(1, 3)->setColumnAlign(1, RowTable::ALIGN_CENTER);
     $table_form->addRow();
     $form->setContent($table_form);
     $this->text_link_note_obj = new Object();
     $this->text_link_note_obj->setId("id_body_note");
     $this->example_obj = new Object();
     $this->example_obj->setId("idExamplesObject");
     if (!$this->current_style_display->isChanged() || $btnValidate->isClicked()) {
         $this->example_obj->add($this->createExamples());
     }
     $table->addRowColumns($form);
     $this->css_config_obj = new Object($table);
     $this->css_config_obj->setId("css_config_obj");
     if (!$this->isAjaxPage()) {
         $this->changeColorBody();
         $this->changeLinkColor();
     }
     $this->render = new AdminTemplateForm($this, $this->css_config_obj, $this->example_obj);
 }
示例#10
0
 /**
  * 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);
     }
 }