App-ZofCMS-PluginBundle-Naughty

 view release on metacpan or  search on metacpan

lib/App/ZofCMS/Plugin/ImageGallery.pm  view on Meta::CPAN

        do { my $id = rand() . time() . rand(); $id =~ tr/.//d; $id },
    );

    return 1;
}

sub _form_template {
    return <<'END_TEMPLATE';
<tmpl_if name='success'>
    <p>Your image has been successfully uploaded.</p>
    <p><a href="<tmpl_var escape='html' name='success_href'>">Upload another image</a></p>
<tmpl_else>
    <form action="" method="POST" id="plug_image_gallery_form" enctype="multipart/form-data">
    <div>
        <tmpl_if name='error'><p class="error"><tmpl_var escape='html' name='error'></p></tmpl_if>
        <input type="hidden" name="page" value="<tmpl_var escape='html' name='page'>">
        <input type="hidden" name="dir" value="<tmpl_var escape='html' name='dir'>">
        <tmpl_if name='is_edit'><input type="hidden" name="plug_image_gallery_id" value="<tmpl_var escape='html' name='id'>"></tmpl_if>
        <ul>
            <tmpl_unless name='is_edit'><li>
                <label for="plug_image_gallery_file">Image: </label
                ><input type="file" name="plug_image_gallery_file" id="plug_image_gallery_file">
            </li></tmpl_unless>
            <li>
                <label for="plug_image_gallery_description">Description: </label
                ><textarea name="plug_image_gallery_description" id="plug_image_gallery_description" cols="60" rows="5"><tmpl_var escape='html' name='plug_image_gallery_description'></textarea>
            </li>
        </ul>
        <input type="submit" name="plug_image_gallery_submit" value="<tmpl_if name='is_edit'>Update<tmpl_else>Upload</tmpl_if>">
    </div>
    </form>
</tmpl_if>
END_TEMPLATE
}

sub _list_template {
    return <<'END_TEMPLATE';
<tmpl_if name='is_view'>
    <a class="plug_image_gallery_return_to_image_list" href="/index.pl?page=<tmpl_var escape='html' name='page'>&amp;dir=<tmpl_var escape='html' name='dir'>">Return to image list.</a>
    <div id="plug_image_gallery_photo"><img src="/<tmpl_var escape='html' name='photo'>" width="<tmpl_var escape='html' name='width'>" height="<tmpl_var escape='html' name='height'>" alt=""><tmpl_if name='has_description'><p class="plug_image_gallery...
<tmpl_else>
    <tmpl_if name='has_images'>
        <ul class="plug_image_gallery_list">
            <tmpl_loop name='images'>
                <li<tmpl_if name='alt'> class="alt"</tmpl_if>>
                    <tmpl_if name='has_view'><a <tmpl_if name='want_lightbox'>rel="<tmpl_var escape='html' name='lightbox_rel'>" href="/<tmpl_var escape='html' name='lightbox_src'>" title="<tmpl_var escape='html' name='lightbox_desc'>"<tmpl_else>href...
                    <tmpl_if name="has_description"><p><tmpl_var name='description'></p></tmpl_if>
                    <tmpl_if name="edit">
                        <form action="" method="POST">
                        <div>
                            <input type="hidden" name="plug_image_gallery_id" value="<tmpl_var escape='html' name='id'>">
                            <input type="hidden" name="page" value="<tmpl_var escape='html' name='page'>">
                            <input type="hidden" name="dir" value="<tmpl_var escape='html' name='dir'>">
                            <input type="submit" class="input_submit" name="plug_image_gallery_action" value="Edit">
                            <input type="submit" class="input_submit" name="plug_image_gallery_action" value="Delete">
                        </div>
                        </form>
                    </tmpl_if>
                </li>
            </tmpl_loop>
        </ul>
    <tmpl_else>
        <p>Currently there are no images.</p>



( run in 0.389 second using v1.01-cache-2.11-cpan-5467b0d2c73 )