Example #1
0
 public function Load()
 {
     parent::$PAGE_TITLE = __(ERROR_USER_BANNED) . " - " . __(SITE_NAME);
     parent::$PAGE_META_ROBOTS = "noindex, nofollow";
     $can_use_captacha = true;
     if (WspBannedVisitors::isBannedIp($this->getRemoteIP())) {
         $last_access = new DateTime(WspBannedVisitors::getBannedIpLastAccess($this->getRemoteIP()));
         $duration = WspBannedVisitors::getBannedIpDuration($this->getRemoteIP());
         $dte_ban = $last_access->modify("+" . $duration . " seconds");
         if ($dte_ban > new DateTime()) {
             $can_use_captacha = false;
         }
     }
     $obj_error_msg = new Object(new Picture("wsp/img/warning.png", 48, 48, 0, "absmidlle"), "<br/><br/>");
     $obj_error_msg->add(new Label(__(ERROR_USER_BANNED_MSG_1), true), "<br/>");
     if ($can_use_captacha) {
         $obj_error_msg->add(new Label(__(ERROR_USER_BANNED_MSG_2), true), "<br/><br/>");
         $this->captcha_error_obj = new Object();
         $form = new Form($this);
         $this->captcha = new Captcha($form);
         $this->captcha->setFocus();
         $unblock_btn = new Button($form);
         $unblock_btn->setValue(__(ERROR_USER_BUTTON))->onClick("onClickUnblock");
         $form->setContent(new Object($this->captcha, "<br/>", $unblock_btn));
         $obj_error_msg->add($this->captcha_error_obj, "<br/>", $form);
     }
     $obj_error_msg->add("<br/><br/>", __(MAIN_PAGE_GO_BACK), new Link(BASE_URL, Link::TARGET_NONE, __(SITE_NAME)));
     $this->render = new ErrorTemplate($obj_error_msg, __(ERROR_USER_BANNED));
 }
Example #2
0
 public function Load()
 {
     parent::$PAGE_TITLE = __(CHANGE_PASSWD);
     $form = new Form($this, "Form_change_passwd");
     if (extension_loaded('openssl')) {
         //$form->setEncryptObject(new EncryptDataWspObject("change wsp password", 2048));
     }
     $table = new Table();
     $table->addRow();
     $this->edt_old_passwd = new Password($form, "wsp_old_password");
     $this->edt_old_passwd->setFocus();
     $live_validation = new LiveValidation();
     $live_validation->addValidatePresence()->setFieldName(__(OLD_PASSWD));
     $table->addRowColumns(__(OLD_PASSWD) . " :&nbsp;", $this->edt_old_passwd->setLiveValidation($live_validation))->setStyle("color:black;");
     $this->edt_new_passwd = new Password($form, "wsp_new_password");
     $live_validation = new LiveValidation();
     $live_validation->addValidatePresence()->setFieldName(__(NEW_PASSWD));
     $table->addRowColumns(__(NEW_PASSWD) . " :&nbsp;", $this->edt_new_passwd->setLiveValidation($live_validation))->setStyle("color:black;");
     $this->edt_confirm_passwd = new Password($form, "wsp_confirm_password");
     $live_validation = new LiveValidation();
     $live_validation->addValidatePresence()->setFieldName(__(CONFIRM_PASSWD));
     $live_validation->addValidateConfirmation("wsp_new_password");
     $table->addRowColumns(__(CONFIRM_PASSWD) . " :&nbsp;", $this->edt_confirm_passwd->setLiveValidation($live_validation))->setStyle("color:black;");
     $table->addRow();
     $this->validate_btn = new Button($form);
     $this->validate_btn->setValue(__(CHANGE_PASSWD))->onClick("onChangePasswd")->setAjaxEvent();
     $table->addRow($this->validate_btn)->setColspan(2)->setAlign(RowTable::ALIGN_CENTER);
     $table->addRow();
     $form->setContent($table);
     $table = new Table();
     $table->setWidth("100%");
     $table->addRow($form, RowTable::ALIGN_CENTER);
     $this->render = $table;
 }
 public function Load()
 {
     parent::$PAGE_TITLE = __(CONFIGURE_BANNED_VISITORS);
     if (!defined('MAX_BAD_URL_BEFORE_BANNED')) {
         define("MAX_BAD_URL_BEFORE_BANNED", 4);
     }
     $this->array_wsp_banned_users = WspBannedVisitors::getBannedVisitors();
     $this->table_ban = new Table();
     $this->table_ban->setId("table_ban")->activateAdvanceTable()->activatePagination()->activateSort(2, "desc")->setWidth(500);
     $this->table_ban->addRowColumns("IP", __(LAST_ACCESS), __(DURATION), __(AUTHORIZE))->setHeaderClass(0);
     $ban_vistors_obj = new Object("<br/><br/>", $this->table_ban, "<br/><br/>");
     $ban_ip_table = new Table();
     $form = new Form($this);
     $this->ip_edt = new TextBox($form);
     $validation = new LiveValidation();
     $validation->addValidatePresence();
     $this->ip_edt->setLiveValidation($validation);
     $this->duration_edt = new TextBox($form);
     $this->duration_edt->setValue(0);
     $validation = new LiveValidation();
     $validation->addValidatePresence()->addValidateNumericality(true);
     $this->duration_edt->setLiveValidation($validation);
     $ip_btn = new Button($form);
     $ip_btn->setValue(__(BAN_IP))->onClick("onBannedIP")->setAjaxEvent();
     $ban_ip_table->addRowColumns("IP : ", $this->ip_edt);
     $ban_ip_table->addRowColumns(__(DURATION) . " : ", $this->duration_edt);
     $form->setContent(new Object($ban_ip_table, $ip_btn));
     $ban_vistors_obj->add($form, "<br/><br/>");
     $this->render = new AdminTemplateForm($this, $ban_vistors_obj);
 }
