Ejemplo n.º 1
0
 function tagImageLoader($Item)
 {
     if ($this->attr("load") !== 1) {
         $form = $_GET["form"];
         $item = $Item["id"];
         if ($this->attr("data-form") > "") {
             $form = $this->attr("data-form");
         }
         if ($this->attr("data-item") > "") {
             $item = $this->attr("data-item");
         }
         $path = formPathGet($form, $item);
         $img = formGetForm("form", "comImages");
         $ext = $this->attr("data-ext");
         $max = $this->attr("data-max");
         $name = $this->attr("data-name");
         if ($this->attr("data-prop") == "false") {
             $img->find(".form-group.prop")->remove();
         }
         $img->contentSetValues($Item);
         $this->attr("path", $path["uplitem"]);
         $this->html($img->outerHtml());
         $this->attr("load", 1);
         $this->addClass("loaded");
         if ($name > "") {
             $this->find("[data-role=imagestore]")->attr("name", $name);
         }
         if ($ext > "") {
             $ext = implode(" ", attrToArray($ext));
         }
         $this->find("[data-role=imagestore]")->attr("data-ext", $ext);
         if ($max > "") {
             $this->find("[data-role=imagestore]")->attr("data-max", $max);
         }
     }
 }
Ejemplo n.º 2
0
function formPathCheck($form = "page", $id = "_new", $uplflds = array("images"))
{
    $savePath = formPathGet($form, $id);
    if (!isset($_SESSION["proj_path"])) {
        $_SESSION["proj_path"] = "";
    }
    $base = $_SESSION["root_path"] . $_SESSION["proj_path"];
    $dir = $base . $savePath["form"];
    if (!is_dir($dir)) {
        mkdir($dir);
    }
    $uplpath = $base . $savePath["uploads"];
    if (!is_dir($uplpath)) {
        mkdir($uplpath);
    }
    $lstpath = $base . $savePath["lists"];
    if (!is_dir($lstpath)) {
        mkdir($lstpath);
    }
    $dir = $base . $savePath["uplform"];
    if (!is_dir($dir)) {
        mkdir($dir);
    }
    if ($uplflds == true) {
        $dir = $base . $savePath["uplitem"];
        if (!is_dir($dir)) {
            mkdir($dir);
        }
    } else {
        foreach ($uplflds as $key => $fld) {
            if ($_POST[$fld] > "") {
                $dir = $base . $savePath["uplitem"];
                if (!is_dir($dir)) {
                    mkdir($dir);
                }
            }
        }
    }
    return $savePath;
}