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 = __(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() { 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); }
/** * 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) . ": ", $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) . ": ", $email); $subject = new TextBox($form, "contact_subject"); $subject_validation = new LiveValidation(); $subject->setLiveValidation($subject_validation->addValidatePresence()->setFieldName(__(CONTACTFORM_SUBJECT))); $table_main->addRowColumns(__(CONTACTFORM_SUBJECT) . ": ", $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; }
/** * Method prepareFieldsArray * @access public * @param mixed $properties [default value: array(] * @return mixed * @since 1.2.1 */ public function prepareFieldsArray($properties = array()) { $this->fields_array = array(); $list_attribute = $this->database_object->getDbTableAttributes(); $list_attribute_type = $this->database_object->getDbTableAttributesType(); $auto_increment_id = $this->database_object->getDbTableAutoIncrement(); // Add properties to apply on all fields if (isset($properties[ModelViewMapper::PROPERTIES_ALL]) && is_array($properties[ModelViewMapper::PROPERTIES_ALL])) { $apply_all_array = $properties[ModelViewMapper::PROPERTIES_ALL]; foreach ($apply_all_array as $property_name => $property_value) { for ($i = 0; $i < sizeof($list_attribute); $i++) { $property[$property_name] = $property_value; if (isset($properties[$list_attribute[$i]])) { // Handle child override of global property if (!isset($properties[$list_attribute[$i]][$property_name])) { $properties[$list_attribute[$i]] = array_merge($properties[$list_attribute[$i]], $property); } } else { $properties[$list_attribute[$i]] = $property; } } } } // check foreign keys $db_table_foreign_keys = $this->database_object->getDbTableForeignKeys(); foreach ($db_table_foreign_keys as $fk_attribute => $value) { if (isset($properties[$fk_attribute])) { $fk_property = $properties[$fk_attribute]; if (isset($fk_property["fk_attribute"])) { // create combobox $cmb = new ComboBox($this->form_or_page); // get foreign key data $query = "select distinct " . $value["column"] . " as id, " . $fk_property["fk_attribute"] . " as value from " . $value["table"]; if (isset($fk_property["fk_where"])) { $query .= " where " . $fk_property["fk_where"]; } if (isset($fk_property["fk_orderby"])) { $query .= " order by " . $fk_property["fk_orderby"]; } $stmt = DataBase::getInstance()->prepareStatement($query); $row = DataBase::getInstance()->stmtBindAssoc($stmt, $row); while ($stmt->fetch()) { $cmb->addItem(utf8encode($row['id']), utf8encode($row['value'])); } // add combo box in properties $value['cmb_obj'] = $cmb; $properties[$fk_attribute] = array_merge($properties[$fk_attribute], $value); } } } foreach ($list_attribute as $i => $attribute) { $wspobject = "TextBox"; $attribute_properties = array(); if (is_array($properties[$attribute])) { $attribute_properties = $properties[$attribute]; } if (isset($attribute_properties["display"]) && $attribute_properties["display"] == false) { continue; } $is_update_ok = true; if (isset($attribute_properties["update"]) && $attribute_properties["update"] == false) { $is_update_ok = false; } $method = "get" . $this->getFormatValue($attribute); $value = call_user_func_array(array($this->database_model_object, $method), array()); if ($attribute != $auto_increment_id && $is_update_ok) { // get property cmb_obj if (isset($attribute_properties['cmb_obj'])) { $field = $attribute_properties['cmb_obj']; } else { if (isset($attribute_properties["wspobject"]) && $attribute_properties["wspobject"] != "") { $wspobject = $attribute_properties["wspobject"]; } else { if ($list_attribute_type[$i] == "datetime") { $wspobject = "Calendar"; } else { if ($list_attribute_type[$i] == "boolean") { $wspobject = "CheckBox"; } } } if ($wspobject == "Calendar") { $field = new Calendar($this->form_or_page); } else { if ($wspobject == "CheckBox") { $field = new CheckBox($this->form_or_page); } else { if ($wspobject == "TextArea") { $field = new TextArea($this->form_or_page); } else { if ($wspobject == "Editor") { $field = new Editor($this->form_or_page); if (isset($attribute_properties["editor_param"]) && $attribute_properties["editor_param"] != "") { $field->setToolbar($attribute_properties["editor_param"]); } } else { if ($wspobject == "ComboBox") { $field = new ComboBox($this->form_or_page); if (isset($attribute_properties["combobox_values"])) { if (is_array($attribute_properties["combobox_values"])) { for ($j = 0; $j < sizeof($attribute_properties["combobox_values"]); $j++) { $field->addItem($attribute_properties["combobox_values"][$j]['value'], $attribute_properties["combobox_values"][$j]['text']); } } else { throw new NewException(get_class($this) . "->prepareFieldsArray() error: the property combobox_values need to be an array.", 0, getDebugBacktrace(1)); } } } else { $field = new TextBox($this->form_or_page); if ($list_attribute_type[$i] == "integer" || $list_attribute_type[$i] == "double") { $field->setWidth(70); } if (in_array($attribute, $key_attributes)) { $lv = new LiveValidation(); $field->setLiveValidation($lv->addValidatePresence()); } } } } } } } // Handle Checkbox case that only support value as "on" or "off" if (get_class($field) == "CheckBox") { if ($value == "1") { $field->setValue("on"); } else { $field->setValue("off"); } } else { if (get_class($field) == "Calendar") { $field->setValue($value); } else { $field->setValue(utf8encode($value)); } } if (isset($attribute_properties["width"]) && method_exists($field, "setWidth")) { $field->setWidth($attribute_properties["width"]); } if (isset($attribute_properties["height"]) && method_exists($field, "setHeight")) { $field->setHeight($attribute_properties["height"]); } if (isset($attribute_properties["class"]) && method_exists($field, "setClass")) { $field->setClass($attribute_properties["class"]); } if (isset($attribute_properties["style"]) && method_exists($field, "setStyle")) { $field->setStyle($attribute_properties["style"]); } if (isset($attribute_properties["disable"])) { if ($attribute_properties["disable"] == true && method_exists($field, "disable")) { $field->disable(); } else { if ($attribute_properties["disable"] == false && method_exists($field, "enable")) { $field->enable(); } } } if (get_class($field) != "Calendar") { if (isset($attribute_properties["strip_tags"]) && $attribute_properties["strip_tags"] == true && method_exists($field, "setStripTags")) { if (isset($attribute_properties["allowable_tags"])) { $field->setStripTags($attribute_properties["allowable_tags"]); } else { $field->setStripTags(""); // no tag allowed } } } } else { if (isset($attribute_properties['cmb_obj'])) { $field_tmp = $attribute_properties['cmb_obj']; $field_tmp->setValue($value); $value = $field_tmp->getText(); } if (get_class($value) == "DateTime") { $value = $value->format("Y-m-d"); } $field = new Object(utf8encode($value)); } $this->fields_array[$attribute] = $field; } return $this->fields_array; }
/** * Method createDbAttributeObject * @access private * @param mixed $row * @param mixed $list_attribute * @param mixed $list_attribute_type * @param mixed $i * @param mixed $ind * @param mixed $key_attributes * @return mixed * @since 1.1.6 */ private function createDbAttributeObject($row, $list_attribute, $list_attribute_type, $i, $ind, $key_attributes) { // get property cmb_obj (created by method loadFromSqlDataView) if (isset($this->from_sql_data_view_properties[$list_attribute[$i]]['cmb_obj'])) { $input_obj_tmp = $this->from_sql_data_view_properties[$list_attribute[$i]]['cmb_obj']; $input_obj = clone $input_obj_tmp; $input_obj->setName($this->id . "_input_" . $list_attribute[$i] . "_ind_" . $ind); $register_objects = WebSitePhpObject::getRegisterObjects(); $register_objects[] = $input_obj; $_SESSION['websitephp_register_object'] = $register_objects; } else { $wspobject = "TextBox"; $attribute_properties = array(); if (is_array($this->from_sql_data_view_properties[$list_attribute[$i]])) { $attribute_properties = $this->from_sql_data_view_properties[$list_attribute[$i]]; } if (isset($attribute_properties["wspobject"]) && $attribute_properties["wspobject"] != "") { $wspobject = $attribute_properties["wspobject"]; } else { if ($list_attribute_type[$i] == "datetime") { $wspobject = "Calendar"; } else { if ($list_attribute_type[$i] == "boolean") { $wspobject = "CheckBox"; } } } if ($wspobject == "Calendar") { $input_obj = new Calendar($this->table_form_object, $this->id . "_input_" . $list_attribute[$i] . "_ind_" . $ind); } else { if ($wspobject == "CheckBox") { $input_obj = new CheckBox($this->table_form_object, $this->id . "_input_" . $list_attribute[$i] . "_ind_" . $ind); } else { if ($wspobject == "TextArea") { $input_obj = new TextArea($this->table_form_object, $object_id); } else { if ($wspobject == "Editor") { $input_obj = new Editor($this->table_form_object, $object_id); if (isset($attribute_properties["editor_param"]) && $attribute_properties["editor_param"] != "") { $input_obj->setToolbar($attribute_properties["editor_param"]); } } else { if ($wspobject == "ComboBox") { $input_obj = new ComboBox($this->table_form_object, $object_id); if (isset($attribute_properties["combobox_values"])) { if (is_array($attribute_properties["combobox_values"])) { for ($j = 0; $j < sizeof($attribute_properties["combobox_values"]); $j++) { $input_obj->addItem($attribute_properties["combobox_values"][$j]['value'], $attribute_properties["combobox_values"][$j]['text']); } } else { throw new NewException(get_class($this) . "->loadFromSqlDataView() error: the property combobox_values need to be an array.", 0, getDebugBacktrace(1)); } } } else { $input_obj = new TextBox($this->table_form_object, $this->id . "_input_" . $list_attribute[$i] . "_ind_" . $ind); if ($list_attribute_type[$i] == "integer" || $list_attribute_type[$i] == "double") { $input_obj->setWidth(70); } if (in_array($list_attribute[$i], $key_attributes)) { $lv = new LiveValidation(); $input_obj->setLiveValidation($lv->addValidatePresence()); } } } } } } } // get properties width and strip_tags if (is_array($this->from_sql_data_view_properties[$list_attribute[$i]])) { $attribute_properties = $this->from_sql_data_view_properties[$list_attribute[$i]]; if (isset($attribute_properties["width"]) && method_exists($input_obj, "setWidth")) { $input_obj->setWidth($attribute_properties["width"]); } if (isset($attribute_properties["height"]) && method_exists($input_obj, "setHeight")) { $input_obj->setHeight($attribute_properties["height"]); } if (isset($attribute_properties["class"]) && method_exists($input_obj, "setClass")) { $input_obj->setClass($attribute_properties["class"]); } if (isset($attribute_properties["style"]) && method_exists($input_obj, "setStyle")) { $input_obj->setStyle($attribute_properties["style"]); } if (isset($attribute_properties["disable"])) { if ($attribute_properties["disable"] == true && method_exists($input_obj, "disable")) { $input_obj->disable(); } else { if ($attribute_properties["disable"] == false && method_exists($input_obj, "enable")) { $input_obj->enable(); } } } if (get_class($input_obj) != "Calendar") { if (isset($attribute_properties["strip_tags"]) && $attribute_properties["strip_tags"] == true && method_exists($input_obj, "setStripTags")) { if (isset($attribute_properties["allowable_tags"])) { $input_obj->setStripTags($attribute_properties["allowable_tags"]); } else { $input_obj->setStripTags(""); // no tag allowed } } } } if ($row != null) { // get property db_attribute $field_value = $row->getValue($list_attribute[$i]); if (isset($this->from_sql_data_view_properties[$list_attribute[$i]]["db_attribute"])) { $db_attribute = $this->from_sql_data_view_properties[$list_attribute[$i]]["db_attribute"]; $field_value = $row->getValue($db_attribute); } $input_obj->onChange("onChangeTableFromSqlDataView")->setAjaxEvent()->disableAjaxWaitMessage(); if (get_class($input_obj) == "TextBox") { $input_obj->onKeyUpJs("if (\$(this)[0].defaultValue != \$(this).val()) { \$('#" . $this->id . "_img_" . $ind . "_cancel_" . $list_attribute[$i] . "').hide(); } else { \$('#" . $this->id . "_img_" . $ind . "_cancel_" . $list_attribute[$i] . "').show(); }"); } if ($list_attribute_type[$i] == "boolean") { if (!$input_obj->isChanged()) { $input_obj->setValue($field_value == true ? "on" : "off"); } } else { if (gettype($field_value) == "object") { $input_obj->setValue($field_value); } else { $input_obj->setValue(utf8encode($field_value)); } } } return $input_obj; }
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 = __(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); }