function add_to_gallery() { $gallery_peer = new GalleryPeer(); $gallery = $gallery_peer->find_by_id(Params::get("id_gallery")); $collection_peer = new GalleryCollectionPeer(); $gallery_collection = $collection_peer->find_by_id($gallery->id_gallery_collection); $full_folder_path = GalleryCollectionController::GALLERY_COLLECTION_ROOT_DIR . $gallery_collection->folder . "/" . $gallery->folder; if (Upload::isUploadSuccessful("file")) { $filename = Random::newHexString() . "_" . Upload::getRealFilename("file"); $gallery_dir = new Dir($full_folder_path); $uploaded_img = Upload::saveTo("file", $gallery_dir, $filename); if (isset(Config::instance()->GALLERY_RESIZE_BY_WIDTH)) { image_w($uploaded_img->getPath(), Config::instance()->GALLERY_RESIZE_BY_WIDTH); } else { if (isset(Config::instance()->GALLERY_RESIZE_BY_HEIGHT)) { image_h($uploaded_img->getPath(), Config::instance()->GALLERY_RESIZE_BY_HEIGHT); } } $peer = new GalleryImagePeer(); $do = $peer->new_do(); $peer->setupByParams($do); $do->image_name = $filename; $peer->save($do); return Redirect::success(); } else { Flash::error(Upload::getUploadError("file")); return Redirect::failure(); } }
if (isset(Config::instance()->GALLERY_RESIZE_BY_HEIGHT)) { $final_image_path = image_h($v["path"], Config::instance()->GALLERY_RESIZE_BY_HEIGHT); } else { $final_image_path = $v["path"]; } } ?> <li> <a href="<?php echo $final_image_path; ?> "><img height="<?php echo $thumb_image_height; ?> " src="<?php echo image_h($v["path"], $thumb_image_height); ?> " alt="<?php echo $v["title"]; ?> " /></a> </li> <?php } ?> </ul> </div> <script type="text/javascript"> $("#gallery_<?php echo $html_gallery_name; ?>
<tr width="100%"> <td> <?php echo $id_prodotto_servizio_vetrina; ?> </td> <td> <?php if ($nome_immagine != null) { ?> <img id="nome_immagine_<?php echo $id_prodotto_servizio_vetrina; ?> " src="<?php echo image_h(ProdottoServizioController::PRODUCT_IMAGE_DIR . "/" . $id_prodotto_servizio . "/" . $nome_immagine, 50); ?> " alt="<?php echo $nome_immagine; ?> " /> <?php } ?> </td> <td> <form name="form__modifica_prodotto_servizio_vetrina" method="post" action="/admin/vetrine/modifica_prodotto_servizio.php?id_vetrina=<?php echo $_GET["id_vetrina"]; ?> "> <input type="hidden" name="id_prodotto_servizio_vetrina" value="<?php echo $id_prodotto_servizio_vetrina;
function add_image() { if (Upload::isUploadSuccessful("file")) { $gallery_dir = new Dir($this->get_current_folder()); $uploaded_img = Upload::saveTo("file", $gallery_dir); if (isset(Config::instance()->GALLERY_RESIZE_BY_WIDTH)) { image_w($uploaded_img->getPath(), Config::instance()->GALLERY_RESIZE_BY_WIDTH); } else { if (isset(Config::instance()->GALLERY_RESIZE_BY_HEIGHT)) { image_h($uploaded_img->getPath(), Config::instance()->GALLERY_RESIZE_BY_HEIGHT); } } $peer = new GalleryImagePeer(); return Redirect::success(); } else { Flash::error(Upload::getUploadError("file")); return Redirect::failure(); } }
function aggiungi_immagine() { $id_prodotto_servizio = Params::get("id_prodotto_servizio"); if (Params::is_set("file_field_name")) { $file_field_name = Params::get("file_field_name"); } else { $file_field_name = "file"; } if (Upload::isUploadSuccessful($file_field_name)) { $product_dir = new Dir(self::PRODUCT_IMAGE_DIR . "/" . $id_prodotto_servizio); $product_dir->touch(); $uploaded_img = Upload::saveTo($file_field_name, $product_dir); if (isset(Config::instance()->PRODUCT_IMAGE_RESIZE_BY_WIDTH)) { image_w($uploaded_img->getPath(), Config::instance()->PRODUCT_IMAGE_RESIZE_BY_WIDTH); } else { if (isset(Config::instance()->PRODUCT_IMAGE_RESIZE_BY_HEIGHT)) { image_h($uploaded_img->getPath(), Config::instance()->PRODUCT_IMAGE_RESIZE_BY_HEIGHT); } } //creo una riga associata all'immagine $immagine_prodotto_servizio_peer = new ImmagineProdottoServizioPeer(); $do = $immagine_prodotto_servizio_peer->new_do(); $do->id_prodotto_servizio = Params::get("id_prodotto_servizio"); $do->nome_immagine = $uploaded_img->getFilename(); $immagine_prodotto_servizio_peer->save($do); return Redirect::success(); } else { Flash::error(Upload::getUploadError($file_field_name)); return Redirect::failure(); } }
?> " alt="<?php echo $image_list[$thumb_image_index]["title"]; ?> " title="<?php echo $image_list[$thumb_image_index]["title"]; ?> " /> </a> <?php foreach ($image_list as $k => $v) { if (isset(Config::instance()->GALLERY_RESIZE_BY_WIDTH)) { $final_image_path = image_w($v["path"], Config::instance()->GALLERY_RESIZE_BY_WIDTH); } else { if (isset(Config::instance()->GALLERY_RESIZE_BY_HEIGHT)) { $final_image_path = image_h($v["path"], Config::instance()->GALLERY_RESIZE_BY_HEIGHT); } else { $final_image_path = $v["path"]; } } ?> <a href="<?php echo $final_image_path; ?> " title="<?php echo $v["title"]; ?> "></a> <?php } ?>
<tr> <td align="center"><a target="_immagine_gallery" href="<?php echo $path; ?> "><img border="0px" alt="Immagine gallery" src="<?php echo image_h($path, 50); ?> " title="<?php echo $title; ?> " /></a></td> <td><?php echo $title; ?> </td> <td> <form action="/admin/gallery/modifica_immagine.php" method="get"> <input type="hidden" name="id_gallery_image" value="<?php echo $id_gallery_image; ?> " /> <input type="submit" name="Modifica dettagli immagine" value="Modifica dettagli immagine" /> <?php Form::after("/admin/gallery/index_gallery.php?id_gallery=" . $id_gallery); ?> </form> <form action="/actions/gallery_image/delete_from_gallery.php" method="post" onsubmit="return window.confirm('Sei sicuro di voler cancellare questa immagine??');"> <input type="hidden" name="id_gallery_image" value="<?php echo $id_gallery_image; ?> " />
} ?> <div> <div align="center"> <h2 style="font-size:20px;font-family:fantasy;"><?php echo $prodotto_servizio["nome"]; ?> </h2> <br /> <?php foreach ($immagini_prodotto_servizio as $img) { ?> <div style="padding:5px;display:inline-block;"> <img src="<?php echo image_h(ProdottoServizioController::PRODUCT_IMAGE_DIR . "/" . $prodotto_servizio["id_prodotto_servizio"] . "/" . $img["nome_immagine"], 200); ?> " alt="" /> </div> <?php } ?> <br /> <br /> <div align="left"> <?php echo $prodotto_servizio["descrizione"]; ?> </div>