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 #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;
 }
Example #3
0
 public function Load()
 {
     require_once dirname(__FILE__) . "/includes/utils-unset-var.inc.php";
     if (!$this->isAjaxPage()) {
         unsetWspAdminVariables();
     }
     parent::$PAGE_TITLE = __(CONNECT_PAGE_TITLE);
     $this->setUserRights("");
     // Welcome message
     $this->render = new Table();
     $this->render->setWidth("100%");
     $connect_box = new RoundBox(RoundBox::STYLE_SECOND, "connect_box", 420, 150);
     $connect_box->setShadow(true);
     $connect_box->setValign(RoundBox::VALIGN_CENTER);
     $connect_table = new Table();
     $connect_table->setWidth("100%")->setDefaultAlign(RowTable::ALIGN_LEFT);
     $admin_pic = new Picture("img/wsp-admin/admin_128.png", 128, 128);
     $this->auth_obj = new Authentication($this, "connect");
     $this->auth_obj->setTableWidth(265);
     $connect_table->addRowColumns($admin_pic, $this->auth_obj);
     $connect_box->setContent($connect_table);
     $this->render->addRow("<br/><br/><br/><br/><br/>");
     $this->obj_br_before = new Object();
     $this->obj_br_before->setId("divBrBefore");
     $this->render->addRow($this->obj_br_before);
     $this->mod_obj = new Object();
     $this->mod_obj->setId("divConfigRecommandation")->setWidth(400);
     $this->render->addRow($this->mod_obj);
     $this->render->addRow("");
     $this->render->addRow($connect_box, RowTable::ALIGN_CENTER, RowTable::VALIGN_CENTER);
     $this->render->addRow("<br/>");
 }
Example #4
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 #5
0
 public function Load()
 {
     parent::$PAGE_TITLE = __(CONFIGURE_MODULES);
     $config_modules_obj = new Object();
     $construction_page = new Object(__(PAGE_IN_CONSTRUCTION));
     $construction_page->setClass("warning");
     $config_modules_obj->add($construction_page);
     $config_modules_obj->add("<br/>", __(PRESENTATION), "<br/><br/>");
     $sort_event_install = new SortableEvent($this);
     $sort_event_install->onSort("onChangeModule")->setAjaxEvent()->disableAjaxWaitMessage();
     $this->list_install_modules_obj = new Object();
     $this->list_install_modules_obj->setId("list_install_modules");
     $this->list_install_modules_obj->setSortable(true, $sort_event_install);
     $list_all_install_modules_obj = new Object();
     $module_style = "cursor:pointer;width:100px;border:1px solid gray;padding:2px;margin:2px;";
     $array_active_modules = array();
     $module_file = new File(dirname(__FILE__) . "/../../../wsp/config/modules.cnf");
     while (($line = $module_file->read_line()) != false) {
         if (trim($line) != "") {
             $array_active_modules[] = trim($line);
             $module_obj = new Object(trim($line));
             $module_obj->setId("module_" . str_replace("-", "_", trim($line)))->forceDivTag();
             if (trim($line) != "Authentication") {
                 $module_obj->setStyle($module_style);
                 $module_obj->setDraggable(true, false, null, true);
                 $this->list_install_modules_obj->add($module_obj);
             } else {
                 $module_obj->setStyle($module_style . "cursor:none;");
                 $list_all_install_modules_obj->add($module_obj);
             }
         }
     }
     $module_file->close();
     $list_all_install_modules_obj->add($this->list_install_modules_obj);
     $sort_event = new SortableEvent($this);
     $sort_event->onSort("onChangeModule")->setAjaxEvent()->disableAjaxWaitMessage();
     $this->list_modules_obj = new Object();
     $this->list_modules_obj->setId("list_modules");
     $this->list_modules_obj->setSortable(true, $sort_event);
     $folder = dirname(__FILE__) . "/../../../wsp/class/modules";
     $array_module_dir = scandir($folder);
     for ($i = 0; $i < sizeof($array_module_dir); $i++) {
         if (is_dir($folder . "/" . $array_module_dir[$i]) && !in_array($array_module_dir[$i], $array_active_modules) && $array_module_dir[$i] != "." && $array_module_dir[$i] != ".." && $array_module_dir[$i] != ".svn") {
             $module_obj = new Object($array_module_dir[$i]);
             $module_obj->setId("module_" . str_replace("-", "_", $array_module_dir[$i]))->forceDivTag();
             $module_obj->setDraggable(true, false, null, true)->setStyle($module_style);
             $this->list_modules_obj->add($module_obj);
         }
     }
     $config_table = new Table();
     $config_table->setWidth(400)->setDefaultAlign(RowTable::ALIGN_CENTER);
     $config_table->setDefaultValign(RowTable::VALIGN_TOP);
     $config_table->addRowColumns(new Object(new Label(__(ALL_MODULES), true), "<br/>", $this->list_modules_obj), "&nbsp;", new Object(new Label(__(INSTALLED_MODULES), true), "<br/>", $list_all_install_modules_obj));
     $config_modules_obj->add($config_table, "<br/><br/>");
     $this->render = new AdminTemplateForm($this, $config_modules_obj);
 }
Example #6
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 #7
0
 public function Load()
 {
     $dialog_update = new DialogBox(__(UPDATE_FRAMEWORK), new Url($this->getBaseLanguageURL() . "wsp-admin/update/update-framework.call?update=" . $_GET['update'] . "&parent_dialog_level=" . DialogBox::getCurrentDialogBoxLevel()));
     $dialog_update->displayFormURL()->modal();
     $button_yes = new Button($this);
     $button_yes->onClickJs($dialog_update->render())->setValue(__(UPDATE_FRAMEWORK_YES));
     $button_no = new Button($this);
     $button_no->onClickJs(DialogBox::closeAll())->setValue(__(UPDATE_FRAMEWORK_NO));
     $table_yes_no = new Table();
     $table_yes_no->addRowColumns($button_yes, "&nbsp;", $button_no);
     if ($_GET['update'] == "update-wsp") {
         $warning_lbl = new Label(__(UPDATE_FRAMEWORK_WSP_WARNING));
         $warning_lbl->setColor("red")->setItalic();
         $this->render = new Object(__(UPDATE_FRAMEWORK_CONFIRM, $_GET['text']), "<br/><br/>", $warning_lbl, "<br/><br/>", $table_yes_no);
     } else {
         $this->render = new Object(__(UPDATE_FRAMEWORK_CONFIRM, $_GET['text']), "<br/><br/>", $table_yes_no);
     }
     $this->render->setAlign(Object::ALIGN_CENTER);
 }
Example #8
0
 public function Load()
 {
     if (defined('SEND_ERROR_BY_MAIL') && SEND_ERROR_BY_MAIL == true && !isLocalDebug()) {
         if ($this->is_trace) {
             // standard msg "administrator is notified"
             parent::$PAGE_TITLE = __(ERROR) . " - " . __(SITE_NAME);
             $box_title = __(ERROR);
             $debug_msg = __(ERROR_DEBUG_MAIL_SENT);
         } else {
             // no trace in the debug information
             parent::$PAGE_TITLE = "Debug error - " . __(SITE_NAME);
             $box_title = "Debug error";
             $debug_msg = $_POST['debug'];
         }
     } else {
         parent::$PAGE_TITLE = "Debug error - " . __(SITE_NAME);
         $box_title = "Debug error";
         $debug_msg = $_POST['debug'];
     }
     $error_title_table = new Table();
     $error_title_table->addRowColumns(new Picture("wsp/img/warning.png", 48, 48, 0, "absmidlle"), "&nbsp;", new Label(__(ERROR), true));
     $obj_error_msg = new Object($error_title_table, "<br/>");
     $debug_obj = new Object(utf8encode($debug_msg));
     $debug_obj->setAlign(Object::ALIGN_LEFT);
     $debug_obj->setWidth("80%");
     $obj_error_msg->add($debug_obj, "<br/><br/>");
     if ($GLOBALS['__AJAX_LOAD_PAGE__'] == false) {
         $obj_error_msg->add("<a href=\"" . $_GET['from_url'] . "\">Refresh this page</a>", "<br/><br/>");
     }
     $obj_error_msg->add("<b>Consult <a href=\"http://www.php.net\" target=\"_blank\">PHP</a> or <a href=\"http://www.website-php.com\" target=\"_blank\">WebSite-PHP</a> documentations.</b>", "<br/>");
     $obj_error_msg->add("<br/><br/>", "Go back to the main page", new Link(BASE_URL, Link::TARGET_NONE, __(SITE_NAME)));
     $this->render = new ErrorTemplate($obj_error_msg, $box_title);
     if (trim($_POST['debug']) != "") {
         $cache_filename = "";
         if (isset($_POST['cache_filename']) && trim($_POST['cache_filename']) != "") {
             $cache_filename = $this->getRealCacheFileName($_POST['cache_filename']);
             if (!file_exists($cache_filename)) {
                 $cache_filename = "";
             }
         }
         NewException::sendErrorByMail($_POST['debug'], $cache_filename);
     }
 }
