$ID = isset($data) ? recoverPOST("ID", $data[0]["ID_Image"]) : 0; $title = isset($data) ? recoverPOST("title", $data[0]["Title"]) : recoverPOST("title"); $description = isset($data) ? recoverPOST("description", $data[0]["Description"]) : recoverPOST("description"); $category = isset($data) ? recoverPOST("category", $data[0]["Album"]) : recoverPOST("category"); $ID_Category = isset($data) ? recoverPOST("ID_Category", $data[0]["ID_Category"]) : recoverPOST("ID_Category"); $medium = isset($data) ? recoverPOST("medium", $data[0]["Medium"]) : recoverPOST("medium"); $situation = isset($data) ? recoverPOST("situation", $data[0]["Situation"]) : recoverPOST("situation"); $edit = isset($data) ? TRUE : FALSE; $action = isset($data) ? "edit" : "save"; $href = isset($data) ? path($this->application . "/cpanel/edit/{$ID}") : path($this->application . "/cpanel/add"); print div("add-form", "class"); print formOpen($href, "form-add", "form-add"); print p(__(_(ucfirst(whichApplication()))), "resalt"); print isset($alert) ? $alert : NULL; print formInput(array("name" => "title", "class" => "span10 required", "field" => __(_("Title")), "p" => TRUE, "value" => $title)); print formTextarea(array("name" => "description", "class" => "span10 required", "style" => "height: 150px;", "field" => __(_("Description")), "p" => TRUE, "value" => $description)); if ($medium) { print p(img(_webURL . _sh . $medium), "field"); } if ($action === "save") { print formInput(array("name" => "files[]", "type" => "file", "class" => "add-img required", "field" => __(_("Image")), "p" => TRUE)); print span(FALSE, " ", "add-img"); } else { print formInput(array("name" => "file", "type" => "file", "class" => "required", "field" => __(_("Image")), "p" => TRUE)); } print formInput(array("name" => "category", "class" => "span10 required", "field" => __(_("Album")) . " (" . __(_("Write a album or select")) . ")", "p" => TRUE)); /* <p class="field"> <select id="ID_Category" name="ID_Category" size="1" tabindex="5" class="select"> <option value="0"><?php print __(_("Select Album")); ?></option> <?php if(is_array($categories)) { ?>
$position = isset($data) ? recoverPOST("position", $data[0]["Position"]) : recoverPOST("position"); $code = isset($data) ? recoverPOST("code", $data[0]["Code"]) : recoverPOST("code"); $time = isset($data) ? recoverPOST("time", $data[0]["Time"]) : recoverPOST("time"); $situation = isset($data) ? recoverPOST("situation", $data[0]["Situation"]) : recoverPOST("situation"); $principal = isset($data) ? recoverPOST("principal", $data[0]["Principal"]) : recoverPOST("principal"); $edit = isset($data) ? TRUE : FALSE; $action = isset($data) ? "edit" : "save"; $href = isset($data) ? path(whichApplication() . "cpanel/{$action}/{$ID}/") : path(whichApplication() . "cpanel/add/"); print div("add-form", "class"); print formOpen($href, "form-add", "form-add"); print p(__(_(ucfirst(whichApplication()))), "resalt"); print isset($alert) ? $alert : NULL; print formInput(array("name" => "title", "class" => "span10 required", "field" => __(_("Title")), "p" => TRUE, "value" => $title)); if (isset($banner)) { print __(_("If you change the banner image, this image will be deleted")) . "<br />"; print img(path($banner, TRUE), array("alt" => "Banner", "class" => "no-border", "style" => "max-width: 780px;")); print formInput(array("name" => "banner", "type" => "hidden", "value" => $banner)); } print formInput(array("type" => "file", "name" => "image", "class" => "required", "field" => __(_("Image")), "p" => TRUE)); $options = array(0 => array("value" => "Top", "option" => __(_("Top")) . " (960x100px)", "selected" => $position === "Top" ? TRUE : FALSE), 1 => array("value" => "Left", "option" => __(_("Left")) . " (120x600px, 250x250px)", "selected" => $position === "Left" ? TRUE : FALSE), 2 => array("value" => "Right", "option" => __(_("Right")) . " (120x600px, 250x250px)", "selected" => $position === "Right" ? TRUE : FALSE), 3 => array("value" => "Bottom", "option" => __(_("Bottom")) . " (960x100px)", "selected" => $position === "Bottom" ? TRUE : FALSE), 4 => array("value" => "Center", "option" => __(_("Center")) . " (600x100px)", "selected" => $position === "Center" ? TRUE : FALSE)); print formSelect(array("name" => "position", "class" => "required", "p" => TRUE, "field" => __(_("Position"))), $options); print formInput(array("name" => "URL", "class" => "span10 required", "field" => __(_("URL")), "p" => TRUE, "value" => $URL)); print formTextarea(array("name" => "code", "class" => "span10 required", "style" => "height: 150px;", "field" => __(_("Code")), "p" => TRUE, "value" => $code)); $options = array(0 => array("value" => 1, "option" => __(_("Yes")), "selected" => (int) $principal === 1 ? TRUE : FALSE), 1 => array("value" => 0, "option" => __(_("No")), "selected" => (int) $principal === 0 ? TRUE : FALSE)); print formSelect(array("name" => "principal", "class" => "required", "p" => TRUE, "field" => __(_("Principal"))), $options); $options = array(0 => array("value" => "Active", "option" => __(_("Active")), "selected" => $situation === "Active" ? TRUE : FALSE), 1 => array("value" => "Inactive", "option" => __(_("Inactive")), "selected" => $situation === "Inactive" ? TRUE : FALSE)); print formSelect(array("name" => "situation", "class" => "required", "p" => TRUE, "field" => __(_("Situation"))), $options); print formSave($action); print formInput(array("name" => "ID", "type" => "hidden", "value" => $ID)); print formClose(); print div(FALSE);
$ID = isset($data) ? recoverPOST("ID", $data[0]["ID_Post"]) : 0; $ID_URL = isset($data) ? recoverPOST("ID_URL", $data[0]["ID_URL"]) : recoverPOST("ID_URL"); $title = isset($data) ? recoverPOST("title", $data[0]["Title"]) : recoverPOST("title"); $content = isset($data) ? recoverPOST("content", $data[0]["Content"]) : recoverPOST("content"); $situation = isset($data) ? recoverPOST("situation", $data[0]["Situation"]) : recoverPOST("situation"); $language = isset($data) ? recoverPOST("language", $data[0]["Language"]) : recoverPOST("language"); $pwd = isset($data) ? recoverPOST("pwd", $data[0]["Pwd"]) : recoverPOST("pwd"); $edit = isset($data) ? TRUE : FALSE; $action = isset($data) ? "edit" : "save"; $href = isset($data) ? path(whichApplication() . "/cpanel/{$action}/{$ID}/") : path(whichApplication() . "/cpanel/add"); print div("add-form", "class"); print formOpen($href, "form-add", "form-add"); print p(__(_(ucfirst(whichApplication()))), "resalt"); print isset($alert) ? $alert : NULL; print formInput(array("name" => "title", "class" => "span10 required", "field" => __(_("Title")), "p" => TRUE, "value" => $title)); print formTextarea(array("id" => "editor", "name" => "content", "class" => "span10", "style" => "height: 400px;", "field" => __(_("Content")), "p" => TRUE, "value" => $content)); $vars["application"] = isset($application) ? $application : NULL; $vars["categories"] = isset($categories) ? $categories : NULL; $vars["categoriesRadio"] = isset($categoriesRadio) ? $categoriesRadio : NULL; $this->view("categories", $vars, "categories"); print isset($imagesLibrary) ? $imagesLibrary : NULL; print isset($documentsLibrary) ? $documentsLibrary : NULL; ?> <div id="file-uploader"> <noscript> <p>Please enable JavaScript to use file uploader.</p> <!-- or put a simple form for upload here --> </noscript> </div> <?php if (isset($tags)) {
); print formFieldsetClose(); // ------------------------------------------------------------------------------- print formFieldsetOpen(__('Choose role'), array( 'id' => '-x-field-role_name', 'is_required' => true )); print formDropdown('role_name', array_merge(array(''=>''), $view->roles_list), '', 'id="-x-input-role_name" class="-i-dropdown"'); print formFieldsetClose(); // ------------------------------------------------------------------------------- print formFieldsetOpen(__('Description'), array( 'id' => '-x-field-description' )); print formTextarea(array( 'id' => '-x-input-description', 'name' => 'description', 'class' => '-i-textarea' ), '' ); print formFieldsetClose(); // ------------------------------------------------------------------------------- print formFieldsetOpen(__('Set password'), array( 'id' => '-x-field-password' )); print formInput(array( 'id' => '-x-input-password', 'name' => 'password', 'class' => '-i-text' ), '' ); print formHint('Note: leave empty to generate a random password automatically'); print formFieldsetClose();
$activation = recoverPOST("activation", $data[0]["Activation"]); $emailRecieve = recoverPOST("email1", $data[0]["Email_Recieve"]); $emailSend = recoverPOST("email2", $data[0]["Email_Send"]); $situation = recoverPOST("situation", $data[0]["Situation"]); $action = "edit"; $href = path($this->application . "/cpanel/edit"); print div("add-form", "class"); print formOpen($href, "form-add", "form-add"); print p(__(_(ucfirst(whichApplication()))), "resalt"); print isset($alert) ? $alert : NULL; print formInput(array("name" => "name", "class" => "required span10", "field" => __(_("Name of the Website")), "p" => TRUE, "value" => $name)); print formInput(array("name" => "URL", "class" => "required span10", "field" => __(_("URL of the Website")), "p" => TRUE, "value" => $URL)); print formInput(array("name" => "slogan_spanish", "class" => "required span10", "field" => getLanguage("Spanish", TRUE) . " " . __(_("Slogan of the Website")), "p" => TRUE, "value" => $sloganEs)); print formInput(array("name" => "slogan_english", "class" => "required span10", "field" => getLanguage("English", TRUE) . " " . __(_("Slogan of the Website")), "p" => TRUE, "value" => $sloganEn)); print formInput(array("name" => "slogan_french", "class" => "required span10", "field" => getLanguage("French", TRUE) . " " . __(_("Slogan of the Website")), "p" => TRUE, "value" => $sloganFr)); print formInput(array("name" => "slogan_portuguese", "class" => "required span10", "field" => getLanguage("Portuguese", TRUE) . " " . __(_("Slogan of the Website")), "p" => TRUE, "value" => $sloganPt)); print formInput(array("name" => "email_recieve", "class" => "required span10", "field" => __(_("E-Mail for recieve notifications")), "p" => TRUE, "value" => $emailRecieve)); print formInput(array("name" => "email_send", "class" => "required span10", "field" => __(_("Email for send notifications")), "p" => TRUE, "value" => $emailSend)); print formSelect(array("name" => "theme", "class" => "required", "p" => TRUE, "field" => __(_("Default theme"))), $themes); print formSelect(array("name" => "application", "class" => "required", "p" => TRUE, "field" => __(_("Default application"))), $defaultApplications); $options = array(0 => array("value" => "Active", "option" => __(_("Active")), "selected" => $validation === "Active" ? TRUE : FALSE), 1 => array("value" => "Inactive", "option" => __(_("Inactive")), "selected" => $validation === "Inactive" ? TRUE : FALSE)); print formSelect(array("name" => "validation", "class" => "required", "p" => TRUE, "field" => __(_("Comments validations"))), $options); $options = array(0 => array("value" => "User", "option" => __(_("User")), "selected" => $activation === "User" ? TRUE : FALSE), 1 => array("value" => "Admin", "option" => __(_("Administrator")), "selected" => $activation === "Admin" ? TRUE : FALSE)); print formSelect(array("name" => "activation", "class" => "required", "p" => TRUE, "field" => __(_("Accounts activation"))), $options); $options = array(0 => array("value" => "Active", "option" => __(_("Active")), "selected" => $situation === "Active" ? TRUE : FALSE), 1 => array("value" => "Inactive", "option" => __(_("Inactive")), "selected" => $situation === "Inactive" ? TRUE : FALSE)); print formSelect(array("name" => "situation", "class" => "required", "p" => TRUE, "field" => __(_("Situation"))), $options); print formTextarea(array("id" => "editor", "name" => "message", "class" => "required span10", "field" => __(_("Message when the Website is inactive")), "p" => TRUE, "value" => $message)); print formField(NULL, __(_("Languages")) . "<br />" . getLanguagesInput($language)); print formSave("edit"); print formClose(); print div(FALSE);
public function build() { $HTML = NULL; $hide = FALSE; $option = FALSE; foreach ($this->columns as $column) { if (!in_array($column["Field"], $this->hide)) { if (count($this->hide) > 0) { if ($this->hideString and !$hide) { $attributes = array("type" => "hidden", "name" => "_hide", "value" => base64_encode($this->hideString)); $HTML .= formInput($attributes); unset($attributes); $hide = TRUE; } } if ($this->type($column["Type"]) === "string") { $attributes = array("type" => "text", "name" => $column["Field"], "class" => "input", "field" => $this->rename($column["Field"]), "p" => TRUE, "value" => !$this->success ? recoverPOST($column["Field"]) : NULL); if (isset($this->options)) { if (!$option) { $HTML .= formInput(array("type" => "hidden", "name" => "_options", "value" => base64_encode(serialize($this->options)))); $option = TRUE; } if (isset($this->options[$column["Field"]])) { if ($this->options[$column["Field"]]["type"] === "select") { $attrs = array("name" => $column["Field"], "class" => "select", "field" => $this->rename($column["Field"]), "p" => TRUE); $HTML .= formSelect($attrs, $this->options[$column["Field"]]["options"]); unset($attrs); } elseif ($this->options[$column["Field"]]["type"] === "radio") { $attrs = array("name" => $column["Field"], "class" => "radio", "field" => $this->rename($column["Field"]), "p" => TRUE); $HTML .= formRadio($attrs, $this->options[$column["Field"]]["options"]); unset($attrs); } elseif ($this->options[$column["Field"]]["type"] === "password") { $attrs = array("name" => $column["Field"], "type" => "password", "class" => "input", "field" => $this->rename($column["Field"]), "p" => TRUE); $HTML .= formInput($attrs); unset($attrs); } elseif ($this->options[$column["Field"]]["type"] === "hidden") { $attrs = array("name" => $column["Field"], "type" => "hidden", "value" => isset($this->options[$column["Field"]]["value"]) ? $this->options[$column["Field"]]["value"] : NULL); $HTML .= formInput($attrs); unset($attrs); } } else { $HTML .= formInput($attributes); } } else { $HTML .= formInput($attributes); } unset($attributes); } elseif ($this->type($column["Type"]) === "text") { $attributes = array("name" => $column["Field"], "class" => "editor textarea", "field" => $this->rename($column["Field"]), "p" => TRUE, "value" => !$this->success ? recoverPOST($column["Field"]) : NULL); $HTML .= formTextarea($attributes); } } } $HTML .= p(TRUE, "center"); $attributes = array("type" => "submit", "name" => "save", "value" => __("Save"), "class" => "submit"); $HTML .= formInput($attributes); unset($attributes); $attributes = array("type" => "submit", "name" => "cancel", "value" => __("Cancel"), "class" => "submit"); $HTML .= formInput($attributes); unset($attributes); $HTML .= p(FALSE); $HTML .= formClose(); return $HTML; }
function eavFormTextarea(Database_Mapper_Result $attributes) { $output = formFieldsetOpen(__($attributes->description), array('id' => '-x-field-' . $attributes->attribute_key, 'is_required' => $attributes->is_required)); $output .= formTextarea(array('id' => '-x-input-' . $attributes->attribute_key, 'name' => $attributes->attribute_key, 'class' => '-i-textarea'), isset($attributes->value) ? $attributes->value : ''); $output .= formFieldsetClose(); return $output; }