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/>"); }
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); }
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) . " : ", $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) . " : ", $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) . " : ", $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 = __(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)); }
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) . ": ", $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) . ": ", $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) . ": ", $this->edtRoot->setLiveValidation($edtRootValidation->addValidatePresence()->setFieldName(__(EDT_ROOT)))); $this->edtPassword = new Password($this->form); $this->edtPassword->setValue(DB_PASSWORD); $table_form->addRowColumns(__(EDT_PASSWORD) . ": ", $this->edtPassword); $this->edtDatabase = new TextBox($this->form); $this->edtDatabase->setValue(DB_DATABASE); $table_form->addRowColumns(__(EDT_DATABASE) . ": ", $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) . ": ", $this->cmb_databases); $this->cmb_tables = new ComboBox($this->form); $table_gen->addRowColumns(__(TABLES) . ": ", $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); } }
public function Load() { header($_SERVER["SERVER_PROTOCOL"] . " 401 Unauthorized"); parent::$PAGE_TITLE = __(ERROR_USER_RIGHTS) . " - " . __(SITE_NAME); parent::$PAGE_META_ROBOTS = "noindex, nofollow"; $obj_error_msg = new Object(new Picture("wsp/img/warning.png", 48, 48, 0, "absmidlle"), "<br/>", new Label(__(ERROR_USER_RIGHTS_MSG))); $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_RIGHTS)); }
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), " ", 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); }
public function Load() { parent::$PAGE_TITLE = __(MANAGE_TEMPLATES); $construction_page = new Object(__(PAGE_IN_CONSTRUCTION)); $construction_page->setClass("warning"); // Use webservices to synchronise the list of available template // Features // - get the list of templates // - download // - update (version check) // - uninstall $this->render = new AdminTemplateForm($this, $construction_page); }
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) . ": ", $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) . ": ", $this->cmb_rights); $this->edt_old_password = new Password($form); $validation = new LiveValidation(); $this->old_passwd_row = $user_table->addRowColumns(__(OLD_PASSWORD) . ": ", $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) . ": ", $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) . " : ", $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, " ", $this->modify_btn, " ", $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); }
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) . ": ", $this->edtHost->setLiveValidation($edtHostValidation->addValidatePresence()->setFieldName(__(EDT_HOST))), " (ssl://smtp.gmail.com)"); $this->edtPort = new TextBox($form); $this->edtPort->setValue(SMTP_PORT); $edtPortValidation = new LiveValidation(); $table_form->addRowColumns(__(EDT_PORT) . ": ", $this->edtPort->setLiveValidation($edtPortValidation->addValidateNumericality(true)->setFieldName(__(EDT_PORT))), " (465)"); $this->edtName = new TextBox($form); $this->edtName->setValue(utf8encode(SMTP_NAME)); $edtNameValidation = new LiveValidation(); $table_form->addRowColumns(__(EDT_NAME) . ": ", $this->edtName->setLiveValidation($edtNameValidation->addValidatePresence()->setFieldName(__(EDT_NAME))), " (Robert Francis)"); $this->edtMail = new TextBox($form); $this->edtMail->setValue(SMTP_MAIL); $edtMailValidation = new LiveValidation(); $table_form->addRowColumns(__(EDT_MAIL) . ": ", $this->edtMail->setLiveValidation($edtMailValidation->addValidatePresence()->addValidateEmail()->setFieldName(__(EDT_MAIL))), " (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) . ": ", $this->cmbAuth, " (" . __(ACTIVATE) . ")"); $this->edtUser = new TextBox($form); $this->edtUser->setValue(SMTP_USER); if (SMTP_AUTH == false) { $this->edtUser->disable(); } $table_form->addRowColumns(__(EDT_USER) . ": ", $this->edtUser, " (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) . ": ", $this->edtPassword, " (*********)"); $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); }
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"), " ", 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); } }
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, " ", $tutorial_box, " ", $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); }
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, " ", $this->btn_add_label, " ", $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) . ": ", $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) . ": ", $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); }
public function Load() { parent::$PAGE_TITLE = __(ADMIN); // Admin $this->render = new AdminTemplateButton($this, $_GET[menu] == "" ? "admin.html" : "admin.html?menu=" . $_GET[menu]); }
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) . ": ", $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) . ": ", $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) . ": ", $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) . ": ", $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) . ": ", $this->bck_body_pic); $this->bck_body_pic_repeat = new ComboBox($form); $this->bck_body_pic_repeat->addItem("", " ", 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) . ": ", $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("", " ", $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) . ": ", 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) . ": ", $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) . ": ", $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) . ": ", $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) . ": ", $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) . ": ", $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) . ": ", $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) . ": ", $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) . ": ", $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) . ": ", $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) . ": ", $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) . ": ", $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) . ": ", $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) . ": ", $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) . ": ", $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) . ": ", $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) . ": ", $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) . ": ", $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) . ": ", $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) . ": ", $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) . ": ", $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); }
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, " ", $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", ""); } } }
public function Load() { header($_SERVER["SERVER_PROTOCOL"] . " 404 Not Found"); parent::$PAGE_TITLE = __(ERROR_PAGE) . " - " . __(SITE_NAME); parent::$PAGE_META_ROBOTS = "noindex, nofollow"; // check if URL is not bad, but could be a good URL if (isset($_GET['error-redirect-url']) && $_GET['error-redirect-url'] != "") { $url_to_check = trim($_GET['error-redirect-url']); } else { $url_to_check = trim($this->getCurrentUrl()); } $base_url_tmp = BASE_URL; if ($base_url_tmp[strlen($base_url_tmp) - 1] == "/") { $base_url_tmp = substr($base_url_tmp, 0, strlen($base_url_tmp) - 1); } $url_to_check = str_replace("%22", "\"", str_replace("%5C", "\\", str_replace("%5c", "\\", str_replace("%27", "'", $url_to_check)))); $redirect_bad_url_to = ""; if (preg_match("@" . $base_url_tmp . "([^?]*)/'(http://|https://|http:/|https:/)(.+)/'@i", $url_to_check, $matches) == 1) { // url detect with /' in the end $redirect_bad_url_to = $matches[3]; $redirect_bad_url_to_http = $matches[2]; } else { if (preg_match("@" . $base_url_tmp . "([^?]*)/'(http://|https://|http:/|https:/)(.+)'@i", $url_to_check, $matches) == 1) { // url detect with ' $redirect_bad_url_to = $matches[3]; $redirect_bad_url_to_http = $matches[2]; } else { if (preg_match("@" . $base_url_tmp . "([^?]*)/\\\\'(http://|https://|http:/|https:/)(.+)\\\\'@i", $url_to_check, $matches) == 1) { // url detect with \' $redirect_bad_url_to = $matches[3]; $redirect_bad_url_to_http = $matches[2]; } else { if (preg_match("@" . $base_url_tmp . "([^?]*)/\"(http://|https://|http:/|https:/)(.+)\"@i", $url_to_check, $matches) == 1) { // url detect with " $redirect_bad_url_to = $matches[3]; $redirect_bad_url_to_http = $matches[2]; } else { if (preg_match("@" . $base_url_tmp . "([^?]*)/(http://|https://|http:/|https:/)(.+)@i", $url_to_check, $matches) == 1) { // url detect without no ' $redirect_bad_url_to = $matches[3]; $redirect_bad_url_to_http = $matches[2]; } else { if (preg_match("@" . BASE_URL . "combine-css/'/(.+)'@i", $url_to_check, $matches) == 1) { // combine-css url with ' $redirect_bad_url_to = BASE_URL . $matches[1]; $redirect_bad_url_to_http = ""; } } } } } } // check apple icon if ($redirect_bad_url_to == "" && find($url_to_check, "apple-touch-icon") > 0) { if ($url_to_check == BASE_URL . "apple-touch-icon.png" || $url_to_check == BASE_URL . "apple-touch-icon-precomposed.png") { if (defined('SITE_META_IPHONE_IMAGE_114PX')) { $redirect_bad_url_to = SITE_META_IPHONE_IMAGE_114PX; } else { if (defined('SITE_META_IPHONE_IMAGE_72PX')) { $redirect_bad_url_to = SITE_META_IPHONE_IMAGE_72PX; } else { if (defined('SITE_META_IPHONE_IMAGE_57PX')) { $redirect_bad_url_to = SITE_META_IPHONE_IMAGE_57PX; } } } } else { if ($url_to_check == BASE_URL . "apple-touch-icon-57x57.png" || $url_to_check == BASE_URL . "apple-touch-icon-57x57-precomposed.png") { if (defined('SITE_META_IPHONE_IMAGE_57PX')) { $redirect_bad_url_to = SITE_META_IPHONE_IMAGE_57PX; } } } if ($redirect_bad_url_to != "") { if (strtoupper(substr($redirect_bad_url_to, 0, 7)) != "HTTP://" && strtoupper(substr($redirect_bad_url_to, 0, 8)) != "HTTPS://") { $redirect_bad_url_to = BASE_URL . $redirect_bad_url_to; } } } // End check if URL is not bad if ($redirect_bad_url_to != "") { // if URL is detect as bad but can be redirect to good URL if ($redirect_bad_url_to_http != "") { $redirect_bad_url_to = str_replace(":/", "", str_replace("://", "", $redirect_bad_url_to_http)) . "://" . $redirect_bad_url_to; } $this->redirect($redirect_bad_url_to); $msg_redirect = new Label(__(REDIRECT_URL_TO, $redirect_bad_url_to, $redirect_bad_url_to)); $this->render = new ErrorTemplate($msg_redirect, parent::$PAGE_TITLE); } else { // display the error page if the URL is correct $error_msg_title = ""; $array_code_error = array(401, 403, 404, 500); if (in_array($_GET['error-redirect'], $array_code_error)) { $_SESSION['calling_page'] = ""; $error_msg = constant("ERROR_" . $_GET['error-redirect'] . "_MSG"); parent::$PAGE_TITLE = constant("ERROR_" . $_GET['error-redirect'] . "_MSG") . " - " . __(SITE_NAME); $error_msg_title = constant("ERROR_" . $_GET['error-redirect'] . "_MSG"); } else { if ($_SESSION['calling_page'] == "error-page") { if (isset($_GET['error-redirect-url']) && $_GET['error-redirect-url'] != "") { $error_msg = __(ERROR_PAGE_MSG, $_GET['error-redirect-url']); } else { if ($this->getRefererURL() != "") { $error_msg = __(ERROR_PAGE_MSG, $this->getRefererURL()); } else { $error_msg = __(ERROR_PAGE_MSG, ""); } } } else { $error_msg = __(ERROR_PAGE_MSG, $_SESSION['calling_page']); } $error_msg_title = __(ERROR_PAGE); } $error_msg = new Label($error_msg, true); $obj_error_msg = new Object(new Picture("wsp/img/warning.png", 48, 48, 0, "absmidlle"), "<br/>", $error_msg->setColor("red")); $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_msg_title); // check if URL is not banned if (!isset($_GET['banned_url'])) { if (file_exists(dirname(__FILE__) . "/../../wsp/config/banned_url.cnf")) { $list_banned_url = file_get_contents(dirname(__FILE__) . "/../../wsp/config/banned_url.cnf"); $array_banned_url = explode("\n", str_replace("\r", "", $list_banned_url)); } else { $array_banned_url = array(); } if (find($this->getCurrentUrl(), $this->getBaseLanguageURL()) > 0) { $url_without_base = str_replace($this->getBaseLanguageURL(), "", $this->getCurrentUrl()); } else { $url_without_base = str_replace($this->getBaseURL(), "", $this->getCurrentUrl()); } if (isset($_GET['error-redirect-url']) && $_GET['error-redirect-url'] != "") { if (find($_GET['error-redirect-url'], $this->getBaseLanguageURL()) > 0) { $url_without_base = str_replace($this->getBaseLanguageURL(), "", $_GET['error-redirect-url']); } else { $url_without_base = str_replace($this->getBaseURL(), "", $_GET['error-redirect-url']); } } if ($url_without_base[0] != '/') { $url_without_base = "/" . $url_without_base; } $url_without_base_array = split("\\?", $url_without_base); $url_without_base = $url_without_base_array[0]; if (in_array(trim($url_without_base), $array_banned_url)) { $_GET['banned_url'] = "true"; } } $nb_user_bad_url_access = 0; if ($_GET['banned_url'] == "true" && !$this->isCrawlerBot()) { WspBannedVisitors::addIP($this->getRemoteIP()); $nb_user_bad_url_access = WspBannedVisitors::getIpNbBadAccess($this->getRemoteIP()); } // send error by mail if (defined('SEND_ERROR_BY_MAIL') && SEND_ERROR_BY_MAIL == true && !isLocalDebug()) { $send_error_mail = true; // Check if we have enougth information to send a mail if (in_array($_GET['error-redirect'], $array_code_error)) { if ($this->getRefererURL() == "") { if (!isset($_GET['error-redirect-referer']) || $_GET['error-redirect-referer'] == "") { if (!isset($_GET['error-redirect-url']) || $_GET['error-redirect-url'] == "") { $send_error_mail = false; // not enougth information to treat the error } } } } // Check if file need to send a mail $array_files_ex = array(); // list of files without error email $array_file_no_mail = array("", "crossdomain.xml", "sitemap.xml", "error-page.html", "undefined", "&", "browserconfig.xml", "favicon.gif", "favicon.png", "ui.item.id;", "url;", "javascript:void(0);"); if (defined('SEND_BY_MAIL_FILE_EX') && SEND_BY_MAIL_FILE_EX != "") { $array_files_ex = explode(',', SEND_BY_MAIL_FILE_EX); } $array_file_no_mail = array_merge($array_file_no_mail, $array_files_ex); if (isset($_GET['error-redirect-url']) && $_GET['error-redirect-url'] != "") { $tmp_current_url = explode('?', $_GET['error-redirect-url']); } else { $tmp_current_url = explode('?', $this->getCurrentUrl()); } $current_url = $tmp_current_url[0]; $array_current_url = explode('/', $current_url); $filename = $array_current_url[sizeof($array_current_url) - 1]; if (in_array($filename, $array_file_no_mail)) { $send_error_mail = false; } else { if ($this->getBrowserName() == "Firefox" && ($this->getBrowserVersion() == "3.6" || $this->getBrowserVersion() == "3.5") && (substr($filename, strlen($filename) - 6, 6) == "%5C%27" || substr($filename, strlen($filename) - 3, 3) == "%22" || substr($filename, strlen($filename) - 3, 3) == "%5C")) { // Interpretation error by firefox 3.6 and 3.5 $send_error_mail = false; } else { if ($this->getBrowserName() == "IE" && $this->getBrowserVersion() < 7) { // Error with IE <= 6.0 $send_error_mail = false; } else { if ($this->getBrowserName() == "BlackBerry" && $this->getBrowserVersion() == 0) { // Error with BlackBerry version 0 $send_error_mail = false; } else { // no mail for some referers (html transformed or base href not take into account) $array_exluded_referer = array("translate.googleusercontent.com", "webcache.googleusercontent.com"); $array_referer_url = explode('/', str_replace("http://", "", str_replace("https://", "", $this->getRefererURL()))); $base_referer_url = $array_referer_url[0]; if (in_array($base_referer_url, $array_exluded_referer)) { $send_error_mail = false; } else { // test if there is regexp in the administrator exclude list for ($i = 0; $i < sizeof($array_files_ex); $i++) { if (is_regexp($array_files_ex[$i], true)) { $path_or_filename = $filename; if (find($array_files_ex[$i], "\\/") > 0) { // detect is regex on a path $path_or_filename = str_replace(BASE_URL, "", $current_url); } if (preg_match($array_files_ex[$i], $path_or_filename)) { $send_error_mail = false; break; } } } } } } } } // send mail if ($send_error_mail) { $debug_mail = $error_msg->render(); $debug_mail .= "<br/><br/><b>General information:</b><br/>"; if (isset($_GET['error-redirect-url']) && $_GET['error-redirect-url'] != "") { $debug_mail .= "URL : " . $_GET['error-redirect-url'] . "<br/>"; } else { $debug_mail .= "URL : " . $this->getCurrentUrl() . "<br/>"; } if (isset($_GET['error-redirect-referer']) && $_GET['error-redirect-referer'] != "") { $debug_mail .= "Referer : " . $_GET['error-redirect-referer'] . "<br/>"; } else { $debug_mail .= "Referer : " . $this->getRefererURL() . "<br/>"; } $debug_mail .= "IP : <a href='http://www.infosniper.net/index.php?ip_address=" . $this->getRemoteIP() . "' target='_blank'>" . $this->getRemoteIP() . "</a><br/>"; $debug_mail .= "Browser : "; if ($this->getBrowserName() == "Default Browser") { $debug_mail .= $this->getBrowserUserAgent(); } else { $debug_mail .= $this->getBrowserName() . " (version: " . $this->getBrowserVersion() . ")"; } $debug_mail .= "<br/>"; $debug_mail .= "Crawler : " . ($this->isCrawlerBot() ? "true" : "false") . "<br/>"; if ($_GET['banned_url'] == "true" && $nb_user_bad_url_access > 0) { $debug_mail .= "<br/><font color='red'>This user already tried to access to " . $nb_user_bad_url_access . " forbidden URL.</font><br/>"; $debug_mail .= "(User will be blocked with captcha code after " . MAX_BAD_URL_BEFORE_BANNED . " attempts)<br/>"; } try { $mail = new SmtpMail(SEND_ERROR_BY_MAIL_TO, __(SEND_ERROR_BY_MAIL_TO), "ERROR on " . __(SITE_NAME) . " !!!", __($debug_mail), SMTP_MAIL, __(SMTP_NAME)); $mail->setPriority(SmtpMail::PRIORITY_HIGH); $mail->send(); } catch (Exception $e) { } } } } }
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) . ": ", $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) . ": ", $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) . ": ", $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) . ": ", $this->cmbRating); $this->edtAuthor = new TextBox($this->form, "edtAuthor"); $this->edtAuthor->setValue(__(SITE_AUTHOR)); $edtValidation = new LiveValidation(); $table_form->addRowColumns(__(EDT_AUTHOR) . ": ", $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) . ": ", $this->cmbLanguage); $table_form->addRow(); $this->cmbSiteType = new ComboBox($this->form, "cmbSiteType"); $this->cmbSiteType->addItem("", " ", 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) . ": ", $this->cmbSiteType); $this->edtSiteImage = new TextBox($this->form, "edtSiteImage"); $this->edtSiteImage->setValue(SITE_META_OPENGRAPH_IMAGE)->setWidth(300); $table_form->addRowColumns(__(EDT_SITE_IMAGE) . ": ", $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) . ": ", $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) . ": ", $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) . ": ", $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) . ": ", $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) . ": ", $this->edtGoogleTracker); /*$this->edtGoogleMapKey = new TextBox($this->form, "edtGoogleMapKey"); $this->edtGoogleMapKey->setValue(GOOGLE_MAP_KEY); $table_form->addRowColumns(__(EDT_GOOGLE_MAP_KEY).": ", $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) . ": ", $this->cmbMetaRobots); $this->cmbMetaGooglebot = new ComboBox($this->form, "cmbMetaGooglebot"); $this->cmbMetaGooglebot->addItem("", " ", 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) . ": ", $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) . ": ", new Object($this->edtRevisitAfter->setLiveValidation($edtValidation->addValidatePresence()->addValidateNumericality(true)->setFieldName(__(EDT_REVISIT_AFTER))), " " . __(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) . ": ", $this->cmbJQueryVersion); $this->cmbJQueryUIVersion = new ComboBox($this->form2, "cmbJQueryUIVersion"); $this->cmbJQueryUIVersion->setWidth(143); $table_form2->addRowColumns(__(CMB_JQUERY_UI_VERSION) . ": ", $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) . ": ", $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) . ": ", $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) . ": ", new Object($this->edtMaxSessionTime->setLiveValidation($edtValidation->addValidatePresence()->addValidateNumericality(true)->setFieldName(__(EDT_MAX_SESSION_TIME))), " " . __(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) . ": ", $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) . ": ", new Object($this->edtCacheTime->setLiveValidation($edtValidation->addValidatePresence()->addValidateNumericality(true)->setFieldName(__(EDT_CACHE_TIME))), " " . __(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).": ", $this->cmbBrowscap); $table_form2->addRowColumns(" ", __(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).": ", $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) . ": ", $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) . ": ", $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) . ": ", new Object($this->edtSendErrorByMailTo, " ", __(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) . ": ", $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) . ": <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) . ": ", $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) . ": ", $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) . ": ", new Object($this->edtSendAdminConnectByMailTo, " ", __(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) . ": ", $this->edtCdnServer->setWidth(300)); $table_form2->addRowColumns(" ", __(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) . ": ", $this->edtForceServerName->setWidth(300)); $table_form2->addRowColumns(" ", __(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); }