Example #9
0
 public function Load()
 {
     parent::$PAGE_TITLE = __(HOME_PAGE_TITLE);
     // Welcome message
     $small_img = new Picture("img/logo_16x16.png", 16, 16, 0, Picture::ALIGN_ABSMIDDLE);
     $title_header = new Object($small_img, __(WELCOME));
     $welcome_box = new Box($title_header, true, Box::STYLE_SECOND, Box::STYLE_SECOND, "", "welcome_box", 600);
     $welcome_obj = new Object(__(WELCOME_MSG));
     list($strAdminLogin, $strAdminPasswd, $strAdminRights) = getWspUserRightsInfo("admin");
     $quickstart_obj = new Object(new Picture("img/quickstart_128.png", 64, 64), "<br/>", __(QUICKSTART));
     $quickstart_link = new Link("http://www.website-php.com/" . $this->getLanguage() . "/quick-start.html", Link::TARGET_BLANK, $quickstart_obj);
     $quickstart_box = new RoundBox(3, "quickstart_box", 120, 120);
     $quickstart_box->setValign(RoundBox::VALIGN_CENTER);
     $quickstart_box->setContent($quickstart_link);
     $tutorial_obj = new Object(new Picture("img/tutorials_128.png", 64, 64), "<br/>", __(TUTORIALS));
     $tutorial_link = new Link("http://www.website-php.com/" . $this->getLanguage() . "/tutorials.html", Link::TARGET_BLANK, $tutorial_obj);
     $tutorial_box = new RoundBox(3, "tutorial_box", 120, 120);
     $tutorial_box->setValign(RoundBox::VALIGN_CENTER);
     $tutorial_box->setContent($tutorial_link);
     $connect_obj = new Object(new Picture("img/wsp-admin/admin_128.png", 64, 64), "<br/>", __(CONNECT));
     $connect_link = new Link("wsp-admin/connect.html", Link::TARGET_BLANK, $connect_obj);
     $connect_box = new RoundBox(3, "connect_box", 120, 120);
     $connect_box->setValign(RoundBox::VALIGN_CENTER);
     $connect_box->setContent($connect_link);
     $icon_table = new Table();
     $icon_table->setDefaultAlign(RowTable::ALIGN_CENTER)->setDefaultValign(RowTable::VALIGN_TOP);
     $icon_row = $icon_table->addRowColumns($quickstart_box, "&nbsp;", $tutorial_box, "&nbsp;", $connect_box);
     $icon_row->setColumnWidth(5, 120);
     if ($strAdminLogin == "admin" && $strAdminPasswd == sha1("admin")) {
         $finalize = new Font(__(FINALIZE_INSTALL));
         $finalize->setFontColor("red");
         $finalize->setFontWeight(Font::FONT_WEIGHT_BOLD);
         $welcome_obj->add("<br/>", $finalize, "<br/>", __(CONNECT_DEFAULT_PASSWD), "<br/>");
     }
     $welcome_obj->add("<br/>", $icon_table);
     $welcome_box->setContent($welcome_obj);
     // Footer
     $this->render = new Template($welcome_box);
 }
Example #10
0
 public function Load()
 {
     parent::$PAGE_TITLE = __(MANAGE_TRANSLATIONS);
     $content = new Object();
     // Search in all translation files the labels
     // Features :
     // - get the list of the labels for a page / language
     // - display for each label if there is a translation in all the language of the website
     // - enter a new label
     // - update a label
     // - delete a label
     $translate_table = new Table();
     $translate_table->setDefaultValign(RowTable::VALIGN_TOP);
     if (!isset($_GET['language'])) {
         $_GET['language'] = $this->getLanguage();
     }
     $this->form = new Form($this);
     $this->form->setAction($this->getCurrentURLWithoutParameters() . "?language=" . $_GET['language']);
     $this->hdn_old_file = new Hidden($this->form, "hdn_old_file");
     $content->add($this->hdn_old_file);
     $tree = new TreeView("wsp_lang_files");
     $array_path = explode("/", $this->getRootWspDirectory());
     $root = new TreeViewFolder($array_path[sizeof($array_path) - 1]);
     $tree_page_items = new TreeViewItems();
     $dir = $this->getRootWspDirectory() . "/lang/" . $_GET['language'] . "/";
     $array_files = $this->loadFiles($dir, '', $_GET['language']);
     foreach ($array_files as $key => $value) {
         $tree_page_type = new TreeViewFolder($key);
         $tree_page_type->expand();
         $tree_page_items->add($tree_page_type);
         $tree_items = new TreeViewItems();
         $array_folder = array();
         for ($i = 0; $i < sizeof($value); $i++) {
             $file = $value[$i];
             $expand = false;
             if ($file == $_GET['file']) {
                 $expand = true;
             }
             $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];
                     $tree_folder = $parent_tree_items->getTreeViewItemParent();
                     if (!$tree_folder->isExpand()) {
                         if ($expand) {
                             $tree_folder->expand();
                         } else {
                             $tree_folder->collapse();
                         }
                     }
                 } else {
                     $tree_folder = new TreeViewFolder($folder);
                     if ($expand) {
                         $tree_folder->expand();
                     } else {
                         $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->form);
             $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("loadTranslation", $file, $this->hdn_old_file, $_GET['language'], 1)->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);
     $language_selector = new Object();
     $array_lang_dir = scandir($this->getRootWspDirectory() . "/lang", 0);
     for ($i = 0; $i < sizeof($array_lang_dir); $i++) {
         if (is_dir($this->getRootWspDirectory() . "/lang/" . $array_lang_dir[$i]) && $array_lang_dir[$i] != "" && $array_lang_dir[$i] != "." && $array_lang_dir[$i] != ".." && $array_lang_dir[$i] != ".svn" && strlen($array_lang_dir[$i]) == 2) {
             $lang_link = $this->getCurrentURLWithoutParameters() . "?language=" . $array_lang_dir[$i];
             $language_link = new Link($lang_link, Link::TARGET_NONE, new Picture("wsp/img/lang/" . $array_lang_dir[$i] . ".png", 24, 24, 0, Picture::ALIGN_ABSMIDDLE));
             if ($array_lang_dir[$i] == $_GET['language']) {
                 $language_link->setStyle("border:1px solid red;padding-bottom: 4px;");
             }
             $language_link->setId("lang_link_" . $array_lang_dir[$i]);
             $this->array_lang_link[] = $language_link;
             $language_selector->add($language_link);
         }
     }
     $lang_tree_obj = new Object($language_selector, "<br/>");
     $tree_obj = new Object($tree);
     $tree_obj->setAlign(Object::ALIGN_LEFT)->setWidth(200)->setHeight(608)->setMaxHeight(608);
     $lang_tree_obj->add($tree_obj);
     // create translate area with all translation labels and sortable
     $this->translate_area = new Object();
     $this->translate_area->setWidth(600)->setHeight(620)->setStyle("border:1px solid gray;overflow:auto;padding:5px;");
     $this->translate_area->emptyObject()->setId("translate_area");
     $this->sort_label_event = new SortableEvent($this->form);
     $this->sort_label_event->onSort("onSort", "");
     $this->sort_label_event->setAjaxEvent()->disableAjaxWaitMessage();
     $this->translate_area->setSortable(true, $this->sort_label_event);
     $translate_table->addRowColumns($lang_tree_obj, $this->translate_area);
     $translate_table->addRow();
     $this->btn_save = new Button($this->form);
     $this->btn_save->setValue(__(BTN_SAVE))->onClick("save", "")->setAjaxEvent();
     $this->btn_save->forceSpanTag();
     if (Page::getInstance("wsp-admin/manage/manage-pages")->userHaveRights()) {
         $this->btn_page = new Button($this);
         $this->btn_page->setValue(__(BTN_PHP_PAGE))->forceSpanTag()->disable();
     }
     $this->btn_add_label = new Button($this);
     $this->btn_add_label->setValue(__(ADD_LABEL))->onClick("addLabel", "")->setAjaxEvent();
     $this->btn_add_label->forceSpanTag();
     $translate_table->addRow(new Object($this->btn_page, "&nbsp;", $this->btn_add_label, "&nbsp;", $this->btn_save))->setColspan(2);
     $translate_table->addRow();
     $this->form->setContent($translate_table);
     // Create a link to the page
     // TODO
     $this->render = new AdminTemplateForm($this, $content->add($this->form));
     if ($this->btn_save->isClicked() || $this->sort_label_event->isSorted() || $this->btn_add_label->isClicked()) {
         // do nothing, translation load is done by the callback function
     } else {
         if (isset($_GET['file'])) {
             $this->loadTranslation(null, $_GET['file'], "", $_GET['language']);
             if (isset($_GET['saved'])) {
                 alert(__(FILE_SAVED, $_GET['file']));
             }
         } else {
             if (!$this->isAjaxPage()) {
                 $this->loadTranslation(null, "all.inc.php", "", $_GET['language']);
             }
         }
     }
     // Create addLabel form
     $this->form_add_label = new Form($this);
     $this->form_add_label->setAction($this->getCurrentURLWithoutParameters() . "?language=" . $_GET['language']);
     $table_add_label = new Table();
     $this->add_label_label_name = new TextBox($this->form_add_label, "add_label_label_name");
     $this->add_label_label_name->setWidth(200);
     $table_add_label->addRowColumns(__(LABEL_NAME) . ":&nbsp;", $this->add_label_label_name);
     $this->add_label_label_value = new TextArea($this->form_add_label, "add_label_label_value");
     $this->add_label_label_value->setAutoHeight()->setWidth(200);
     $table_add_label->addRowColumns(__(LABEL_VALUE) . ":&nbsp;", $this->add_label_label_value);
     $this->btn_create_label = new Button($this->form_add_label, "btn_create_label");
     $this->btn_create_label->setValue(__(ADD_LABEL))->setAjaxEvent();
     $table_add_label->addRowColumns($this->btn_create_label)->setColspan(2)->setAlign(RowTable::ALIGN_CENTER);
     $this->form_add_label->setContent($table_add_label);
 }