Example #4
0
 public function Load()
 {
     parent::$PAGE_TITLE = __(CONFIGURE_SMTP);
     // Admin
     $form = new Form($this);
     $table_form = new Table();
     $table_form->addRow();
     $this->edtHost = new TextBox($form);
     $this->edtHost->setValue(SMTP_HOST);
     $edtHostValidation = new LiveValidation();
     $table_form->addRowColumns(__(EDT_HOST) . ":&nbsp;", $this->edtHost->setLiveValidation($edtHostValidation->addValidatePresence()->setFieldName(__(EDT_HOST))), "&nbsp;(ssl://smtp.gmail.com)");
     $this->edtPort = new TextBox($form);
     $this->edtPort->setValue(SMTP_PORT);
     $edtPortValidation = new LiveValidation();
     $table_form->addRowColumns(__(EDT_PORT) . ":&nbsp;", $this->edtPort->setLiveValidation($edtPortValidation->addValidateNumericality(true)->setFieldName(__(EDT_PORT))), "&nbsp;(465)");
     $this->edtName = new TextBox($form);
     $this->edtName->setValue(utf8encode(SMTP_NAME));
     $edtNameValidation = new LiveValidation();
     $table_form->addRowColumns(__(EDT_NAME) . ":&nbsp;", $this->edtName->setLiveValidation($edtNameValidation->addValidatePresence()->setFieldName(__(EDT_NAME))), "&nbsp;(Robert Francis)");
     $this->edtMail = new TextBox($form);
     $this->edtMail->setValue(SMTP_MAIL);
     $edtMailValidation = new LiveValidation();
     $table_form->addRowColumns(__(EDT_MAIL) . ":&nbsp;", $this->edtMail->setLiveValidation($edtMailValidation->addValidatePresence()->addValidateEmail()->setFieldName(__(EDT_MAIL))), "&nbsp;(robert.francis@gmail.com)");
     $this->cmbAuth = new ComboBox($form);
     $this->cmbAuth->addItem("false", __(DESACTIVATE), SMTP_AUTH == false ? true : false)->addItem("true", __(ACTIVATE), SMTP_AUTH == true ? true : false)->setWidth(143)->onChange("changeCmbAuth")->setAjaxEvent()->disableAjaxWaitMessage();
     $table_form->addRowColumns(__(CMB_AUTH) . ":&nbsp;", $this->cmbAuth, "&nbsp;(" . __(ACTIVATE) . ")");
     $this->edtUser = new TextBox($form);
     $this->edtUser->setValue(SMTP_USER);
     if (SMTP_AUTH == false) {
         $this->edtUser->disable();
     }
     $table_form->addRowColumns(__(EDT_USER) . ":&nbsp;", $this->edtUser, "&nbsp;(robert.francis@gmail.com)");
     $this->edtPassword = new Password($form);
     $this->edtPassword->setValue(SMTP_PASS);
     if (SMTP_AUTH == false) {
         $this->edtPassword->disable();
     }
     $table_form->addRowColumns(__(EDT_PASS) . ":&nbsp;", $this->edtPassword, "&nbsp;(*********)");
     $table_form->addRow();
     $btnValidate = new Button($form);
     $btnValidate->setValue(__(BTN_VALIDATE))->onClick("configureSmtp")->setAjaxEvent();
     $table_form->addRowColumns($btnValidate)->setColumnColspan(1, 3)->setColumnAlign(1, RowTable::ALIGN_CENTER);
     $table_form->addRow();
     $form->setContent($table_form);
     $this->render = new AdminTemplateForm($this, $form);
 }
