Example #1
0
$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);
Example #2
0
/**
 * Cria um label->input[type=radio]
 * @param string $name
 * @param string $caption
 * @param string|int $value
 * @param array $attributes
 * @return string
 */
function formInputRadio($name, $caption, $value, array $attributes = null)
{
    return formLabel($caption, formInput($name, $value, 'radio', $attributes), array('class' => 'box'));
}
Example #3
0
/**
 * Upload field. Identical to the input function but adds the "file" type.
 * @param string $data
 * @param string $value
 * @param string $extra
 * @return string
 */
function formUpload($data = '', $value = '', $extra = '')
{
    if (!is_array($data)) {
        $data = array('name' => $data);
    }
    $data['type'] = 'file';
    return formInput($data, $value, $extra);
}
Example #4
0
    $this->view("tags", $var, "tags");
} else {
    $this->view("tags", NULL, "tags");
}
print formField(NULL, __(_("Language of the post")) . "<br />" . getLanguagesInput($language, "language", "select"));
$options = array(0 => array("value" => 1, "option" => __(_("Yes")), "selected" => TRUE), 1 => array("value" => 0, "option" => __(_("No"))));
print formSelect(array("name" => "enable_comments", "class" => "required", "p" => TRUE, "field" => __(_("Enable Comments"))), $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", "p" => TRUE, "class" => "required", "field" => __(_("Situation"))), $options);
if (!isset($pwd)) {
    print formInput(array("name" => "pwd", "class" => "span10", "field" => __(_("Password")), "p" => TRUE, "value" => $pwd));
} else {
    print formField(NULL, __(_("Password")) . "<br />");
    print formInput(array("id" => "lock", "class" => "lock", "type" => "button"));
    print formInput(array("id" => "password", "type" => "hidden", "value" => $pwd));
}
print formInput(array("type" => "file", "name" => "image", "field" => __(_("Image for this post")), "p" => TRUE));
if (isset($medium)) {
    print img(path($medium, TRUE));
}
print formInput(array("type" => "file", "name" => "mural", "class" => "required", "field" => __(_("Mural image")) . " (" . _muralSize . ")", "p" => TRUE));
if (isset($muralImage) and is_array($muralImage)) {
    print formInput(array("type" => "hidden", "name" => "mural_exist", "class" => "span10", "field" => __(_("Current mural image")), "p" => TRUE));
    print img(path($muralImage[0]["Image"], TRUE), array("style" => "width: 98%; border: 1px solid #000;"));
    print $this->js("var URL = '{$muralDeleteURL}';", TRUE);
    print formInput(array("type" => "submit", "id" => "delete_mural", "name" => "delete_mural_image", "value" => __(_("Delete Mural")), "class" => "btn error", "p" => TRUE));
}
print formSave($action);
print formInput(array("name" => "ID", "type" => "hidden", "value" => $ID, "id" => "ID_Post"));
print formClose();
print div(FALSE);
Example #5
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;
}
Example #6
0
  '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();
// -------------------------------------------------------------------------------
print formFieldsetOpen('', array(
  'id' => '-x-field-do_not_email_password'
));