Example #11
0
 public function Loaded()
 {
     $users_table = new Table();
     $users_table->setId("users_table")->activateAdvanceTable()->activateSort(1)->setWidth(400);
     $users_table->addRowColumns(__(LOGIN), __(RIGHTS), __(MODIFY), __(DELETE))->setHeaderClass(0);
     $this->old_passwd_row->hide();
     $this->validate_btn->show();
     $this->modify_btn->hide();
     $this->cancel_btn->hide();
     $is_modify_mode = false;
     $array_users = getAllWspUsers();
     for ($i = 0; $i < sizeof($array_users); $i++) {
         $edit_user = new Picture("img/wsp-admin/edit_16.png", 16, 16);
         $edit_user->onClick($this, "refresh")->setAjaxEvent()->disableAjaxWaitMessage();
         if ($edit_user->isClicked() && !$is_modify_mode) {
             $this->old_passwd_row->show();
             $this->validate_btn->hide();
             $this->modify_btn->show();
             $this->cancel_btn->show();
             $this->edt_login->setValue($array_users[$i]['login']);
             $this->edt_old_password->forceEmpty();
             $this->edt_password->forceEmpty();
             $this->edt_confirm_passwd->forceEmpty();
             $is_modify_mode = true;
         }
         if ($array_users[$i]['login'] == $_SESSION['wsp-login']) {
             $del_user = new Object();
         } else {
             $del_user = new Picture("img/wsp-admin/delete_16.png", 16, 16);
             $del_user->setId("user_" . $array_users[$i]['login']);
             $del_user->onClickJs("if (!confirm('" . __(DEL_CONFIRM) . "')) { return false; }");
             $del_user->onClick($this, "removeWspUser", $array_users[$i]['login'])->setAjaxEvent();
             if ($del_user->isClicked()) {
                 continue;
             }
         }
         $users_table->addRowColumns($array_users[$i]['login'], $array_users[$i]['rights'], $edit_user, $del_user)->setColumnAlign(3, RowTable::ALIGN_CENTER)->setColumnAlign(4, RowTable::ALIGN_CENTER);
     }
     $this->users_table_obj->add($users_table);
 }
 function __construct($page_object, $content, $right_side_content = null)
 {
     parent::__construct();
     $page_object->includeJsAndCssFromObjectToPage("LiveValidation");
     $this->render = new Table();
     $this->render->setWidth("100%");
     $this->render->setDefaultAlign(RowTable::ALIGN_CENTER);
     $table = new Table();
     $table->setWidth("800");
     $table->setDefaultAlign(RowTable::ALIGN_LEFT);
     // search parent link and current page icon, name
     $pathway = "";
     $page_icon_16 = "";
     $wsp_admin_url = WSP_ADMIN_URL;
     $array_menu = xml2array(file_get_contents(dirname(__FILE__) . "/../menu.xml"));
     foreach ($array_menu['MenuItems']['MenuItem'] as $menuitems) {
         if (find($menuitems['Menu_attr']['name'], "__(", 0, 0) > 0) {
             eval("\$page_title = " . $menuitems['Menu_attr']['name'] . ";");
         } else {
             eval("\$page_title = \"" . $menuitems['Menu_attr']['name'] . "\";");
         }
         eval("\$page_link = \"" . $menuitems['Menu_attr']['url'] . "\";");
         if (!isset($menuitems['MenuItems']['MenuItem'][0])) {
             $sub_menuitems = $menuitems['MenuItems'];
         } else {
             $sub_menuitems = $menuitems['MenuItems']['MenuItem'];
         }
         foreach ($sub_menuitems as $menuitem) {
             eval("\$sub_page_link = \"" . $menuitem['Menu_attr']['url'] . "\";");
             if ($sub_page_link == $_GET['p'] . ".html") {
                 eval("\$page_icon_16 = \"" . $menuitem['Menu_attr']['icon_16'] . "\";");
                 if (find($menuitem['Menu_attr']['name'], "__(", 0, 0) > 0) {
                     eval("\$sub_page_title = " . $menuitem['Menu_attr']['name'] . ";");
                 } else {
                     eval("\$sub_page_title = \"" . $menuitem['Menu_attr']['name'] . "\";");
                 }
                 $pathway = new Object(new Link($page_link, Link::TARGET_NONE, $page_title), " > ", $sub_page_title);
                 break;
             }
         }
         if ($pathway != "") {
             break;
         }
     }
     // Header
     $logo_pic = new Picture("img/wsp-admin/logo_60x160_" . $_SESSION['lang'] . ".png", 60, 160, 0);
     $table->addRowColumns(new AdminMenu($page_object, $array_menu), new Link("http://www.website-php.com", Link::TARGET_BLANK, $logo_pic))->setColumnAlign(2, RowTable::ALIGN_RIGHT);
     // check WSP version
     $alert_version_obj = getAlertVersiobObject($page_object);
     if ($alert_version_obj != null) {
         $table->addRowColumns($alert_version_obj)->setColspan(2);
     }
     // Main
     $small_img = new Picture($page_icon_16, 16, 16, 0, Picture::ALIGN_ABSMIDDLE);
     $title_header = new Object($small_img);
     $title_header->add(new Object(new Link("wsp-admin/admin.html", Link::TARGET_NONE, __(ADMIN)), " > ", $pathway));
     $box_width = 800;
     if ($right_side_content != null) {
         $box_width = 700;
     }
     $configure_box = new Box($title_header, true, Box::STYLE_SECOND, Box::STYLE_SECOND, "", "configure_database_box", $box_width);
     $configure_box->setContent($content);
     if ($right_side_content != null) {
         $table->addRowColumns($configure_box, "&nbsp;", $right_side_content)->setColumnColspan(1, 2)->setColumnWidth(1, $box_width)->setColumnWidth(2, 10);
     } else {
         $table->addRow($configure_box)->setColspan(2);
     }
     $this->render->addRow($table);
     $this->render->addRow(__(CURRENT_WSP_VERSION, getCurrentWspVersion()));
 }
 function __construct($page_object, $menu_url)
 {
     parent::__construct();
     $wsp_admin_url = WSP_ADMIN_URL;
     $array_menu = xml2array(file_get_contents(dirname(__FILE__) . "/../menu.xml"));
     foreach ($array_menu['MenuItems']['MenuItem'] as $menuitems) {
         if ($menuitems['Menu_attr']['url'] == "\$wsp_admin_url/" . $menu_url) {
             eval("\$icon_16 = \"" . $menuitems['Menu_attr']['icon_16'] . "\";");
             if (find($menuitems['Menu_attr']['name'], "__(", 0, 0) > 0) {
                 eval("\$page_title = " . $menuitems['Menu_attr']['name'] . ";");
             } else {
                 eval("\$page_title = \"" . $menuitems['Menu_attr']['name'] . "\";");
             }
             if ($menuitems['Menu_attr']['url'] == "\$wsp_admin_url/admin.html") {
                 $menuitems = $array_menu;
             }
             if (!isset($menuitems['MenuItems']['MenuItem'][0])) {
                 $sub_menuitems = $menuitems['MenuItems'];
             } else {
                 $sub_menuitems = $menuitems['MenuItems']['MenuItem'];
             }
             foreach ($sub_menuitems as $menuitem) {
                 if ($menuitem['Menu_attr']['url'] != "\$wsp_admin_url/admin.html") {
                     eval("\$sub_page_icon_64 = \"" . $menuitem['Menu_attr']['icon_64'] . "\";");
                     if (find($menuitem['Menu_attr']['name'], "__(", 0, 0) > 0) {
                         eval("\$sub_page_title = " . $menuitem['Menu_attr']['name'] . ";");
                     } else {
                         eval("\$sub_page_title = \"" . $menuitem['Menu_attr']['name'] . "\";");
                     }
                     eval("\$sub_page_link = \"" . $menuitem['Menu_attr']['url'] . "\";");
                     $this->addLink($sub_page_icon_64, $sub_page_title, $sub_page_link);
                 }
             }
             break;
         }
     }
     if ($page_title == "" && $icon_16 == "") {
         throw new NewException("Administration page doesn't exists", 0, getDebugBacktrace(1));
     }
     $this->render = new Table();
     $this->render->setWidth("100%");
     $this->render->setDefaultAlign(RowTable::ALIGN_CENTER);
     $table = new Table();
     $table->setWidth("800");
     $table->setDefaultAlign(RowTable::ALIGN_LEFT);
     // Header
     $logo_pic = new Picture("img/wsp-admin/logo_60x160_" . $_SESSION['lang'] . ".png", 60, 160, 0);
     $table->addRowColumns(new AdminMenu($page_object, $array_menu), new Link("http://www.website-php.com", Link::TARGET_BLANK, $logo_pic))->setColumnAlign(2, RowTable::ALIGN_RIGHT);
     // check WSP version
     $alert_version_obj = getAlertVersiobObject($page_object);
     if ($alert_version_obj != null) {
         $table->addRowColumns($alert_version_obj)->setColspan(2);
     }
     // Main
     $small_img = new Picture($icon_16, 16, 16, 0, Picture::ALIGN_ABSMIDDLE);
     $title_header = new Object($small_img);
     if ($page_title == __(ADMIN)) {
         $title_header->add($page_title);
     } else {
         $title_header->add(new Object(new Link(WSP_ADMIN_URL . "/admin.html", Link::TARGET_NONE, __(ADMIN)), " > ", $page_title));
     }
     $admin_box = new Box($title_header, true, Box::STYLE_SECOND, Box::STYLE_SECOND, "", "admin_box", 800);
     $admin_obj = new Object("<br/>");
     $admin_obj->add(createTableFirstPagePic64($this->array_link_obj), "<br/><br/>");
     $admin_box->setContent($admin_obj);
     $table->addRow($admin_box)->setColspan(2);
     $this->render->addRow($table);
     $this->render->addRow(__(CURRENT_WSP_VERSION, getCurrentWspVersion()));
 }