Example #5
0
 public function Load()
 {
     parent::$PAGE_TITLE = __(CONFIGURE_USERS);
     $config_users_obj = new Object("<br/>");
     $this->result_obj = new Object();
     $this->result_obj->setId("page_result_area");
     $config_users_obj->add($this->result_obj);
     $this->users_table_obj = new Object();
     $this->users_table_obj->setId("users_table_obj");
     $config_users_obj->add($this->users_table_obj, "<br/><br/>");
     $user_table = new Table();
     $form = new Form($this);
     if (extension_loaded('openssl')) {
         $form->setEncryptObject(new EncryptDataWspObject());
     }
     $this->edt_login = new TextBox($form);
     $validation = new LiveValidation();
     $user_table->addRowColumns(__(LOGIN) . ":&nbsp;", $this->edt_login->setLiveValidation($validation->addValidatePresence()));
     $this->cmb_rights = new ComboBox($form);
     $this->cmb_rights->addItem(Page::RIGHTS_ADMINISTRATOR, "Administrator");
     $this->cmb_rights->addItem(Page::RIGHTS_MODERATOR, "Moderator");
     $this->cmb_rights->addItem(Page::RIGHTS_TRANSLATOR, "Translator");
     $this->cmb_rights->addItem(Page::RIGHTS_DEVELOPER, "Developer");
     $this->cmb_rights->addItem(Page::RIGHTS_AUTH_USER, "Authentificated user");
     $this->cmb_rights->addItem(Page::RIGHTS_GUEST, "Guest");
     $user_table->addRowColumns(__(RIGHTS) . ":&nbsp;", $this->cmb_rights);
     $this->edt_old_password = new Password($form);
     $validation = new LiveValidation();
     $this->old_passwd_row = $user_table->addRowColumns(__(OLD_PASSWORD) . ":&nbsp;", $this->edt_old_password->setLiveValidation($validation->addValidatePresence()->setFieldName(__(OLD_PASSWORD))));
     $this->old_passwd_row->setId("old_passwd_row");
     $this->edt_password = new Password($form);
     $validation = new LiveValidation();
     $user_table->addRowColumns(__(PASSWORD) . ":&nbsp;", $this->edt_password->setLiveValidation($validation->addValidatePresence()->setFieldName(__(PASSWORD))));
     $this->edt_confirm_passwd = new Password($form);
     $live_validation = new LiveValidation();
     $live_validation->addValidatePresence()->setFieldName(__(CONFIRM_PASSWD));
     $live_validation->addValidateConfirmation($this->edt_password->getId());
     $user_table->addRowColumns(__(CONFIRM_PASSWD) . " :&nbsp;", $this->edt_confirm_passwd->setLiveValidation($live_validation))->setStyle("color:black;");
     $user_table->addRow();
     $this->validate_btn = new Button($form);
     $this->validate_btn->setValue(__(ADD))->onClick("addWspUser")->setAjaxEvent()->disableAjaxWaitMessage()->assignEnterKey();
     $this->modify_btn = new Button($form);
     $this->modify_btn->setValue(__(SAVE))->onClick("changeWspUser")->setAjaxEvent()->disableAjaxWaitMessage()->assignEnterKey();
     $this->cancel_btn = new Button($this);
     $this->cancel_btn->setValue(__(CANCEL))->onClick("refresh")->setAjaxEvent()->disableAjaxWaitMessage();
     $modif_btn_table = new Table();
     $modif_btn_table->addRowColumns($this->validate_btn, "&nbsp;", $this->modify_btn, "&nbsp;", $this->cancel_btn);
     $user_table->addRow($modif_btn_table)->setColspan(2)->setAlign(RowTable::ALIGN_CENTER);
     $config_users_obj->add($form->setContent($user_table), "<br/><br/>");
     $this->render = new AdminTemplateForm($this, $config_users_obj);
 }
