Ejemplo n.º 1
0
/**
 * Form declaration - Multipart type
 * Creates the opening portion of the form, but with "multipart/form-data".
 * @param string $action
 * @param array $attributes
 * @return string
 */
function formOpenMultipart($action = '', array $attributes = array())
{
    $attributes['enctype'] = 'multipart/form-data';
    return formOpen($action, $attributes);
}
Ejemplo n.º 2
0
    die("Error: You don't have permission to access here...");
}
$ID = isset($data) ? recoverPOST("ID", $data[0]["ID_Ad"]) : 0;
$title = isset($data) ? recoverPOST("title", $data[0]["Title"]) : recoverPOST("title");
$banner = isset($data) ? recoverPOST("banner", $data[0]["Banner"]) : NULL;
$URL = isset($data) ? recoverPOST("URL", $data[0]["URL"]) : "http://";
$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);
Ejemplo n.º 3
0
"
      },
      role_name: '<?php 
print __('Please choose role');
?>
'
    },
    errorClass: "-i-error"
  });
});
</script>
<?
$helper->heading(__('Users - Create user'));
print formOpen(uriSite('/user/action/create'), array(
  'id'     => '-x-user-add',
  'class'  => '-i-form',
  'method' => 'POST'
));
// Form fields
print formFieldsetOpen(__('User name (login name)'), array(
  'id'          => '-x-field-user_name',
  'is_required' => true
));
print formInput(array(
  'id'    => '-x-input-user_name',
  'name'  => 'user_name',
  'class' => '-i-text'
  ), ''
);
print formFieldsetClose();
// -------------------------------------------------------------------------------
Ejemplo n.º 4
0
function getSearch()
{
    global $Load;
    $Load->helper(array("forms", "html"));
    $application = whichApplication();
    if ($application === "users") {
        $field = "username";
        $name = __(_("Username"));
    } else {
        $field = "title";
        $name = __(_("Title"));
    }
    $fields = array(0 => array("field" => "ID", "name" => "ID", "selected" => FALSE), 1 => array("field" => $field, "name" => $name, "selected" => TRUE));
    $trash = NULL;
    if (segment(3, isLang()) === "trash") {
        $trash = "trash";
    }
    $HTML = formOpen(path($application . "/cpanel/results/{$trash}"), "form-results-search");
    $HTML .= br();
    $HTML .= bold("&nbsp" . __(_("Search")) . ":", FALSE);
    $attributes = array("p" => FALSE, "name" => "search", "class" => "span 1 required");
    $HTML .= formInput($attributes);
    $HTML .= bold(" " . __(_("Field")) . ":", FALSE);
    $i = 0;
    foreach ($fields as $field) {
        $fields[$i]["value"] = $field["field"];
        $fields[$i]["option"] = $field["name"];
        $fields[$i]["selected"] = $field["selected"];
        $i++;
    }
    $HTML .= formSelect(array("name" => "field", "class" => "span2 required"), $fields);
    $HTML .= bold(__(_("Order")) . ":", FALSE);
    $options[0]["value"] = "ASC";
    $options[0]["option"] = __(_("Ascending"));
    $options[0]["selected"] = TRUE;
    $options[1]["value"] = "DESC";
    $options[1]["option"] = __(_("Descending"));
    $options[1]["selected"] = FALSE;
    $HTML .= formSelect(array("name" => "order", "class" => "span2 required"), $options);
    $HTML .= formInput(array("name" => "seek", "type" => "submit", "class" => "btn btn-info", "value" => __(_("Seek"))));
    return $HTML;
}
Ejemplo n.º 5
0
if (!defined("_access")) {
    die("Error: You don't have permission to access here...");
}
$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", "multimedia");
print p(__(_(ucfirst(whichApplication()))), "resalt");
print isset($alert) ? $alert : NULL;
print formInput(array("type" => "file", "id" => "fileselect", "name" => "fileselect[]", "multiple" => "multiple", "class" => "required", "field" => __(_("Upload files")), "p" => TRUE));
print div("filedrag");
print __(_("Drag & drop your files here"));
print div(FALSE);
print div("progress") . div(FALSE);
print div("response") . div(FALSE);
print '<div class="clear"></div>';
if ($uploaded) {
    print formSave($action);
}
print formInput(array("name" => "upload", "type" => "hidden", "value" => path(whichApplication() . "/cpanel/upload"), "id" => "upload"));
print formInput(array("name" => "MAX_FILE_SIZE", "type" => "hidden", "value" => "MAX_FILE_SIZE", "id" => "upload"));
print formInput(array("name" => "ID", "type" => "hidden", "value" => $ID, "id" => "ID_Post"));
Ejemplo n.º 6
0
 public function make()
 {
     $this->action = isLang() ? _webBase . "/" . segment(0) . "/" . segment(1) . "/" . segment(2) : _webBase . "/" . segment(0) . "/" . segment(1);
     if (is_array($this->columns)) {
         $this->CSS("scaffold");
         $this->js("tiny-mce", NULL, "class");
         $HTML = formOpen($this->action, "scaffold");
         if ($this->error) {
             $HTML .= $this->error;
         } elseif ($this->success) {
             $HTML .= $this->success;
         }
         $attributes = array("type" => "hidden", "name" => "_table", "value" => base64_encode($this->table));
         $HTML .= formInput($attributes);
         unset($attributes);
     }
     $HTML .= $this->build();
     $vars["HTML"] = $HTML;
     $this->template("scaffold", $vars);
     $this->render("header", "footer");
 }
Ejemplo n.º 7
0
function eavCreateForm($form_id, array $attributes, $action = '')
{
    // Print form javascript to View object
    print eavCreateFormValidationJS($form_id, $attributes);
    if (empty($action)) {
        $action = uriFull();
    }
    // Print open tag
    print formOpen($action, array('id' => $form_id, 'class' => '-i-form', 'method' => 'POST'));
    // Print form fields
    foreach ($attributes as $field) {
        // Create form field
        if ($field->backend_object != null) {
            // Parse helper name and function name
            $field_helper = explode('/', $field->backend_object, 2);
            if (isset($field_helper[0]) and isset($field_helper[1])) {
                // Load required helper
                Helper::load($field_helper[0]);
                if (function_exists($field_helper[1])) {
                    // And execute the function
                    print call_user_func($field_helper[1], $field);
                }
            }
        }
    }
    // Print submit
    print formSubmit(array('class' => '-b-button', 'name' => 'submit', 'value' => __('Save')));
    // Close form
    print formClose();
}