Example #14
0
 public function Load()
 {
     parent::$PAGE_TITLE = __(CONFIGURE_DATABASE);
     $this->includeJsAndCssFromObjectToPage("ComboBox(\$this)");
     // Admin
     $this->form = new Form($this);
     $table_form = new Table();
     $table_form->addRow();
     $this->edtHost = new TextBox($this->form);
     $this->edtHost->setValue(DB_HOST);
     $edtHostValidation = new LiveValidation();
     $table_form->addRowColumns(__(EDT_HOST) . ":&nbsp;", $this->edtHost->setLiveValidation($edtHostValidation->addValidatePresence()->setFieldName(__(EDT_HOST))));
     $this->edtPort = new TextBox($this->form);
     $this->edtPort->setValue(DB_PORT);
     $edtPortValidation = new LiveValidation();
     $table_form->addRowColumns(__(EDT_PORT) . ":&nbsp;", $this->edtPort->setLiveValidation($edtPortValidation->addValidateNumericality(true)->setFieldName(__(EDT_PORT))));
     $this->edtRoot = new TextBox($this->form);
     $this->edtRoot->setValue(DB_ROOT);
     $edtRootValidation = new LiveValidation();
     $table_form->addRowColumns(__(EDT_ROOT) . ":&nbsp;", $this->edtRoot->setLiveValidation($edtRootValidation->addValidatePresence()->setFieldName(__(EDT_ROOT))));
     $this->edtPassword = new Password($this->form);
     $this->edtPassword->setValue(DB_PASSWORD);
     $table_form->addRowColumns(__(EDT_PASSWORD) . ":&nbsp;", $this->edtPassword);
     $this->edtDatabase = new TextBox($this->form);
     $this->edtDatabase->setValue(DB_DATABASE);
     $table_form->addRowColumns(__(EDT_DATABASE) . ":&nbsp;", $this->edtDatabase);
     $table_form->addRow();
     $this->btnValidate = new Button($this->form);
     $this->btnValidate->setValue(__(BTN_VALIDATE))->onClick("configureDatabase")->setAjaxEvent();
     $table_form->addRowColumns($this->btnValidate)->setColumnColspan(1, 2)->setColumnAlign(1, RowTable::ALIGN_CENTER);
     $table_form->addRow();
     $table_form->addRow();
     $this->form->setContent($table_form);
     $this->render = new AdminTemplateForm($this, $this->form);
     // generate database object part
     $this->objCreateDbClass = new Object();
     $this->objCreateDbClass->setId("idCreateDbClass");
     $table_form->addRow($this->objCreateDbClass)->setColspan(2);
     $table_gen = new Table();
     $table_gen->addRow(__(GENERATE_DATABASE_OBJECTS))->setColspan(2);
     $table_gen->addRow();
     $this->cmb_databases = new ComboBox($this->form);
     $this->cmb_databases->onChange("configureGenDbObject")->setAjaxEvent();
     $table_gen->addRowColumns(__(DATABASES) . ":&nbsp;", $this->cmb_databases);
     $this->cmb_tables = new ComboBox($this->form);
     $table_gen->addRowColumns(__(TABLES) . ":&nbsp;", $this->cmb_tables);
     $table_gen->addRow();
     $btnGenObject = new Button($this->form);
     $btnGenObject->setValue(__(GENERATE_OBJECTS))->onClick("generateDbObject")->setAjaxEvent();
     $table_gen->addRow($btnGenObject)->setColspan(2);
     $table_gen->addRow();
     $this->objCreateDbClass->add($table_gen);
     // database list
     if ($this->testDbConnexion(null)) {
         $this->loadAllDatabases();
         $this->configureGenDbObject(null);
     }
 }