Example #6
0
 public function Load()
 {
     parent::$PAGE_TITLE = __(MANAGE_PAGES);
     $content = new Object();
     // Search all php files in the folder pages with the synstax "class * extends Page"
     $code_editor_table = new Table();
     $code_editor_table->setDefaultValign(RowTable::VALIGN_TOP);
     $form = new Form($this);
     $this->hdn_old_file = new Hidden($this);
     $content->add($this->hdn_old_file);
     $tree = new TreeView("wsp_files");
     $array_path = explode("/", $this->getRootWspDirectory());
     $root = new TreeViewFolder($array_path[sizeof($array_path) - 1]);
     $tree_page_items = new TreeViewItems();
     $dir = $this->getRootWspDirectory() . "/pages/";
     $array_files = $this->loadFiles($dir);
     foreach ($array_files as $key => $value) {
         $tree_page_type = new TreeViewFolder($key);
         if ($key == "Page classes") {
             $tree_page_type->expand();
         } else {
             $tree_page_type->collapse();
         }
         $tree_page_items->add($tree_page_type);
         $tree_items = new TreeViewItems();
         $array_folder = array();
         for ($i = 0; $i < sizeof($value); $i++) {
             $file = $value[$i];
             $array_path = explode('/', $file);
             $file_name = $array_path[sizeof($array_path) - 1];
             $array_path[sizeof($array_path) - 1] = null;
             $folder = implode('/', $array_path);
             if ($folder == "") {
                 $parent_tree_items = $tree_items;
             } else {
                 if (isset($array_folder[$folder])) {
                     $parent_tree_items = $array_folder[$folder];
                 } else {
                     $tree_folder = new TreeViewFolder($folder);
                     $tree_folder->collapse();
                     $tree_items->add($tree_folder);
                     $parent_tree_items = new TreeViewItems();
                     $tree_folder->setTreeViewItems($parent_tree_items);
                     $array_folder[$folder] = $parent_tree_items;
                 }
             }
             $file_link = new Button($this);
             $file_name_label = new Label($file_name);
             $file_name_label->setId("file_label_" . str_replace("/", "_slashsep_", str_replace(".", "_", str_replace("-", "_", $file))));
             $this->array_files_label[$file] = $file_name_label;
             $file_link->setValue($file_name_label)->setIsLink();
             $file_link->onClick("loadFile", $file, $this->hdn_old_file)->setAjaxEvent();
             $tree_file = new TreeViewFile($file_link);
             $parent_tree_items->add($tree_file);
         }
         $tree_page_type->setTreeViewItems($tree_items);
     }
     $root->setTreeViewItems($tree_page_items);
     $root_items = new TreeViewItems();
     $root_items->add($root);
     $tree->setTreeViewItems($root_items);
     $tree_obj = new Object($tree);
     $tree_obj->setAlign(Object::ALIGN_LEFT)->setWidth(220)->setHeight(630)->setMaxHeight(630);
     $this->code_editor = new TextArea($form);
     $this->code_editor->setWidth(600)->setHeight(620)->allowTabulation()->activateSourceCodeEdit("php")->noWrap();
     $code_editor_table->addRowColumns($tree_obj, $this->code_editor);
     $this->btn_save = new Button($form);
     $this->btn_save->setValue(__(BTN_SAVE))->setAjaxEvent()->hide();
     $this->btn_save->forceSpanTag();
     if (Page::getInstance("wsp-admin/manage/manage-translations")->userHaveRights()) {
         $this->tranlate_links_obj = new Object(__(MANAGE_TRANSLATIONS) . ": ");
         $this->tranlate_links_obj->setId("tranlate_links_obj");
     }
     $code_editor_table->addRow(new Object($this->tranlate_links_obj, "&nbsp;", $this->btn_save))->setColspan(2);
     $code_editor_table->addRow();
     $form->setContent($code_editor_table);
     // Create a link to the labels of this page
     // TODO
     $this->render = new AdminTemplateForm($this, $content->add($form));
     if (isset($_GET['file'])) {
         $this->loadFile(null, $_GET['file'], "");
     } else {
         if (!$this->isAjaxPage()) {
             $this->loadFile(null, "home.php", "");
         }
     }
 }