print formCheckbox('do_not_email_password', '1', false);
print formLabel(__('Do not email the password'));
print formHint('Note: by default the password will be emailed, but you can prevent this by unchecking this option');
print formFieldsetClose();
// -------------------------------------------------------------------------------
print formFieldsetOpen('', array(
Example #7
0
$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);
Example #8
0
 public function getLibrary($type)
 {
     $this->type = $type;
     $action = NULL;
     if (POST("iDelete") and POST("iLibrary")) {
         $this->getAction("iDelete", POST("iLibrary"));
     } elseif (POST("dDelete") and POST("dLibrary")) {
         $this->getAction("dDelete", POST("dLibrary"));
     } elseif (POST("iMake")) {
         $this->getAction("make", FALSE, POST("iDir", "clean"), POST("iDirname", "clean"));
     } elseif (POST("dMake")) {
         $this->getAction("make", FALSE, POST("dDir", "clean"), POST("dDirname", "clean"));
     }
     if ($type === "images") {
         $this->px = "i";
         $this->path = "www/lib/files/images/uploaded/";
         $text = __(_("Images library"));
     } elseif ($type === "documents") {
         $this->px = "d";
         $this->path = "www/lib/files/documents/uploaded/";
         $text = __(_("Documents library"));
     }
     $action = segment(0, isLang()) . _sh . segment(1, isLang()) . _sh . segment(2, isLang());
     $href = segment(0, isLang()) . _sh . segment(1, isLang());
     $URL = path();
     $alert = "onclick=\"document.getElementById('form-add').target='';";
     $alert .= "document.getElementById('form-add').action='" . $URL . $action . "/#" . $this->px . "Library';";
     $alert .= "return confirm('" . __(_("Do you want to delete the file?")) . "');\"";
     $event = "onclick=\"document.getElementById('form-add').target=''; ";
     $event .= "document.getElementById('form-add').action='" . $URL . $action . _sh . "#" . $this->px . "Library';\"";
     $path = path($href . "/upload/" . strtolower($this->type) . "/#" . $this->px . "Library");
     $target = "document.getElementById('form-add').target='" . $this->px . "Upload'; ";
     $action = "document.getElementById('form-add').action='" . $path . "'; ";
     $submit = "javascript:submit(); ";
     $eventUpload = 'onclick="' . $target . $action . $submit . '"';
     $HTML = a($this->px . "Library");
     if ($this->type === "images") {
         $aEvents = "onclick=\"showElement(document.getElementById('" . $this->px . "-library'));\" title=\"" . __(_("Click to show or hide")) . "\" class=\"pointer\"";
     } else {
         $aEvents = "onclick=\"showElement(document.getElementById('" . $this->px . "-library1'));\" title=\"" . __(_("Click to show or hide")) . "\" class=\"pointer\"";
     }
     $HTML .= formField($aEvents, $text);
     if ($this->type === "images") {
         if (POST("iGo") or POST("iMake") or POST("iDelete")) {
             $HTML .= div($this->px . "-library");
         } else {
             $HTML .= div($this->px . "-library", "id/class", "no-display");
         }
     } else {
         if (POST("dGo") or POST("dMake") or POST("dDelete")) {
             $HTML .= div($this->px . "-library1");
         } else {
             $HTML .= div($this->px . "-library1", "id/class", "no-display");
         }
     }
     $HTML .= div("extra", "class");
     $selected = NULL;
     if (POST($this->px . "Dirbase")) {
         if (POST($this->px . "Dirbase") !== $this->path) {
             $dir = str_replace($this->path, "/", POST($this->px . "Dirbase"));
             $selected = '<option value="' . POST($this->px . "Dirbase") . '" selected="selected">' . $dir . '</option>';
         }
     }
     if ($type === "images") {
         if (POST("iMake") and POST("iDirname") != "") {
             if (POST("iDirname") !== $this->path) {
                 $dir = str_replace($this->path, "/", POST("iDir"));
                 $selected = '<option value="' . POST("iDir") . slug(POST("iDirname")) . '/" selected="selected">';
                 $selected .= $dir . slug(POST("iDirname")) . '/</option>';
             }
         }
     } elseif ($type === "documents") {
         if (POST("dMake") and POST("dDirname") !== "") {
             if (POST("dDirname") !== $this->path) {
                 $dir = str_replace($this->path, "/", POST("dDir"));
                 $selected = '<option value="' . POST("dDir") . slug(POST("dDirname")) . '/" selected="selected">';
                 $selected .= $dir . slug(POST("dDirname")) . '/</option>';
             }
         }
     }
     $value = POST($this->px . "Dirbase") ? POST($this->px . "Dirbase") : $this->path;
     $value = POST($this->px . "Make") ? POST($this->px . "Dir") . slug(POST($this->px . "Dirname")) : $value;
     $parts = explode("/", $value);
     if (count($parts) > 0) {
         $part = NULL;
         for ($i = 0; $i <= count($parts) - 1; $i++) {
             $part .= slug($parts[$i]) . "/";
         }
         $part = str_replace("//", "/", $part);
     }
     $attributes = array("name" => $this->px . "Dir", "value" => $part, "type" => "hidden");
     $HTML .= formInput($attributes);
     $attributes = array("name" => $this->px . "Px", "value" => $this->px, "type" => "hidden");
     $HTML .= formInput($attributes);
     $attributes = array("name" => $this->px . "Application", "value" => $this->application, "type" => "hidden");
     $HTML .= formInput($attributes);
     $attributes = array("name" => $this->px . "Path", "value" => $this->path, "type" => "hidden");
     $HTML .= formInput($attributes);
     if (SESSION("ZanUserPrivilegeID") < 3) {
         $attributes = array("name" => $this->px . "Dirname", "type" => "text", "class" => "required");
         $HTML .= formInput($attributes);
         $attributes = array("name" => $this->px . "Make", "value" => __(_("Make directory")), "type" => "submit", "class" => "btn btn-info", "events" => $event);
         $HTML .= formInput($attributes);
         if (count($this->getDirs($this->path)) > 1) {
             $attributes = array("name" => $this->px . "Dirbase", "class" => "required");
             $HTML .= formSelect($attributes, $this->getDirs($this->path), $selected);
             $attributes = array("name" => $this->px . "Go", "value" => __(_("Go")), "type" => "submit", "class" => "btn btn-warning", "events" => $event);
             $HTML .= formInput($attributes);
             $HTML .= br();
         } else {
             $HTML .= br();
         }
         $HTML .= small(span("bold", __(_("The new folders will be created and the files will be uploaded in")) . ": ") . $part);
         $HTML .= br();
         if ($type === "images") {
             $HTML .= small(span("bold", __(_("Support files"))) . ": jpg, jpeg, png, gif " . __(_("and")) . " bmp.");
         } elseif ($type === "documents") {
             $formats = "csv, doc, docx, exe, pdf, ppt, pptx, rar, xls, xlsx " . __(_("and")) . " zip";
             $HTML .= small(span("bold", __(_("Support files"))) . ": " . $formats);
         }
         $HTML .= "<br />";
     }
     $HTML .= div(FALSE);
     $HTML .= div("library", "class");
     $HTML .= $this->getFiles($type);
     $HTML .= div(FALSE);
     $HTML .= div($this->px . "-upload-message", TRUE);
     $HTML .= formUploadFrame($this->px, $eventUpload);
     if (SESSION("ZanUserPrivilegeID") < 3) {
         $attributes = array("name" => $this->px . "Delete", "value" => __(_("Delete")), "type" => "submit", "class" => "btn btn-danger", "events" => $alert);
         $HTML .= formInput($attributes);
     }
     $HTML .= div(FALSE);
     return $HTML;
 }
Example #9
0
 public function build($categories, $ID = NULL, $type = "checkbox", $name = "categories", $class = NULL, $parent = 0, $URL = NULL, $hide = FALSE)
 {
     if (is_null($ID)) {
         if ($name === "parent") {
             $this->HTML = NULL;
         }
         if (!is_null($class)) {
             $this->HTML .= openUl(NULL, "categories-list");
         } else {
             $this->HTML .= openUl();
         }
         $i = 0;
         if (is_array($categories)) {
             foreach ($categories as $category) {
                 if (is_array($category)) {
                     if (isset($category["Situation"]) and $category["Situation"] === "Active" and (int) $category["ID_Parent"] === 0) {
                         $title = $category["Title"];
                         if ($type === "radio") {
                             if ($name === "parent" and $i === 0) {
                                 $input = formInput(array("name" => $name, "type" => "radio", "value" => 0));
                                 $link = a(span("bold", __("Principal")), FALSE, FALSE, array("title" => __("Principal")));
                                 $this->HTML .= li($input . $link);
                                 $i++;
                             }
                             $attrs = array("text" => getLanguage($category["Language"], TRUE), "name" => $name, "value" => $category["ID_Category"], "position" => "right");
                             $input = formRadio($attrs);
                             $link = a(span("bold", $title), FALSE, FALSE, array("title" => $title));
                             $this->HTML .= li($input . $link, TRUE);
                             if ($this->parents($categories, $category["ID_Category"])) {
                                 $this->build($categories, $category["ID_Category"], $type, $name);
                             }
                             $this->HTML .= li(FALSE);
                         } elseif ($type === "checkbox") {
                             if (isset($category["checked"]) and $category["checked"]) {
                                 $check = TRUE;
                             } elseif ((int) $category["ID_Category"] === $parent) {
                                 $check = TRUE;
                             } else {
                                 $check = FALSE;
                             }
                             $attrs = array("id" => $name, "text" => getLanguage($category["Language"], TRUE), "name" => $name . "[]", "value" => $category["ID_Category"], "position" => "right", "checked" => $check);
                             $input = formCheckbox($attrs);
                             $link = a(span("bold", $title), FALSE, FALSE, array("title" => $title));
                             $this->HTML .= li($input . $link, TRUE);
                             if ($this->parents($categories, $category["ID_Category"])) {
                                 $this->build($categories, $category["ID_Category"], $type, $name);
                             }
                             $this->HTML .= li(FALSE);
                         } else {
                             $link = a($title, $URL . $category["Slug"], FALSE, array("title" => $title));
                             $this->HTML .= li($link, TRUE);
                             if ($this->parents($categories, $category["ID_Category"])) {
                                 $this->build($categories, $category["ID_Category"], $type, $name);
                             }
                             $this->HTML .= li(FALSE);
                         }
                     }
                 }
             }
         }
         $this->HTML .= closeUl();
     } else {
         $this->HTML .= openUl();
         foreach ($categories as $category) {
             if ($category["Situation"] === "Active" and $category["ID_Parent"] === $ID) {
                 $title = $category["Title"];
                 if ($type === "radio") {
                     if (!$hide) {
                         if (isset($category["checked"]) and $category["checked"]) {
                             $check = TRUE;
                         } elseif ((int) $category["ID_Category"] === $parent) {
                             $check = TRUE;
                         } else {
                             $check = FALSE;
                         }
                         $attrs = array("id" => $name, "text" => getLanguage($category["Language"], TRUE), "name" => $name, "value" => $category["ID_Category"], "position" => "right", "checked" => $check);
                         $input = formRadio($attrs);
                         $link = a($title, FALSE, FALSE, array("title" => $title));
                         $this->HTML .= li($input . $link, TRUE);
                         if ($this->parents($categories, $category["ID_Category"]) === TRUE) {
                             $this->build($categories, $category["ID_Category"], $type, $name);
                         }
                         $this->HTML .= li(FALSE);
                     } else {
                         $link = a($title, FALSE, FALSE, array("title" => $title));
                         $this->HTML .= li(getLanguage($category["Language"], TRUE) . $link);
                         if ($this->parents($categories, $category["ID_Category"]) === TRUE) {
                             $this->build($categories, $category["ID_Category"], $type);
                         }
                         $this->HTML .= li(FALSE);
                     }
                 } elseif ($type === "checkbox") {
                     if (isset($category["checked"]) and $category["checked"]) {
                         $check = TRUE;
                     } elseif ((int) $category["ID_Category"] === $parent) {
                         $check = TRUE;
                     } else {
                         $check = FALSE;
                     }
                     $attrs = array("id" => $name, "text" => getLanguage($category["Language"], TRUE), "name" => $name . "[]", "value" => $category["ID_Category"], "position" => "right", "checked" => $check);
                     $input = formCheckbox($attrs);
                     $link = a($title, FALSE, FALSE, array("title" => $title));
                     $this->HTML .= li($input . $link, TRUE);
                     if ($this->parents($categories, $category["ID_Category"])) {
                         $this->build($categories, $category["ID_Category"], $type);
                     }
                     $this->HTML .= li(FALSE);
                 } else {
                     $link = a($title, $URL . $category["Slug"], FALSE, array("title" => $title));
                     $this->HTML .= li($link, TRUE);
                     if ($this->parents($categories, $category["ID_Category"])) {
                         $this->build($categories, $category["ID_Category"], $type);
                     }
                     $this->HTML .= li(FALSE);
                 }
             }
         }
     }
     $this->HTML .= closeUl();
     return $this->HTML;
 }
Example #10
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");
 }
Example #11
0
function eavFormInput(Database_Mapper_Result $attributes)
{
    $output = formFieldsetOpen(__($attributes->description), array('id' => '-x-field-' . $attributes->attribute_key, 'is_required' => $attributes->is_required));
    $output .= formInput(array('id' => '-x-input-' . $attributes->attribute_key, 'name' => $attributes->attribute_key, 'class' => '-i-text'), isset($attributes->value) ? $attributes->value : '');
    $output .= formFieldsetClose();
    return $output;
}