Example #15
0
 public function createExamples($ind)
 {
     $table_box = new Table();
     $table_box->setWidth(250)->setDefaultAlign(RowTable::ALIGN_LEFT);
     $table_box->addRow();
     $body_obj = new Object();
     $body_obj->setAlign(Object::ALIGN_CENTER);
     //->setId("id_body_obj")->setStyle("padding:5px;background:".$this->background_body->getValue().";");
     $text_obj = new Object(__(TEXT_ON_BODY));
     $body_obj->add($text_obj->setId("id_body_text"), "<br/>");
     $link_obj = new Object(new Link("javascript:void(0);", Link::TARGET_BLANK, __(LINK_ON_BODY)));
     $body_obj->add($link_obj->setId("id_body_link"), "<br/>");
     $body_obj->add($this->text_link_note_obj, "<br/>");
     $table_box->addRow($body_obj);
     $table_box->addRow();
     $table_box->addRow();
     $button_1 = new Button($this);
     $button_1->setWidth(245);
     $table_box->addRow($button_1->setValue("Button [style jquery]"));
     $table_box->addRow();
     $tabs = new Tabs("tab-sample");
     $tabs->addTab("Tab1", "");
     $tabs->addTab("Tab2", "");
     $tabs->addTab("Tab3", "");
     $table_box->addRow($tabs);
     $table_box->addRow();
     $table_box->addRow();
     $table_box->addRow();
     $table_box->addRow();
     $table_box->addRow();
     $dialogbox = new DialogBox(__(DIALOGBOX_TITLE), __(DIALOGBOX_CONTENT));
     $dialogbox->setWidth(245)->activateOneInstance()->setPosition("");
     $dialogbox_link = new Object(new Link($dialogbox, Link::TARGET_NONE, __(VIEW_DIALOGBOX)));
     $table_box->addRow($dialogbox_link->setId("id_dialogbox_link"));
     $dialogbox->setPositionX("\$('#" . $dialogbox_link->getId() . "').position().left-f_scrollLeft()");
     $dialogbox->setPositionY("\$('#" . $dialogbox_link->getId() . "').position().top-f_scrollTop()-70");
     $this->addObject(clone $dialogbox);
     $table_box->addRow();
     $table_box->addRow();
     $table_box->addRow();
     $table_box->addRow();
     $table_box->addRow();
     $table_box->addRow();
     $style1_box_text = new Box("text", false, $this->current_style_val, $this->current_style_val, "", "box_text_" . $this->current_style_val, 245);
     if ($this->background_picture_1->getValue() != "") {
         $style1_box_text->forceBoxWithPicture(true, $this->border_table_1->getValue());
     } else {
         $style1_box_text->forceBoxWithPicture(false);
     }
     $table_box->addRow($style1_box_text->setContent("Box Object [<a href=\"javascript:void(0);\">style " . $this->current_style_val . "</a>]"));
     $style1_box = new Box("link", false, $this->current_style_val, $this->current_style_val, "javascript:void(0);", "box_" . $this->current_style_val, 245);
     if ($this->background_picture_1->getValue() != "") {
         $style1_box->forceBoxWithPicture(true, $this->border_table_1->getValue());
     } else {
         $style1_box->forceBoxWithPicture(false);
     }
     $style1_box->setShadow(true);
     $table_box->addRow($style1_box->setContent("Box Object [<a href=\"javascript:void(0);\">style " . $this->current_style_val . "</a>]"));
     $style1_box = new RoundBox($this->current_style_val, "round_box_" . $this->current_style_val, 245);
     $style1_box->setShadow(true);
     if ($this->background_picture_1->getValue() != "") {
         $style1_box->forceBoxWithPicture(true, $this->border_table_1->getValue());
     } else {
         $style1_box->forceBoxWithPicture(false);
     }
     $table_box->addRow($style1_box->setContent("RoundBox Object<br/>[style " . $this->current_style_val . "]"));
     $table_box->addRow();
     if (!defined('DEFINE_STYLE_BORDER_TABLE_' . $this->current_style_val)) {
         define('DEFINE_STYLE_BORDER_TABLE_' . $this->current_style_val, $this->border_table_1->getValue());
     }
     $table = new Table();
     $table->setId("table_sample")->setWidth(245);
     $table->addRowColumns("header1", "header2", "header3")->setHeaderClass($this->current_style_val);
     $table->addRowColumns("cel 1-1", "cel 1-2", "cel 1-3")->setId("table_tr_sample")->setBorderPredefinedStyle($this->current_style_val)->setAlign(RowTable::ALIGN_CENTER);
     $table_box->addRow($table);
     return $table_box;
 }
Example #16
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", "");
         }
     }
 }
 /**
  * Method getTableFields
  * @access public
  * @return mixed
  * @since 1.2.1
  */
 public function getTableFields()
 {
     $table = new Table();
     foreach ($this->fields_array as $attribute => $field) {
         $table->addRowColumns($attribute . "&nbsp;:&nbsp;", $this->fields_array[$attribute_name]);
     }
     return $table;
 }