Example #7
0
 /**
  * Constructor ContactForm
  * @param Page $page_object 
  * @param string $send_method 
  * @param string $table_style 
  */
 function __construct($page_object, $send_method, $table_style = '')
 {
     parent::__construct();
     if (!isset($page_object) || !isset($send_method)) {
         throw new NewException("2 arguments for " . get_class($this) . "::__construct() are mandatory", 0, getDebugBacktrace(1));
     }
     if (gettype($page_object) != "object" || !is_subclass_of($page_object, "Page")) {
         throw new NewException("Argument page_object for " . get_class($this) . "::__construct() error", 0, getDebugBacktrace(1));
     }
     $this->page_object = $page_object;
     $this->mail_to = SMTP_MAIL;
     $this->mail_to_name = SMTP_NAME;
     $table_main = new Table();
     $table_main->setClass($table_style);
     $form = new Form($this->page_object);
     $name = new TextBox($form, "contact_name");
     $name_validation = new LiveValidation();
     $name->setLiveValidation($name_validation->addValidatePresence()->setFieldName(__(CONTACTFORM_NAME)));
     $table_main->addRowColumns(__(CONTACTFORM_NAME) . ":&nbsp;", $name->setFocus())->setColumnWidth(2, "100%");
     $email = new TextBox($form, "contact_email");
     $email_validation = new LiveValidation();
     $email->setLiveValidation($email_validation->addValidateEmail()->addValidatePresence()->setFieldName(__(CONTACTFORM_EMAIL)));
     $table_main->addRowColumns(__(CONTACTFORM_EMAIL) . ":&nbsp;", $email);
     $subject = new TextBox($form, "contact_subject");
     $subject_validation = new LiveValidation();
     $subject->setLiveValidation($subject_validation->addValidatePresence()->setFieldName(__(CONTACTFORM_SUBJECT)));
     $table_main->addRowColumns(__(CONTACTFORM_SUBJECT) . ":&nbsp;", $subject);
     $table_main->addRow();
     $editor = new Editor($form, "contact_message");
     $editor_validation = new LiveValidation();
     $editor->setLiveValidation($editor_validation->addValidatePresence()->setFieldName(__(CONTACTFORM_MESSAGE)));
     $editor->setToolbar(Editor::TOOLBAR_SIMPLE);
     $table_main->addRow(new Object(__(CONTACTFORM_MESSAGE) . ": ", "<br/>", $editor))->setColspan(3)->setAlign(RowTable::ALIGN_LEFT);
     $table_main->addRow();
     $this->captcha = new Captcha($form, "contact_captcha");
     $table_main->addRow($this->captcha)->setColspan(3);
     $table_main->addRow();
     $this->send_button = new Button($form, "contact_send", "", __(CONTACTFORM_SEND));
     $this->send_button->assignEnterKey()->onClick($send_method)->setAjaxEvent();
     $table_main->addRow($this->send_button)->setColspan(3);
     $table_main->addRow();
     $form->setContent($table_main);
     $this->render = $form;
 }
Example #8
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);
 }