Example #18
0
 public function Load()
 {
     parent::$PAGE_TITLE = __(CONFIGURE_SITE);
     // Admin
     $this->form = new Form($this);
     $table_form = new Table();
     $table_form->addRow();
     $this->edtName = new TextBox($this->form, "edtName");
     $this->edtName->setValue(__(SITE_NAME))->setWidth(300);
     $this->edtName->onChange("changeSiteName")->setAjaxEvent()->disableAjaxWaitMessage();
     $edtValidation = new LiveValidation();
     $table_form->addRowColumns(__(EDT_NAME) . ":&nbsp;", $this->edtName->setLiveValidation($edtValidation->addValidatePresence()->setFieldName(__(EDT_NAME))));
     $this->edtDesc = new Editor($this->form, "edtDesc");
     $this->edtDesc->setValue(__(SITE_DESC));
     $this->edtDesc->setToolbar(Editor::TOOLBAR_NONE)->setWidth(290)->setHeight(100);
     $edtValidation = new LiveValidation();
     $table_form->addRowColumns(__(EDT_DESC) . ":&nbsp;", $this->edtDesc->setLiveValidation($edtValidation->addValidatePresence()->setFieldName(__(EDT_DESC))));
     $this->edtKey = new TextBox($this->form, "edtKey");
     $this->edtKey->setValue(__(SITE_KEYS))->setWidth(300);
     $edtValidation = new LiveValidation();
     $table_form->addRowColumns(__(EDT_KEY) . ":&nbsp;", $this->edtKey->setLiveValidation($edtValidation->addValidatePresence()->setFieldName(__(EDT_KEY))));
     $table_form->addRow();
     $this->cmbRating = new ComboBox($this->form, "cmbRating");
     $this->cmbRating->addItem("general", "general", SITE_RATING == "general" ? true : false)->addItem("mature", "mature", SITE_RATING == "mature" ? true : false)->addItem("restricted", "restricted", SITE_RATING == "restricted" ? true : false)->addItem("14years", "14years", SITE_RATING == "14years" ? true : false)->setWidth(143);
     $table_form->addRowColumns(__(CMB_RATING) . ":&nbsp;", $this->cmbRating);
     $this->edtAuthor = new TextBox($this->form, "edtAuthor");
     $this->edtAuthor->setValue(__(SITE_AUTHOR));
     $edtValidation = new LiveValidation();
     $table_form->addRowColumns(__(EDT_AUTHOR) . ":&nbsp;", $this->edtAuthor->setLiveValidation($edtValidation->addValidatePresence()->setFieldName(__(EDT_AUTHOR))));
     $this->cmbLanguage = new ComboBox($this->form, "cmbLanguage");
     $this->cmbLanguage->addItem("en", __(ENGLISH), SITE_DEFAULT_LANG == "en" ? true : false, "wsp/img/lang/en.png")->addItem("fr", __(FRENCH), SITE_DEFAULT_LANG == "fr" ? true : false, "wsp/img/lang/fr.png");
     //->addItem("de", __(GERMAN), (SITE_DEFAULT_LANG=="de")?true:false, "wsp/img/lang/de.png")->addItem("es", __(SPANISH), (SITE_DEFAULT_LANG=="es")?true:false, "wsp/img/lang/es.png")
     $this->cmbLanguage->setWidth(143);
     $table_form->addRowColumns(__(CMB_LANGUAGE) . ":&nbsp;", $this->cmbLanguage);
     $table_form->addRow();
     $this->cmbSiteType = new ComboBox($this->form, "cmbSiteType");
     $this->cmbSiteType->addItem("", "&nbsp;", SITE_META_OPENGRAPH_TYPE == "" ? true : false);
     $this->cmbSiteType->addItem("activity", "activity", SITE_META_OPENGRAPH_TYPE == "activity" ? true : false);
     $this->cmbSiteType->addItem("sport", "sport", SITE_META_OPENGRAPH_TYPE == "sport" ? true : false);
     $this->cmbSiteType->addItem("bar", "bar", SITE_META_OPENGRAPH_TYPE == "bar" ? true : false);
     $this->cmbSiteType->addItem("company", "company", SITE_META_OPENGRAPH_TYPE == "company" ? true : false);
     $this->cmbSiteType->addItem("cafe", "cafe", SITE_META_OPENGRAPH_TYPE == "cafe" ? true : false);
     $this->cmbSiteType->addItem("hotel", "hotel", SITE_META_OPENGRAPH_TYPE == "hotel" ? true : false);
     $this->cmbSiteType->addItem("restaurant", "restaurant", SITE_META_OPENGRAPH_TYPE == "restaurant" ? true : false);
     $this->cmbSiteType->addItem("cause", "cause", SITE_META_OPENGRAPH_TYPE == "cause" ? true : false);
     $this->cmbSiteType->addItem("sports_league", "sports league", SITE_META_OPENGRAPH_TYPE == "sports_league" ? true : false);
     $this->cmbSiteType->addItem("sports_team", "sports team", SITE_META_OPENGRAPH_TYPE == "sports_team" ? true : false);
     $this->cmbSiteType->addItem("band", "band", SITE_META_OPENGRAPH_TYPE == "band" ? true : false);
     $this->cmbSiteType->addItem("government", "government", SITE_META_OPENGRAPH_TYPE == "government" ? true : false);
     $this->cmbSiteType->addItem("non_profit", "non profit", SITE_META_OPENGRAPH_TYPE == "non_profit" ? true : false);
     $this->cmbSiteType->addItem("school", "school", SITE_META_OPENGRAPH_TYPE == "school" ? true : false);
     $this->cmbSiteType->addItem("university", "university", SITE_META_OPENGRAPH_TYPE == "university" ? true : false);
     $this->cmbSiteType->addItem("actor", "actor", SITE_META_OPENGRAPH_TYPE == "actor" ? true : false);
     $this->cmbSiteType->addItem("athlete", "athlete", SITE_META_OPENGRAPH_TYPE == "athlete" ? true : false);
     $this->cmbSiteType->addItem("author", "author", SITE_META_OPENGRAPH_TYPE == "author" ? true : false);
     $this->cmbSiteType->addItem("director", "director", SITE_META_OPENGRAPH_TYPE == "director" ? true : false);
     $this->cmbSiteType->addItem("musician", "musician", SITE_META_OPENGRAPH_TYPE == "musician" ? true : false);
     $this->cmbSiteType->addItem("politician", "politician", SITE_META_OPENGRAPH_TYPE == "politician" ? true : false);
     $this->cmbSiteType->addItem("profile", "profile", SITE_META_OPENGRAPH_TYPE == "profile" ? true : false);
     $this->cmbSiteType->addItem("public_figure", "public figure", SITE_META_OPENGRAPH_TYPE == "public_figure" ? true : false);
     $this->cmbSiteType->addItem("city", "city", SITE_META_OPENGRAPH_TYPE == "city" ? true : false);
     $this->cmbSiteType->addItem("country", "country", SITE_META_OPENGRAPH_TYPE == "country" ? true : false);
     $this->cmbSiteType->addItem("landmark", "landmark", SITE_META_OPENGRAPH_TYPE == "landmark" ? true : false);
     $this->cmbSiteType->addItem("state_province", "state province", SITE_META_OPENGRAPH_TYPE == "state_province" ? true : false);
     $this->cmbSiteType->addItem("album", "album", SITE_META_OPENGRAPH_TYPE == "album" ? true : false);
     $this->cmbSiteType->addItem("book", "book", SITE_META_OPENGRAPH_TYPE == "book" ? true : false);
     $this->cmbSiteType->addItem("drink", "drink", SITE_META_OPENGRAPH_TYPE == "drink" ? true : false);
     $this->cmbSiteType->addItem("food", "food", SITE_META_OPENGRAPH_TYPE == "food" ? true : false);
     $this->cmbSiteType->addItem("game", "game", SITE_META_OPENGRAPH_TYPE == "game" ? true : false);
     $this->cmbSiteType->addItem("movie", "movie", SITE_META_OPENGRAPH_TYPE == "movie" ? true : false);
     $this->cmbSiteType->addItem("product", "product", SITE_META_OPENGRAPH_TYPE == "product" ? true : false);
     $this->cmbSiteType->addItem("song", "song", SITE_META_OPENGRAPH_TYPE == "song" ? true : false);
     $this->cmbSiteType->addItem("tv_show", "tv show", SITE_META_OPENGRAPH_TYPE == "tv_show" ? true : false);
     $this->cmbSiteType->addItem("article", "article", SITE_META_OPENGRAPH_TYPE == "article" ? true : false);
     $this->cmbSiteType->addItem("blog", "blog", SITE_META_OPENGRAPH_TYPE == "blog" ? true : false);
     $this->cmbSiteType->addItem("website", "website", SITE_META_OPENGRAPH_TYPE == "website" ? true : false);
     $this->cmbSiteType->setWidth(143);
     $table_form->addRowColumns(__(CMB_SITE_TYPE) . ":&nbsp;", $this->cmbSiteType);
     $this->edtSiteImage = new TextBox($this->form, "edtSiteImage");
     $this->edtSiteImage->setValue(SITE_META_OPENGRAPH_IMAGE)->setWidth(300);
     $table_form->addRowColumns(__(EDT_SITE_IMAGE) . ":&nbsp;", $this->edtSiteImage);
     $table_form->addRow();
     $this->edtSiteIphoneImage57 = new TextBox($this->form, "edtSiteIphoneImage57");
     $this->edtSiteIphoneImage57->setValue(SITE_META_IPHONE_IMAGE_57PX)->setWidth(300);
     $table_form->addRowColumns(__(EDT_SITE_IPHONE_IMAGE_57PX) . ":&nbsp;", $this->edtSiteIphoneImage57);
     $this->edtSiteIphoneImage72 = new TextBox($this->form, "edtSiteIphoneImage72");
     $this->edtSiteIphoneImage72->setValue(SITE_META_IPHONE_IMAGE_72PX)->setWidth(300);
     $table_form->addRowColumns(__(EDT_SITE_IPHONE_IMAGE_72PX) . ":&nbsp;", $this->edtSiteIphoneImage72);
     $this->edtSiteIphoneImage114 = new TextBox($this->form, "edtSiteIphoneImage114");
     $this->edtSiteIphoneImage114->setValue(SITE_META_IPHONE_IMAGE_114PX)->setWidth(300);
     $table_form->addRowColumns(__(EDT_SITE_IPHONE_IMAGE_114PX) . ":&nbsp;", $this->edtSiteIphoneImage114);
     if (!defined("SITE_META_IPHONE_IMAGE_152PX")) {
         define("SITE_META_IPHONE_IMAGE_152PX", "");
     }
     $this->edtSiteIphoneImage152 = new TextBox($this->form, "edtSiteIphoneImage152");
     $this->edtSiteIphoneImage152->setValue(SITE_META_IPHONE_IMAGE_152PX)->setWidth(300);
     $table_form->addRowColumns(__(EDT_SITE_IPHONE_IMAGE_152PX) . ":&nbsp;", $this->edtSiteIphoneImage152);
     $table_form->addRow();
     $this->edtGoogleTracker = new TextBox($this->form, "edtGoogleTracker");
     $this->edtGoogleTracker->setValue(GOOGLE_CODE_TRACKER);
     $table_form->addRowColumns(__(EDT_GOOGLE_CODE_TRACKER) . ":&nbsp;", $this->edtGoogleTracker);
     /*$this->edtGoogleMapKey = new TextBox($this->form, "edtGoogleMapKey");
     		$this->edtGoogleMapKey->setValue(GOOGLE_MAP_KEY);
     		$table_form->addRowColumns(__(EDT_GOOGLE_MAP_KEY).":&nbsp;", $this->edtGoogleMapKey);*/
     $table_form->addRow();
     $this->cmbMetaRobots = new ComboBox($this->form, "cmbMetaRobots");
     $this->cmbMetaRobots->addItem("index, follow", "index, follow", SITE_META_ROBOTS == "index, follow" ? true : false);
     $this->cmbMetaRobots->addItem("noindex, follow", "noindex, follow", SITE_META_ROBOTS == "noindex, follow" ? true : false);
     $this->cmbMetaRobots->addItem("index, nofollow", "index, nofollow", SITE_META_ROBOTS == "index, nofollow" ? true : false);
     $this->cmbMetaRobots->addItem("noindex, nofollow", "noindex, nofollow", SITE_META_ROBOTS == "noindex, nofollow" ? true : false);
     $this->cmbMetaRobots->setWidth(143);
     $table_form->addRowColumns(__(CMB_META_ROBOTS) . ":&nbsp;", $this->cmbMetaRobots);
     $this->cmbMetaGooglebot = new ComboBox($this->form, "cmbMetaGooglebot");
     $this->cmbMetaGooglebot->addItem("", "&nbsp;", SITE_META_GOOGLEBOTS == "" ? true : false);
     $this->cmbMetaGooglebot->addItem("archive", "archive", SITE_META_ROBOTS == "archive" ? true : false);
     $this->cmbMetaGooglebot->addItem("noarchive", "noarchive", SITE_META_ROBOTS == "noarchive" ? true : false);
     $this->cmbMetaGooglebot->setWidth(143);
     $table_form->addRowColumns(__(CMB_META_GOOGLEBOTS) . ":&nbsp;", $this->cmbMetaGooglebot);
     $this->edtRevisitAfter = new TextBox($this->form, "edtRevisitAfter");
     $this->edtRevisitAfter->setValue(SITE_META_REVISIT_AFTER)->setWidth(80);
     $edtValidation = new LiveValidation();
     $table_form->addRowColumns(__(EDT_REVISIT_AFTER) . ":&nbsp;", new Object($this->edtRevisitAfter->setLiveValidation($edtValidation->addValidatePresence()->addValidateNumericality(true)->setFieldName(__(EDT_REVISIT_AFTER))), "&nbsp;" . __(DAYS)));
     $table_form->addRow();
     $this->btnValidateF1 = new Button($this->form, "btnValidateF1");
     $this->btnValidateF1->setValue(__(BTN_VALIDATE))->onClick("configureSite")->setAjaxEvent();
     $table_form->addRowColumns($this->btnValidateF1)->setColumnColspan(1, 3)->setColumnAlign(1, RowTable::ALIGN_CENTER);
     $this->form->setContent($table_form);
     // advance tab
     $this->form2 = new Form($this);
     $table_form2 = new Table();
     $table_form2->addRow();
     $this->cmbJQueryVersion = new ComboBox($this->form2, "cmbJQueryVersion");
     $this->cmbJQueryVersion->setWidth(143);
     $table_form2->addRowColumns(__(CMB_JQUERY_VERSION) . ":&nbsp;", $this->cmbJQueryVersion);
     $this->cmbJQueryUIVersion = new ComboBox($this->form2, "cmbJQueryUIVersion");
     $this->cmbJQueryUIVersion->setWidth(143);
     $table_form2->addRowColumns(__(CMB_JQUERY_UI_VERSION) . ":&nbsp;", $this->cmbJQueryUIVersion);
     $jquery_dir = SITE_DIRECTORY . "/wsp/js/jquery/";
     $files = scandir($jquery_dir, 0);
     for ($i = 0; $i < sizeof($files); $i++) {
         $file = $files[$i];
         if (is_file($jquery_dir . $file)) {
             $version = str_replace("jquery-", "", str_replace(".min.js", "", $file));
             if (is_numeric(str_replace(".", "", $version))) {
                 $this->cmbJQueryVersion->addItem($version, $version, JQUERY_VERSION == $version ? true : false);
             } else {
                 if (substr($version, 0, 3) == "ui-" && substr($version, strlen($version) - 7, strlen($version)) == ".custom") {
                     $version = str_replace("ui-", "", str_replace(".custom", "", $version));
                     $this->cmbJQueryUIVersion->addItem($version, $version, JQUERY_UI_VERSION == $version ? true : false);
                 }
             }
         }
     }
     $this->cmbJqueryLocal = new ComboBox($this->form2, "cmbJqueryLocal");
     $this->cmbJqueryLocal->addItem("true", "true", JQUERY_LOAD_LOCAL == true ? true : false);
     $this->cmbJqueryLocal->addItem("false", "false", JQUERY_LOAD_LOCAL == false ? true : false);
     $this->cmbJqueryLocal->setWidth(143);
     $table_form2->addRowColumns(__(CMB_JQUERY_LOAD_LOCAL) . ":&nbsp;", $this->cmbJqueryLocal);
     $table_form2->addRow();
     $this->edtDefaultTimezone = new TextBox($this->form2, "edtDefaultTimezone");
     $this->edtDefaultTimezone->setValue(DEFAULT_TIMEZONE);
     $edtValidation = new LiveValidation();
     $table_form2->addRowColumns(__(EDT_DEFAULT_TIMEZONE) . ":&nbsp;", $this->edtDefaultTimezone->setLiveValidation($edtValidation->addValidatePresence()->setFieldName(__(EDT_DEFAULT_TIMEZONE))));
     $table_form2->addRow();
     $this->edtMaxSessionTime = new TextBox($this->form2, "edtMaxSessionTime");
     $this->edtMaxSessionTime->setValue(MAX_SESSION_TIME)->setWidth(80);
     $edtValidation = new LiveValidation();
     $table_form2->addRowColumns(__(EDT_MAX_SESSION_TIME) . ":&nbsp;", new Object($this->edtMaxSessionTime->setLiveValidation($edtValidation->addValidatePresence()->addValidateNumericality(true)->setFieldName(__(EDT_MAX_SESSION_TIME))), "&nbsp;" . __(SECONDS)));
     $table_form2->addRow();
     $this->cmbCachingAllPage = new ComboBox($this->form2, "cmbCachingAllPage");
     $this->cmbCachingAllPage->addItem("true", "true", CACHING_ALL_PAGES == true ? true : false);
     $this->cmbCachingAllPage->addItem("false", "false", CACHING_ALL_PAGES == false ? true : false);
     $this->cmbCachingAllPage->onChange("changeCachingAllPage")->setAjaxEvent()->disableAjaxWaitMessage();
     $this->cmbCachingAllPage->setWidth(143);
     $table_form2->addRowColumns(__(CMB_CACHING_ALL_PAGES) . ":&nbsp;", $this->cmbCachingAllPage);
     $this->edtCacheTime = new TextBox($this->form2, "edtCacheTime");
     $this->edtCacheTime->setValue(CACHE_TIME)->setWidth(80);
     if (CACHING_ALL_PAGES == false) {
         $this->edtCacheTime->disable();
         $this->edtCacheTime->setValue("");
     }
     $edtValidation = new LiveValidation();
     $table_form2->addRowColumns(__(EDT_CACHE_TIME) . ":&nbsp;", new Object($this->edtCacheTime->setLiveValidation($edtValidation->addValidatePresence()->addValidateNumericality(true)->setFieldName(__(EDT_CACHE_TIME))), "&nbsp;" . __(SECONDS)));
     /*if (!defined("LITE_PHP_BROWSCAP")) {
     			define("LITE_PHP_BROWSCAP", true);
     		}
     		$this->cmbBrowscap = new ComboBox($this->form2, "cmbBrowscap");
     		$this->cmbBrowscap->addItem("true", "true", (LITE_PHP_BROWSCAP==true)?true:false);
     		$this->cmbBrowscap->addItem("false", "false", (LITE_PHP_BROWSCAP==false)?true:false);
     		$this->cmbBrowscap->setWidth(143);
     		$table_form2->addRowColumns(__(CMB_LITE_PHP_BROWSCAP).":&nbsp;", $this->cmbBrowscap);
     		$table_form2->addRowColumns("&nbsp;", __(LITE_PHP_BROWSCAP_EXPLANATION));*/
     /*$this->cmbJsCompression = new ComboBox($this->form);
     		$this->cmbJsCompression->addItem("NONE", "NONE", (JS_COMPRESSION_TYPE=="NONE")?true:false);
     		$this->cmbJsCompression->addItem("GOOGLE_WS", "GOOGLE_WS", (JS_COMPRESSION_TYPE=="GOOGLE_WS")?true:false);
     		$this->cmbJsCompression->addItem("LOCAL", "LOCAL", (JS_COMPRESSION_TYPE=="LOCAL")?true:false);
     		$this->cmbJsCompression->setWidth(143);
     		$table_form->addRowColumns(__(CMB_JS_COMPRESSION_TYPE).":&nbsp;", $this->cmbJsCompression);*/
     $table_form2->addRow();
     $this->cmbDebug = new ComboBox($this->form2, "cmbDebug");
     $this->cmbDebug->addItem("true", "true", DEBUG == true ? true : false);
     $this->cmbDebug->addItem("false", "false", DEBUG == false ? true : false);
     $this->cmbDebug->setWidth(143);
     $table_form2->addRowColumns(__(CMB_DEBUG) . ":&nbsp;", $this->cmbDebug);
     $table_form2->addRow();
     if (!defined("SEND_ERROR_BY_MAIL")) {
         define(SEND_ERROR_BY_MAIL, false);
     }
     $this->cmbSendErrorByMail = new ComboBox($this->form2, "cmbSendErrorByMail");
     $this->cmbSendErrorByMail->addItem("true", "true", SEND_ERROR_BY_MAIL == true ? true : false);
     $this->cmbSendErrorByMail->addItem("false", "false", SEND_ERROR_BY_MAIL == false ? true : false);
     $this->cmbSendErrorByMail->setWidth(143);
     $this->cmbSendErrorByMail->onChange("changeSendErrorByMail")->setAjaxEvent()->disableAjaxWaitMessage();
     $table_form2->addRowColumns(__(CMB_SEND_ERROR_BY_MAIL) . ":&nbsp;", $this->cmbSendErrorByMail);
     $this->edtSendErrorByMailTo = new TextBox($this->form2, "edtSendErrorByMailTo");
     $this->edtSendErrorByMailTo->setWidth(143)->setValue(defined("SEND_ERROR_BY_MAIL_TO") ? SEND_ERROR_BY_MAIL_TO : "");
     if (SEND_ERROR_BY_MAIL == false) {
         $this->edtSendErrorByMailTo->disable();
     }
     $edtValidation = new LiveValidation();
     $this->edtSendErrorByMailTo->setLiveValidation($edtValidation->addValidateEmail()->setFieldName(__(EDT_SEND_ERROR_BY_MAIL_TO)));
     $table_form2->addRowColumns(__(EDT_SEND_ERROR_BY_MAIL_TO) . ":&nbsp;", new Object($this->edtSendErrorByMailTo, "&nbsp;", __(SEND_ERROR_BY_MAIL_CMT)));
     if (!defined("SEND_JS_ERROR_BY_MAIL")) {
         define(SEND_JS_ERROR_BY_MAIL, false);
     }
     $this->cmbSendJsErrorByMail = new ComboBox($this->form2, "cmbSendJsErrorByMail");
     $this->cmbSendJsErrorByMail->addItem("true", "true", SEND_JS_ERROR_BY_MAIL == true ? true : false);
     $this->cmbSendJsErrorByMail->addItem("false", "false", SEND_JS_ERROR_BY_MAIL == false ? true : false);
     $this->cmbSendJsErrorByMail->setWidth(143);
     $table_form2->addRowColumns(__(CMB_SEND_JS_ERROR_BY_MAIL) . ":&nbsp;", $this->cmbSendJsErrorByMail);
     if (defined("SEND_BY_MAIL_FILE_EX")) {
         $this->array_files_ex = explode(',', SEND_BY_MAIL_FILE_EX);
     } else {
         $this->array_files_ex = array();
     }
     $this->hidden_nb_exclude_files = new Hidden($this->form2, "hidden_nb_exclude_files");
     if ($this->hidden_nb_exclude_files->getValue() == "") {
         if (sizeof($this->array_files_ex) > 0) {
             $this->hidden_nb_exclude_files->setValue(sizeof($this->array_files_ex) + 1);
         } else {
             $this->hidden_nb_exclude_files->setValue($this->nb_min_exclude_files);
         }
     }
     $table_form2->addRowColumns("", $this->hidden_nb_exclude_files);
     $this->exclude_files_table = new Table();
     $this->exclude_files_table->setId("exclude_files_table_id");
     $this->nb_empty_exclude_files = 0;
     $this->edt_exclude_files = array();
     for ($i = 1; $i <= $this->hidden_nb_exclude_files->getValue(); $i++) {
         $edt_exclude_files = $this->createExcludedFile();
         if (trim($edt_exclude_files->getValue()) == "") {
             if ($this->edt_exclude_files_focus == null) {
                 $this->edt_exclude_files_focus = $edt_exclude_files;
             }
             $this->nb_empty_exclude_files++;
         }
     }
     $table_form2->addRowColumns(__(EDT_SEND_BY_MAIL_FILE_EX) . ":&nbsp;<br/><i><font size=1>" . __(EDT_SEND_BY_MAIL_FILE_EX_CMT) . "</font></i>", $this->exclude_files_table)->setValign(RowTable::VALIGN_TOP);
     $this->changeSendErrorByMail();
     $table_form2->addRow();
     $this->edtMaxBadUrlBeforeBan = new TextBox($this->form2, "edtMaxBadUrlBeforeBan");
     $this->edtMaxBadUrlBeforeBan->setWidth(143)->setValue(MAX_BAD_URL_BEFORE_BANNED);
     $edtValidation = new LiveValidation();
     $this->edtMaxBadUrlBeforeBan->setLiveValidation($edtValidation->addValidatePresence()->addValidateNumericality()->setFieldName(__(EDT_MAX_BAD_URL_BEFORE_BANNED)));
     $table_form2->addRowColumns(__(EDT_MAX_BAD_URL_BEFORE_BANNED) . ":&nbsp;", $this->edtMaxBadUrlBeforeBan);
     $table_form2->addRow();
     if (!defined("SEND_ADMIN_CONNECT_BY_MAIL")) {
         define(SEND_ADMIN_CONNECT_BY_MAIL, false);
     }
     $this->cmbSendAdminConnectByMail = new ComboBox($this->form2, "cmbSendAdminConnectByMail");
     $this->cmbSendAdminConnectByMail->addItem("true", "true", SEND_ADMIN_CONNECT_BY_MAIL == true ? true : false);
     $this->cmbSendAdminConnectByMail->addItem("false", "false", SEND_ADMIN_CONNECT_BY_MAIL == false ? true : false);
     $this->cmbSendAdminConnectByMail->setWidth(143);
     $this->cmbSendAdminConnectByMail->onChange("changeSendAdminConnectByMail")->setAjaxEvent()->disableAjaxWaitMessage();
     $table_form2->addRowColumns(__(CMB_SEND_ADMIN_CONNECT_BY_MAIL) . ":&nbsp;", $this->cmbSendAdminConnectByMail);
     $this->edtSendAdminConnectByMailTo = new TextBox($this->form2, "edtSendAdminConnectByMailTo");
     $this->edtSendAdminConnectByMailTo->setWidth(143)->setValue(defined("SEND_ADMIN_CONNECT_BY_MAIL_TO") ? SEND_ADMIN_CONNECT_BY_MAIL_TO : "");
     if (SEND_ADMIN_CONNECT_BY_MAIL == false) {
         $this->edtSendAdminConnectByMailTo->disable();
     }
     $edtValidation = new LiveValidation();
     $this->edtSendAdminConnectByMailTo->setLiveValidation($edtValidation->addValidateEmail()->setFieldName(__(EDT_SEND_ADMIN_CONNECT_BY_MAIL_TO)));
     $table_form2->addRowColumns(__(EDT_SEND_ADMIN_CONNECT_BY_MAIL_TO) . ":&nbsp;", new Object($this->edtSendAdminConnectByMailTo, "&nbsp;", __(SEND_ADMIN_CONNECT_BY_MAIL_CMT)));
     $table_form2->addRow();
     $this->edtCdnServer = new TextBox($this->form2, "edtCdnServer");
     if (!defined("CDN_SERVER") || CDN_SERVER == "") {
         $this->edtCdnServer->setValue("http://");
     } else {
         $this->edtCdnServer->setValue(CDN_SERVER);
     }
     $table_form2->addRowColumns(__(EDT_CDN_SERVER) . ":&nbsp;", $this->edtCdnServer->setWidth(300));
     $table_form2->addRowColumns("&nbsp;", __(CDN_SERVER_CMT));
     $this->edtForceServerName = new TextBox($this->form2, "edtForceServerName");
     if (FORCE_SERVER_NAME == "") {
         $this->edtForceServerName->setValue("http://");
     } else {
         $this->edtForceServerName->setValue(FORCE_SERVER_NAME);
     }
     $table_form2->addRowColumns(__(EDT_FORCE_SERVER_NAME) . ":&nbsp;", $this->edtForceServerName->setWidth(300));
     $table_form2->addRowColumns("&nbsp;", __(PROBLEM_WITH_REDIRECT));
     $table_form2->addRow();
     $this->btnValidateF2 = new Button($this->form2, "btnValidateF2");
     $this->btnValidateF2->setValue(__(BTN_VALIDATE))->onClick("configureSite")->setAjaxEvent();
     $table_form2->addRowColumns($this->btnValidateF2)->setColumnColspan(1, 3)->setColumnAlign(1, RowTable::ALIGN_CENTER);
     $table_form2->addRow();
     $this->form2->setContent($table_form2);
     $tabs = new Tabs("tabs_id");
     $tabs->addTab(__(TAB_SITE), $this->form);
     $tabs->addTab(__(TAB_ADVANCE), $this->form2);
     $this->render = new AdminTemplateForm($this, $tabs);
 }