Commit a15b08fd by netz.coop

GPL

0 parents
Showing with 9374 additions and 0 deletions
/**
* @category freeSN
* @mailto code [at] netz.coop
* @version 0.4.200901
* @link http://netz.coop
*
* @copyright Copyright by netz.coop e.G. 2015
*
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
\ No newline at end of file
ln -s /var/www/Magento/AncLib/app/design/adminhtml/layout/lib.xml /var/www/Magento/Magento19/app/design/adminhtml/default/default/layout/anc/
\ No newline at end of file
SplineFontDB: 3.0
FontName: Untitled1
FullName: Untitled1
FamilyName: Untitled1
Weight: Medium
Copyright: Created by v,,, with FontForge 2.0 (http://fontforge.sf.net)
UComments: "2014-8-22: Created."
Version: 001.000
ItalicAngle: 0
UnderlinePosition: -100
UnderlineWidth: 500
Ascent: 800
Descent: 200
LayerCount: 2
Layer: 0 0 "Back" 1
Layer: 1 0 "Zeichenebene" 0
XUID: [1021 430 1860185808 5426416]
FSType: 8
OS2Version: 0
OS2_WeightWidthSlopeOnly: 0
OS2_UseTypoMetrics: 1
CreationTime: 1408710620
ModificationTime: 1408710864
PfmFamily: 17
TTFWeight: 500
TTFWidth: 5
LineGap: 90
VLineGap: 0
OS2TypoAscent: 0
OS2TypoAOffset: 1
OS2TypoDescent: 0
OS2TypoDOffset: 1
OS2TypoLinegap: 90
OS2WinAscent: 0
OS2WinAOffset: 1
OS2WinDescent: 0
OS2WinDOffset: 1
HheadAscent: 0
HheadAOffset: 1
HheadDescent: 0
HheadDOffset: 1
OS2Vendor: 'PfEd'
MarkAttachClasses: 1
DEI: 91125
LangName: 1033
Encoding: ISO8859-1
UnicodeInterp: none
NameList: Adobe Glyph List
DisplaySize: -96
AntiAlias: 1
FitToEm: 1
WinInfo: 0 19 8
OnlyBitmaps: 1
BeginPrivate: 0
EndPrivate
TeXData: 1 0 0 346030 173015 115343 0 1048576 115343 783286 444596 497025 792723 393216 433062 380633 303038 157286 324010 404750 52429 2506097 1059062 262144
BeginChars: 256 0
EndChars
EndSplineFont
#!/usr/bin/python
# vim:ts=8:sw=4:expandtab:encoding=utf-8
'''Center glyphs.
Copyright <hashao2@gmail.com> 2008
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
# MA 02110-1301, USA.
Put the file in $(PREFIX)/share/fontforge/python or ~/.FontForge/python, invoke
from "Tools->Metrics->Center in Glyph" after selected some glyphs.
'''
__version__ = '0.1'
import sys
import fontforge
import psMat
def center_glyph(glyph, vcenter=0, lbearing=15, rbearing=None):
'''Center a glyph.'''
# Shift width
if not rbearing:
rbearing = lbearing
bounding = glyph.boundingBox() # xmin,ymin,xmax,ymax
width = (bounding[2] - bounding[0])
width_new = width+(lbearing+rbearing)
glyph.width = width_new
glyph.left_side_bearing = lbearing
glyph.right_side_bearing = rbearing
# Shift Height
center_glyph_height(glyph, vcenter, bounding)
def center_glyph_height(glyph, vcenter, abound=None):
bounding = abound or glyph.boundingBox() # xmin,ymin,xmax,ymax
glyphcenter = (bounding[3] - bounding[1])/2+bounding[1]
deltay = vcenter - glyphcenter
matrix = psMat.translate(0, deltay)
glyph.transform(matrix)
def CenterGlyph(junk, afont):
'''Main function.'''
center = (afont.ascent - afont.descent)/2
# total 5% margin
em = afont.ascent + afont.descent
lbearing = int(em*0.05/2)
for glyph in afont.selection.byGlyphs:
center_glyph(glyph, center, lbearing)
def CenterHeight(junk, afont):
'''Main function.'''
center = (afont.ascent - afont.descent)/2
for glyph in afont.selection.byGlyphs:
center_glyph_height(glyph, center)
def fit_glyph(glyph, em, percent=0.95):
'''Scale a glyph horizontally to fit the width.'''
bounding = glyph.boundingBox() # xmin, ymin, xmax, ymax
gwidth = (bounding[2] - bounding[0])
gheight = (bounding[3] - bounding[1])
if not gwidth or not gheight:
return
rate = em*percent/gwidth
#print gwidth, rate, em
# Don't excess the height
if rate*gheight > em:
rate = em*percent/gheight
matrix = psMat.scale(rate)
glyph.transform(matrix)
def ScaleToEm(percent, afont):
'''Scale a font to fit 5% less than the em.'''
em = afont.ascent + afont.descent
center = (afont.ascent - afont.descent)/2
lbearing = int(em*0.05/2)
if not percent:
ret = fontforge.askString('Scale Percent?',
'Percent of Line Height (em)?', '90' )
if not ret:
return
try:
percent = float(ret)/100
if percent <= 0 or percent > 1:
raise ValueError
except ValueError:
fontforge.postError('Wrong Percent!', "Need a value <= 100.")
return
for glyph in afont.selection.byGlyphs:
fit_glyph(glyph, em, percent)
#center_glyph(glyph, center, lbearing) # Maybe not move glyph?
center_glyph_height(glyph, center)
def get_max_size(afont):
'''Get the max size of the selected glyphs.'''
wmax = 0
hmax = 0
for glyph in afont.selection.byGlyphs:
bbox = glyph.boundingBox()
wmax = max(wmax, bbox[2] - bbox[0])
hmax = max(hmax, bbox[3] - bbox[1])
em = afont.ascent + afont.descent
wpct = wmax and em/wmax*100
hpct = hmax and em/hmax*100
return wmax, hmax, wpct, hpct
def GetSelectedBound(junk, afont):
'''Show max height and width of the selected glyphs.'''
wmax, hmax, wpct, hpct = get_max_size(afont)
msg = ('The max width and height of the selected glyphs are:\n'
'Points:\t%d\t%d\nScale Factor to 100%%:\t%.3f\t %.3f%%')
msg = msg % (wmax, hmax, wpct, hpct)
fontforge.postError('Max Demension', msg)
if fontforge.hasUserInterface():
fontforge.registerMenuItem(GetSelectedBound, None, None, "Font", None,
"Metrics", "Max Selected Size");
fontforge.registerMenuItem(CenterHeight, None, None, "Font", None, "Metrics",
"Center in Height");
fontforge.registerMenuItem(CenterGlyph, None, None, "Font", None, "Metrics",
"Center in Glyph");
fontforge.registerMenuItem(ScaleToEm, None, None, "Font", None, "Transform",
"Scale to Em");
No preview for this file type
#!/bin/bash
timestamp=$(date "+%F +%T" )
#timestamp=$(date +%s)
for D in `ls /var/www/Magento/SPV3_Bilder/Alben/Bilder`; do
for F in `ls /var/www/Magento/SPV3_Bilder/Alben/Bilder/${D}`;do
mv /var/www/Magento/SPV3_Bilder/Alben/Bilder/${D}/${F} /var/www/Magento/magento/media/anc/image//admin/1/original/${F}
echo "INSERT INTO magento19_spv3.mag_anc_image_ncimage ( customer_id, admin_user_id, path, file,ncalbum_id,created_at) VALUES ('0', '1', 'media/anc/image//admin/1/original/${F}', '${F}', '${D}','${timestamp}');"
done | mysql -uspv3 -pxGr5ZuopTr45gZpl1R5t4EsrwftzuIo magento19_spv3;
#done
done
\ No newline at end of file
select "-- AncImage lösche Datenbank Tabellen";
select "-- lösche mag_core_resource / anc_image_setup";
DELETE FROM `mag_core_resource` WHERE `mag_core_resource`.`code` = 'anc_image_setup';
select "-- lösche mag_anc_image_album";
DROP TABLE mag_anc_image_album;
select "-- lösche mag_anc_image_album_list";
DROP TABLE mag_anc_image_album_list;
select "-- lösche mag_anc_image_ncimage";
DROP TABLE mag_anc_image_ncimage;
select "-- lösche mag_anc_image_ncimage_quoteitemoption";
DROP TABLE mag_anc_image_ncimage_quoteitemoption;
\ No newline at end of file
#!/bin/bash
/bin/mkdir -p /usr/share/fonts/anc/
/bin/mkdir -p /var/www/Magento/Magento19/media/anc/image/fonts/insystem
/bin/rm /var/www/Magento/Magento19/media/anc/image/fonts/*.bmp
/bin/rm /var/www/Magento/Magento19/media/anc/image/fonts/*.svg
/bin/cp /var/www/Magento/Magento19/media/anc/image/fonts/*.ttf /usr/share/fonts/anc/
/bin/cp /var/www/Magento/Magento19/media/anc/image/fonts/*.ttf /var/www/Magento/Magento19/media/anc/image/fonts/insystem
/bin/rm /var/www/Magento/Magento19/media/anc/image/fonts/*.ttf
#cp /var/www/Magento/Magento19/media/anc/image/fonts/*.otf /usr/share/fonts/anc/
#cp /var/www/Magento/Magento19/media/anc/image/fonts/*.otf /var/www/Magento/Magento19/media/anc/image/fonts/insystem
#rm /var/www/Magento/Magento19/media/anc/image/fonts/*.otf
/usr/bin/fc-cache -fv
\ No newline at end of file
This diff could not be displayed because it is too large.
#!/bin/bash
INFILE="$1"
NAME="$2"
PATH="$3" #/var/www/Magento/Magento19/media/anc/tmp/fonts/#
FONTCHAR="$4"
cd ${PATH}
echo /usr/bin/convert $INFILE ${PATH}${NAME}.bmp
/usr/bin/convert $INFILE ${PATH}${NAME}.bmp
/usr/bin/potrace -s ${PATH}${NAME}.bmp
/usr/bin/python2.7 /var/www/Magento/AncImage/ancSetup/pythonfontforge.py ${NAME} ${PATH} ${FONTCHAR}
/bin/bash /var/www/Magento/AncImage/ancSetup/fontscrontab.sh
/bin/mkdir -p /usr/share/fonts/anc/
/bin/mkdir -p /var/www/Magento/Magento19/media/anc/image/fonts/insystem
/bin/rm /var/www/Magento/Magento19/media/anc/image/fonts/*.bmp
/bin/rm /var/www/Magento/Magento19/media/anc/image/fonts/*.svg
/bin/cp /var/www/Magento/Magento19/media/anc/image/fonts/*.ttf /usr/share/fonts/anc/
/bin/cp /var/www/Magento/Magento19/media/anc/image/fonts/*.ttf /var/www/Magento/Magento19/media/anc/image/fonts/insystem
/bin/rm /var/www/Magento/Magento19/media/anc/image/fonts/*.ttf
/usr/bin/fc-cache -fv
#!/bin/bash
INFILE="$1"
NAME="$2"
PATH="$3" #/var/www/Magento/Magento19/media/anc/tmp/fonts/#
FONTCHAR="$4"
cd ${PATH}
echo /usr/bin/convert $INFILE ${PATH}${NAME}.bmp
/usr/bin/convert $INFILE ${PATH}${NAME}.bmp
/usr/bin/potrace -s ${PATH}${NAME}.bmp
/usr/bin/python2.7 /var/www/Magento/AncImage/ancSetup/pythonfontforge.py ${NAME} ${PATH} ${FONTCHAR}
/bin/bash /var/www/Magento/AncImage/ancSetup/fontscrontab.sh
/bin/mkdir -p /usr/share/fonts/anc/
/bin/mkdir -p /var/www/Magento/Magento19/media/anc/image/fonts/insystem
/bin/rm /var/www/Magento/Magento19/media/anc/image/fonts/*.bmp
/bin/rm /var/www/Magento/Magento19/media/anc/image/fonts/*.svg
/bin/cp /var/www/Magento/Magento19/media/anc/image/fonts/*.ttf /usr/share/fonts/anc/
/bin/cp /var/www/Magento/Magento19/media/anc/image/fonts/*.ttf /var/www/Magento/Magento19/media/anc/image/fonts/insystem
/bin/rm /var/www/Magento/Magento19/media/anc/image/fonts/*.ttf
/usr/bin/fc-cache -fv
import sys
import os
import fontforge #Load the module
import psMat
import centerglyph
def center_glyph(glyph, vcenter=0, lbearing=15, rbearing=None):
'''Center a glyph.'''
# Shift width
if not rbearing:
rbearing = lbearing
bounding = glyph.boundingBox() # xmin,ymin,xmax,ymax
width = (bounding[2] - bounding[0])
width_new = width+(lbearing+rbearing)
glyph.width = width_new
glyph.left_side_bearing = lbearing
glyph.right_side_bearing = rbearing
# Shift Height
center_glyph_height(glyph, vcenter, bounding)
def fit_glyph_height(glyph, em, percent=0.95):
'''Scale a glyph verticaly to fit the width.'''
bounding = glyph.boundingBox() # xmin, ymin, xmax, ymax
gwidth = (bounding[2] - bounding[0])
gheight = (bounding[3] - bounding[1])
if not gwidth or not gheight:
return
rate = em*percent/gheight
#print gwidth,gheight, rate, em, percent
# Don't excess the height
#if rate*gwidth > em:
# rate = em*percent/gwidth
matrix = psMat.scale(rate,rate)
#print matrix
glyph.transform(matrix)
def center_glyph_height(glyph, vcenter, abound=None):
bounding = abound or glyph.boundingBox() # xmin,ymin,xmax,ymax
glyphcenter = (bounding[3] - bounding[1])/2+bounding[1]
deltay = vcenter - glyphcenter
matrix = psMat.translate(0, deltay)
glyph.transform(matrix)
print ('start')
font = fontforge.font()
fontfile = sys.argv[1]
fontpath = sys.argv[2]
fontchar = sys.argv[3]
glyph = font.createMappedChar(fontchar)
glyph.importOutlines(fontpath+fontfile+'.svg')
##
# Aufruf um Glyph hoehe auf Maximal zu skalieren und zu positionieren (hoehe und breite werden gleich skaliert)
#
fit_glyph_height(glyph, 1000, 0.95)
center_glyph(glyph, 0, 15, None)
print( font )
font.fullname = fontfile+' Font Medium'
font.familyname = fontfile+' Font'
font.fontname = fontfile+'FontMedium'
font.weight = 'medium'
font.round() # this one is needed to make simplify more reliable
font.removeOverlap()
font.round()
font.autoHint()
glyph.getPosSub('*')
font.generate(fontpath+fontfile+'.ttf')
#font.generate(fontpath+fontfile+'.otf', flags=("round", "opentype"))
No preview for this file type
import sys
import os
import fontforge #Load the module
import psMat
import centerglyph
def center_glyph(glyph, vcenter=0, lbearing=15, rbearing=None):
'''Center a glyph.'''
# Shift width
if not rbearing:
rbearing = lbearing
bounding = glyph.boundingBox() # xmin,ymin,xmax,ymax
width = (bounding[2] - bounding[0])
width_new = width+(lbearing+rbearing)
glyph.width = width_new
glyph.left_side_bearing = lbearing
glyph.right_side_bearing = rbearing
# Shift Height
center_glyph_height(glyph, vcenter, bounding)
def center_glyph_height(glyph, vcenter, abound=None):
bounding = abound or glyph.boundingBox() # xmin,ymin,xmax,ymax
glyphcenter = (bounding[3] - bounding[1])/2+bounding[1]
deltay = vcenter - glyphcenter
matrix = psMat.translate(0, deltay)
glyph.transform(matrix)
def CenterGlyph(junk, afont):
'''Main function.'''
center = (afont.ascent - afont.descent)/2
# total 5% margin
em = afont.ascent + afont.descent
lbearing = int(em*0.05/2)
for glyph in afont.selection.byGlyphs:
center_glyph(glyph, center, lbearing)
def CenterHeight(junk, afont):
'''Main function.'''
center = (afont.ascent - afont.descent)/2
for glyph in afont.selection.byGlyphs:
center_glyph_height(glyph, center)
def fit_glyph(glyph, em, percent=0.95):
'''Scale a glyph horizontally to fit the width.'''
bounding = glyph.boundingBox() # xmin, ymin, xmax, ymax
gwidth = (bounding[2] - bounding[0])
gheight = (bounding[3] - bounding[1])
if not gwidth or not gheight:
return
rate = em*percent/gwidth
#print gwidth, rate, em
# Don't excess the height
if rate*gheight > em:
rate = em*percent/gheight
matrix = psMat.scale(rate)
glyph.transform(matrix)
def fit_glyph_height(glyph, em, percent=0.95):
'''Scale a glyph verticaly to fit the width.'''
bounding = glyph.boundingBox() # xmin, ymin, xmax, ymax
gwidth = (bounding[2] - bounding[0])
gheight = (bounding[3] - bounding[1])
if not gwidth or not gheight:
return
rate = em*percent/gheight
print gwidth,gheight, rate, em, percent
# Don't excess the height
#if rate*gwidth > em:
# rate = em*percent/gwidth
matrix = psMat.scale(rate,rate)
#print matrix
glyph.transform(matrix)
def ScaleToEm(percent, afont):
'''Scale a font to fit 5% less than the em.'''
em = afont.ascent + afont.descent
center = (afont.ascent - afont.descent)/2
lbearing = int(em*0.05/2)
if not percent:
ret = fontforge.askString('Scale Percent?',
'Percent of Line Height (em)?', '90' )
if not ret:
return
try:
percent = float(ret)/100
if percent <= 0 or percent > 1:
raise ValueError
except ValueError:
fontforge.postError('Wrong Percent!', "Need a value <= 100.")
return
for glyph in afont.selection.byGlyphs:
fit_glyph(glyph, em, percent)
#center_glyph(glyph, center, lbearing) # Maybe not move glyph?
center_glyph_height(glyph, center)
def get_max_size(afont):
'''Get the max size of the selected glyphs.'''
wmax = 0
hmax = 0
for glyph in afont.selection.byGlyphs:
bbox = glyph.boundingBox()
wmax = max(wmax, bbox[2] - bbox[0])
hmax = max(hmax, bbox[3] - bbox[1])
em = afont.ascent + afont.descent
wpct = wmax and em/wmax*100
hpct = hmax and em/hmax*100
return wmax, hmax, wpct, hpct
def GetSelectedBound(junk, afont):
'''Show max height and width of the selected glyphs.'''
wmax, hmax, wpct, hpct = get_max_size(afont)
msg = ('The max width and height of the selected glyphs are:\n'
'Points:\t%d\t%d\nScale Factor to 100%%:\t%.3f\t %.3f%%')
msg = msg % (wmax, hmax, wpct, hpct)
fontforge.postError('Max Demension', msg)
print ('start')
font = fontforge.font()
#font_in = "/home/dev/git/Magento/AncImage/ancSetup/ancfont.sfd"
#font_in = "/home/dev/git/Magento/AncImage/ancSetup/movie.sfd"
#font = fontforge.open(font_in)
#ScaleToEm(10,font)
fontfile = sys.argv[1]
fontpath = sys.argv[2]
fontchar = sys.argv[3]
# Create a char in the unicode 41 pos (an "A")
#glyph = font.createChar(41, 'B')
glyph = font.createMappedChar(fontchar)
glyph.importOutlines(fontpath+fontfile+'.svg')
#print(glyph.boundingBox())
#print(glyph.activeLayer)
#glyph.removeoverlap()
#GetSelectedBound(glyph ,font)
#print (get_max_size(font))
##
#Keine Ahnung Warum aber so funzt es allerdings buggy
#
#fit_glyph(glyph, 1000, 1)
#fit_glyph(glyph, 1000,0.5);
fit_glyph_height(glyph, 1000, 0.95)
#CenterHeight(glyph, font)
#CenterMain(glyph, font)
center_glyph(glyph, 0, 15, None)
#matrix = psMat.scale(2,.5)
#glyph.transform(matrix)
#CenterHeight(glyph,font)
#matrix = psMat.translate(0,-1800)
#glyph.transform(matrix)
print(glyph.width)
#glyph.intersect()
#font['a'].unicode
glyph = font.createMappedChar('a')
glyph.importOutlines(fontpath+fontfile+'.svg')
#glyph.importOutlines()
#print( glyph.width )
print( font )
# Write the font from memory to a TTF file
font.fullname = fontfile+' Font Medium'
font.familyname = fontfile+' Font'
font.fontname = fontfile+'FontMedium'
font.weight = 'medium'
font.round() # this one is needed to make simplify more reliable
#font.simplify()
font.removeOverlap()
font.round()
font.autoHint()
#font.em =200
#font.addExtrema()
glyph.getPosSub('*')
font.generate(fontpath+fontfile+'.ttf')
#font.generate(fontpath+fontfile+'.otf', flags=("round", "opentype"))
#print fontpath
#print fontfile
#print (font)
#amb=fontforge.open("Ambrosia.sfd") #Open a font
#amb.selection.select(("ranges",None),"A","Z") #select A-Z
#amb.copy() #Copy those glyphs into the clipboard
#n=fontforge.font() #Create a new font
#n.selection.select(("ranges",None),"A","Z") #select A-Z of it
#n.paste() #paste the glyphs above in
#print n["A"].foreground #test to see that something
# actually got pasted
#n.fontname="NewFont" #Give the new font a name
#n.save("NewFont.sfd") #and save it.
#!/bin/bash
APPBASE="Anc"
APPNAME="Image"
APPBASELC="anc"
APPNAMELC="image"
APPDIR="/var/www/$2/${APPBASE}${APPNAME}"
echo "############"
echo "###########"
echo "########## Setup Script für ${APPBASE}${APPNAME} $1 $2"
####
#
#
##
if [ "$3" = "TRUE" ];then
echo '*** !!! ACHTUNG NEWINSTALL = TRUE Datenbanken und Verzeichnisse der ${APPBASE}${APPNAME} werden gelöscht'
# CODE
echo "Lösche: rm -R $1/app/code/local/${APPBASE}/${APPNAME}"
rm -R "$1/app/code/local/${APPBASE}/${APPNAME}"
#ETC
echo "Lösche: $1/app/etc/modules/${APPBASE}_${APPNAME}.xml"
rm -R "$1/app/etc/modules/${APPBASE}_${APPNAME}.xml"
#Design Adminhtml
echo "Lösche: $1/app/design/adminhtml/base/default/layout/${APPBASELC}/${APPNAMELC}.xml"
rm -R "$1/app/design/adminhtml/base/default/layout/${APPBASELC}/${APPNAMELC}.xml"
echo "Lösche: $1/app/design/adminhtml/base/default/template/${APPBASELC}/${APPNAMELC}"
rm -R "$1/app/design/adminhtml/base/default/template/${APPBASELC}/${APPNAMELC}"
#Design Frontend
echo "Lösche: $1/app/design/frontend/base/default/layout/${APPBASELC}/${APPNAMELC}.xml"
rm -R "$1/app/design/frontend/base/default/layout/${APPBASELC}_${APPNAMELC}.xml"
echo "Lösche: $1/app/design/frontend/base/default/template/${APPBASELC}/${APPNAMELC}"
rm -R "$1/app/design/frontend/base/default/template/${APPBASELC}/${APPNAMELC}"
#JS
echo "Lösche: $1/js/${APPBASE}/${APPNAME}"
rm -R "$1/js/${APPBASE}/${APPNAME}"
#SKIN
echo "Lösche: $1/skin/frontend/base/default/css/${APPBASELC}/${APPNAMELC}"
rm -R "$1/skin/frontend/base/default/css/${APPBASELC}/${APPNAMELC}"
rm "$1/skin/adminhtml/base/default/css/${APPBASELC}/${APPNAMELC}"
exit 0
fi
###
# Code Local
#
##
if [ ! -d "$1/app/code/local/${APPBASE}" ];then
echo "*** Erstelle das Verzeichniss: $1/app/code/local/${APPBASE}"
mkdir "$1/app/code/local/${APPBASE}"
fi
if [ ! -d "$1/app/code/local/${APPBASE}/${APPNAME}" ];then
echo "*** Verlinke Verzeichniss: $APPDIR/app/code/local/${APPBASE}/${APPNAME} $1/app/code/local/${APPBASE}/${APPNAME}"
ln -s $APPDIR/app/code $1/app/code/local/${APPBASE}/${APPNAME}
fi
###
# etc
#
##
if [ ! -f "$1/app/etc/modules/${APPBASE}_${APPNAME}.xml" ];then
echo "*** Verlinke Datei: $1/app/etc/modules/${APPBASE}_${APPNAME}.xml"
ln -s $APPDIR/app/etc/modules/${APPBASE}_${APPNAME}.xml $1/app/etc/modules/${APPBASE}_${APPNAME}.xml
fi
###
# Design Adminhtml
#
##
#if [ ! -d "$1/app/design/frontend/base/default/layout" ];then
# echo "*** Erstelle das Verzeichniss: $1/app/design/frontend/base/default/layout"
# mkdir "$1/app/design/frontend/base/default/layout"
#fi
#if [ ! -d "$1/app/design/adminhtml/base/default/layout/${APPBASELC}" ];then
# echo "*** Erstelle das Verzeichniss: $1/app/design/adminhtml/base/default/layout/${APPBASELC}"
# mkdir "$1/app/design/adminhtml/base/default/layout/${APPBASELC}"
#fi
#if [ ! -f "$1/app/design/adminhtml/base/default/layout/${APPBASELC}/${APPNAMELC}.xml" ];then
# echo "*** Verlinke Datei: $APPDIR/app/design/adminhtml/layout/${APPBASELC}/${APPNAMELC}.xml $1/app/design/adminhtml/base/default/layout/${APPBASELC}/${APPNAMELC}.xml"
# ln -s $APPDIR/app/design/adminhtml/layout/${APPBASELC}/${APPNAMELC}.xml $1/app/design/adminhtml/base/default/layout/${APPBASELC}/${APPNAMELC}.xml
#fi
if [ ! -d "$1/app/design/adminhtml/base/default/template/${APPBASELC}" ];then
echo "*** Erstelle das Verzeichniss: $1/app/design/adminhtml/base/default/template/${APPBASELC}"
mkdir "$1/app/design/adminhtml/base/default/template/${APPBASELC}"
fi
if [ ! -d "$1/app/design/adminhtml/base/default/template/${APPBASELC}/${APPNAMELC}" ];then
echo "***### Verlinke Datei: $APPDIR/app/design/adminhtml/template $1/app/design/adminhtml/base/default/template/${APPBASELC}/${APPNAMELC}"
ln -s $APPDIR/app/design/adminhtml/template $1/app/design/adminhtml/base/default/template/${APPBASELC}/${APPNAMELC}
fi
###
# Design Frontend
#
##
if [ ! -d "$1/app/design/frontend/base/default/layout" ];then
echo "*** Erstelle das Verzeichniss: $1/app/design/frontend/base/default/layout"
mkdir "$1/app/design/frontend/base/default/layout"
fi
if [ ! -d "$1/app/design/frontend/base/default/layout/${APPBASELC}" ];then
echo "*** Erstelle das Verzeichniss: $1/app/design/frontend/base/default/layout/${APPBASELC}"
mkdir "$1/app/design/frontend/base/default/layout/${APPBASELC}"
fi
if [ ! -f "$1/app/design/frontend/base/default/layout/${APPBASELC}/${APPNAMELC}.xml" ];then
echo "*** Verlinke Datei: $APPDIR/app/design/frontend/layout/${APPBASELC}/${APPNAMELC}.xml $1/app/design/frontend/base/default/layout/${APPBASELC}/${APPNAMELC}.xml"
# ln -s $APPDIR/app/design/frontend/layout/${APPBASELC}_${APPNAMELC}.xml $1/app/design/frontend/base/default/layout/${APPBASELC}_${APPNAMELC}.xml
ln -s $APPDIR/app/design/frontend/layout/${APPNAMELC}.xml $1/app/design/frontend/base/default/layout/${APPBASELC}/${APPNAMELC}.xml
fi
if [ ! -d "$1/app/design/frontend/base/default/template" ];then
echo "*** Erstelle das Verzeichniss: $1/app/design/frontend/base/default/template"
mkdir "$1/app/design/frontend/base/default/template"
fi
if [ ! -d "$1/app/design/frontend/base/default/template/${APPBASELC}" ];then
echo "*** Erstelle das Verzeichniss: $1/app/design/frontend/base/default/template/${APPBASELC}"
mkdir "$1/app/design/frontend/base/default/template/${APPBASELC}"
fi
if [ ! -d "$1/app/design/frontend/base/default/template/${APPBASELC}/${APPNAMELC}" ];then
echo "*** Verlinke Datei: $APPDIR/app/design/frontend/template/${APPBASELC}/${APPNAMELC} $1/app/design/frontend/base/default/template/${APPBASELC}/${APPNAMELC}"
ln -s $APPDIR/app/design/frontend/template $1/app/design/frontend/base/default/template/${APPBASELC}/${APPNAMELC}
fi
###
# js
#
##
if [ ! -d "$1/js/${APPBASE}" ];then
echo "*** Erstelle das Verzeichniss: $1/js/${APPBASE}"
mkdir "$1/js/${APPBASE}"
fi
if [ ! -d "$1/js/${APPBASE}/${APPNAME}" ];then
echo "*** Verlinke Verzeichniss: $APPDIR/js $1/js/${APPBASE}/${APPNAME}"
ln -s $APPDIR/js $1/js/${APPBASE}/${APPNAME}
fi
###
# skin
#
##
if [ ! -d "$1/skin/frontend/base/default/css/${APPBASELC}" ];then
echo "*** Erstelle das Verzeichniss: $1/skin/frontend/base/default/css/${APPBASELC}"
mkdir -p "$1/skin/frontend/base/default/css/${APPBASELC}"
fi
if [ ! -d "$1/skin/frontend/base/default/css/${APPBASELC}/${APPNAMELC}" ];then
echo "*** Verlinke Verzeichniss: $APPDIR/js $1/skin/frontend/base/default/css/${APPBASELC}/${APPNAMELC}"
ln -s $APPDIR/skin/frontend/css $1/skin/frontend/base/default/css/${APPBASELC}/${APPNAMELC}
fi
if [ ! -d "$1/skin/frontend/base/default/images/${APPBASELC}" ];then
echo "*** Erstelle das Verzeichniss: $1/skin/frontend/base/default/images/${APPBASELC}"
mkdir -p "$1/skin/frontend/base/default/images/${APPBASELC}"
fi
if [ ! -d "$1/skin/frontend/base/default/images/${APPBASELC}/${APPNAMELC}" ];then
echo "*** Verlinke Verzeichniss: $APPDIR/js $1/skin/frontend/base/default/images/${APPBASELC}/${APPNAMELC}"
ln -s $APPDIR/skin/frontend/images $1/skin/frontend/base/default/images/${APPBASELC}/${APPNAMELC}
fi
###
# skin Adminhtml
#
##
if [ ! -d "$1/skin/adminhtml/base/default/css/${APPBASELC}" ];then
echo "*** Erstelle das Verzeichniss: $1/skin/frontend/base/default/css/${APPBASELC}"
mkdir -p "$1/skin/adminhtml/base/default/css/${APPBASELC}"
fi
if [ ! -d "$1/skin/adminhtml/base/default/css/${APPBASELC}/${APPNAMELC}" ];then
echo "*** Verlinke Verzeichniss: $APPDIR/skin/adminhtml/css $1/skin/adminhtml/base/default/css/${APPBASELC}/${APPNAMELC}"
ln -s $APPDIR/skin/adminhtml/css $1/skin/adminhtml/base/default/css/${APPBASELC}/${APPNAMELC}
fi
<?php
/**
* @package anc_image
* @category magento
* @mailto code [at] netz.coop
* @author netz.coop eG*
* @copyright (c) 2014, netz.coop eG
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
class Anc_Image_Block_Adminhtml_Admingallery extends Mage_Core_Block_Template{
/**
* gibt eingeloggten Benutzer zurück
*
* @return type
*/
public function getCustomer() {
return Mage::getSingleton('customer/session')->getCustomer();
}
/**
*
* @return Collection
*/
public function getNcImages() {
$params=$this->getRequest()->getParams();
return Mage::helper('anc_image/ncmodel')->getNcImagesForAlbum($params['id']);
// return Mage::helper('anc_image/ncmodel')->getNcImagesForCustomer();
}
/**
*
*/
public function getCallNcImage() {
$params=$this->getRequest()->getParams();
$ncimage = Mage::helper('anc_image/ncmodel')->getNcImage($params['id']);
return $ncimage;
}
public function getNcImageMetaData($param_ncimage_id) {
return Mage::helper('anc_image/ncmodel')->getNcImageMetaData($param_ncimage_id);
}
protected function getNcImagePath($param_ncimage_id) {
return Mage::helper('anc_image/ncimage')->getNcImagePath($param_ncimage_id, 'relative', 'original');
}
// existiert _toHtml() wird das template gar nicht erst mehr aufgerufen
// protected function _toHtml()
// {
// return 'Hallo Welt!';
// }
}
<?php
/**
* @package anc_image
* @category magento
* @mailto code [at] netz.coop
* @author netz.coop eG*
* @copyright (c) 2014, netz.coop eG
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
class Anc_Image_Block_Adminhtml_Catalog_Product_Edit_Tab_Options_Option
extends Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Options_Option
{
/**
* Class constructor
*/
public function __construct()
{
// D::li('Anc_Image_Block_Adminhtml_Catalog_Product_Edit_Tab_Options_Option');
parent::__construct();
$this->setTemplate('anc/image/catalog/product/edit/options/option.phtml');
}
/**
* Retrieve html templates for different types of product custom options
* @eingabetyp_Redundanz
* @return string
*/
public function getTemplatesHtml()
{
$canEditPrice = $this->getCanEditPrice();
$canReadPrice = $this->getCanReadPrice();
$this->getChild('ancplaylist_option_type')
->setCanReadPrice($canReadPrice)
->setCanEditPrice($canEditPrice);
$this->getChild('ancimage_option_type')
->setCanReadPrice($canReadPrice)
->setCanEditPrice($canEditPrice);
$this->getChild('anctext_option_type')
->setCanReadPrice($canReadPrice)
->setCanEditPrice($canEditPrice);
$this->getChild('ancaddressimport_option_type')
->setCanReadPrice($canReadPrice)
->setCanEditPrice($canEditPrice);
$templates = parent::getTemplatesHtml() . "\n" .
$this->getChildHtml('ancplaylist_option_type').
$this->getChildHtml('ancimage_option_type').
$this->getChildHtml('anctext_option_type').
$this->getChildHtml('ancaddressimport_option_type');
return $templates;
}
}
\ No newline at end of file
<?php
/**
* @package anc_image
* @category magento
* @mailto code [at] netz.coop
* @author netz.coop eG*
* @copyright (c) 2014, netz.coop eG
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @anc_image_eingabetyp - _Block_Adminhtml_ Formular im Backend beim Produkt editieren
*
*/
class Anc_Image_Block_Adminhtml_Catalog_Product_Edit_Tab_Options_Type_Ancimage extends
Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Options_Type_Abstract
{
public function __construct()
{
parent::__construct();
// D::li('Anc_Image_Block_Adminhtml_Catalog_Product_Edit_Tab_Options_Type_Ancimage',1,1);
$this->setTemplate('anc/image/catalog/product/edit/options/type/ancimage.phtml');
}
}
\ No newline at end of file
<?php
/**
* @package anc_image
* @category magento
* @mailto code [at] netz.coop
* @author netz.coop eG*
* @copyright (c) 2014, netz.coop eG
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
class Anc_Image_Block_Adminhtml_Images extends Mage_Adminhtml_Block_Widget_Grid_Container {
public function __construct() {
//where is the controller
$this->_controller = 'adminhtml_images';
$this->_blockGroup = 'anc_image';
$this->_headerText = Mage::helper('anc_image/data')->__('Bilder');
// //value of the add button
$this->_addButtonLabel = Mage::helper('anc_image/data')->__('Bilder erstellen');
parent::__construct();
}
public function getCreateUrl()
{
$varParam = $this->getRequest()->getParams();
if (array_key_exists('albumid', $varParam)) {
$var_album= '/albumid/'.$varParam['albumid'];
}
/**
* Wichtig für Add Button
*/
return $this->getUrl(
'image/adminhtml_image/edit'.$var_album
);
}
}
<?php
/**
* @package anc_image
* @category magento
* @mailto code [at] netz.coop
* @author netz.coop eG*
* @copyright (c) 2014, netz.coop eG
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
class Anc_Image_Block_Adminhtml_Images_Edit
extends Mage_Adminhtml_Block_Widget_Form_Container
{
public function __construct()
{
parent::__construct();
$this->_controller = 'images';
$this->_blockGroup = 'anc_image_adminhtml';
$this->_addButton('saveandcontinue', array(
'label' => Mage::helper('adminhtml')->__('Speichern und Bearbeitung fortsetzen'),
'onclick' => 'saveAndContinueEdit()',
'class' => 'save',
), -100);
$this->_updateButton('save', 'label', $this->__('Save'));
$varparams = $this->getRequest()->getParams();
$this->_updateButton('delete', 'label', $this->__('Delete'));
if($varparams['albumid']){
$data = array(
'label' => 'Zurück zum Album',
'onclick' => 'setLocation(\'' . $this->getUrl('*/*/list',array('albumid'=>$varparams['albumid'])) . '\')',
'class' => 'back'
);
}else{
$data = array(
'label' => 'Zurück',
'onclick' => 'setLocation(\'' . $this->getUrl('*/*/list') . '\')',
'class' => 'back'
);
}
$this->addButton ('my_back', $data, 0, 100, 'header');
$this->_removeButton('back');
$this->_formScripts[] = "
function saveAndContinueEdit(){
editForm.submit($('edit_form').action+'back/edit/');
}
";
}
public function getHeaderText()
{
return Mage::helper('anc_album/data')->__('Album Container');
}
}
\ No newline at end of file
<?php
/**
* @package anc_image
* @category magento
* @mailto code [at] netz.coop
* @author netz.coop eG*
* @copyright (c) 2014, netz.coop eG
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
class Anc_Image_Block_Adminhtml_Images_Edit_Form extends Mage_Adminhtml_Block_Widget_Form {
protected function _prepareForm() {
//echo 'test3';
if (Mage::registry('anc_image')) {
$data = Mage::registry('anc_image')->getData();
} else {
$data = array();
}
$form = new Varien_Data_Form(array(
'id' => 'edit_form',
'action' => $this->getUrl('*/*/save', array('id' => $this->getRequest()->getParam('id'))),
'method' => 'post',
'enctype' => 'multipart/form-data'
)
);
$form->setUseContainer(true);
$this->setForm($form);
$form->setValues($data);
return parent::_prepareForm();
}
}
\ No newline at end of file
<?php
/**
* @package anc_image
* @category magento
* @mailto code [at] netz.coop
* @author netz.coop eG*
* @copyright (c) 2014, netz.coop eG
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
class Anc_Image_Block_Adminhtml_Images_Edit_Tab_Content extends Mage_Adminhtml_Block_Widget_Form {
protected function _prepareForm() {
if (Mage::registry('anc_image')) {
$data = Mage::registry('anc_album')->getData();
} else {
$data = array();
}
$form = new Varien_Data_Form();
$this->setForm($form);
$fieldset = $form->addFieldset('anc_album', array('name' => 'Info'));//Mage::helper('news')->__('news information')));
$form->setValues($data);
return parent::_prepareForm();
}
}
<?php
/**
* @package anc_image
* @category magento
* @mailto code [at] netz.coop
* @author netz.coop eG*
* @copyright (c) 2014, netz.coop eG
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
class Anc_Image_Block_Adminhtml_Images_Edit_Tab_Form extends Mage_Adminhtml_Block_Widget_Form {
protected function _prepareForm() {
$admin_id = Mage::getSingleton('admin/session')->getUser()->getId();
if (Mage::registry('anc_image')) {
$data = Mage::registry('anc_image')->getData();
} else {
$data = array();
}
if (strpos($data['path'], "/media/") === 0) {
$data['path'] = substr($data['path'], 7);
$data['path'] = dirname($data['path']) . '/';
}
$varParam = $this->getRequest()->getParams();
// D::s($data,'data',5,1,1);
// $varurlimage = $this->getUrl('lib/adminhtml_ncrights/edit', $arrayurl());
$imageurl = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB) .$data['path'] ;
if( $data['file']){
echo '<img src="'.$imageurl.'" style="height:100px"></img>';
}
$form = new Varien_Data_Form(array(
'id' => 'edit_form',
'action' => $this->getUrl('*/*/save', array('id' => $this->getRequest()->getParam('id'))),
'method' => 'post',
'enctype' => 'multipart/form-data'
));
$this->setForm($form);
$fieldset = $form->addFieldset('anc_image', array('name' => 'name')); //Mage::helper('news')->__('news information')));
// D::s($data,'$data',5,1,1);
if ($data['path'] && $data['file']) {
// echo '<img src="' . $data['path'] . $data['file'] . '" alt = "' . $data['file'] . '" />';
}
$fieldset->addField('name', 'text', array(
'label' => Mage::helper('anc_image/data')->__('Name'),
// 'class' => 'required-entry',
'required' => false,
'name' => 'name',
));
$fieldset->addField('comment', 'textarea', array(
'label' => Mage::helper('anc_image/data')->__('Comment'),
// 'class' => 'required-entry',
'required' => false,
'name' => 'comment',
));
if ($varParam['kind'] === 'users' || $data['customer_id'] > 0) {
$fieldset->addField('customer_id', 'text', array(
'label' => Mage::helper('anc_album/data')->__('Customer Id'),
'class' => 'required-entry',
'required' => true,
'name' => 'customer_id',
));
}
$fieldset->addField('path', 'text', array(
'label' => Mage::helper('anc_image/data')->__('Pfad'),
'value' => 'anc/image/admin/' . $admin_id . '/original/',
'class' => 'required-entry',
'required' => true,
'name' => 'path',
));
// $fieldset->addField('file', 'text', array(
// 'label' => Mage::helper('anc_image/data')->__('Datei'),
// 'class' => 'required-entry',
// 'required' => true,
// 'name' => 'file',
// ));
$array = Mage::helper('anc_lib/sql')->selectFetchAll(
'anc_album_ncalbum');
// D::s($array,'$array',5,1,1);
$arrayoptions = array('-1' => 'Bitte wählen..');
foreach ($array as $key => $value) {
$arrayoptions[$value['entity_id']] = $value['name'];
}
// $testarray=array('-1'=>'Please Select..','1' => 'Option1','2' => 'Option2', '3' => 'Option3');
// D::s($arrayoptions,'$array',5,1,1);
// D::s($testarray,'$testarray',5,1,1);
// $varParam = $this->getRequest()->getParams();
if (array_key_exists('albumid', $varParam)) {
$var_album_id = $varParam['albumid'];
}
$fieldset->addField('ncalbum_id', 'select', array(
'label' => Mage::helper('anc_album/data')->__('Album'),
'class' => 'required-entry',
'required' => true,
'name' => 'ncalbum_id',
'onclick' => "",
'onchange' => "",
'value' => $var_album_id,
'values' => $arrayoptions,
'disabled' => false,
'readonly' => false,
));
$arrayoptions = array('0' => 'Standard');
// foreach ($array as $key => $value) {
$arrayoptions['A'] = 'Unterschrift';
// }
// $testarray=array('-1'=>'Please Select..','1' => 'Option1','2' => 'Option2', '3' => 'Option3');
// D::s($arrayoptions,'$array',5,1,1);
// D::s($testarray,'$testarray',5,1,1);
// $varParam = $this->getRequest()->getParams();
if (array_key_exists('issignature', $varParam)) {
$var_advertising = $varParam['issignature'];
}
$fieldset->addField('issignature', 'select', array(
'label' => Mage::helper('anc_album/data')->__('Typ'),
'class' => 'required-entry',
'required' => true,
'name' => 'issignature',
'onclick' => "",
'onchange' => "",
'value' => $var_advertising,
'values' => $arrayoptions,
'disabled' => false,
'readonly' => false,
));
// $varurlplaylists = $this->getUrl('site/adminhtml_playlist/list', array('id' => $data['entity_id'],));
$arrayurl = array('imageid' => $data['entity_id']);
if ($data['ncright_id'] > 0) {
$arrayurl['id'] = $data['ncright_id'];
}
$varurlrights = $this->getUrl('lib/adminhtml_ncrights/edit', $arrayurl
);
$fieldset->addType('ancbutton', 'Anc_Album_Lib_Varien_Data_Form_Element_ExtendedLabel');
if($varParam['id']){
$fieldset->addField('myrights', 'ancbutton', array(
'label' => 'Rechte verwalten',
'name' => 'myrights',
'required' => false,
'value' => $varurlrights,
'bold' => true,
'label_style' => '',
));
}
// $fieldset->addField('mysaveandcontinue', 'ancbutton', array(
// 'label' => 'Speichern und weiter bearbeiten',
// 'name' => 'mysaveandcontinue',
// 'required' => false,
// 'value' => $this->getUrl('*/*/save', array( '_current' => true, 'back' => 'edit',)),
// 'bold' => true,
// 'label_style' => '',
// ));
// $fieldset->addField('linkrights', 'link', array(
// 'label' => "zu:",
// 'style' => "test",
// 'href' => $this->getUrl('site/adminhtml_playlist/list', array('id' => $data['entity_id'],)),
// 'value' => 'Rechte verwalten',
// 'name' => 'linkrights',
// 'after_element_html' => ''
// ));
/**
* Setzen der Hidden Id für Admin muss über den $data array erfolgen da sonst Magento für neue Elemente 0 setzt
*/
if ($varParam['kind'] === 'users' || $data['customer_id'] > 0) {
} else {
$data['admin_user_id'] = $admin = Mage::getSingleton('admin/session')->getUser()->getId();
$fieldset->addField('admin_user_id', 'hidden', array('name' => 'admin_user_id'));
}
if ($varParam['albumid'] === 'users' || $data['customer_id'] > 0) {
} else {
$data['albumid'] = $varParam['albumid'];
$fieldset->addField('albumid', 'hidden', array('name' => 'albumid'));
}
// D::s($data,'$data',5,1,1);
// $data['path']= 'media/serviceplus/image/';
$fieldset->addField('file', 'image', array(
'label' => Mage::helper('anc_album/data')->__('Upload'),
'required' => false,
// 'value' => 'media/serviceplus/image/'.$data['file'],
'name' => 'file',
// 'path'=> 'media/serviceplus/image/',
// 'disabled' => false,
// 'readonly' => true,
'after_element_html' => $data['file'],
// 'tabindex' => 1
));
if (!empty($data)) {
$form->addValues($data);
}
/*
* Damit das Bild als preview angezeigt wird
*/
$p = $form->getElement('file')->getValue();
$form->getElement('file')->setValue($data['path'] . $p);
return parent::_prepareForm();
}
}
<?php
/**
* @package anc_image
* @category magento
* @mailto code [at] netz.coop
* @author netz.coop eG*
* @copyright (c) 2014, netz.coop eG
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
class Anc_Image_Block_Adminhtml_Images_Edit_Tabs extends Mage_Adminhtml_Block_Widget_Tabs {
public function __construct() {
parent::__construct();
$this->setId('images_edit_tabs');
$this->setDestElementId('edit_form'); // this should be same as the form id define above
$this->setTitle('Images');
// echo 'a';
}
protected function _beforeToHtml() {
$this->addTab(
'form_section', array(
'label' => Mage::helper('anc_image/data')->__('Images Info'),//'Images Info', // Mage::helper('news')->__('News Information'),
'title' => Mage::helper('anc_image/data')->__('Images Info'),//'Images Info', //Mage::helper('news')->__('News Information'),
'content' => $this->getLayout()->createBlock('anc_image/adminhtml_images_edit_tab_form')->toHtml(),
'active' => true,
)
);
// $this->addTab('form_section1', array(
// 'label' => Mage::helper('anc_image/data')->__('Images Extras'),//'Images Extras', //Mage::helper('news')->__('Content'),
// 'title' => Mage::helper('anc_image/data')->__('Images Extras'),//'Images Extras', //Mage::helper('news')->__('Content'),
//// 'content' => $this->getLayout()->createBlock('anc_image/adminhtml_images_edit_tab_content')->toHtml(),
// ));
return parent::_beforeToHtml();
}
}
<?php
/**
* @package anc_album
* @category magento
* @mailto code [at] netz.coop
* @author netz.coop eG*
* @copyright (c) 2014, netz.coop eG
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
class Anc_Image_Block_Adminhtml_Images_Grid extends Mage_Adminhtml_Block_Widget_Grid {
public function __construct() {
parent::__construct();
$this->setId('anc_image_images_grid');
$this->setDefaultSort('entity_id');
$this->setDefaultDir('DESC');
$this->setSaveParametersInSession(true);
}
protected function _getCollectionClass() {
return 'anc_image/ncimage';
}
protected function _prepareCollection() {
$varParam = $this->getRequest()->getParams();
if (array_key_exists('albumid', $varParam)) {
$array = Mage::helper('anc_lib/sql')->selectFetchAll(
'anc_album_ncalbum', array('entity_id' => $varParam['albumid'])
);
echo "<h1>Bilder des Albums: " . $array[0]['name'] . " </h1>";
$collection = Mage::getModel('anc_image/ncimage')->getCollection()->addFieldToFilter('ncalbum_id', array('eq' => $varParam['albumid']));
;
} else if(array_key_exists('kind', $varParam)&& $varParam['kind']=='users') {
echo "<h1>Alle Bilder der Benutzer: </h1>";
echo '<a href="'.$this->getUrl('image/adminhtml_image/list', array('kind' => 'admin',)).'" >Bilder Admin</a>';
$collection = Mage::getModel('anc_image/ncimage')->getCollection()->addFieldToFilter('customer_id', array('gt' => 0))->addFieldToFilter('ordered', array('null' => true));;
;
} else {
echo "<h1>Alle Bilder der Administratoren: </h1>";
echo '<a href="'.$this->getUrl('image/adminhtml_image/list', array('kind' => 'users',)).'" >Bilder der Benutzer</a>';
$collection = Mage::getModel('anc_image/ncimage')->getCollection()->addFieldToFilter('admin_user_id', array('gt' => 0));
;
}
$this->setCollection($collection);
return parent::_prepareCollection();
}
protected function _prepareColumns() {
$this->addColumn('entity_id', array(
'header' => Mage::helper('anc_image/data')->__('Id'),
'align' => 'right',
'width' => '50px',
'index' => 'entity_id',
));
$this->addColumn('name', array(
'header' => Mage::helper('anc_image/data')->__('Name'),
'align' => 'left',
'index' => 'name',
));
$this->addColumn('comment', array(
'header' => Mage::helper('anc_image/data')->__('Comment'),
'align' => 'left',
'index' => 'comment',
));
$this->addColumn('admin_user_id', array(
'header' => Mage::helper('anc_image/data')->__('Admin'),
'align' => 'left',
'index' => 'admin_user_id',
));
$this->addColumn('customer_id', array(
'header' => Mage::helper('anc_image/data')->__('Customer'),
'align' => 'left',
'index' => 'customer_id',
));
$this->addColumn('path', array(
'header' => Mage::helper('anc_image/data')->__('Pfad'),
'align' => 'left',
'index' => 'path',
));
$this->addColumn('file', array(
'header' => Mage::helper('anc_image/data')->__('Datei'),
'align' => 'left',
'index' => 'file',
));
$this->addColumn('ncalbum_id', array(
'header' => Mage::helper('anc_image/data')->__('Album Id'),
'align' => 'left',
'index' => 'ncalbum_id',
));
$this->addColumn('ncright_id', array(
'header' => Mage::helper('anc_image/data')->__('Rechte Id'),
'align' => 'left',
'index' => 'ncright_id',
));
$this->addColumn('original_id', array(
'header' => Mage::helper('anc_image/data')->__('Eltern Id'),
'align' => 'left',
'index' => 'original_id',
));
$this->addColumn('created_at', array(
'header' => Mage::helper('anc_image/data')->__('Created'),
'align' => 'left',
'index' => 'created_at',
));
$this->addColumn('updated_at', array(
'header' => Mage::helper('anc_image/data')->__('Updated'),
'align' => 'left',
'index' => 'updated_at',
));
$this->addColumn('issignature', array(
'header' => Mage::helper('anc_image/data')->__('Unterschrift'),
'align' => 'left',
'index' => 'issignature',
));
$this->addColumn('font', array(
'header' => Mage::helper('anc_image/data')->__('Schriftname'),
'align' => 'left',
'index' => 'font',
));
return parent::_prepareColumns();
}
public function getRowUrl($row) {
$varParam = $this->getRequest()->getParams();
if (array_key_exists('albumid', $varParam)) {
// $var_album= '/albumid/'.$varParam['albumid'];
return $this->getUrl('*/*/edit', array('id' => $row->getId(),'albumid'=>$varParam['albumid']));
}else{
return $this->getUrl('*/*/edit', array('id' => $row->getId()));
}
}
public function getMainButtonsHtml()
{
$html = parent::getMainButtonsHtml();//get the parent class buttons
$addButton = $this->getLayout()->createBlock('adminhtml/widget_button') //create the add button
->setData(array(
'label' => Mage::helper('adminhtml')->__('Kunden Bild erstellen'),
'onclick' => "setLocation('".$this->getUrl('*/*/new',array('kind'=>'users'))."')",
'class' => 'task'
))->toHtml();
return $addButton.$html;
}
}
<?php
/**
* @package anc_image
* @category magento
* @mailto code [at] netz.coop
* @author netz.coop eG*
* @copyright (c) 2014, netz.coop eG
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
class Anc_Image_Block_Catalog_Product_View_Options_Type_Ancimage
extends Mage_Catalog_Block_Product_View_Options_Abstract
{
/**
* Returns default value to show in text input
*
* @return string
*/
public function getDefaultValue()
{
return $this->getProduct()->getPreconfiguredValues()->getData('options/' . $this->getOption()->getId());
}
}
\ No newline at end of file
<?php
/**
* @package anc_image
* @category magento
* @mailto code [at] netz.coop
* @author netz.coop eG*
* @copyright (c) 2014, netz.coop eG
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
class Anc_Image_Block_Galleriesmanager extends Mage_Core_Block_Template{
/**
* gibt eingeloggten Benutzer zurück
*
* @return type
*/
public function getCustomer() {
return Mage::getSingleton('customer/session')->getCustomer();
}
/**
*
* @return Collection
*/
public function getNcImages() {
return Mage::helper('anc_image/ncmodel')->getNcImagesForCustomer();
}
/**
*
*/
public function getCallNcImage() {
$params=$this->getRequest()->getParams();
$ncimage = Mage::helper('anc_image/ncmodel')->getNcImage($params['id']);
return $ncimage;
}
public function getNcImageMetaData($param_ncimage_id) {
return Mage::helper('anc_image/ncmodel')->getNcImageMetaData($param_ncimage_id);
}
protected function getNcImagePath($param_ncimage_id) {
return Mage::helper('anc_image/ncimage')->getNcImagePath($param_ncimage_id, 'relative', 'original');
}
// existiert _toHtml() wird das template gar nicht erst mehr aufgerufen
// protected function _toHtml()
// {
// return 'Hallo Welt!';
// }
}
<?php
/**
* @package anc_image
* @category magento
* @mailto code [at] netz.coop
* @author netz.coop eG*
* @copyright (c) 2014, netz.coop eG
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
class Anc_Image_Block_Options_Type_Customview_Ancimage
extends Mage_Core_Block_Template
{
protected $_template = 'anc/image/options/customview/ancimage.phtml';
}
\ No newline at end of file
<?php
/**
* @package anc_image
* @category magento
* @mailto code [at] netz.coop
* @author netz.coop eG*
* @copyright (c) 2014, netz.coop eG
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
class Anc_Image_Helper_Data extends Mage_Core_Helper_Abstract {
}
\ No newline at end of file
<?php
/**
* @package anc_image
* @category magento
* @mailto code [at] netz.coop
* @author netz.coop eG*
* @copyright (c) 2014, netz.coop eG
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
class Anc_Image_Helper_Ncconstant extends Mage_Core_Helper_Abstract {
/**
* @const SVGModul Bild
*/
private $ancSPImage = 'ancSPImage_KEY';
private $ancSPImage_KEY_cropH = 'ancSPImage_KEY_cropH';
private $ancSPImage_KEY_cropW = 'ancSPImage_KEY_cropW';
private $ancSPImage_KEY_imgH = 'ancSPImage_KEY_imgH';
private $ancSPImage_KEY_imgW = 'ancSPImage_KEY_imgW';
private $ancSPImage_KEY_imgInitH = 'ancSPImage_KEY_imgInitH';
private $ancSPImage_KEY_imgInitW = 'ancSPImage_KEY_imgInitW';
private $ancSPImage_KEY_imgX1 = 'ancSPImage_KEY_imgX1';
private $ancSPImage_KEY_imgY1 = 'ancSPImage_KEY_imgY1';
private $ancSPImage_KEY_cropfile = 'ancSPImage_KEY_cropfile';
/**
*
* @const SVGModul Bild - Individuelle Option NcImage > Bild
*/
private $ancSPAncImage = 'ancSPImage_KEY_ancimage';
private $ancSPAncImage_Size = 10;
// private $ancSPAncImageWidth = 'ancSPImage_KEY_width';
// private $ancSPAncImageHeight = 'ancSPImage_KEY_height';
public function __get($name) {
// D::li('Anc_Image_Helper_Ncconstant->'.$name,1,1);
return $this->$name;
}
public function isProductAncImage(Mage_Catalog_Model_Product $param_product) {
if(is_object($param_product)) {
if (strpos($param_product->getSku(), Mage::helper('anc_image/ncconstant')->ancSPImage) !== false) {
return true;
}
}
return false;
}
}
<?php
/**
* @package anc_image
* @category magento
* @mailto code [at] netz.coop
* @author netz.coop eG*
* @copyright (c) 2014, netz.coop eG
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
class Anc_Image_Helper_Ncfonts extends Mage_Core_Helper_Abstract {
public function nccreateFont($param_image, $param_userid,$param_font_char='A') {
$fontbasicname='Ancfont'.$param_userid;
$installpath='/var/www/Magento/Magento19/';
// $installpath='/var/www/serviceplus/magento';
$basicpath=$installpath."media/anc/image/fonts/";
if(!is_dir($basicpath)){
mkdir($basicpath, 0777, TRUE);
}
D::ulli("/usr/bin/sudo /var/www/Magento/AncImage/ancSetup/preparefont.sh " . $installpath.$param_image . " " . $fontbasicname. " " .$basicpath,1);
exec("/usr/bin/sudo /var/www/Magento/AncImage/ancSetup/preparefont.sh " . $installpath.$param_image . " " . $fontbasicname. " " .$basicpath.' '.$param_font_char ,$ary_return );
$fontname=$fontbasicname.'.ttf';
D::s($ary_return,' $ary_return',5,1);
if(!$ary_return[0]){
return FALSE;
}
return $fontname;
}
}
\ No newline at end of file
<?php
/**
* @package anc_image
* @category magento
* @mailto code [at] netz.coop
* @author netz.coop eG*
* @copyright (c) 2014, netz.coop eG
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
class Anc_Image_Helper_Ncimage extends Mage_Core_Helper_Abstract {
public function printAdminId() {
$admin_id = Mage::getSingleton('admin/session')->getUser()->getId();
}
public function getNcImageMetaDataAsHtml($param_ncimage_id) {
$Quoteitemoption_Collection = Mage::helper('anc_image/ncmodel')->getNcImageMetaData($param_ncimage_id);
$ncimage_quoteitemoptions = $Quoteitemoption_Collection->getItems();
$return_html = 'Dieses Bild haben Sie bis jetzt '.count($ncimage_quoteitemoptions).' mal verwendet! &#10;';
foreach($ncimage_quoteitemoptions as $ncimage_quoteitemoption) {
$return_html .= $ncimage_quoteitemoption->getOrdertime().' &#10;';
}
return $return_html;
}
/**
* return the path from the anc_image/ncimage with the $param_ncimage_id
*
* @param int $param_ncimage_id
* @param string $param_kindOfPath relative || absolute
* @param string $param_kindOfFile original || thumbnail
* @return string
*/
public function getNcImagePath($param_ncimage_id, $param_kindOfPath, $param_kindOfFile, $param_NoPrivacy=false) {
$ncimage = Mage::helper('anc_image/ncmodel')->getNcImage($param_ncimage_id);
if(is_object($ncimage)) {
$mainpath = $this->getMainPath($ncimage, $param_NoPrivacy);
if($mainpath) {
if($param_kindOfFile === 'original') {
} else if($param_kindOfFile === 'thumbnail') {
if($this->generateThumbnail($mainpath, $ncimage)) {
} else {
$param_kindOfFile = 'original';
}
} else {
D::ulli("getNcImagePath($param_ncimage_id, $param_kindOfPath, $param_kindOfFile) FALSE: kindoffile problem");
return false;
}
if(is_file($this->getPath('absolute', $this->getAncImagePath($param_kindOfFile).$mainpath, $param_kindOfFile, $ncimage))) {
return $this->getPath($param_kindOfPath, $this->getAncImagePath($param_kindOfFile).$mainpath, $param_kindOfFile, $ncimage);
} else {
D::ulli("getNcImagePath($param_ncimage_id, $param_kindOfPath, $param_kindOfFile) FALSE: datei existiert nicht +++ ".Mage::helper('anc_lib/ncfilepath')->getThisMagentoInstallationPath().$path.DS.$ncimage->getFile());
return false;
}
} else {
D::ulli("getNcImagePath($param_ncimage_id, $param_kindOfPath, $param_kindOfFile) FALSE: es gab getMainPath probleme");
}
} else {
D::ulli("getNcImagePath($param_ncimage_id, $param_kindOfPath, $param_kindOfFile) FALSE: es gibt kein ncimage");
return false;
}
}
private function getPath($param_kindOfPath, $param_partOfPath, $param_kindOfFile, Anc_Image_Model_Ncimage $param_ncimage=null) {
if($param_kindOfPath==='relative') {
$root = '';
} else if($param_kindOfPath==='absolute') {
$root = Mage::helper('anc_lib/ncfilepath')->getThisMagentoInstallationPath();
}
if(is_null($param_ncimage)) {
return $root.$param_partOfPath.DS.$param_kindOfFile.DS;
} else {
return $root.$param_partOfPath.DS.$param_kindOfFile.DS.$param_ncimage->getFile();
}
}
public function generateThumbnail($param_path, Anc_Image_Model_Ncimage $param_ncimage) {
if(!file_exists($this->getPath('absolute', $this->getAncImagePath('thumbnail').$param_path, 'thumbnail', $param_ncimage))) {
$originalpath = $this->getPath('absolute', $this->getAncImagePath('original').$param_path, 'original', $param_ncimage);
$thumbnail_filepath = $this->getPath('absolute', $this->getAncImagePath('thumbnail').$param_path, 'thumbnail', $param_ncimage);
if(file_exists($originalpath)) {
return mcImagick::makeThumbnail($originalpath, $thumbnail_filepath);
} else {
D::li('es existiert kein Bild!!!!!');
return false;
}
} else {
return true;
}
}
public function getPathForNewNcImage($param_kindOfFile='original') {
$mainpath = $this->getMainPath();
if($mainpath) {
$path = Mage::helper('anc_lib/ncfilepath')->getThisMagentoInstallationPath().$this->getAncImagePath().$mainpath.DS.$param_kindOfFile;
return $path;
} else {
return false;
}
}
private $CropfilePath = array();
/**
* wenn es die optionalen individuelle optionen gibt, und diese im frontend durch js:crop gesetzt wurden, gibt es ein gecroptest bild zurück
*
*
* @param int $param_item_id - AncImage item id
* @return string
*/
public function getCropfilePath($param_item_id) {
if(!array_key_exists($param_item_id, $this->CropfilePath) || !$this->CropfilePath[$param_item_id]) {
$ItemProductOptionByOptionSku = Mage::helper('anc_lib/quoteitem')->getItemProductOptionByOptionSku($param_item_id, Mage::helper('anc_image/ncconstant')->ancSPAncImage);
if ($ItemProductOptionByOptionSku) {
$imgUrl = Mage::helper('anc_image/ncimage')->getNcImagePath($ItemProductOptionByOptionSku, 'absolute', 'original');
$ncimage = Mage::helper('anc_image/ncmodel')->getNcImage($ItemProductOptionByOptionSku);
if(is_object($ncimage)) {
$mainpath = $this->getMainPath($ncimage, false);
$crop_filepath = $this->getPath('absolute', $this->getAncImagePath('crop').$mainpath, 'crop', null);
$Cropdata = $this->getCropdata($param_item_id);
if(is_array($Cropdata) && !empty($Cropdata)) {
$returnpath = $this->crop($imgUrl, $crop_filepath, $Cropdata, $ncimage->getFile());
} else {
$returnpath = $imgUrl;
}
$this->CropfilePath[$param_item_id] = $returnpath;
} else {
return false;
}
}
}
return $this->CropfilePath[$param_item_id];
}
public function getCropdata($param_item_id) {
$return = array();
$return['cropH'] = Mage::helper('anc_lib/quoteitem')->getItemProductOptionByOptionSku($param_item_id, Mage::helper('anc_image/ncconstant')->ancSPImage_KEY_cropH);
$return['cropW'] = Mage::helper('anc_lib/quoteitem')->getItemProductOptionByOptionSku($param_item_id, Mage::helper('anc_image/ncconstant')->ancSPImage_KEY_cropW);
$return['imgH'] = Mage::helper('anc_lib/quoteitem')->getItemProductOptionByOptionSku($param_item_id, Mage::helper('anc_image/ncconstant')->ancSPImage_KEY_imgH);
$return['imgW'] = Mage::helper('anc_lib/quoteitem')->getItemProductOptionByOptionSku($param_item_id, Mage::helper('anc_image/ncconstant')->ancSPImage_KEY_imgW);
$return['imgInitH'] = Mage::helper('anc_lib/quoteitem')->getItemProductOptionByOptionSku($param_item_id, Mage::helper('anc_image/ncconstant')->ancSPImage_KEY_imgInitH);
$return['imgInitW'] = Mage::helper('anc_lib/quoteitem')->getItemProductOptionByOptionSku($param_item_id, Mage::helper('anc_image/ncconstant')->ancSPImage_KEY_imgInitW);
$return['imgX1'] = Mage::helper('anc_lib/quoteitem')->getItemProductOptionByOptionSku($param_item_id, Mage::helper('anc_image/ncconstant')->ancSPImage_KEY_imgX1);
$return['imgY1'] = Mage::helper('anc_lib/quoteitem')->getItemProductOptionByOptionSku($param_item_id, Mage::helper('anc_image/ncconstant')->ancSPImage_KEY_imgY1);
if($return['imgInitW'] || $return['imgInitH'] || $return['imgW'] || $return['imgH'] || $return['imgY1'] || $return['imgX1'] || $return['cropW'] || $return['cropH']) {
return $return;
} else {
return false;
}
}
/**
* cropt das bild (schneiden, vergrößern etc) in ein temporäres verzeichnis
*
* !!! THIS IS JUST AN EXAMPLE !!!, PLEASE USE ImageMagick or some other quality image processing libraries
*
* @param string $imgUrl
* @param string $targetpath
* @param array $Cropdata = array(
* imgInitW // your image original width (the one we recieved after upload)
* imgInitH // your image original height (the one we recieved after upload)
* imgW // your new scaled image width
* imgH // your new scaled image height
* imgX1 // top left corner of the cropped image in relation to scaled image
* imgY1 // top left corner of the cropped image in relation to scaled image
* cropW // cropped image width
* cropH // cropped image height
* )
* @param string $filenamepart=''
* @return string
*/
private function crop($imgUrl, $targetpath, $Cropdata, $filenamepart='') {
mcDir::create($targetpath);
$jpeg_quality = 100;
$what = getimagesize($imgUrl);
switch(strtolower($what['mime']))
{
case 'image/png':
// $img_r = imagecreatefrompng($imgUrl);
// $source_image = imagecreatefrompng($imgUrl);
$type = '.png';
break;
case 'image/jpeg':
// $img_r = imagecreatefromjpeg($imgUrl);
// $source_image = imagecreatefromjpeg($imgUrl);
$type = '.jpeg';
break;
case 'image/gif':
// $img_r = imagecreatefromgif($imgUrl);
// $source_image = imagecreatefromgif($imgUrl);
$type = '.gif';
break;
default: die('image type not supported');
}
/**
* @crop jetzt mit imagemagick
*/
$output_filename = $targetpath."/".$filenamepart."cropped_".rand().$type;
/**
* * imgInitW // your image original width (the one we recieved after upload)
* imgInitH // your image original height (the one we recieved after upload)
* imgW // your new scaled image width
* imgH // your new scaled image height
* imgX1 // top left corner of the cropped image in relation to scaled image
* imgY1 // top left corner of the cropped image in relation to scaled image
* cropW // cropped image width
* cropH // cropped image height
*/
// D::s($Cropdata,'$Cropdata',5,1,1);
/**
* Skalier das Bild
*/
$this->scalewithimagemagick($imgUrl,$output_filename,$Cropdata['imgW'], $Cropdata['imgH'],true );
/**
* Beschneide das Bild
*/
$this->cropwithimagemagick($output_filename,$output_filename,$Cropdata['cropW'], $Cropdata['cropH'], $Cropdata['imgX1'], $Cropdata['imgY1'] );
return $output_filename ;
//
// $resizedImage = imagecreatetruecolor($Cropdata['imgW'], $Cropdata['imgH']);
// imagecopyresampled($resizedImage, $source_image, 0, 0, 0, 0, $Cropdata['imgW'],
// $Cropdata['imgH'], $Cropdata['imgInitW'], $Cropdata['imgInitH']);
//
// $dest_image = imagecreatetruecolor($Cropdata['cropW'], $Cropdata['cropH']);
// imagecopyresampled($dest_image, $resizedImage, 0, 0, $Cropdata['imgX1'], $Cropdata['imgY1'], $Cropdata['cropW'],
// $Cropdata['cropH'], $Cropdata['cropW'], $Cropdata['cropH']);
//
//
// imagejpeg($dest_image, $output_filename.$type, $jpeg_quality);
//
// return $output_filename.$type ;
}
private function scalewithimagemagick($paramInfile,$param_outfile,$param_scale_new_x,$param_scale_new_y,$param_bestfit=true){
$image = new Imagick($paramInfile);
$image->scaleImage($param_scale_new_x,$param_scale_new_y,$param_bestfit );
$image->writeImage($param_outfile);
}
private function cropwithimagemagick($paramInfile,$param_outfile,$param_crop_image_size_x,$param_crop_image_size_y,$param_crop_image_topleft_x,$param_crop_topleft_size_y){
$image = new Imagick($paramInfile);
$image->cropImage($param_crop_image_size_x,$param_crop_image_size_y,$param_crop_image_topleft_x,$param_crop_topleft_size_y);
$image->writeImage($param_outfile);
}
/**
* gibt den pfad für das
*
* @return string
*/
private function getAncImagePath($param_kindOfFile) {
if($param_kindOfFile==='thumbnail' || $param_kindOfFile==='crop') {
$tmp = true;
} else {
$tmp = false;
}
return Mage::helper('anc_lib/ncfilepath')->getModuleFilepath('anc_image',$tmp);
}
/**
* gibt den wesentlichen Part zurück vom Pfad zur NcImage datei ... ob benutzer, öffentlich oder so
*
* @param Anc_Image_Model_Ncimage $param_ncimage
* @return string|boolean
*/
private function getMainPath(Anc_Image_Model_Ncimage $param_ncimage=null, $param_NoPrivacy=false) {
$admin_logged_in = Mage::getSingleton('admin/session', array('name' => 'adminhtml'))->isLoggedIn();
if(Mage::app()->getStore()->isAdmin()){
$vartest='true';
}
if(is_object($param_ncimage)
&& (
(
$param_ncimage->getCustomerId() == 0
&& $param_ncimage->getAdminUserId() > 0
)
)
)
{
$path .= DS.'admin'.DS.$param_ncimage->getAdminUserId();
}
// wenns ein objekt gibt, dann überprüf auch ob du darfst
else if(is_object($param_ncimage)
&& (
$param_NoPrivacy
||
(
($param_ncimage->getCustomerId()==0 || $param_ncimage->getCustomerId()===Mage::getSingleton('customer/session')->getCustomer()->getId())
||
Mage::app()->getStore()->isAdmin()
)
)
) {
$path .= DS.'customer'.DS.$param_ncimage->getCustomerId();
// ansonsten bei keinem objekt einfach
} else if(!is_object($param_ncimage)) {
# Ensure we are in the admin session namespace for checking the admin user..
if(Mage::getSingleton('customer/session')->isLoggedIn()) {
$path .= DS.'customer'.DS.Mage::getSingleton('customer/session')->getCustomer()->getId();
} else if($admin_logged_in){
$path .= DS.'admin'.DS.Mage::getSingleton('admin/session')->getUser()->getId();;
}else{
$path .= DS.'customer'.DS.'0';
}
} else {
return false;
}
return $path;
}
public function getFontName($param_customerid,$param_char='A'){
// $customer = Mage::getSingleton('customer/session')->getCustomer()->getId();
$obj_ncimage = Mage::helper('anc_image/ncmodel')->getNcImagesForCustomer($param_customerid);
$array_ncimage = $obj_ncimage->getData();
$fontname=false;
// D::s($array_ncimage,'$array_ncimage',5,1);
if(is_array($array_ncimage)&& $array_ncimage[0]){
foreach ($array_ncimage as $key){
// D::ulli('Outside if'.$key.' $key; '. $array_ncimage[$key]['font'],1,1);
// D::s($key,'$array_ncimage',5,1,1);
if($key['font']&& $key['issignature']==$param_char){
// D::ulli('Inside if'. $key['font'],1,1);
$fontname= $key['font'];
}
}
}
if($fontname){
$fontname=str_replace('.ttf', '', $fontname);
}
return $fontname;
// return 'test';
}
}
\ No newline at end of file
<?php
/**
* @package anc_image
* @category magento
* @mailto code [at] netz.coop
* @author netz.coop eG*
* @copyright (c) 2014, netz.coop eG
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
class Anc_Image_Helper_Ncmodel extends Mage_Core_Helper_Abstract {
/**
* cache für anc_image/ncimage models
* @var array
*/
private $NcImages = array();
/**
* gibt zurück wie oft das bild schon für den kauf verwendet wurde
*
* @param int $param_ncimage_id
* @return Anc_Image_Model_Resource_Mysql4_Ncimage_Quoteitemoption_Collection
*/
public function getNcImageMetaData($param_ncimage_id) {
$collection = Mage::getModel('anc_image/ncimage_quoteitemoption')->getCollection();
$Quoteitemoption_Collection = $collection->addFieldToFilter('ncimage_id',$param_ncimage_id);
return $Quoteitemoption_Collection;
}
/**
*
* @param int $param_ncimage_id
* @return anc_image/ncimage
*/
public function getNcImage($param_ncimage_id) {
if($param_ncimage_id) {
if(!array_key_exists($param_ncimage_id, $this->NcImages)) {
// $ncimage = Mage::getModel('anc_image/ncimage')->load($param_ncimage_id);
$ncimage = Mage::helper('anc_lib/ncrights')->loadNcModel('anc_image/ncimage', $param_ncimage_id);
$this->NcImages[$param_ncimage_id] = $ncimage;
}
return $this->NcImages[$param_ncimage_id];
} else {
return false;
}
}
public function getNcImagesForCustomer($param_customerid=null) {
// D::ulli('$param_customerid'.$param_customerid ,1);
if(!$param_customerid){
$customerid = Mage::getSingleton('customer/session')->getCustomer()->getId();
}else{
$customerid=$param_customerid;
}
return Mage::getModel('anc_image/ncimage')->getCollection()->addFieldToFilter('customer_id', $customerid);
// return Mage::helper('anc_lib/ncrights')->getNcModelsByOneFilter('anc_image/ncimage', 'customer_id', $customerid);
}
public function getNcImagesForAlbum($param_album_id) {
// $customer = Mage::getSingleton('customer/session')->getCustomer();
// return Mage::getModel('anc_image/ncimage')->getCollection()->addFieldToFilter('ncalbum_id', $param_album_id);
$param_arrayFields = array(
'ncalbum_id',
'ordered'
);
$param_arrayContent = array(
array('eq' => $param_album_id),
array('null' => true),
);
return Mage::helper('anc_lib/ncrights')->getNcModelsByOneFilter('anc_image/ncimage', $param_arrayFields, $param_arrayContent);
// return Mage::helper('anc_lib/ncrights')->getNcModelsByOneFilter('anc_image/ncimage', 'ncalbum_id', $param_album_id);
}
public function saveNcImage(Anc_Image_Model_Ncimage $param_ncimage) {
if(is_object($param_ncimage)) {
$param_ncimage->save();
$this->NcImages[$param_ncimage->getId()] = $param_ncimage;
return $this->NcImages[$param_ncimage->getId()];
} else {
return false;
}
}
public function deleteNcImage(Anc_Image_Model_Ncimage $param_ncimage) {
if(is_object($param_ncimage)) {
$customer = Mage::getSingleton('customer/session')->getCustomer();
if($customer->getId() && $customer->getId() === $param_ncimage->getCustomerId()) {
Mage::helper('anc_image/ncmodel')->deleteNcImageFiles($param_ncimage);
$param_ncimage->delete();
// D::s($param_ncimage, '$param_ncimage');
return true;
} else {
return false;
}
} else {
return false;
}
}
public function deleteNcImageFiles(Anc_Image_Model_Ncimage $param_ncimage) {
if(is_object($param_ncimage)) {
$customer = Mage::getSingleton('customer/session')->getCustomer();
if($customer->getId() && $customer->getId() === $param_ncimage->getCustomerId()) {
// mcFile::deleteFile(Mage::getBaseDir().$param_ncimage->getPath());
mcFile::deleteFile(Mage::helper('anc_lib/ncfilepath')->getThisMagentoInstallationPath().$param_ncimage->getPath());
return true;
} else {
return false;
}
} else {
return false;
}
}
public function getBlancoNcImageQuoteitemoption() {
return Mage::getModel('anc_image/ncimage_quoteitemoption');
}
}
\ No newline at end of file
<?php
/**
* @package anc_image
* @category magento
* @mailto code [at] netz.coop
* @author netz.coop eG*
* @copyright (c) 2014, netz.coop eG
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
class Anc_Image_Helper_Ncsvginterface extends Mage_Core_Helper_Abstract {
/**
* Bearbeiten eines BildElementes in einer SVG (erstellt mit Inkscape Erweiterung)
* @param type $domel
* @param type $p_parentitemId
* @param type $MagentoID
* @return type
*/
public function editImageSVG(DOMNode $domel, $p_parentitemId, $MagentoID) {
/**
* anc_image ....
*/
if (true) {
$ChildrenItemIds = Mage::helper('anc_printconfigproduct/cart')->getChildrenItemIds($p_parentitemId, $MagentoID);
$CropfilePath = Mage::helper('anc_image/ncimage')->getCropfilePath($ChildrenItemIds[0], 'absolute');
if($CropfilePath) {
$domel->setAttribute('xlink:href', 'file://' . $CropfilePath);
} else {
$ItemProductOptionByOptionSku = Mage::helper('anc_lib/quoteitem')->getItemProductOptionByOptionSku($ChildrenItemIds[0], Mage::helper('anc_image/ncconstant')->ancSPAncImage);
if ($ItemProductOptionByOptionSku) {
$NcImageRelativePath = Mage::helper('anc_image/ncimage')->getNcImagePath($ItemProductOptionByOptionSku, 'absolute', 'original');
if ($NcImageRelativePath) {
$domel->setAttribute('xlink:href', 'file://' . $NcImageRelativePath);
}
} else {
// D::ulli("editImageSVG($domel, $p_parentitemId, $MagentoID)".$ChildrenItemIds[0].": es wurde kein Bild zum ersetzen angegeben, also gibts das svg bild");
}
}
}
/**
* version wenns eine magento datei ist und nicht das neue anc_image gennutzt wird
*/ else {
$ary_backdata = Mage::helper('anc_printconfigproduct/cart')->doGetChildItemOptionInfoBuyRequest($p_parentitemId, $MagentoID);
$file = $this->getImagefromOptions($ary_backdata[0]['options']);
if ($file) {
$domel->setAttribute('xlink:href', 'file://' . $file);
}
}
return $domel;
}
/**
* Gibt ein Bildpfad aus dem Optionen Array der Media Gallery zurück
* bei mehr Bildern eine Ausgabe in der mc_log
* @param array $p_options
* @param type $parmam_what
* @return array
*/
private function getImagefromOptions(array $p_options, $parmam_what = "fullpath") {
$filename = null;
foreach ($p_options as $key => $valarray) {
if (!$filename) {
$filename = $p_options[$key]['fullpath'];
} else {
$filename2 = $p_options[$key]['fullpath'];
}
}
return $filename;
}
public function replaceSignature($customerid=null,$param_char='A'){
$fontname = Mage::helper('anc_image/ncimage')->getFontName($customerid,$param_char);
if($fontname){
$string = '<flowSpan id="flowSpanUnterschrift" style="font-size:1em;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:\''.$fontname.' Font\';-inkscape-font-specification:\''.$fontname.' Font\'">A</flowSpan>';
}else{
$string= 'Unterschrift ist nicht im System';
}
// D::ulli('$string'.$string,1,1);
return $string;
//
// $fontname =
//
// return $replacestring;
}
}
\ No newline at end of file
<?php
/**
* @package anc_image
* @category magento
* @mailto code [at] netz.coop
* @author netz.coop eG*
* @copyright (c) 2014, netz.coop eG
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
/* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!
* Diese Klasse Existiert in Mehreren Extensions von uns und Muss im Zweifel leider in allen geändert werden!
*
* Dies geschah aus Faulheit und unwissenheit wie auf die Lib eioner anderen Extension zugegriffen werden kann!
*
* !!!!
*/
class Anc_Album_Lib_Varien_Data_Form_Element_ExtendedLabel extends Varien_Data_Form_Element_Abstract
{
public function __construct($attributes=array())
{
parent::__construct($attributes);
$this->setType('label');
}
public function getElementHtml()
{
//'<button type="button" value="Open Window" onclick="window.open(\'' . $varurlimages . '\')">Bilder des Albums verwalten</button>';
//
$var_url= $this->getEscapedValue();
$var_label= $this->getLabel();
// D::s($var_name,'$var_name',5,1,1);
$html = '<button title="'.$var_label.'" onclick="window.open(\''.$var_url . '\')"><span>'.$var_label.'</span></button>';
$html.= $this->getAfterElementHtml();
return $html;
}
public function getLabelHtml($idSuffix = ''){
if (!is_null($this->getLabel())) {
$html = '<label for="'.$this->getHtmlId() . $idSuffix . '" style="'.$this->getLabelStyle().'">'.''//$this->getLabel()
. ( $this->getRequired() ? ' <span class="required">*</span>' : '' ).'</label>'."\n";
}
else {
$html = '';
}
return $html;
}
}
\ No newline at end of file
<?php
/**
* @package anc_image
* @category magento
* @mailto code [at] netz.coop
* @author netz.coop eG*
* @copyright (c) 2014, netz.coop eG
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*
* @anc_image_eingabetyp
* @eingabetyp_Redundanz Achtung!!! weitere Extensions die davon betroffen sind und selben Inhalt benötigen!!!!: AncImage, AncPlaylist, AncAddressimport
*/
class Anc_Image_Model_Catalog_Product_Option extends Mage_Catalog_Model_Product_Option
{
// public function __construct() {
// D::li('Anc_Image_Model_Catalog_Product_Option');
// }
const OPTION_GROUP_ANCPLAYLIST = 'ancplaylist';
const OPTION_TYPE_ANCPLAYLIST_TYPE = 'ancplaylist_type';
const OPTION_GROUP_ANCIMAGE = 'ancimage';
const OPTION_TYPE_ANCIMAGE_TYPE = 'ancimage_type';
const OPTION_GROUP_ANCTEXT = 'anctext';
const OPTION_TYPE_ANCTEXT_TYPE = 'anctext_type';
const OPTION_GROUP_ANCADDRESSIMPORT = 'ancaddressimport';
const OPTION_TYPE_ANCADDRESSIMPORT_TYPE = 'ancaddressimport_type';
/**
* Get group name of option by given option type
*
* @param string $type
* @return string
*/
public function getGroupByType($type = null)
{
if (is_null($type)) {
$type = $this->getType();
}
$group = parent::getGroupByType($type);
if( $group === '' && $type === self::OPTION_TYPE_ANCPLAYLIST_TYPE ){
$group = self::OPTION_GROUP_ANCPLAYLIST;
} else if( $group === '' && $type === self::OPTION_TYPE_ANCIMAGE_TYPE ){
$group = self::OPTION_GROUP_ANCIMAGE;
} else if( $group === '' && $type === self::OPTION_TYPE_ANCTEXT_TYPE ){
$group = self::OPTION_GROUP_ANCTEXT;
} else if( $group === '' && $type === self::OPTION_TYPE_ANCADDRESSIMPORT_TYPE ){
$group = self::OPTION_GROUP_ANCADDRESSIMPORT;
}
return $group;
}
/**
* Group model factory
*
* @param string $type Option type
* @return Mage_Catalog_Model_Product_Option_Group_Abstract
*/
public function groupFactory($type)
{
if( $type === self::OPTION_TYPE_ANCPLAYLIST_TYPE ){
return Mage::getModel('anc_playlist/catalog_product_option_type_ancplaylisttype');
} else if( $type === self::OPTION_TYPE_ANCIMAGE_TYPE ){
return Mage::getModel('anc_image/catalog_product_option_type_ancimagetype');
} else if( $type === self::OPTION_TYPE_ANCTEXT_TYPE ){
return Mage::getModel('anc_text/catalog_product_option_type_anctexttype');
} else if( $type === self::OPTION_TYPE_ANCADDRESSIMPORT_TYPE ){
return Mage::getModel('anc_addressimport/catalog_product_option_type_ancaddressimporttype');
}
return parent::groupFactory($type);
}
}
\ No newline at end of file
<?php
/**
* @package anc_image
* @category magento
* @mailto code [at] netz.coop
* @author netz.coop eG*
* @copyright (c) 2014, netz.coop eG
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*
* @anc_image_eingabetyp - Model
*/
class Anc_Image_Model_Catalog_Product_Option_Type_Ancimagetype
extends Mage_Catalog_Model_Product_Option_Type_Default
// extends Mage_Catalog_Model_Product_Option_Type_Text
{
public function isCustomizedView() {
return true;
}
public function getCustomizedView($optionInfo)
{
D::ulli("Anc_Image_Model_Catalog_Product_Option_Type_Ancimagetype->getCustomizedView($optionInfo) ???? ");
$customizeBlock = new Anc_Image_Block_Options_Type_Customview_Ancimage();
$customizeBlock->setInfo($optionInfo);
return $customizeBlock->toHtml();
}
public function validateUserValue($values)
{
parent::validateUserValue($values);
$option = $this->getOption();
$value = trim($this->getUserValue());
//D::fe($values, 'validateUserValue: '.$value);
$this->setUserValue($value);
return $this;
}
}
\ No newline at end of file
<?php
/**
* @package anc_image
* @category magento
* @mailto code [at] netz.coop
* @author netz.coop eG*
* @copyright (c) 2014, netz.coop eG
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
class Anc_Image_Model_Ncimage extends Mage_Core_Model_Abstract {
protected function _construct()
{
parent::_construct();
$this->_init('anc_image/ncimage');
}
}
\ No newline at end of file
<?php
/**
* @package anc_image
* @category magento
* @mailto code [at] netz.coop
* @author netz.coop eG*
* @copyright (c) 2014, netz.coop eG
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
class Anc_Image_Model_Ncimage_Quoteitemoption extends Mage_Core_Model_Abstract {
protected function _construct()
{
parent::_construct();
$this->_init('anc_image/ncimage_quoteitemoption');
}
}
\ No newline at end of file
<?php
/**
* @package anc_image
* @category magento
* @mailto code [at] netz.coop
* @author netz.coop eG*
* @copyright (c) 2014, netz.coop eG
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
class Anc_Image_Model_Observer {
public function saveImageOrderLink(array $param_values) {
$order = $param_values->getOrder();
$customerId = Mage::getSingleton('customer/session')->getCustomer()->getId();
$ListQuoteItemsByQuoteId = Mage::helper('anc_lib/quoteitem')->getListQuoteItemsByQuoteId($order->getQuoteId());
foreach ($ListQuoteItemsByQuoteId as $ListQuoteItem) {
$ItemProductOptions = Mage::helper('anc_lib/quoteitem')->getItemProductOptionByOptionType($ListQuoteItem['item_id'], 'ancimage_type');
if (is_array($ItemProductOptions) && !empty($ItemProductOptions)) {
foreach ($ItemProductOptions as $option_id => $ncimage_id) {
if (!array_search($ncimage_id, $this->itemarray)) {
try {
D::s($this->itemarray, '$this->itemarray', 5, 1);
$this->itemarray[] = $ncimage_id;
$model = Mage::getModel('anc_image/ncimage');
$imageitem = $model->load($ncimage_id)->getData();
if ($imageitem['admin_user_id'] < 1) {
unset($imageitem['entity_id']);
unset($imageitem['ordered']);
unset($imageitem['admin_user_id']);
$imageitem['customer_id'] = $customerId;
// $imageitem['comment'] = $imageitem['comment'] . ' Kopie ' . $imageitem['entity_id'] ;
$model->setData($imageitem);
$model->save();
$var_own_image = true;
}
} catch (Exception $e) {
// D::show($e->getMessage());
}
}
if ($var_own_image) {
Mage::helper('anc_lib/sql')->updateOneCell(
'anc_image/ncimage', 'ordered', '1', array(
'entity_id' => $ncimage_id,
)
);
}
$ncimage_quoteitemoption_id = (int) Mage::helper('anc_lib/sql')->selectFetchOne(
'entity_id', 'anc_image/ncimage_quoteitemoption', array(
'customer_id' => $order->getCustomerId(),
'ncimage_id' => $ncimage_id,
'order_id' => $order->getId(),
'quote_item_id' => $ListQuoteItem['item_id'],
'ordertime' => $order->getCreatedAt()
)
);
if (!$ncimage_quoteitemoption_id) {
// $ncimage_quoteitemoption = Mage::getModel('anc_image/ncimage_quoteitemoption');
$ncimage_quoteitemoption = Mage::helper('anc_image/ncmodel')->getBlancoNcImageQuoteitemoption();
$ncimage_quoteitemoption->setCustomerId($order->getCustomerId());
$ncimage_quoteitemoption->setNcimageId($ncimage_id);
$ncimage_quoteitemoption->setOrderId($order->getId());
$ncimage_quoteitemoption->setQuoteItemId($ListQuoteItem['item_id']);
$ncimage_quoteitemoption->setOrdertime($order->getCreatedAt());
$ncimage_quoteitemoption->save();
}
}
}
}
}
}
<?php
/**
* @package anc_image
* @category magento
* @mailto code [at] netz.coop
* @author netz.coop eG*
* @copyright (c) 2014, netz.coop eG
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
class Anc_Image_Model_Resource_Mysql4_Ncimage extends Mage_Core_Model_Mysql4_Abstract {
protected function _construct() {
$this->_init('anc_image/ncimage', 'entity_id');
}
protected function _beforeSave(Mage_Core_Model_Abstract $ncimage) {
if(!$ncimage->getId()) {
$ncimage->setCreatedAt(now());
}
$ncimage->setUpdatedAt(now());
return parent::_beforeSave($ncimage);
}
}
\ No newline at end of file
<?php
/**
* @package anc_image
* @category magento
* @mailto code [at] netz.coop
* @author netz.coop eG*
* @copyright (c) 2014, netz.coop eG
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
class Anc_Image_Model_Resource_Mysql4_Ncimage_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract{
public function _construct(){
$this->_init('anc_image/ncimage');
parent::_construct();
}
/**
* spezielle function um bei der anc_lib/ncrights überprüfung die collection zu korrigieren
* * muss in jede extension rein, die ncrights nutzt!!!!
* @since 20141014
*
* @param array $param_data
*/
public function setDataAnc($param_data) {
$this->_data = $param_data;
}
}
\ No newline at end of file
<?php
/**
* @package anc_image
* @category magento
* @mailto code [at] netz.coop
* @author netz.coop eG*
* @copyright (c) 2014, netz.coop eG
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
class Anc_Image_Model_Resource_Mysql4_Ncimage_Quoteitemoption extends Mage_Core_Model_Mysql4_Abstract {
protected function _construct() {
$this->_init('anc_image/ncimage_quoteitemoption', 'entity_id');
}
// protected function _beforeSave(Mage_Core_Model_Abstract $ncimage) {
// if(!$ncimage->getId()) {
// $ncimage->setCreatedAt(now());
// }
// $ncimage->setUpdatedAt(now());
// return parent::_beforeSave($ncimage);
// }
}
\ No newline at end of file
<?php
/**
* @package anc_image
* @category magento
* @mailto code [at] netz.coop
* @author netz.coop eG*
* @copyright (c) 2014, netz.coop eG
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
class Anc_Image_Model_Resource_Mysql4_Ncimage_Quoteitemoption_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract{
public function _construct(){
$this->_init('anc_image/ncimage_quoteitemoption');
parent::_construct();
}
}
\ No newline at end of file
<?php
/**
* @package anc_image
* @category magento
* @mailto code [at] netz.coop
* @author netz.coop eG*
* @copyright (c) 2014, netz.coop eG
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
class Anc_Image_Adminhtml_AdministratorController extends Mage_Adminhtml_Controller_Action {
protected function _initAction() {
$this->loadLayout();
return $this;
}
/**
* Block/Template Funktion
*
* fnc ist in "mein Benutzerkonto" laut @see app/design/frontend/layout/anc_image.xml als link aufrufbar,
* * durch selbige anc_image.xml bekommt die fnc das template @see app/design/frontend/template/ancimage/customer_owngallery.phtml beigesteuert
*/
public function owngalleryAction() {
$this->loadLayout();
$this->getLayout()->getBlock('root')->setTemplate('page/1column.phtml');
$this->renderLayout();
}
/**
* param - $this->getRequest()->getParams()['id'] -- id des zu bearbeiteten ncimage
*
* Block/Template Funktion
*
*/
public function showncimageformAction() {
if (Mage::getSingleton('customer/session')->isLoggedIn()) {
$params=$this->getRequest()->getParams();
if(is_array($params) && array_key_exists('id', $params)) {
$ncimage = Mage::helper('anc_image/ncmodel')->getNcImage($params['id']);
//D::li($ncimage, '$ncimage'.$params['id']);
if(is_object($ncimage)) {
if(array_key_exists('name', $params)) {
$ncimage->setName($params['name']);
}
if(array_key_exists('comment', $params)) {
$ncimage->setComment($params['comment']);
}
$ncimage = Mage::helper('anc_image/ncmodel')->saveNcImage($ncimage);
D::compareFe($ncimage,$params, '$ncimage, $this->getParams()');
}
}
$this->loadLayout();
$this->getLayout()->getBlock('root')->setTemplate('page/empty.phtml');
// $this->getLayout()->getBlock('content')->append(
// $this->getLayout()->createBlock('anc_image/owngallery')->setTemplate('anc/image/customer_showNcImageForm.phtml')
// );
$this->renderLayout();
} else {
echo('nicht eingeloggt');
}
}
public function simpleowngalleryAction() {
D::li('testme',1);
$this->loadLayout();
$this->getLayout()->getBlock('root')->setTemplate('page/empty.phtml');
$this->renderLayout();
}
/**
* @param _POST[id] => $this->getRequest()->getParams()[id] -- anc_image/ncimage id
*
*/
public function deleteNcImageAction() {
$params=$this->getRequest()->getParams();
$json_rueckgabe = array();
if(array_key_exists('id', $params) && $params['id']) {
$param_id = $params['id'];
$ncimage = Mage::helper('anc_image/ncmodel')->getNcImage($param_id);
if(Mage::helper('anc_image/ncmodel')->deleteNcImage($ncimage)) {
$json_rueckgabe['status'] = 'OK';
$json_rueckgabe['message'] = 'Das Bild ('.$ncimage->getId().' wurde gelöscht)!';
} else {
$json_rueckgabe['status'] = 'ERROR';
$json_rueckgabe['message'] = 'Es ist beim Löschen ein Fehler aufgetreten!';
}
} else {
$json_rueckgabe['status'] = 'ERROR';
$json_rueckgabe['message'] = 'Keine ID angegeben!';
}
echo json_encode($json_rueckgabe);
}
/**
* @param optional _POST[id] => $this->getRequest()->getParams()[id] -- anc_image/ncimage id
*
* fnc wird übers formular von owngalleryAction() bzw customer_owngallery.phtml
* bei einem datei upload aufgerufen und verarbeitet die post werte
* * kopiert datei in entsprechendes kunden verzeichniss
* * speichert dateiname im model / in tabelle
*/
public function uploadImageAction() {
$params=$this->getRequest()->getParams();
if(array_key_exists('id', $params)) {
$param_id = $params['id'];
} else {
$param_id = false;
}
if(array_key_exists('album_id', $params)) {
$param_album_id = $params['album_id'];
} else {
$param_album_id = false;
}
$user = Mage::getSingleton('admin/session');
$userId = $user->getUser()->getUserId();
D::ulli('Albumid: '.$param_album_id.' / Userid: '.$userId,1);
$json_rueckgabe = array();
/* Get the customer data */
$customer = Mage::getSingleton('customer/session')->getCustomer();
if(isset($_FILES['file']['name']) && $_FILES['file']['name'] != '') {
try
{
$path = Mage::helper('anc_image/ncimage')->getPathForNewNcImage('original');
$fname = $_FILES['file']['name']; //file name
$uploader = new Varien_File_Uploader('file'); //load class
$uploader->setAllowedExtensions(array('jpg','jpeg','gif','png')); //Allowed extension for file
$uploader->setAllowCreateFolders(true); //for creating the directory if not exists
$uploader->setAllowRenameFiles(true); //if true, uploaded file's name will be changed, if file with the same name already exists directory.
$uploader->setFilesDispersion(false);
$uploader->save($path,$fname); //save the file on the specified path
// den modifizierten namen, falls datei schon existierte
$fname = $uploader->getUploadedFileName();
if(is_file($path.DS.$fname)) {
/**
* datei wird ersetzt
*/
if($param_id) {
$ncimage = Mage::helper('anc_image/ncmodel')->getNcImage($param_id);
if(Mage::helper('anc_image/ncmodel')->deleteNcImageFiles($ncimage)) {
} else {
$json_rueckgabe['status'] = 'ERROR';
$json_rueckgabe['message'] = 'Sie habe nicht die Berechtigung!';
echo json_encode($json_rueckgabe);
return;
}
} else {
$ncimage = Mage::getModel('anc_image/ncimage');
}
// $ncimage->setData('customer_id',$customer->getId());
$ncimage->setData('admin_user_id',$userId);
$ncimage->setData('file',$fname);
if($param_album_id){//ncalbum_id
$ncimage->setData('ncalbum_id',$param_album_id);
}
$ncimage->save();
$ncimage->setData('path', Mage::helper('anc_image/ncimage')->getNcImagePath($ncimage->getId(), 'relative', 'original'));
$ncimage->save();
if($ncimage->getId()) {
$json_rueckgabe['model'] = 'anc_image/ncimage';
$json_rueckgabe['file'] = $fname;
$json_rueckgabe['id'] = $ncimage->getId();
$json_rueckgabe['path'] = $ncimage->getPath();
$json_rueckgabe['status'] = 'OK';
$json_rueckgabe['message'] = 'upload erfolgreich !! ('.$ncimage->getId().'/'.$uploader->getUploadedFileName().')';
} else {
$json_rueckgabe['status'] = 'ERROR';
$json_rueckgabe['message'] = 'Datei konnte nicht in die Datenbank eingetragen werden';
}
} else {
$json_rueckgabe['status'] = 'ERROR';
$json_rueckgabe['message'] = 'Datei konnte nicht auf dem Server gespeichert werden';
}
} catch (Exception $e) {
$json_rueckgabe['status'] = 'ERROR';
$json_rueckgabe['message'] = $e->getMessage();
}
} else {
$json_rueckgabe['status'] = 'ERROR';
$json_rueckgabe['message'] = 'Übermittlungsprobleme: Datei konnte nicht gespeichert werden (vielleicht war die Datei größer als '.@ini_get('post_max_size').' MB)';
}
echo json_encode($json_rueckgabe);
}
}
\ No newline at end of file
<?php
/**
* @package anc_image
* @category magento
* @mailto code [at] netz.coop
* @author netz.coop eG*
* @copyright (c) 2014, netz.coop eG
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
// extends Mage_Adminhtml_Controller_Action
class Anc_Image_Adminhtml_ImageController extends Mage_Adminhtml_Controller_Action {
// private static $customerid;
public function listAction() {
$albumBlock = $this->getLayout()->createBlock('anc_image/adminhtml_images');
$this->loadLayout()
->_addContent($albumBlock)
->renderLayout();
}
protected function _initAction() {
$this->loadLayout()->_setActiveMenu('anc_image/ANC')
->_addBreadcrumb('test Manager', 'test Manager');
return $this;
}
public function indexAction() {
$this->_initAction();
$this->renderLayout();
/**
* go to listAction
*/
$varparams = $this->getRequest()->getParams();
D::s($varparams, '$varparams Index', 5, 1);
if ($varparams['albumid']) {
$this->_redirect('*/*/list', array(
'albumid' => $varparams['albumid'],
));
} else {
$this->_redirect(
'*/*/list', array(
)
);
}
}
public function editAction() {
$id = $this->getRequest()->getParam('id');
$model = Mage::getModel('anc_image/ncimage')->load($id);
if ($model->getId() || $id == 0) {
Mage::register('anc_image', $model);
$this->loadLayout();
$this->_setActiveMenu('test/set_time');
$this->_addBreadcrumb('test Manager', 'test Manager');
$this->_addBreadcrumb('Test Description', 'Test Description');
$this->getLayout()->getBlock('head')
->setCanLoadExtJs(true);
$this->_addContent($this->getLayout()
->createBlock('anc_image/adminhtml_images_edit'))
->_addLeft($this->getLayout()
->createBlock('anc_image/adminhtml_images_edit_tabs')
);
$this->renderLayout();
} else {
Mage::getSingleton('adminhtml/session')
->addError('Test does not exist');
$this->_redirect('*/*/');
}
}
public function newAction() {
$this->_forward('edit');
}
public function saveAction() {
$var_deleted=false;
if ($this->getRequest()->getPost()) {
try {
$postData = $this->getRequest()->getPost();
$varparams = $this->getRequest()->getParams();
$testModel = Mage::getModel('anc_image/ncimage');
if ($this->getRequest()->getParam('id') <= 0)
$testModel->setCreatedTime(
Mage::getSingleton('core/date')
->gmtDate()
);
// D::s($_FILES,'$_FILES',5,1);
if($postData['file']['delete'] === '1'){
// D::s($postData, '$postData', 5, 1);
// D::s($varparams, '$varparams', 5, 1);
// D::ulli("PATH: media/".$postData['file']['value'],1);
// $path= Mage::helper('anc_lib/data')->realPathToWebPath("media/".$postData['file']['value'],false);
// D::ulli("$path:". $path,1);
unlink( "media/".$postData['file']['value']);
$var_deleted = true;
// $postData['path']= dirname($postData['file']);
unset($postData['file']);
}
$path = "";
if (isset($_FILES['file']['name']) && $_FILES['file']['name'] != '') {
try {
if (!(strpos($varparams['path'], "/media/") === 0)) {
$varparams['path'] = 'media/' . $varparams['path'];
}
$filename = $_FILES['file']['name'];
$path = $varparams['path'];
D::ulli('Pfad: ' . $path, 1);
$fname = $_FILES['file']['name']; //file name
$uploader = new Varien_File_Uploader('file'); //load class
$uploader->setAllowedExtensions(array('png', 'jpg', 'gif')); //Allowed extension for file
$uploader->setAllowCreateFolders(true); //for creating the directory if not exists
$uploader->setAllowRenameFiles(false); //if true, uploaded file's name will be changed, if file with the same name already exists directory.
$uploader->setFilesDispersion(false);
$uploader->save($path, $fname); //save the file on the specified path
$postData['file'] = $_FILES['file']['name'];
// D::ulli('$path:'.$path.' / $fname:'.$fname);
$var_upload = true;
} catch (Exception $e) {
$var_upload = false;
echo 'Error Message: ' . $e->getMessage();
}
} else {
$var_upload = false;
}
if (is_array($varparams['file'])) {
// unset($postData['file']);
}
if (!(strpos($postData['path'], "/media/") === 0) && $var_deleted !== true) {
// D::ulli('inside: fn: '.$filename.' /'.$postData['path'],1);
// $postData['path']=dirname($postData['path']).'/';
$postData['path'] = '/media/' . $postData['path'] . $filename;
// $postData['path']=$data['path'];
$postData['file'] = $filename;
// D::ulli('inside after : fn: '.$postData['file'].' /'.$postData['path'],1);
}
/**
* Falls Keine Datei gespeichert wurde
*/
if ($var_upload === false && $var_deleted === false) {
unset($postData['file']);
unset($postData['path']);
}else{
D::ulli('Upload Font'.$postData['issignature'].' / '. $postData['customer_id'] .' / '. $postData['path'],1);
if($postData['issignature']=='A' && $postData['customer_id'] && $postData['path']){
$fontname = Mage::helper('anc_image/ncfonts')->nccreateFont($postData['path'],$postData['customer_id'],$postData['issignature']);
//issignature
if($fontname){
$postData['font']=$fontname;
Mage::getSingleton('adminhtml/session')
->addSuccess('Font wurde erstellt er muss jetzt dem System zur Verfügung gestellt werden');
}else{
Mage::getSingleton('adminhtml/session')
->addError('Der Font konnte nicht erstellt werden');
}
}
}
// D::s($postData,'$postData',5,1);
$testModel
->addData($postData)
->setUpdateTime(
Mage::getSingleton('core/date')
->gmtDate())
->setId($this->getRequest()->getParam('id'))
->save();
Mage::getSingleton('adminhtml/session')
->addSuccess('successfully saved');
Mage::getSingleton('adminhtml/session')
->settestData(false);
/**
* Für save and continue
*/
if ($this->getRequest()->getParam('back')) {
if ($varparams['albumid']) {
$this->_redirect(
'*/*/edit', array(
'id' => $testModel->getId(),
'albumid' => $varparams['albumid'],
)
);
} else {
$this->_redirect(
'*/*/edit', array(
'id' => $testModel->getId(),
)
);
}
return;
}
if ($varparams['albumid']) {
$this->_redirect('*/*/list', array(
'albumid' => $varparams['albumid'],
));
} else {
$this->_redirect('*/*/list');
}
return;
} catch (Exception $e) {
Mage::getSingleton('adminhtml/session')
->addError($e->getMessage());
Mage::getSingleton('adminhtml/session')
->settestData($this->getRequest()
->getPost()
);
$this->_redirect('*/*/edit', array('id' => $this->getRequest()
->getParam('id')));
return;
}
}
$this->_redirect('*/*/');
}
public function deleteAction() {
if ($this->getRequest()->getParam('id') > 0) {
try {
$testModel = Mage::getModel('anc_image/ncimage');
$testModel->setId($this->getRequest()
->getParam('id'))
->delete();
Mage::getSingleton('adminhtml/session')
->addSuccess('successfully deleted');
$this->_redirect('*/*/');
$this->_redirect('*/*/list');
} catch (Exception $e) {
Mage::getSingleton('adminhtml/session')
->addError($e->getMessage());
$this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
}
}
$this->_redirect('*/*/list');
// $this->_redirect('*/*/');
}
protected function _isAllowed() {
return Mage::getSingleton('admin/session')->isAllowed('image/form');
}
}
<?php
/**
* @package anc_image
* @category magento
* @mailto code [at] netz.coop
* @author netz.coop eG*
* @copyright (c) 2014, netz.coop eG
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
class Anc_Image_Adminhtml_AlbumController extends Mage_Adminhtml_Controller_Action {
// private static $customerid;
public function listAction() {
$albumBlock = $this->getLayout()->createBlock('anc_image/adminhtml_albums');
$this->loadLayout()
->_addContent($albumBlock)
->renderLayout();
}
protected function _initAction() {
$this->loadLayout()->_setActiveMenu('anc_image/ANC')
->_addBreadcrumb('test Manager', 'test Manager');
return $this;
}
public function indexAction() {
$this->_initAction();
$this->renderLayout();
}
public function editAction() {
$id = $this->getRequest()->getParam('id');
$model = Mage::getModel('anc_image/album')->load($id);
if ($model->getId() || $id == 0) {
Mage::register('anc_album', $model);
$this->loadLayout();
$this->_setActiveMenu('test/set_time');
$this->_addBreadcrumb('test Manager', 'test Manager');
$this->_addBreadcrumb('Test Description', 'Test Description');
$this->getLayout()->getBlock('head')
->setCanLoadExtJs(true);
$this->_addContent($this->getLayout()
->createBlock('anc_image/adminhtml_albums_edit'))
->_addLeft($this->getLayout()
->createBlock('anc_image/adminhtml_albums_edit_tabs')
);
$this->renderLayout();
} else {
Mage::getSingleton('adminhtml/session')
->addError('Test does not exist');
$this->_redirect('*/*/');
}
}
public function newAction() {
$this->_forward('edit');
}
public function saveAction() {
if ($this->getRequest()->getPost()) {
try {
$postData = $this->getRequest()->getPost();
$testModel = Mage::getModel('anc_image/album');
if ($this->getRequest()->getParam('id') <= 0)
$testModel->setCreatedTime(
Mage::getSingleton('core/date')
->gmtDate()
);
$testModel
->addData($postData)
->setUpdateTime(
Mage::getSingleton('core/date')
->gmtDate())
->setId($this->getRequest()->getParam('id'))
->save();
Mage::getSingleton('adminhtml/session')
->addSuccess('successfully saved');
Mage::getSingleton('adminhtml/session')
->settestData(false);
$this->_redirect('*/*/list');
return;
} catch (Exception $e) {
Mage::getSingleton('adminhtml/session')
->addError($e->getMessage());
Mage::getSingleton('adminhtml/session')
->settestData($this->getRequest()
->getPost()
);
$this->_redirect('*/*/edit', array('id' => $this->getRequest()
->getParam('id')));
return;
}
}
$this->_redirect('*/*/');
}
public function deleteAction() {
if ($this->getRequest()->getParam('id') > 0) {
try {
$testModel = Mage::getModel('anc_image/album');
$testModel->setId($this->getRequest()
->getParam('id'))
->delete();
Mage::getSingleton('adminhtml/session')
->addSuccess('successfully deleted');
$this->_redirect('*/*/');
$this->_redirect('*/*/list');
} catch (Exception $e) {
Mage::getSingleton('adminhtml/session')
->addError($e->getMessage());
$this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
}
}
$this->_redirect('*/*/list');
// $this->_redirect('*/*/');
}
protected function _isAllowed() {
return Mage::getSingleton('admin/session')->isAllowed('image/form');
}
}
<?php
/**
* @package anc_image
* @category magento
* @mailto code [at] netz.coop
* @author netz.coop eG*
* @copyright (c) 2014, netz.coop eG
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
class Anc_Image_CustomerController extends Mage_Core_Controller_Front_Action {
protected function _initAction() {
$this->loadLayout();
return $this;
}
/**
* Block/Template Funktion
*
* fnc ist in "mein Benutzerkonto" laut @see app/design/frontend/layout/anc_image.xml als link aufrufbar,
* * durch selbige anc_image.xml bekommt die fnc das template @see app/design/frontend/template/ancimage/customer_galleriesmanager.phtml beigesteuert
*/
public function galleriesmanagerAction() {
$this->loadLayout();
$this->getLayout()->getBlock('root')->setTemplate('page/2columns-right.phtml');
$this->renderLayout();
}
/**
* param - $this->getRequest()->getParams()['id'] -- id des zu bearbeiteten ncimage
*
* Block/Template Funktion
*
*/
public function showncimageformAction() {
if (Mage::getSingleton('customer/session')->isLoggedIn()) {
$params=$this->getRequest()->getParams();
if(is_array($params) && array_key_exists('id', $params)) {
$ncimage = Mage::helper('anc_image/ncmodel')->getNcImage($params['id']);
if(is_object($ncimage)) {
if(array_key_exists('name', $params)) {
$ncimage->setName($params['name']);
}
if(array_key_exists('comment', $params)) {
$ncimage->setComment($params['comment']);
}
$ncimage = Mage::helper('anc_image/ncmodel')->saveNcImage($ncimage);
D::compareFe($ncimage,$params, '$ncimage, $this->getParams()');
}
}
$this->loadLayout();
$this->getLayout()->getBlock('root')->setTemplate('page/empty.phtml');
// $this->getLayout()->getBlock('content')->append(
// $this->getLayout()->createBlock('anc_image/galleriesmanager')->setTemplate('anc/image/customer_showNcImageForm.phtml')
// );
$this->renderLayout();
} else {
echo('nicht eingeloggt');
}
}
public function gallerysimpleAction() {
$this->loadLayout();
$this->getLayout()->getBlock('root')->setTemplate('page/empty.phtml');
$this->renderLayout();
}
/**
* @param _POST[id] => $this->getRequest()->getParams()[id] -- anc_image/ncimage id
*
*/
public function deleteNcImageAction() {
$params=$this->getRequest()->getParams();
$json_rueckgabe = array();
if(array_key_exists('id', $params) && $params['id']) {
$param_id = $params['id'];
$ncimage = Mage::helper('anc_image/ncmodel')->getNcImage($param_id);
if(Mage::helper('anc_image/ncmodel')->deleteNcImage($ncimage)) {
$json_rueckgabe['status'] = 'OK';
$json_rueckgabe['message'] = 'Das Bild ('.$ncimage->getId().' wurde gelöscht)!';
} else {
$json_rueckgabe['status'] = 'ERROR';
$json_rueckgabe['message'] = 'Es ist beim Löschen ein Fehler aufgetreten!';
}
} else {
$json_rueckgabe['status'] = 'ERROR';
$json_rueckgabe['message'] = 'Keine ID angegeben!';
}
echo json_encode($json_rueckgabe);
}
/**
* @param optional _POST[id] => $this->getRequest()->getParams()[id] -- anc_image/ncimage id
*
* fnc wird übers formular von galleriesmanagerAction() bzw customer_galleriesmanager.phtml
* bei einem datei upload aufgerufen und verarbeitet die post werte
* * kopiert datei in entsprechendes kunden verzeichniss
* * speichert dateiname im model / in tabelle
*/
public function uploadImageAction() {
$params=$this->getRequest()->getParams();
if(array_key_exists('id', $params)) {
$param_id = $params['id'];
} else {
$param_id = false;
}
if(array_key_exists('ncalbum_id', $params)) {
$param_ncalbum_id = $params['ncalbum_id'];
} else {
$param_ncalbum_id = false;
}
$json_rueckgabe = array();
/* Get the customer data */
$customer = Mage::getSingleton('customer/session')->getCustomer();
if(isset($_FILES['file']['name']) && $_FILES['file']['name'] != '') {
try
{
$path = Mage::helper('anc_image/ncimage')->getPathForNewNcImage('original');
$fname = $_FILES['file']['name']; //file name
$uploader = new Varien_File_Uploader('file'); //load class
$uploader->setAllowedExtensions(array('jpg','jpeg','gif','png')); //Allowed extension for file
$uploader->setAllowCreateFolders(true); //for creating the directory if not exists
$uploader->setAllowRenameFiles(true); //if true, uploaded file's name will be changed, if file with the same name already exists directory.
$uploader->setFilesDispersion(false);
$uploader->save($path,$fname); //save the file on the specified path
// den modifizierten namen, falls datei schon existierte
$fname = $uploader->getUploadedFileName();
if(is_file($path.DS.$fname)) {
/**
* datei wird ersetzt
*/
if($param_id) {
$ncimage = Mage::helper('anc_image/ncmodel')->getNcImage($param_id);
if(Mage::helper('anc_image/ncmodel')->deleteNcImageFiles($ncimage)) {
} else {
$json_rueckgabe['status'] = 'ERROR';
$json_rueckgabe['message'] = 'Sie habe nicht die Berechtigung!';
echo json_encode($json_rueckgabe);
return;
}
} else {
$ncimage = Mage::getModel('anc_image/ncimage');
}
$ncimage->setData('customer_id',$customer->getId());
$ncimage->setData('file',$fname);
$ncimage->save();
if($ncimage->getId()) {
if($param_ncalbum_id === false) {
if($customer->getId()) {
$ncalbum = Mage::getModel('anc_album/ncalbum')->load($customer->getId(), 'customer_id');
$param_ncalbum_id = $ncalbum->getId();
if(!$param_ncalbum_id) {
$ncalbum->setData('name','Album: '.$customer->getName());
$ncalbum->setData('customer_id',$customer->getId());
$ncalbum->setData('isplaylist',false);
$ncalbum->setData('iscategory',false);
$ncalbum->save();
$param_ncalbum_id = $ncalbum->getId();
}
} else {
$param_ncalbum_id = 0;
}
}
$ncimage->setData('path', Mage::helper('anc_image/ncimage')->getNcImagePath($ncimage->getId(), 'relative', 'original'));
$ncimage->setData('ncalbum_id', $param_ncalbum_id);
$ncimage->save();
$json_rueckgabe['model'] = 'anc_image/ncimage';
$json_rueckgabe['file'] = $fname;
$json_rueckgabe['id'] = $ncimage->getId();
$json_rueckgabe['path'] = $ncimage->getPath();
$json_rueckgabe['status'] = 'OK';
$json_rueckgabe['message'] = 'upload erfolgreich !! ('.$ncimage->getId().'/'.$uploader->getUploadedFileName().')';
} else {
$json_rueckgabe['status'] = 'ERROR';
$json_rueckgabe['message'] = 'Datei konnte nicht in die Datenbank eingetragen werden';
}
} else {
$json_rueckgabe['status'] = 'ERROR';
$json_rueckgabe['message'] = 'Datei konnte nicht auf dem Server gespeichert werden';
}
} catch (Exception $e) {
$json_rueckgabe['status'] = 'ERROR';
$json_rueckgabe['message'] = $e->getMessage();
}
} else {
$json_rueckgabe['status'] = 'ERROR';
$json_rueckgabe['message'] = 'Übermittlungsprobleme: Datei konnte nicht gespeichert werden (vielleicht war die Datei größer als '.@ini_get('post_max_size').' MB)';
}
echo json_encode($json_rueckgabe);
}
}
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<config>
<acl>
<resources>
<all>
<title>Allow Everything</title>
</all>
<admin>
<children>
<Anc_Anc module="anc_image">
<title>ANC</title>
<sort_order>71</sort_order>
<children>
<!-- <ncalbum module="anc_image">
<title>Album</title>
<sort_order>1</sort_order>
<action>image/adminhtml_album/list</action>
</ncalbum>-->
<!-- @backend_grid-->
<!-- <ncimage module="anc_image">
<title>Image</title>
<sort_order>2</sort_order>
<action>image/adminhtml_album/list</action>
</ncimage>-->
</children>
</Anc_Anc>
<system>
<children>
<config>
<children>
<site translate="title">
<title>Lib</title>
<sort_order>101</sort_order>
</site>
</children>
</config>
</children>
</system>
</children>
</admin>
</resources>
</acl>
</config>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<config>
<!-- versionierung des moduls -
wichtig vor alle dem auch im Zusammenhang mit dem Datenbankinstallationsskript
-->
<modules>
<Anc_Image>
<version>0.0.3</version>
</Anc_Image>
</modules>
<!-- was im frontend passiert -->
<frontend>
<!-- einbindung der layoutkonfiguration (s.u.) -->
<layout>
<updates>
<Anc_Image>
<file>anc/image.xml</file>
</Anc_Image>
</updates>
</layout>
<!-- damit die controller funktionen über eine url erreichbar sind (s.u.) -->
<routers>
<!--Umleitung bzw aktivierung der controllers-->
<anc_image>
<use>standard</use>
<args>
<!-- alle urls die mit "http://magento/ancimage" werden ins modul Anc_Image umgeleitet -->
<module>Anc_Image</module>
<frontName>ancimage</frontName>
</args>
</anc_image>
</routers>
<events>
<sales_order_save_commit_after>
<observers>
<!-- <anc_printconfigproduct_attribute_set_load_before>
<type>singleton</type>
<class>anc_printconfigproduct/observer</class>
<method>copyAttributeset</method>
</anc_printconfigproduct_attribute_set_load_before> -->
<anc_image_save_image_order_link>
<type>singleton</type>
<class>anc_image/observer</class>
<method>saveImageOrderLink</method>
</anc_image_save_image_order_link>
</observers>
</sales_order_save_commit_after>
</events>
</frontend>
<global>
<helpers>
<anc_image>
<class>Anc_Image_Helper</class>
</anc_image>
</helpers>
<!-- dem system bekannt machen das block klassen existieren -->
<blocks>
<anc_image>
<class>Anc_Image_Block</class>
</anc_image>
<!-- Wichtig damit die Blocks zum editieren richtig geladen werden-->
<anc_image_adminhtml>
<class>Anc_Image_Block_Adminhtml</class>
</anc_image_adminhtml>
<adminhtml>
<!-- @anc_image_eingabetyp -->
<rewrite>
<catalog_product_edit_tab_options_option>Anc_Image_Block_Adminhtml_Catalog_Product_Edit_Tab_Options_Option</catalog_product_edit_tab_options_option>
</rewrite>
</adminhtml>
</blocks>
<catalog>
<product>
<options>
<custom>
<groups>
<!-- @anc_image_eingabetyp -->
<ancimage translate="label" module="anc_image">
<label>NcImage</label>
<render>anc_image/adminhtml_catalog_product_edit_tab_options_type_ancimage</render>
<types>
<ancimage_type translate="label" module="anc_image">
<label>Image</label>
</ancimage_type>
</types>
</ancimage>
</groups>
</custom>
</options>
</product>
</catalog>
<!-- die konfiguration der datenbank schnittstelle -->
<models>
<anc_image>
<class>Anc_Image_Model</class>
<!-- folgendes ist ein verweis auf den nachfolgenden tag <anc_image_resource> -->
<resourceModel>anc_image_resource</resourceModel>
</anc_image>
<anc_image_resource>
<class>Anc_Image_Model_Resource_Mysql4</class>
<!-- entitie's mit s hier können mehrere Tabellen(namen) untergebracht werden -->
<entities>
<ncimage>
<table>anc_image_ncimage</table>
</ncimage>
<ncimage_quoteitemoption>
<table>anc_image_ncimage_quoteitemoption</table>
</ncimage_quoteitemoption>
<!-- <image>
<table>anc_image_album</table>
</album>-->
<!-- <album_list>
<table>anc_image_album_list</table>
</album_list> -->
</entities>
</anc_image_resource>
<catalog>
<!-- @anc_image_eingabetyp -->
<rewrite>
<product_option>Anc_Image_Model_Catalog_Product_Option</product_option>
</rewrite>
</catalog>
</models>
<resources>
<!-- hier verbirgt sich das installationsskript um die datenbanktabellen zu erstellen -->
<anc_image_setup>
<setup>
<module>Anc_Image</module>
<class>Mage_Sales_Model_Mysql4_Setup</class>
</setup>
<connection>
<use>core_setup</use>
</connection>
</anc_image_setup>
<!-- datenbank verbindungen -->
<anc_image_write>
<connection>
<use>core_write</use>
</connection>
</anc_image_write>
<anc_image_read>
<connection>
<use>core_read</use>
</connection>
</anc_image_read>
</resources>
</global>
<admin>
<routers>
<anc_image>
<use>admin</use>
<args>
<modules>
<certification_may before="Mage_Adminhtml">Anc_Image_Adminhtml</certification_may>
</modules>
<module>Anc_Image</module>
<frontName>image</frontName>
</args>
</anc_image>
</routers>
</admin>
<adminhtml>
<menu>
<Anc_Anc module="anc_image">
<title>ANC</title>
<sort_order>71</sort_order>
<children>
<ncalbum module="anc_image">
<title>Bilder</title>
<sort_order>1</sort_order>
<action>image/adminhtml_image/list</action>
</ncalbum>
<!-- @backend_grid-->
<!-- <ncimage module="anc_image">
<title>Image</title>
<sort_order>2</sort_order>
<action>image/adminhtml_album/list</action>
</ncimage> -->
</children>
</Anc_Anc>
</menu>
</adminhtml>
</config>
\ No newline at end of file
<?php
/**
* @copyright (c) 2014, netz.coop eG
*/
/**
* @var Mage_Sales_Model_Mysql4_Setup $installer
*/
$installer = $this;
$installer->startSetup();
// Erstellen der anc_pricespercustomer Tabelle
$tableName = $installer->getTable('anc_image/ncimage');
//D::li('***************: '.$tableName);
if ($installer->getConnection()->isTableExists($tableName) != true ){
$table = $installer->getConnection()->newTable($tableName)
->addColumn('entity_id', Varien_Db_Ddl_Table::TYPE_INTEGER,null,array('identity' => true,'unsigned' => true,'nullable' => false,'primary' => true,),'Id')
->addColumn('customer_id', Varien_Db_Ddl_Table::TYPE_INTEGER,null,array('unsigned' => true,'nullable' => false,'default' => '0',),'Who Created frontend')
->addColumn('admin_user_id',Varien_Db_Ddl_Table::TYPE_INTEGER,null,array('unsigned' => true,'nullable' => false,'default' => '0',),'Who Created backend')
->addColumn('created_at', Varien_Db_Ddl_Table::TYPE_TIMESTAMP,null,array(),'When beginn')
->addColumn('updated_at', Varien_Db_Ddl_Table::TYPE_TIMESTAMP,null,array(),'When updated')
->addColumn('deleted_at', Varien_Db_Ddl_Table::TYPE_TIMESTAMP,null, array(), 'When deleted')
->addColumn('deleted', Varien_Db_Ddl_Table::TYPE_TINYINT,null,array('default' => '0'),'Deleted')
->addColumn('path', Varien_Db_Ddl_Table::TYPE_VARCHAR,null,array(),'file path')
->addColumn('file', Varien_Db_Ddl_Table::TYPE_VARCHAR,null,array(),'file')
->addColumn('name', Varien_Db_Ddl_Table::TYPE_VARCHAR,null,array(),'Name')
->addColumn('comment', Varien_Db_Ddl_Table::TYPE_VARCHAR,null,array(),'comment')
->addColumn('ncalbum_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array('unsigned' => true,'nullable' => false,'default' => '0',),'gehört zum album')
->addColumn('original_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array('unsigned' => true,'nullable' => false,'default' => '0',),'wenn album dupliziert wird, würde hier die original album id angezeigt werden')
->addColumn('ncright_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array('unsigned' => true,'nullable' => false,'default' => '0',),'Who Created frontend')
->addIndex($installer->getIdxName('anc_image/ncimage', array('customer_id')), array('customer_id'))
->addIndex($installer->getIdxName('anc_image/ncimage', array('admin_user_id')), array('admin_user_id'))
->addIndex($installer->getIdxName('anc_image/ncimage', array('original_id')), array('original_id'))
->addIndex($installer->getIdxName('anc_image/ncimage', array('ncalbum_id')), array('ncalbum_id'))
// http://docs.magentocommerce.com/Varien/Varien_Db/Varien_Db_Ddl_Table.html#addForeignKey
// ->addForeignKey(
// $installer->getFkName( 'anc_image/ncimage','customer_id','customer/entity','entity_id'), 'customer_id',
// $installer->getTable('customer/entity'), 'entity_id',
// Varien_Db_Ddl_Table::ACTION_CASCADE, Varien_Db_Ddl_Table::ACTION_CASCADE
// )
// ->addForeignKey(
// $installer->getFkName( 'anc_image/ncimage','admin_user_id','admin/user','user_id'), 'admin_user_id',
// $installer->getTable('admin/user'), 'user_id',
// Varien_Db_Ddl_Table::ACTION_NO_ACTION, Varien_Db_Ddl_Table::ACTION_NO_ACTION
// )
// ->addForeignKey(
// $installer->getFkName( 'anc_image/ncimage','original_id','anc_image/ncimage','entity_id'), 'original_id',
// $installer->getTable('anc_image/ncimage'), 'entity_id',
// Varien_Db_Ddl_Table::ACTION_NO_ACTION, Varien_Db_Ddl_Table::ACTION_NO_ACTION
// )
// ->addForeignKey(
// $installer->getFkName( 'anc_image/ncimage','ncalbum_id','anc_album/ncalbum','entity_id'), 'ncalbum_id',
// $installer->getTable('anc_album/ncalbum'), 'entity_id',
// Varien_Db_Ddl_Table::ACTION_CASCADE, Varien_Db_Ddl_Table::ACTION_CASCADE
// )
;
$installer->getConnection()->createTable($table);
}
/**
* für die anzeige ob kunde schon mal bild benutzt hat, und wenn ja wan
* redudant weil info ansich vorhanden, aber zu performant um ran zukommen
*/
$tableName = $installer->getTable('anc_image/ncimage_quoteitemoption');
if ($installer->getConnection()->isTableExists($tableName) != true ){
$table = $installer->getConnection()->newTable($tableName)
->addColumn('entity_id', Varien_Db_Ddl_Table::TYPE_INTEGER,null,array('identity' => true,'unsigned' => true,'nullable' => false,'primary' => true,),'Id')
->addColumn('customer_id', Varien_Db_Ddl_Table::TYPE_INTEGER,null,array('unsigned' => true,'nullable' => false,'default' => '0',),'Who Created frontend')
->addColumn('ncimage_id', Varien_Db_Ddl_Table::TYPE_INTEGER,null,array('unsigned' => true,'nullable' => false,'default' => '0',),'Who Created backend')
->addColumn('order_id', Varien_Db_Ddl_Table::TYPE_INTEGER,null,array('unsigned' => true,'nullable' => false,'default' => '0',),'Who Created backend')
->addColumn('quote_item_id',Varien_Db_Ddl_Table::TYPE_INTEGER,null,array('unsigned' => true,'nullable' => false,'default' => '0',),'Who Created backend')
->addColumn('ordertime', Varien_Db_Ddl_Table::TYPE_TIMESTAMP,null,array(),'Bestellzeitpunkt')
->addColumn('product_name', Varien_Db_Ddl_Table::TYPE_VARCHAR,null,array(),'Produktname')
->addIndex($installer->getIdxName('anc_image/ncimage_quoteitemoption', array('customer_id')),array('customer_id'))
->addIndex($installer->getIdxName('anc_image/ncimage_quoteitemoption', array('ncimage_id')),array('ncimage_id'))
->addIndex($installer->getIdxName('anc_image/ncimage_quoteitemoption', array('order_id')),array('order_id'))
->addIndex($installer->getIdxName('anc_image/ncimage_quoteitemoption', array('quote_item_id')),array('quote_item_id'))
// ->addForeignKey(
// $installer->getFkName( 'anc_image/ncimage_quoteitemoption','customer_id','customer/entity','entity_id'), 'customer_id',
// $installer->getTable('customer/entity'), 'entity_id',
// Varien_Db_Ddl_Table::ACTION_CASCADE, Varien_Db_Ddl_Table::ACTION_CASCADE
// )
// ->addForeignKey(
// $installer->getFkName( 'anc_image/ncimage_quoteitemoption','ncimage_id','anc_image/ncimage','entity_id'), 'ncimage_id',
// $installer->getTable('anc_image/ncimage'), 'entity_id',
// Varien_Db_Ddl_Table::ACTION_CASCADE, Varien_Db_Ddl_Table::ACTION_CASCADE
// )
// ->addForeignKey(
// $installer->getFkName( 'anc_image/ncimage_quoteitemoption','order_id','sales/order','entity_id'), 'order_id',
// $installer->getTable('sales/order'), 'entity_id',
// Varien_Db_Ddl_Table::ACTION_CASCADE, Varien_Db_Ddl_Table::ACTION_CASCADE
// )
// ->addForeignKey(
// $installer->getFkName( 'anc_image/ncimage_quoteitemoption','quote_item_id','sales/quote_item','item_id'), 'quote_item_id',
// $installer->getTable('sales/quote_item'), 'item_id',
// Varien_Db_Ddl_Table::ACTION_CASCADE, Varien_Db_Ddl_Table::ACTION_CASCADE
// )
;
$installer->getConnection()->createTable($table);
}
$installer->endSetup();
?>
\ No newline at end of file
<?php
/**
* @copyright (c) 2014, netz.coop eG
*/
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
$model = 'anc_image/ncimage';
$installer = $this;
$connection = $installer->getConnection();
$installer->startSetup();
/**
* Neue Spalte für die Unterschrift als font wenn gesetzt muss der Buchstabe für das einbetten angegeben werden
*/
$installer->getConnection()
->addColumn($installer->getTable('anc_image/ncimage'), 'issignature', Varien_Db_Ddl_Table::TYPE_TEXT, null, array(), 'Unterschrift');
$installer->getConnection()
->addColumn($installer->getTable('anc_image/ncimage'), 'font', Varien_Db_Ddl_Table::TYPE_TEXT, null, array(), 'Schriftname');
?>
\ No newline at end of file
<?php
/**
* @copyright (c) 2014, netz.coop eG
*/
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
$model = 'anc_image/ncimage';
$installer = $this;
$connection = $installer->getConnection();
$installer->startSetup();
$installer->getConnection()
->addColumn($installer->getTable('anc_image/ncimage'), 'ordered',Varien_Db_Ddl_Table::TYPE_BOOLEAN,null,array(),'standard')
?>
\ No newline at end of file
<?xml version="1.0"?>
<layout version="0.1.0">
<anc_image_administrator_simpleowngallery>
<reference name="content">
<block type="anc_image/adminhtml_admingallery" name="simpleadmingallery" template="anc/image/simpleadmingallery.phtml" />
</reference>
</anc_image_administrator_simpleowngallery>
</layout>
<?php
/**
*
* @package anc_image
* @anc_image_eingabetyp
* @copy from Magento18/app/design/adminhtml/default/default/template/catalog/product/edit/options/option.phtml
* @eingabetyp_Redundanz Achtung!!! weitere Extensions die davon betroffen sind und selben Inhalt benötigen!!!!: AncImage, AncPlaylist, AncAddressimport
* @since 20140416
* @author netz.coop eG*
* @copyright (c) netz.coop eG*
* @version Magento 1.8, 1.9
*/
D::li('Anc_Image_Block_Adminhtml_Catalog_Product_Edit_Tab_Options_Option => anc/image/catalog/product/edit/options/option.phtml');
?>
<?php
/**
* Magento
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE_AFL.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@magentocommerce.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade Magento to newer
* versions in the future. If you wish to customize Magento for your
* needs please refer to http://www.magentocommerce.com for more information.
*
* @category design
* @package default_default
* @copyright Copyright (c) 2013 Magento Inc. (http://www.magentocommerce.com)
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
*/
?>
<?php echo $this->getTemplatesHtml() ?>
<script type="text/javascript">
//<![CDATA[
var firstStepTemplate = '<div class="option-box" id="option_{{id}}">'+
'<table id="<?php echo $this->getFieldId() ?>_{{id}}" class="option-header" cellpadding="0" cellspacing="0">'+
'<input type="hidden" id="<?php echo $this->getFieldId() ?>_{{id}}_is_delete" name="<?php echo $this->getFieldName() ?>[{{id}}][is_delete]" value="" />'+
'<input type="hidden" id="<?php echo $this->getFieldId() ?>_{{id}}_previous_type" name="<?php echo $this->getFieldName() ?>[{{id}}][previous_type]" value="{{type}}" />'+
'<input type="hidden" id="<?php echo $this->getFieldId() ?>_{{id}}_previous_group" name="<?php echo $this->getFieldName() ?>[{{id}}][previous_group]" value="" />'+
'<input type="hidden" id="<?php echo $this->getFieldId() ?>_{{id}}_id" name="<?php echo $this->getFieldName() ?>[{{id}}][id]" value="{{id}}" />'+
'<input type="hidden" id="<?php echo $this->getFieldId() ?>_{{id}}_option_id" name="<?php echo $this->getFieldName() ?>[{{id}}][option_id]" value="{{option_id}}" />'+
'<thead>'+
'<tr>'+
'<th class="opt-title"><?php echo Mage::helper('catalog')->__('Title') ?> <span class="required">*</span></th>'+
'<th class="opt-type"><?php echo Mage::helper('catalog')->__('Input Type') ?> <span class="required">*</span></th>'+
'<th class="opt-req"><?php echo $this->jsQuoteEscape(Mage::helper('catalog')->__('Is Required')) ?></th>'+
'<th class="opt-order"><?php echo Mage::helper('catalog')->__('Sort Order') ?></th>'+
'<th class="a-right"><?php echo $this->jsQuoteEscape($this->getDeleteButtonHtml()) ?></th>'+
'</tr>'+
'</thead>'+
'<tr>'+
'<td><input type="text" class="required-entry input-text" id="<?php echo $this->getFieldId() ?>_{{id}}_title" name="<?php echo $this->getFieldName() ?>[{{id}}][title]" value="{{title}}">{{checkboxScopeTitle}}</td>'+
'<td><?php echo $this->getTypeSelectHtml() ?></td>'+
'<td class="opt-req"><?php echo $this->getRequireSelectHtml() ?></td>'+
'<td><input type="text" class="validate-zero-or-greater input-text" name="<?php echo $this->getFieldName() ?>[{{id}}][sort_order]" value="{{sort_order}}"></td>'+
'<td>&nbsp;</td>'+
'</tr></table></div>';
var productOption = {
div : $('product_options_container_top'),
templateSyntax : /(^|.|\r|\n)({{(\w+)}})/,
templateText : firstStepTemplate,
itemCount : 1,
add : function(data) {
this.template = new Template(this.templateText, this.templateSyntax);
if(!data.id){
data = {};
data.id = this.itemCount;
data.type = '';
data.option_id = 0;
} else {
this.itemCount = data.item_count;
}
Element.insert(this.div, {'after':this.template.evaluate(data)});
//set selected type
if (data.type) {
$A($('<?php echo $this->getFieldId() ?>_'+data.id+'_type').options).each(function(option){
if (option.value==data.type) option.selected = true;
});
}
//set selected is_require
if (data.is_require) {
$A($('<?php echo $this->getFieldId() ?>_'+data.id+'_is_require').options).each(function(option){
if (option.value==data.is_require) option.selected = true;
});
}
if (data.checkboxScopeTitle) {
//set disabled
if ($('<?php echo $this->getFieldId() ?>_'+data.option_id+'_title') && data.scopeTitleDisabled) {
$('<?php echo $this->getFieldId() ?>_'+data.option_id+'_title').disable();
}
}
this.itemCount++;
this.bindRemoveButtons();
productOptionType.bindSelectInputType();
},
remove : function(event){
var element = $(Event.findElement(event, 'div'));
if(element){
$('product_'+element.readAttribute('id')+'_'+'is_delete').value = '1';
element.addClassName('no-display');
element.addClassName('ignore-validate');
element.hide();
}
},
bindRemoveButtons : function(){
var buttons = $$('div.product-custom-options .delete-product-option');
for(var i=0;i<buttons.length;i++){
if(!$(buttons[i]).binded){
$(buttons[i]).binded = true;
Event.observe(buttons[i], 'click', this.remove.bind(this));
}
}
var inputs = $$('div.product-custom-options button', 'div.product-custom-options input', 'div.product-custom-options select', 'div.product-custom-options textarea');
<?php if ($this->isReadonly()):?>
for (var i=0, l = inputs.length; i < l; i ++) {
inputs[i].disabled = true;
if (inputs[i].tagName.toLowerCase()=='button') {
inputs[i].addClassName('disabled');
}
}
<?php else: ?>
inputs.each(function(el) { Event.observe(el, 'change', el.setHasChanges.bind(el)); } )
<?php endif;?>
}
}
var productOptionType = {
templateSyntax : /(^|.|\r|\n)({{(\w+)}})/,
loadStepTwo : function(event){
var element = $(Event.findElement(event, 'select'));
var group = '';
var previousGroupElm = $(element.readAttribute('id').sub('_type', '_previous_group'));
switch(element.getValue()){
case 'field':
case 'area':
template = OptionTemplateText;
group = 'text';
break;
case 'file':
template = OptionTemplateFile;
group = 'file';
break;
case 'drop_down':
case 'radio':
case 'checkbox':
case 'multiple':
template = OptionTemplateSelect;
group = 'select';
break;
case 'date':
case 'date_time':
case 'time':
template = OptionTemplateDate;
group = 'date';
break;
// @eingabetyp_Redundanz
// * @package anc_image
// * @since 20140416 @author netz.coop eG
case 'ancimage_type':
template = OptionTemplateAncimage;
group = 'ancimage';
break;
case 'anctext_type':
template = OptionTemplateAnctext;
group = 'anctext';
break;
//
// * @package anc_addressimport
// * @since 20140717 @author netz.coop eG
case 'ancaddressimport_type':
template = OptionTemplateAncaddressimport;
group = 'ancaddressimport';
break;
case 'ancplaylist_type':
template = OptionTemplateAncplaylist;
group = 'ancplaylist';
break;
default:
template = '';
group = 'unknown';
break;
}
if (previousGroupElm.getValue() != group) {
if ($(element.readAttribute('id')+'_'+previousGroupElm.getValue())) {
formElm = $(element.readAttribute('id')+'_'+previousGroupElm.getValue()).descendants();
formElm.each(function(elm){
if (elm.tagName == 'input' || elm.tagName == 'select') {
elm.name = '__delete__'+elm.readAttribute('name');
}
});
$(element.readAttribute('id')+'_'+previousGroupElm.getValue()).addClassName('no-display');
$(element.readAttribute('id')+'_'+previousGroupElm.getValue()).addClassName('ignore-validate');
$(element.readAttribute('id')+'_'+previousGroupElm.getValue()).hide();
}
previousGroupElm.value = group;
if ($(element.readAttribute('id')+'_'+group)) {
formElm = $(element.readAttribute('id')+'_'+group).descendants();
formElm.each(function(elm){
if (elm.match('input') || elm.match('select')) {
elm.name = elm.readAttribute('name').sub('__delete__', '');
}
});
$(element.readAttribute('id')+'_'+group).removeClassName('no-display');
$(element.readAttribute('id')+'_'+group).removeClassName('ignore-validate');
$(element.readAttribute('id')+'_'+group).show();
} else {
template = '<div id="'+element.readAttribute('id')+'_'+group+'" class="grid tier form-list">'+template+'</div><div id="'+element.readAttribute('id')+'_'+group+'_advice"></div';
this.secondTemplate = new Template(template, this.templateSyntax);
data = {};
if (!data.option_id) {
data = {};
data.option_id = $(element.readAttribute('id').sub('_type', '_id')).getValue();
}
Element.insert(element.readAttribute('id').sub('_type', ''), {'after':this.secondTemplate.evaluate(data)});
switch(element.getValue()){
case 'drop_down':
case 'radio':
case 'checkbox':
case 'multiple':
selectOptionType.bindAddButton();
break;
}
}
}
},
addDataToValues : function(data){
switch(data.type){
case 'field':
case 'area':
template = OptionTemplateText;
group = 'text';
break;
case 'file':
template = OptionTemplateFile;
group = 'file';
break;
case 'drop_down':
case 'radio':
case 'checkbox':
case 'multiple':
template = OptionTemplateSelect;
group = 'select';
break;
case 'date':
case 'date_time':
case 'time':
template = OptionTemplateDate;
group = 'date';
break;
// @eingabetyp_Redundanz
// * @package anc_image
// * @since 20140416 @author netz.coop eG
case 'ancimage_type':
template = OptionTemplateAncimage;
group = 'ancimage';
break;
case 'anctext_type':
template = OptionTemplateAnctext;
group = 'anctext';
break;
// * @package anc_addressimport
// * @since 20140717 @author netz.coop eG
case 'ancaddressimport_type':
template = OptionTemplateAncaddressimport;
group = 'ancaddressimport';
break;
case 'ancplaylist_type':
template = OptionTemplateAncplaylist;
group = 'ancplaylist';
break;
}
$('<?php echo $this->getFieldId() ?>_'+data.id+'_previous_group').value = group;
template = '<div id="<?php echo $this->getFieldId() ?>_{{id}}_type_'+group+'" class="grid tier form-list">'+template+'</div><div id="<?php echo $this->getFieldId() ?>_{{id}}_type_'+group+'_advice"></div>';
this.secondTemplate = new Template(template, this.templateSyntax);
Element.insert($('<?php echo $this->getFieldId() ?>_'+data.option_id), {'after':this.secondTemplate.evaluate(data)});
if (data.checkboxScopePrice) {
//set disabled
if ($('<?php echo $this->getFieldId() ?>_'+data.option_id+'_price') && data.scopePriceDisabled) {
$('<?php echo $this->getFieldId() ?>_'+data.option_id+'_price').disable();
$('<?php echo $this->getFieldId() ?>_'+data.option_id+'_price_type').disable();
}
}
switch(data.type){
case 'drop_down':
case 'radio':
case 'checkbox':
case 'multiple':
data.optionValues.each(function(value) {
selectOptionType.add(value);
});
selectOptionType.bindAddButton();
break;
}
if (data.price_type) {
$A($('<?php echo $this->getFieldId() ?>_'+data.option_id+'_price_type').options).each(function(option){
if (option.value==data.price_type) option.selected = true;
});
}
},
bindSelectInputType : function(){
var types = $$('.select-product-option-type');
for(var i=0;i<types.length;i++){
if(!$(types[i]).binded){
$(types[i]).binded = true;
Event.observe(types[i], 'change', function(event){
productOptionType.loadStepTwo(event);
});
}
}
}
}
var productOptionScope = {
addScope : function(event){
var element = $(Event.element(event));
fieldToDisable = $(element.readAttribute('id').sub('_use_default', ''));
if (fieldToDisable.disabled) {
if (fieldToDisable.hasClassName('product-option-price')) {//need change to cheking value of element
$(fieldToDisable.readAttribute('id')+'_type').enable();
}
fieldToDisable.enable();
} else {
if (fieldToDisable.hasClassName('product-option-price')) {//need change to cheking value of element
$(fieldToDisable.readAttribute('id')+'_type').disable();
}
fieldToDisable.disable();
}
},
bindScopeCheckbox : function(){
var checkboxes = $$('.product-option-scope-checkbox');
for (var i=0;i<checkboxes.length;i++) {
if (!$(checkboxes[i]).binded) {
$(checkboxes[i]).binded = true;
Event.observe(checkboxes[i], 'click', this.addScope.bind(this));
}
}
}
}
if($('option_panel')){
$('option_panel').remove();
}
productOption.bindRemoveButtons();
if($('<?php echo $this->getAddButtonId() ?>')){
Event.observe('<?php echo $this->getAddButtonId() ?>', 'click', productOption.add.bind(productOption));
}
//validation for selected input type
Validation.addAllThese([
['required-option-select', <?php echo $this->helper('core')->jsonEncode(Mage::helper('catalog')->__('Select type of option')) ?>, function(v, elm) {
if (elm.getValue() == '') {
return false;
}
return true;
}]]);
//adding data to templates
<?php foreach ($this->getOptionValues() as $_value): ?>
productOption.add(<?php echo $_value->toJson() ?>);
productOptionType.addDataToValues(<?php echo $_value->toJson() ?>);
<?php endforeach; ?>
//bind scope checkboxes
productOptionScope.bindScopeCheckbox();
//]]>
</script>
<div><?php if (!$this->isReadonly()):?><input type="hidden" name="affect_product_custom_options" value="1" /><?php endif;?></div>
<?php
/**
* @package anc_image
* @anc_image_eingabetyp - Formular-template im Backend beim Produkt editieren
* @copy app/design/adminhtml/default/default/template/catalog/product/edit/options/type/text.phtml
* @since 20140416
* @author netz.coop eG*
* @version Magento 1.8, 1.9
*/
D::li('Anc_Image_Block_Adminhtml_Catalog_Product_Edit_Tab_Options_Type_Ancimage => app/design/adminhtml/template/catalog/product/edit/options/type/ancimage.phtml');
?>
<script type="text/javascript">
//<![CDATA[
OptionTemplateAncimage = '<table class="border" cellpadding="0" cellspacing="0">'+
'<tr class="headings">'+
<?php if ($this->getCanReadPrice() !== false) : ?>
'<th class="type-price"><?php echo Mage::helper('catalog')->__('Price') ?></th>' +
'<th class="type-type"><?php echo Mage::helper('catalog')->__('Price Type') ?></th>' +
<?php endif; ?>
'<th class="type-sku"><?php echo Mage::helper('catalog')->__('SKU') ?></th>'+
'<th class="type-last last"><?php echo Mage::helper('catalog')->__('Max Size in MB') ?> </th>'+
'<th class="last">' + <?php echo $this->helper('core')->jsonEncode(Mage::helper('catalog')->__('Maximum Image Size')); ?> + '</th>' +
'</tr>'+
'<tr>'+
<?php if ($this->getCanReadPrice() !== false) : ?>
'<td><input type="text" class="input-text validate-number product-option-price" id="product_option_{{option_id}}_price" name="product[options][{{option_id}}][price]" value="{{price}}"<?php if ($this->getCanEditPrice() === false) : ?> disabled="disabled"<?php endif; ?>></td>' +
'<td><?php echo $this->getPriceTypeSelectHtml() ?>{{checkboxScopePrice}}</td>' +
<?php else : ?>
'<input type="hidden" name="product[options][{{option_id}}][price]">' +
'<input type="hidden" name="product[options][{{option_id}}][price_type]" id="product_option_{{option_id}}_price_type">' +
<?php endif; ?>
'<td><input type="text" class="input-text" name="product[options][{{option_id}}][sku]" value="{{sku}}"></td>'+
'<td class="type-last last"><input type="text" class="input-text validate-zero-or-greater" name="product[options][{{option_id}}][max_characters]" value="{{max_characters}}"></td>'+
'<td class="type-last last" nowrap><input class="input-text" type="text" name="product[options][{{option_id}}][image_size_x]" value="{{image_size_x}}">' +
<?php echo $this->helper('core')->jsonEncode(Mage::helper('catalog')->__('x')) ?> +
'<input class="input-text" type="text" name="product[options][{{option_id}}][image_size_y]" value="{{image_size_y}}">' +
<?php echo $this->helper('core')->jsonEncode(Mage::helper('catalog')->__('px.')) ?> +
'</td>' +
'</tr>'+
'</table>';
if ($('option_panel_type_ancimage')) {
$('option_panel_type_ancimage').remove();
}
//]]>
</script>
\ No newline at end of file
<?php
$params=$this->getRequest()->getParams();
D::ulli('Test sg.phtml',1);
?>
<?php $NcImagesForCustomer = Mage::helper('anc_image/ncmodel')->getNcImagesForAlbum($params['id']); ?>
<ul class="gallery AncGalleryImages">
<?php foreach($NcImagesForCustomer as $ncimage ): ?>
<?php $NcImagePath = Mage::helper('anc_image/ncimage')->getNcImagePath($ncimage['entity_id'], 'relative', 'original'); ?>
<?php $ncimage_title = Mage::helper('anc_image/ncimage')->getNcImageMetaDataAsHtml($ncimage['entity_id']); ?>
<a data-site="<?php echo $this->getUrl('ancimage/customer/showNcImageForm', array('id'=>$ncimage['entity_id'])) ?>" class="ancimage-showNcImageForm" rel="prettyPhoto[pp_gal2]" href="<?php echo DS.$NcImagePath ?>" title="<?php echo $ncimage_title; ?>">
<img height="50" src="<?php echo DS.$NcImagePath ?>" class="anc-image-draggable" id="<?php echo $ncimage['entity_id'] ?>" />
</a>
<?php endforeach; ?>
</ul>
\ No newline at end of file
<?xml version="1.0"?>
<layout version="0.1.0">
<!-- in "meinem Benutzerkonto" wird ein weiterer link angezeigt, der über den Controller die neue seite anzeigt -->
<customer_account>
<reference name="customer_account_navigation">
<action method="addLink"><name>galleriesmanager</name><path>ancimage/customer/galleriesmanager</path><label>Verwalten Sie Ihre Bilder</label><urlParams /></action>
</reference>
<reference name="head">
<action method="addJs"><script>Anc/Image/extlib/dropzone.js</script></action>
<action method="addCss"><stylesheet>css/anc/image/dropzone.css</stylesheet></action>
<action method="addJs"><script>Anc/Image/extlib/jquery.prettyPhoto.js</script></action>
<action method="addCss"><stylesheet>css/anc/image/prettyPhoto.css</stylesheet></action>
</reference>
<reference name="right"></reference>
</customer_account>
<catalog_product_view translate="label">
<reference name="head">
<action method="addCss"><stylesheet>css/anc/image/dropzone.css</stylesheet></action>
<action method="addCss"><stylesheet>css/anc/lib/ancextension_type.css</stylesheet></action>
<action method="addCss"><stylesheet>css/anc/image/customer_galleriesmanager.css</stylesheet></action>
<action method="addCss"><stylesheet>css/anc/image/prettyPhoto.css</stylesheet></action>
<action method="addJs"><script>Anc/Image/Type.js</script></action>
<action method="addJs"><script>Anc/Image/extlib/dropzone.js</script></action>
<action method="addJs"><script>Anc/Image/extlib/jquery.prettyPhoto.js</script></action>
<!--jquery version problematik @since 20140828-->
<action method="addJs"><script>Anc/Lib/croppic/croppic.min.js</script></action>
<action method="addJs"><script>Anc/Lib/Croppic.js</script></action>
<action method="addCss"><stylesheet>css/anc/lib/croppic/croppic.css</stylesheet></action>
</reference>
<reference name="product.info">
</reference>
<reference name="product.info.options">
<!-- @anc_image_eingabetyp -->
<action method="addOptionRenderer">
<type>ancimage</type>
<block>anc_image/catalog_product_view_options_type_ancimage</block>
<template>anc/image/catalog/product/view/options/type/ancimage.phtml</template>
</action>
</reference>
</catalog_product_view>
<!-- for the @AncBundleproduct Extension and the sepcial catalog_product_subview @anc_image_eingabetyp -->
<catalog_product_subview translate="label">
<reference name="head">
<action method="addCss"><stylesheet>css/anc/lib/ancextension_type.css</stylesheet></action>
<action method="addCss"><stylesheet>css/anc/image/dropzone.css</stylesheet></action>
<action method="addCss"><stylesheet>css/anc/image/prettyPhoto.css</stylesheet></action>
<action method="addJs"><script>Anc/Image/Type.js</script></action>
<action method="addJs"><script>Anc/Image/extlib/dropzone.js</script></action>
<action method="addJs"><script>Anc/Image/extlib/jquery.prettyPhoto.js</script></action>
<action method="addJs"><script>Anc/Lib/croppic/croppic.min.js</script></action>
<action method="addJs"><script>Anc/Lib/Croppic.js</script></action>
</reference>
<reference name="content">
<block type="core/template" name="product.subview.image" template="anc/image/manipulate_catalog_product_subview.phtml"/>
</reference>
<reference name="product.info">
</reference>
<reference name="product.info.options">
<!-- @anc_image_eingabetyp -->
<action method="addOptionRenderer">
<type>ancimage</type>
<block>anc_image/catalog_product_view_options_type_ancimage</block>
<template>anc/image/catalog/product/view/options/type/ancimage.phtml</template>
</action>
<action method="addOptionRenderer">
<type>ancaddressimport</type>
<block>anc_addressimport/catalog_product_view_options_type_ancaddressimport</block>
<template>anc/addressimport/catalog/product/view/options/type/ancaddressimport.phtml</template>
</action>
</reference>
</catalog_product_subview>
<anc_image_customer_gallerysimple>
<reference name="head">
<action method="addJs"><script>Anc/Image/extlib/jquery.prettyPhoto.js</script></action>
</reference>
<reference name="content">
<block type="anc_image/galleriesmanager" name="anc_image_gallerysimple" template="anc/image/customer_gallerysimple.phtml" />
</reference>
</anc_image_customer_gallerysimple>
<anc_image_customer_showncimageform>
<reference name="head">
<!-- <action method="addCss"><stylesheet>css/anc/lib/ancextension_type.css</stylesheet></action>
<action method="addJs"><script>Anc/Image/Form.js</script></action>
<action method="addCss"><stylesheet>css/anc/image/dropzone.css</stylesheet></action>-->
<action method="addCss"><stylesheet>css/anc/image/prettyPhoto.css</stylesheet></action>
<action method="addJs"><script>Anc/Image/extlib/dropzone.js</script></action>
<!--<action method="addJs"><script>Anc/Image/Form.js</script></action>-->
<action method="addJs"><script>Anc/Image/extlib/jquery.prettyPhoto.js</script></action>
<!--notwendig für einzelansicht nicht aber wenn ajaxmaessig geladen wird-->
<!--<action method="removeItem"><type>js</type><name>jquery/jquery-2.0.2.min.js</name></action>-->
<!--jquery version problematik @since 20140828-->
<!--<action method="removeItem"><type>js</type><name>jquery/jqueryui/jquery-ui.min.js</name></action>-->
<action method="removeItem"><type>js</type><name>Anc/Printconfigproduct/tinymce/js/tinymce/tinymce.min.js</name></action>
</reference>
<reference name="content">
<block type="anc_image/galleriesmanager" name="anc_image_showncimageform" template="anc/image/customer_showncimageform.phtml" />
</reference>
</anc_image_customer_showncimageform>
<!-- Kürzel_extensionname_contraller_funcion bzw module_controller_action
die controller funktion muss kleingeschrieben sein, nur das A von Action muss groß
Ansicht wird konfiguriert -->
<anc_image_customer_galleriesmanager>
<!-- einbindung von javascript und css -->
<reference name="head">
<action method="addCss"><stylesheet>css/anc/image/customer_galleriesmanager.css</stylesheet></action>
<action method="addCss"><stylesheet>css/anc/lib/ancextension_type.css</stylesheet></action>
<action method="addCss"><stylesheet>css/anc/image/dropzone.css</stylesheet></action>
<action method="addCss"><stylesheet>css/anc/image/prettyPhoto.css</stylesheet></action>
<action method="addJs"><script>Anc/Image/extlib/dropzone.js</script></action>
<action method="addJs"><script>Anc/Image/Type.js</script></action>
<action method="addJs"><script>Anc/Image/extlib/jquery.prettyPhoto.js</script></action>
<!--<action method="addJs"><script>Anc/Image/extlib/dropzone.js</script></action>-->
<!--<action method="addCss"><stylesheet>css/anc/image/dropzone.css</stylesheet></action>-->
</reference>
<!-- einbindung des templates -->
<reference name="content">
<!--
type: module/block klasse
name: derzeit egal, so lange (wie gerade der fall) nicht zB mit getChildHtml aufgerufen wird
template: /var/www/Magento/Magento18/app/design/frontend/base/default/template/anc/image/customer_galleriesmanager.phtml liegen
-->
<block type="anc_image/galleriesmanager" name="anc_image_galleriesmanager" template="anc/image/customer_galleriesmanager.phtml" />
</reference>
<reference name="right">
<!--<action method="insert"><name>customer_account_navigation</name></action>-->
<block type="customer/account_navigation" name="customer_account_navigation" before="-" template="customer/account/navigation.phtml">
<action method="addLink" translate="label" module="customer"><name>account</name><path>customer/account/</path><label>Account Dashboard</label></action>
<action method="addLink" translate="label" module="customer"><name>account_edit</name><path>customer/account/edit/</path><label>Account Information</label></action>
<action method="addLink" translate="label" module="customer"><name>address_book</name><path>customer/address/</path><label>Address Book</label></action>
<action method="addLink" translate="label" module="sales"><name>orders</name><path>sales/order/history/</path><label>My Orders</label></action>
<action method="addLink"><name>galleriesmanager</name><path>ancimage/customer/galleriesmanager</path><label>Verwalten Sie Ihre Bilder</label><urlParams /></action>
</block>
<action method="unsetChild"><name>cart_sidebar</name></action>
<action method="unsetChild"><name>right.reports.product.viewed</name></action>
<remove name="right.poll" />
<remove name="sale.reorder.sidebar" />
<remove name="wishlist_sidebar" />
<action method="unsetChild"><name>right.reports.product.compared</name></action>
<action method="unsetChild"><name>right.permanent.callout</name></action>
</reference>
</anc_image_customer_galleriesmanager>
</layout>
\ No newline at end of file
<?php
/**
*
* @var $this anc_image/catalog_product_view_options_type_ancimage
*
* @package anc_image
* @anc_image_eingabetyp -- Formular bzw ansicht im Frontend im Warenkorb beim Produkt konfigurieren
* @copy Grundlage: Magento18/app/design/frontend/base/default/template/catalog/product/view/options/type/text.phtml
* @since 20140416
* @author netz.coop eG*
*/
?>
<?php
/**
* @cache problem
*/
Mage::app()->cleanCache();
?>
<?php $DropzoneIndex = Mage::helper('anc_lib/data')->getElementIndexForId(); ?>
<?php $dropzone_id = 'ancimage-dropzone-id'.$DropzoneIndex; ?>
<?php $ancnote_id = 'ancnote-id'; ?>
<?php $_option = $this->getOption(); ?>
<?php $input_id = 'options_'.$_option->getId().'_text'; ?>
<div class="ancimage-ancimage anc-productview">
<script type="text/javascript">
function loadNcImageIntoProductGalleryThumbnailButton() {
jQuery('.anc_image_choose').unbind("click").click(function(e){
e.preventDefault();
Anc_Image_Type.loadImageInto(
jQuery(this).data('anc_image_id'),
jQuery('#<?php echo $input_id; ?>'),
jQuery(this).data('anc_image_url'),
jQuery('#<?php echo $dropzone_id; ?>')
);
});
}
</script>
<div class="ancimage_type anc-productview-type" id="<?php echo $_option->getSku(); ?>">
<div class="ancimage_type-fakewrapper anc-productview-type-fakewrapper">
<div id="<?php echo $ancnote_id; ?>"></div>
<input type="hidden" onchange="opConfig.reloadPrice()" id="<?php echo $input_id ?>" class="input-text<?php echo $_option->getIsRequire() ? ' required-entry' : '' ?> <?php echo $_option->getMaxCharacters() ? ' validate-length maximum-length-'.$_option->getMaxCharacters() : '' ?> product-custom-option" name="options[<?php echo $_option->getId() ?>]" value="<?php echo $this->escapeHtml($this->getDefaultValue()) ?>" />
<div class="ancimage-info">
<div class="editor"></div>
<div class="image"></div>
</div>
<div class="<?php echo $_option->getSku(); ?>" id="ancimage-imageeditorarea-id">
<div id="<?php echo $dropzone_id; ?>"
class="dropzone ancimage-dropzone"
title=""
data-pxwidth="<?php echo $_option->getImageSizeX() ?>"
data-pxheight="<?php echo $_option->getImageSizeY() ?>"
data-maxfilesizemb="<?php echo $_option->getMaxCharacters() ?>"
>
<?php $path = Mage::helper('anc_image/ncimage')->getNcImagePath($this->getDefaultValue(), 'relative', 'original'); ?>
<?php // $Currentpageinfos = Mage::helper('anc_lib/data')->getCurrentcheckoutcartinfos(); ?>
<?php $ItemInfos= Mage::helper('anc_lib/data')->getCheckoutCartItemInfos(); ?>
<?php $Cropdata = Mage::helper('anc_image/ncimage')->getCropdata($ItemInfos['item_id']); ?>
<div class="preview-database-image"
data-imagesrc="<?php echo DS.$path; ?>"
<?php if(is_array($Cropdata)): ?>
data-cropH="<?php echo $Cropdata['cropH']; ?>"
data-cropW="<?php echo $Cropdata['cropW']; ?>"
data-imgH="<?php echo $Cropdata['imgH']; ?>"
data-imgW="<?php echo $Cropdata['imgW']; ?>"
data-imgInitH="<?php echo $Cropdata['imgInitH']; ?>"
data-imgInitW="<?php echo $Cropdata['imgInitW']; ?>"
data-imgX1="<?php echo $Cropdata['imgX1']; ?>"
data-imgY1="<?php echo $Cropdata['imgY1']; ?>"
<?php endif; ?>
>
<?php // if($path):?>
<!--<img src="<?php // echo $path; ?>" />-->
<?php // endif; ?>
</div>
</div>
</div>
</div>
</div>
<!-- Gallerien zum auswählen -->
<?php $gallerie_dropzone_id = 'ancimage-dropzone-id'.Mage::helper('anc_lib/data')->getElementIndexForId(); ?>
<div class="ancimage_type-possibility anc-productview-possibility">
<?php echo $this->getLayout()
->getBlockSingleton('anc_image/galleriesmanager')
->setTemplate('anc/image/customer_galleries.phtml')
->setIfGalleryCategory(true)
->setSelectorIdDropzoneOwn($gallerie_dropzone_id)
->toHtml(); ?>
<script type="text/javascript">
jQuery(document).ready(function($) {
// damit initialen laden der Gallerie auch die Thumbnail-Bilder-Button funktionieren
loadNcImageIntoProductGalleryThumbnailButton();
});
</script>
</div>
<script type="text/javascript">
jQuery(document).ready(function($) {
var dropzone_params = {
url: "<?php echo $this->getUrl('ancimage/customer/uploadImage', array()) ?>",
dictDefaultMessage: 'Bild hochladen',
success: function() { this.removeAllFiles(); }
}
var gallery_ajaxData = {
url: "<?php echo $this->getUrl('ancimage/customer/gallerysimple', array()) ?> ul.gallery",
context: jQuery(".ancimage-customer_galleriesown > .ancimage-gallerie-content > .ancimage-gallerie-content-view"),
success: function(reponse) {
// damit das hochgeladene Bild auch in der dropbopx angezeigt wird
Anc_Image_Type.loadImageInto(
reponse.id,
// jQuery('#<?php // echo $_option->getSku(); ?> > dd > .input-box > input'),
jQuery('#<?php echo $input_id; ?>'),
'<?php echo DS; ?>'+reponse.path,
jQuery('#<?php echo $dropzone_id; ?>')
);
// damit nach hochladen eines bildes und darauf folgende reloaden der gallerie,
// die (anderen) galleriebilder wieder in die dropbox geladen werden können
loadNcImageIntoProductGalleryThumbnailButton();
},
};
Anc_Image_Type.droppableFile(
jQuery(" #<?php echo $gallerie_dropzone_id; ?>"),
dropzone_params,
jQuery(" #<?php echo $input_id; ?>"),
jQuery(" #<?php echo $ancnote_id; ?>"),
gallery_ajaxData,
false
);
});
</script>
</div>
\ No newline at end of file
<?php
/**
* @input $this->getIfGalleryCategory()
* @input $this->getSelectorIdDropzoneOwn()
*/
?>
<div class="ancimage-customer_galleries anc-menu-box">
<div class="ancimage-customer_galleries-header anc-menu-box-header">Motive</div>
<div id="accordion" class="anc-menu-box-content">
<?php if($this->getIfGalleryCategory()): ?>
<h3 class="ancimage-gallerie-header anc-menu-box-content-subheader">Vorlagen</h3>
<div class="anc-menu-box-content-subcontent">
<?php echo $this->getLayout()
->getBlockSingleton('anc_image/galleriesmanager')
->setTemplate('anc/image/customer_galleriescategory.phtml')
->setSelectorIdDropzoneCategory()
->toHtml(); ?>
</div>
<?php endif; ?>
<h3 class="ancimage-gallerie-header anc-menu-box-content-subheader">Eigene Motive</h3>
<div class="anc-menu-box-content-subcontent">
<?php echo $this->getLayout()
->getBlockSingleton('anc_image/galleriesmanager')
->setTemplate('anc/image/customer_galleriesown.phtml')
->setSelectorIdDropzoneOwn($this->getSelectorIdDropzoneOwn())
->toHtml(); ?>
</div>
</div>
<script type="text/javascript">
jQuery(document).ready(function($) {
Anc_Image_Type.customerGallerysimplePrettyPhoto();
});
jQuery(function() {
jQuery( "#accordion" ).accordion();
});
</script>
</div>
\ No newline at end of file
<!--/**
* wird geladen wenn der eingabetyp @see @anc_image_eingabetyp genutzt wird
* @package anc_image
* @since 20140425
* @author netz.coop eG*
*/
-->
<?php
$SelectedCategoryNcAlbumModel = Mage::helper('anc_album/nccategory')->getSelectedCategoryNcAlbumModel();
if(is_object($SelectedCategoryNcAlbumModel) && $SelectedCategoryNcAlbumModel->getId()) {
$SelectedCategoryNcAlbumModel_id = $SelectedCategoryNcAlbumModel->getId();
} else {
$SelectedCategoryNcAlbumModel_id = false;
}
?>
<div class="ancimage-customer_galleriescategory">
<div class="ancimage-gallerie-subheader">
<?php if($this->getSelectorIdDropzone()): ?>
<div id="<?php echo $this->getSelectorIdDropzone(); ?>" class="dropzone ancimage-dropzone" title="Bitte ziehen Sie aus Ihrem Dateiexplorer einfach ein Bild in diesen Bereich!"></div>
<?php else: ?>
<div>&nbsp;</div>
<?php endif; ?>
<?php $categories_ncalbums = Mage::helper('anc_album/ncmodel')->getAllCategoryNcAlbums(); ?>
<?php if(is_array($categories_ncalbums) && !empty($categories_ncalbums)): ?>
<div id="ancimage-gallerie-subheader-category">
<ul id="menu">
<li>Rubrik <img src="/skin/frontend/base/default/images/anc/image/unten_25x50.png" />
<ul id="categories_ncalbums">
<?php foreach ($categories_ncalbums as $ncalbum): ?>
<?php $ncalbum_id = $ncalbum['entity_id']; ?>
<li data-ncalbum_id="<?php echo $ncalbum['entity_id'] ?>"
class="<?php if($ncalbum_id===$SelectedCategoryNcAlbumModel_id) { echo 'ui-selected'; } ?>"
>
<?php echo $ncalbum['name'] ?>
</li>
<?php endforeach; ?>
</ul>
</li>
</ul>
</div>
<script type="text/javascript">
var selectOpt = {
selected: function(typ, ui) {
var url = "<?php echo $this->getUrl('ancimage/customer/gallerysimple', array()) ?>ncalbum_id/"+ui.selected.dataset['ncalbum_id']+"/ ul.gallery";
var gallerie_csspath = '.ancimage-customer_galleriescategory > .ancimage-gallerie-content > .ancimage-gallerie-content-view';
jQuery(gallerie_csspath).load(url, function() {
Anc_Image_Type.customerGallerysimplePrettyPhoto();
loadNcImageIntoProductGalleryThumbnailButton();
});
jQuery('#menu > li > ul').css('display','none');
}
}
jQuery('#categories_ncalbums').selectable(selectOpt);
jQuery("#menu").menu({
position: {
my:'left top',
at:'left bottom'
}
});
</script>
<?php endif; ?>
</div>
<?php if($SelectedCategoryNcAlbumModel_id === false) { $SelectedCategoryNcAlbumModel_id = $ncalbum_id; } ?>
<div class="ancimage-gallerie-content">
<div class="ancimage-gallerie-content-view">
<?php echo $this->setTemplate('anc/image/customer_gallerysimple.phtml')->setNcalbumId($SelectedCategoryNcAlbumModel_id)->toHtml(); ?>
</div>
</div>
</div>
\ No newline at end of file
<script type="text/javascript">
function loadNcImageIntoFormThumbnailButton() {
jQuery('.anc_image_choose').unbind("click").click(function(e){
e.preventDefault();
loadNcImageIntoForm(jQuery(this).data('site'));
});
}
function loadNcImageIntoForm(param_url) {
jQuery(".ancimage-customer_galleriesmanager * #ancimage-customer_galleriesmanager-form-content").load(param_url, function() {
jQuery('#ancimage-customer_showNcImageFormDelete').submit(function() { // catch the form's submit event
jQuery.ajax({ // create an AJAX call...
data: jQuery(this).serialize(), // get the form data
type: jQuery(this).attr('method'), // GET or POST
url: jQuery(this).attr('action'), // the file to call
success: function(response) { // on success..
jQuery('.ancimage-customer_galleriesmanager * #ancimage-customer_galleriesmanager-form-content').html(response); // update the DIV
}
});
return false; // cancel original event to prevent form submitting
});
jQuery('#ancimage-customer_showNcImageForm').submit(function() { // catch the form's submit event
jQuery.ajax({ // create an AJAX call...
data: jQuery(this).serialize(), // get the form data
type: jQuery(this).attr('method'), // GET or POST
url: jQuery(this).attr('action'), // the file to call
success: function(response) { // on success..
jQuery('.ancimage-customer_galleriesmanager * #ancimage-customer_galleriesmanager-form-content').html(response); // update the DIV
loadNcImageIntoForm(param_url)
}
});
return false; // cancel original event to prevent form submitting
});
});
}
</script>
<div class="ancimage-customer_galleriesmanager">
<?php if(Mage::getSingleton('customer/session')->isLoggedIn()): ?>
<div class="col2-set">
<div class="col-1">
<div class="ancimage-customer_galleriesmanager-form">
<div class="ancimage-customer_galleriesmanager-main"><h1>Ihre Motive</h1></div>
<div class="ancimage-customer_galleriesmanager-content" id="ancimage-customer_galleriesmanager-form-content"></div>
</div>
</div>
<div class="col-2">
<?php $dropzone_id = 'ancimage-dropzone-id'.Mage::helper('anc_lib/data')->getElementIndexForId(); ?>
<?php $ancnote_id = 'ancnote-id'; ?>
<?php echo $this->getLayout()
->getBlockSingleton('anc_image/galleriesmanager')
->setTemplate('anc/image/customer_galleries.phtml')
->setSelectorIdDropzoneOwn($dropzone_id)
->toHtml(); ?>
<script type="text/javascript">
jQuery(document).ready(function($) {
var dropzone_params = {
url: "<?php echo $this->getUrl('ancimage/customer/uploadImage', array()) ?>",
dictDefaultMessage: 'Bild hochladen',
success: function() { this.removeAllFiles(); }
}
var gallery_ajaxData = {
url: "<?php echo $this->getUrl('ancimage/customer/gallerysimple', array()) ?> ul.gallery",
context: jQuery(".ancimage-customer_galleriesown > .ancimage-gallerie-content > .ancimage-gallerie-content-view"),
success: function(reponse) {
// damit die gallerie auch klickbar ist
loadNcImageIntoFormThumbnailButton();
// damit hochgeladenes Bild auch im Formular gleich angezeigt wird
loadNcImageIntoForm('<?php echo $this->getUrl('ancimage/customer/showNcImageForm', array())?>id/'+reponse.id+'/');
},
};
Anc_Image_Type.droppableFile(
jQuery(" #<?php echo $dropzone_id; ?>"),
dropzone_params,
null,
jQuery(" #<?php echo $ancnote_id; ?>"),
gallery_ajaxData,
false
);
});
</script>
</div>
</div>
<script type="text/javascript">
jQuery(document).ready(function($) {
loadNcImageIntoFormThumbnailButton();
});
</script>
<?php else: ?>
<h1>Bitte loggen Sie sich ein!</h1>
<?php endif; ?>
</div>
<!--/**
* wird geladen wenn der eingabetyp @see @anc_image_eingabetyp genutzt wird
* @package anc_image
* @since 20140425
* @author netz.coop eG*
*/
-->
<div class="ancimage-customer_galleriesown">
<div class="ancimage-gallerie-subheader">
<?php if($this->getSelectorIdDropzoneOwn()): ?>
<div id="<?php echo $this->getSelectorIdDropzoneOwn(); ?>" class="dropzone ancimage-dropzone" title="Bitte ziehen Sie aus Ihrer Galerie oder Ihrem Dateiexplorer einfach ein Bild in diesen Bereich!"></div>
<?php else: ?>
<div>&nbsp;</div>
<?php endif; ?>
<div class="ancimage-gallerie-subheader-category"></div>
</div>
<div class="ancimage-gallerie-content">
<?php if(Mage::getSingleton('customer/session')->isLoggedIn()): ?>
<!-- Anzeige der Daten -->
<div class="ancimage-gallerie-content-view">
<?php $customer = Mage::getSingleton('customer/session')->getCustomer(); ?>
<?php $ncalbum_id = Mage::getModel('anc_album/ncalbum')->load($customer->getId(), 'customer_id')->getId(); ?>
<?php echo $this->setTemplate('anc/image/customer_gallerysimple.phtml')->setNcalbumId($ncalbum_id)->toHtml(); ?>
</div>
<?php else: ?>
<div id="ancnote" class="anc-error">Sie sind nicht angemeldet!<br/>Nutzen Sie die Vorzüge einer eigenen Bildergalerie in der Sie Ihre Bilder verwalten können!</div>
<?php endif; ?>
</div>
</div>
\ No newline at end of file
<?php // $NcImages = Mage::helper('anc_image/ncmodel')->getNcImagesForCustomer(); ?>
<?php
$params=Mage::app()->getRequest()->getParams();
if(!$ncalbum_id = $this->getNcalbumId()) {
$ncalbum_id = Mage::app()->getRequest()->getParam('ncalbum_id');
}
if(!$ncalbum_id) {
$customer = Mage::getSingleton('customer/session')->getCustomer();
$ncalbum_id = Mage::getModel('anc_album/ncalbum')->load($customer->getId(), 'customer_id')->getId();
}
if($ncalbum_id) {
if($params['ncobject_album_id']&&$params['ncobjectsingle']){
$NcImages = Mage::helper('anc_image/ncmodel')->getNcImagesForAlbum($params['ncobject_album_id']);
}else{
$NcImages = Mage::helper('anc_image/ncmodel')->getNcImagesForAlbum($ncalbum_id);
}
} else {
D::li('getNcImagesForCustomer() - nix mit album aber anscheinend wohl trotzdem keine bilder in der gallerie');
$NcImages = Mage::helper('anc_image/ncmodel')->getNcImagesForCustomer();
}
?>
<ul class="gallery AncGalleryImages">
<?php foreach($NcImages as $ncimage ): ?>
<?php $NcImagePath = Mage::helper('anc_image/ncimage')->getNcImagePath($ncimage['entity_id'], 'relative', 'thumbnail'); ?>
<?php $NcImagePath_original = Mage::helper('anc_image/ncimage')->getNcImagePath($ncimage['entity_id'], 'relative', 'original'); ?>
<?php $ncimage_title = Mage::helper('anc_image/ncimage')->getNcImageMetaDataAsHtml($ncimage['entity_id']); ?>
<a data-site="<?php echo $this->getUrl('ancimage/customer/showNcImageForm', array('id'=>$ncimage['entity_id'])) ?>"
class="ancimage-showNcImageForm"
rel="prettyPhoto[pp_gal2]"
href="<?php echo DS.$NcImagePath_original ?>"
>
<div class="anc_image_wrapper">
<a class="anc_image_choose"
href="#"
data-anc_image_id="<?php echo $ncimage['entity_id'] ?>"
data-anc_image_url="<?php echo DS.$NcImagePath_original ?>"
data-site="<?php echo $this->getUrl('ancimage/customer/showNcImageForm', array('id'=>$ncimage['entity_id'])) ?>"
title='<?php if($ncimage['name']):?><span class="header"><?php echo $ncimage['name']; ?></span><?php endif; ?><span class="content"><?php if($ncimage['comment']): echo $ncimage['comment'].'<br/><br/>'; endif; ?><?php echo $ncimage_title; ?></span>'
>
<img src="<?php echo DS.$NcImagePath ?>" class="anc-image-draggable" id="<?php echo $ncimage['entity_id'] ?>" />
</a>
</div>
</a>
<?php endforeach; ?>
</ul>
<!--
/**
* Anc_Image_CustomerController::showncimageformAction() template
* @var $this anc_image/galleriesmanager (Anc_Image_Block_Galleriesmanager)
*
* @package anc_image
* @anc_image_eingabetyp -- Formular bzw ansicht im Frontend im Warenkorb beim Produkt konfigurieren
* @copy Grundlage: Magento18/app/design/frontend/base/default/template/catalog/product/view/options/type/text.phtml
* @since 20140416
* @author netz.coop eG*
*/
-->
<?php
$ncimage = $this->getCallNcImage();
$path = Mage::helper('anc_image/ncimage')->getNcImagePath($ncimage->getId(), 'relative', 'original');
// $ncimage_data = mcImagick::getData(Mage::getBaseDir().$path);
$ncimage_data = mcImagick::getData(Mage::helper('anc_lib/ncfilepath')->getThisMagentoInstallationPath().$path);
$dropzone_id = 'ancimage-dropzone-id';
$ancnote_id = '#ancnote';
?>
<form action="<?php echo $this->getUrl('ancimage/customer/showNcImageForm', array('id'=>$ncimage->getId())); ?>" id="ancimage-customer_showNcImageForm">
<div class="anctable showncimageform">
<div id="ancnote"></div>
<div class="ancimage" >
<div id="<?php echo $dropzone_id; ?>" class="dropzone ancimage-dropzone">
<div class="preview-database-image">
<?php if($path):?>
<img src="<?php echo DS.$path; ?>" />
<?php endif; ?>
</div>
</div>
</div>
<div class="fileinfos anctablerow">
<div class="label">Dateiinfos:</div>
<div class="value">Breite: <?php echo $ncimage_data['width']?> px - Höhe: <?php echo $ncimage_data['height']; ?> px - Dateigröße: <?php echo mcFile::binary_multiples($ncimage_data['size']); ?> </div>
</div>
<div class="name anctablerow">
<div class="label">Name:</div>
<div class="value"><input name="name" type="text" size="30" maxlength="30" value="<?php echo $ncimage->getName(); ?>" /></div>
</div>
<div class="comment anctablerow">
<div class="label">Kommentar:</div>
<div class="value"><textarea name="comment" cols="50" rows="5" ><?php echo $ncimage->getComment(); ?></textarea></div>
</div>
<div class="anctablerow buttons">
<div class="label"></div>
<div class="value">
<?php $buttonTitle = 'lösche Datei'; ?>
<input class="button delete" title="<?php echo $this->__($buttonTitle) ?>" type="submit" value="<?php echo $this->__($buttonTitle) ?>" />
<?php $buttonTitle = 'speichern'; ?>
<input class="button save" title="<?php echo $this->__($buttonTitle) ?>" type="submit" value="<?php echo $this->__($buttonTitle) ?>" />
</div>
</div>
<script type="text/javascript">
jQuery('.buttons > .delete').unbind("click").click(function(e){
e.preventDefault();
jQuery.ajax({ // create an AJAX call...
url: '<?php echo $this->getUrl('ancimage/customer/deleteNcImage', array('id'=>$ncimage->getId())); ?>', // the file to call
success: function(rep) { // on success..
var reponse = jQuery.parseJSON( rep );
jQuery('#ancnote').append(reponse.message);
jQuery('#ancnote').addClass('anc-error');
jQuery('#ancimage-customer_showNcImageForm').hide();
var gallery_ajaxData = {
url: "<?php echo $this->getUrl('ancimage/customer/gallerysimple', array()) ?> ul.gallery",
context: jQuery(".ancimage-customer_galleriesown > .ancimage-gallerie-content > .ancimage-gallerie-content-view"),
success: function(data) {
jQuery(this).html(data);
// damit die gallerie auch klickbar ist
loadNcImageIntoFormThumbnailButton();
Anc_Image_Type.customerGallerysimplePrettyPhoto();
},
};
jQuery.ajax(gallery_ajaxData);
}
});
});
</script>
</div>
</form>
<script type="text/javascript">
jQuery(document).ready(function($) {
var dropzone_params = {
url: "<?php echo $this->getUrl('ancimage/customer/uploadImage', array('id'=> $ncimage->getId())) ?>",
dictDefaultMessage: '',
success: function(file, rep) {
var reponse = jQuery.parseJSON( rep );
this.removeAllFiles();
jQuery('#<?php echo $dropzone_id; ?> > .preview-database-image').append('<img src="'+reponse.path+'" />');
}
};
var gallery_ajaxData = {
url: "<?php echo $this->getUrl('ancimage/customer/gallerysimple', array()) ?> ul.gallery",
context: jQuery(".ancimage-customer_galleriesown > .ancimage-gallerie-content > .ancimage-gallerie-content-view"),
success: function() {
loadNcImageIntoFormThumbnailButton();
},
};
Anc_Image_Type.droppableFile(
jQuery(" #<?php echo $dropzone_id; ?>"),
dropzone_params,
null,
jQuery(" <?php echo $ancnote_id; ?>"),
gallery_ajaxData,
false
);
});
</script>
\ No newline at end of file
<script type="text/javascript">
jQuery(document).ready(function($) {
jQuery('#anc-product-config-area * .anc-productview-type').prepend(jQuery('#anc-product-config-area * .col-main > .ncbreadcrumbs'));
});
</script>
<?php
/**
* @var $this Anc_Image_Block_Options_Type_Customview_Ancimage
* @package anc_image
* @anc_image_eingabetyp
* @since 20140416
* @author netz.coop eG*
*/
D::li('Anc_Image_Block_Options_Type_Customview_Ancimage-> temmlate ancimage.phtml ???????');
?>
<?php $data = $this->getInfo(); ?>
<h1>ancimage.phtml: <?php echo $data['value'] ; ?> wird aufgerufen um informationen zB Warenkorb anzugeben</h1>
\ No newline at end of file
<?xml version="1.0"?>
<config>
<modules>
<Anc_Image>
<active>true</active>
<codePool>local</codePool>
</Anc_Image>
</modules>
</config>
\ No newline at end of file
/**
* @package anc_image
* @since 20140416
* @copyright (c) netz.coop eG
* @author netz.coop eG
*/
//$.noConflict();
var Anc_Image_Type = (function() {
var pastDraggable = '';
var droppableFile = function(param_dropzone_element, param_dropzone_params, param_input_element, param_note_element, param_gallery_ajaxData, param_DragAndDrop) {
/**
* fnc teil der die dateien aus dem dateiexplorer entgegen nimmt
*/
if(!param_dropzone_params.url) {
alert('keine url zum hochladen angegeben');
exit;
}
if(!param_dropzone_params.maxFiles) {
param_dropzone_params.maxFiles = 1;
}
param_dropzone_params.paramName = "file";
param_dropzone_params.processing = function(file) {
jQuery(" button.button ").attr("disabled", "disabled");
param_note_element.append('<div>Bild wird hochgeladen. Bitte warten!</div>');
jQuery(" > .preview-database-image > img ", param_dropzone_element).remove();
jQuery(" > img ", param_dropzone_element).remove();
this.removeAllFiles();
};
param_dropzone_params.init = function() {
this.on("complete", function (file) {
if (this.getUploadingFiles().length === 0 && this.getQueuedFiles().length === 0) {
// alert('file.width: '+file.width+' file.height: '+file.height);
}
});
this.on("success", function(file,rep) {
var reponse = jQuery.parseJSON( rep );
if(param_input_element) {
param_input_element.attr('value', reponse.id);
}
if(reponse.status === 'OK') {
var noteclass = 'anc-success';
var param_gallery_ajaxData_success = false;
if(jQuery.isFunction(param_gallery_ajaxData.success)) {
param_gallery_ajaxData_success = param_gallery_ajaxData.success;
}
param_gallery_ajaxData.success = function(data, textStatus, jqXhr) {
jQuery(this).html(data);
if(jQuery.isFunction(param_gallery_ajaxData_success)) {
param_gallery_ajaxData_success(reponse);
}
Anc_Image_Type.customerGallerysimplePrettyPhoto();
};
jQuery.ajax(param_gallery_ajaxData);
} else {
var noteclass = 'anc-error';
}
jQuery(" button.button ").attr("disabled", false);
jQuery(" div ", param_note_element).remove();
param_note_element.append('<div class="'+noteclass+'">'+reponse.message+'</div>');
});
};
param_dropzone_element.dropzone(param_dropzone_params);
/**
*
*/
if(param_DragAndDrop) {
alert('param_DragAndDrop:'+param_DragAndDrop);
var droppable_opt = {
accept:".anc-image-draggable",
tolerance: 'touch',
drop: function(typ, ui) {
var currentDraggable = jQuery(ui.draggable).attr('id');
jQuery(this).append(jQuery(ui.draggable).clone());
if(param_input_element) {
param_input_element.attr('value', ui.draggable.attr('id'));
}
jQuery(" > div ", param_dropzone_element).remove();
//If there is an object prior to the current one
if (this.pastDraggable != "") {
jQuery("#" + this.pastDraggable).remove(); //Place past object into its original coordinate
}
this.pastDraggable = currentDraggable;
},
activate: function(typ, ui) {},
deactivate: function(typ, ui) {},
over: function(typ, ui) {},
out: function(typ, ui) {
jQuery(ui.draggable).remove(); // jQuery(this).droppable('option', 'accept', '.anc-image-draggable');
},
}
param_dropzone_element.droppable(droppable_opt);
}
}
/**
* fnc löscht falls vorhanden dropzone elemente
* lädt bild in div.preview-database-image und setzt id ins input
* bereitet bild für crop vor (resizeImageForImageEditor)
*
* @param int param_anc_image_id
* @param element element_input
* @param string param_anc_image_url
* @param element element_image_container
* @returns {undefined}
*/
var loadImageInto = function(param_anc_image_id, element_input, param_anc_image_url, element_image_container) {
jQuery('img ', element_image_container).remove();
jQuery('.dz-message ', element_image_container).remove();
jQuery('.dz-image-preview ', element_image_container).remove();
element_input.attr('value', param_anc_image_id);
resizeImageForImageEditor(param_anc_image_url);
}
var customerGallerysimplePrettyPhoto = function() {
jQuery("a[rel^='prettyPhoto']").prettyPhoto({});
jQuery(".ancimage-showNcImageForm").append('<img class="zoom" src="/skin/frontend/base/default/images/anc/image/zoom.png" />');
jQuery(".anc_image_wrapper > .ancimage-showNcImageForm").remove();
var css_zoom = {
'height': '20px',
'margin-right': '-20px',
'position': 'relative',
'z-index': '4',
'opacity':'1'
};
jQuery(".AncGalleryImages > .ancimage-showNcImageForm > .zoom").css(css_zoom);
}
var placeholder_width;
var placeholder_height;
var ImageEditorFactor;
var element_imageEditorArea;
var manipulateImageEditor = function() {
element_imageEditorArea = jQuery("#ancimage-imageeditorarea-id");
jQuery(document).ready(function($) {
var imageEditorArea_width = element_imageEditorArea.width();
var imageEditorArea_height = element_imageEditorArea.height();
placeholder_width = jQuery('> .dropzone ',element_imageEditorArea).data('pxwidth');
placeholder_height = jQuery('> .dropzone ',element_imageEditorArea).data('pxheight');
var maxfilesizemb = jQuery('> .dropzone ',element_imageEditorArea).data('maxfilesizemb');
jQuery('.ancimage-info > .editor').html('Sie haben einen Bildplatzhalterraum von '+placeholder_width+'px mal '+placeholder_height+'px zu Verf&uuml;gung! Ihr Bild darf nicht mehr als '+maxfilesizemb+' mb haben.');
var factor = imageEditorArea_width / placeholder_width;
ImageEditorFactor = factor;
console.log('factor: '+factor);
var css_new_size = {
'width': imageEditorArea_width,
'height': placeholder_height * factor,
}
jQuery('> .dropzone ',element_imageEditorArea).css(css_new_size);
resizeImageForImageEditor(
jQuery('> .dropzone > .preview-database-image ',element_imageEditorArea).data('imagesrc'),
jQuery('> .dropzone > .preview-database-image ',element_imageEditorArea).data()
);
});
}
var Croppic;
/**
* bereitet bild für crop bearbgeitung vor
*
* benötigt object variable @var Anc_Image_Type.ImageEditorFactor und @var Anc_Image_Type.element_imageEditorArea,
* diese werden durch @see Anc_Image_Type.manipulateImageEditor() initialisiert
*
* @param string param_imagesrc
* @returns {undefined}
*/
var resizeImageForImageEditor = function(param_imagesrc, param_cropdata) {
var newImg2 = new Image();
newImg2.src = param_imagesrc;
newImg2.onload = function() {
var warning = '';
if(placeholder_width > newImg2.width || placeholder_height > newImg2.height ) {
warning = '<div class="anc-error">Das Bild ist zu klein, bitte nutzen Sie ein Bild mit einer größeren Auflösung!</div>';
alert('Das Bild ist zu klein, bitte nutzen Sie ein Bild mit einer größeren Auflösung!');
}
var new_img_width = newImg2.width * ImageEditorFactor;
var new_img_height = newImg2.height * ImageEditorFactor;
jQuery('.ancimage-info > .image').html('Ihr Bild ist '+newImg2.width+'px mal '+newImg2.height+'px gro&szlig;!' + warning);
if(warning) {
return;
}
var cropperOptions = {
imageUrl: param_imagesrc,
imageHeight: Math.round(new_img_height),
imageWidth: Math.round(new_img_width),
onBeforeImgUpload: function(){ console.log('onBeforeImgUpload') },
onAfterImgUpload: function(){ console.log('onAfterImgUpload') },
onImgDrag: function(){ console.log('onImgDrag') },
onImgZoom: function(){ console.log('onImgZoom') },
onBeforeImgCrop: function(){ console.log('onBeforeImgCrop') },
onAfterImgCrop: function(){ console.log('onAfterImgCrop') },
}
jQuery(' > .dropzone > div', element_imageEditorArea).remove();
Croppic = new Anc_Lib_Croppic(jQuery(' > .dropzone', element_imageEditorArea), cropperOptions);
if (typeof param_cropdata !== 'undefined') {
var cropdata = {
'cropH' : Math.round(param_cropdata.croph*ImageEditorFactor),
'cropW' : Math.round(param_cropdata.cropw*ImageEditorFactor),
'imgH' : Math.round(param_cropdata.imgh*ImageEditorFactor),
'imgW' : Math.round(param_cropdata.imgw*ImageEditorFactor),
'imgInitH' :Math.round(param_cropdata.imginith*ImageEditorFactor),
'imgInitW' :Math.round(param_cropdata.imginitw*ImageEditorFactor),
'imgX1' : Math.round(param_cropdata.imgx1*ImageEditorFactor),
'imgY1' : Math.round(param_cropdata.imgy1*ImageEditorFactor),
}
Croppic.initialWithValues(cropdata);
}
if(false) {
// @ControlRotate
var rotate = 90;
jQuery('div.cropControls').append('<i class="ControlRotate">X</i>');
jQuery('.ControlRotate').unbind("click").click(function(e){
e.preventDefault();
var css_rotate = {
'position': 'relative',
'transform': 'rotate('+rotate+'deg)',
'transform-origin': '50% 50% 0px',
}
jQuery('.ancimage-dropzone > .cropImgWrapper > img').css(css_rotate);
jQuery('.ancimage-dropzone > img').css(css_rotate);
var position = jQuery('.ancimage-dropzone > img').position();
var cropdata = {
'cropH' : Croppic.cropW,
'cropW' : Croppic.cropH,
'imgH' : Croppic.imgW,
'imgW' : Croppic.imgH,
'imgInitH' :Croppic.imgInitW,
'imgInitW' :Croppic.imgInitH,
'imgX1' : Croppic.imgX1,
'imgY1' : Croppic.imgY1,
}
Croppic.cropH = cropdata.cropH;
Croppic.cropW = cropdata.cropW;
Croppic.imgH = cropdata.imgH;
Croppic.imgW = cropdata.imgW;
Croppic.imgInitH = cropdata.imgInitH;
Croppic.imgInitW = cropdata.imgInitW;
Croppic.imgX1 = cropdata.imgX1;
Croppic.imgY1 = cropdata.imgY1;
console.log('cropH',Croppic.cropH);
console.log('cropW',Croppic.cropW);
console.log('imgH',Croppic.imgH);
console.log('imgW',Croppic.imgW);
console.log('imgInitH',Croppic.imgInitH);
console.log('imgInitW',Croppic.imgInitW);
console.log('imgX1',Croppic.imgX1);
console.log('imgY1',Croppic.imgY1);
// Croppic.initialWithValues(cropdata);
if(rotate ===270) {
rotate = 0;
} else {
rotate = rotate+90;
}
});
}
};
}
var crop = function() {
cropData = Croppic.crop();
jQuery('#product_addtocart_form * .ancSPImage_KEY_cropH > .input-box > input').attr('value', Math.round(cropData.cropH / ImageEditorFactor));
jQuery('#product_addtocart_form * .ancSPImage_KEY_cropW > .input-box > input').attr('value', Math.round(cropData.cropW / ImageEditorFactor));
jQuery('#product_addtocart_form * .ancSPImage_KEY_imgH > .input-box > input').attr('value', Math.round(cropData.imgH / ImageEditorFactor));
jQuery('#product_addtocart_form * .ancSPImage_KEY_imgInitH > .input-box > input').attr('value', Math.round(cropData.imgInitH / ImageEditorFactor));
jQuery('#product_addtocart_form * .ancSPImage_KEY_imgInitW > .input-box > input').attr('value', Math.round(cropData.imgInitW / ImageEditorFactor));
jQuery('#product_addtocart_form * .ancSPImage_KEY_imgW > .input-box > input').attr('value', Math.round(cropData.imgW / ImageEditorFactor));
jQuery('#product_addtocart_form * .ancSPImage_KEY_imgX1 > .input-box > input').attr('value', Math.round(cropData.imgX1 / ImageEditorFactor));
jQuery('#product_addtocart_form * .ancSPImage_KEY_imgY1 > .input-box > input').attr('value', Math.round(cropData.imgY1 / ImageEditorFactor));
}
return {
manipulateImageEditor:manipulateImageEditor,
droppableFile:droppableFile,
loadImageInto:loadImageInto,
customerGallerysimplePrettyPhoto:customerGallerysimplePrettyPhoto,
crop:crop
}
})();
\ No newline at end of file
/**
* @package anc_image
* @since 20140416
* @copyright (c) netz.coop eG
* @author netz.coop eG
*/
//$.noConflict();
var Anc_Image_Typeadmin = {
"pastDraggable" : "",
/**
*
* @param element param_dropzone_element - welches die dropzone darstellen soll
* @param element param_input_element - optional - set input.value - bekommt die rückgabe id vom hochgeladenen bild
* @param string param_url_upload - url die das bild entgegen nimmt
* @param element param_note_element - rückgabe notiz (fehler, erfolgreich)
* @returns {undefined}
*/
"droppableFile" : function(param_dropzone_element, param_input_element, param_url_upload, param_note_element, param_url_simpleowngallery,param_secure) {
/**
* fnc teil der die dateien aus dem dateiexplorer entgegen nimmt
*/
param_dropzone_element.dropzone({
url: param_url_upload,
paramName: "file", // The name that will be used to transfer the file
maxFilesize: 50, // MB
maxFiles: 10,
params: { form_key : param_secure },
// maxfilesexceeded: function(file) { },
processing: function(file) {
jQuery(" button.button ").attr("disabled", "disabled");
param_note_element.append('<div>Bild wird hochgeladen. Bitte warten!</div>');
jQuery(" > .preview-database-image ", param_dropzone_element).remove();
jQuery(" > img ", param_dropzone_element).remove();
this.removeAllFiles();
},
init: function() {
this.on("complete", function (file) {
if (this.getUploadingFiles().length === 0 && this.getQueuedFiles().length === 0) {
// alert('file.width: '+file.width+' file.height: '+file.height);
}
});
this.on("success", function(file,rep) {
var reponse = jQuery.parseJSON( rep );
if(param_input_element) {
param_input_element.attr('value', reponse.id);
}
if(reponse.status === 'OK') {
var noteclass = 'anc-success';
jQuery(".anc-image-owngallery-content .anc-image-owngallery-content-view").load(param_url_simpleowngallery, function() {});
} else {
var noteclass = 'anc-error';
}
jQuery(" button.button ").attr("disabled", false);
jQuery(" div ", param_note_element).remove();
param_note_element.append('<div class="'+noteclass+'">'+reponse.message+'</div>');
});
}
});
// var droppable_opt = {
// accept:".anc-image-draggable",
// tolerance: 'touch',
//
// drop: function(typ, ui) {
// var currentDraggable = jQuery(ui.draggable).attr('id');
// jQuery(this).append(jQuery(ui.draggable).clone());
// if(param_input_element) {
// param_input_element.attr('value', ui.draggable.attr('id'));
// }
// jQuery(" > div ", param_dropzone_element).remove();
//
// //If there is an object prior to the current one
// if (this.pastDraggable != "") {
// jQuery("#" + this.pastDraggable).remove(); //Place past object into its original coordinate
// }
// this.pastDraggable = currentDraggable;
// },
// activate: function(typ, ui) {},
// deactivate: function(typ, ui) {},
// over: function(typ, ui) {},
// out: function(typ, ui) {
// jQuery(ui.draggable).remove(); // jQuery(this).droppable('option', 'accept', '.anc-image-draggable');
// },
// }
// param_dropzone_element.droppable(droppable_opt);
},
}
\ No newline at end of file
;(function(){
/**
* Require the given path.
*
* @param {String} path
* @return {Object} exports
* @api public
*/
function require(path, parent, orig) {
var resolved = require.resolve(path);
// lookup failed
if (null == resolved) {
orig = orig || path;
parent = parent || 'root';
var err = new Error('Failed to require "' + orig + '" from "' + parent + '"');
err.path = orig;
err.parent = parent;
err.require = true;
throw err;
}
var module = require.modules[resolved];
// perform real require()
// by invoking the module's
// registered function
if (!module._resolving && !module.exports) {
var mod = {};
mod.exports = {};
mod.client = mod.component = true;
module._resolving = true;
module.call(this, mod.exports, require.relative(resolved), mod);
delete module._resolving;
module.exports = mod.exports;
}
return module.exports;
}
/**
* Registered modules.
*/
require.modules = {};
/**
* Registered aliases.
*/
require.aliases = {};
/**
* Resolve `path`.
*
* Lookup:
*
* - PATH/index.js
* - PATH.js
* - PATH
*
* @param {String} path
* @return {String} path or null
* @api private
*/
require.resolve = function(path) {
if (path.charAt(0) === '/') path = path.slice(1);
var paths = [
path,
path + '.js',
path + '.json',
path + '/index.js',
path + '/index.json'
];
for (var i = 0; i < paths.length; i++) {
var path = paths[i];
if (require.modules.hasOwnProperty(path)) return path;
if (require.aliases.hasOwnProperty(path)) return require.aliases[path];
}
};
/**
* Normalize `path` relative to the current path.
*
* @param {String} curr
* @param {String} path
* @return {String}
* @api private
*/
require.normalize = function(curr, path) {
var segs = [];
if ('.' != path.charAt(0)) return path;
curr = curr.split('/');
path = path.split('/');
for (var i = 0; i < path.length; ++i) {
if ('..' == path[i]) {
curr.pop();
} else if ('.' != path[i] && '' != path[i]) {
segs.push(path[i]);
}
}
return curr.concat(segs).join('/');
};
/**
* Register module at `path` with callback `definition`.
*
* @param {String} path
* @param {Function} definition
* @api private
*/
require.register = function(path, definition) {
require.modules[path] = definition;
};
/**
* Alias a module definition.
*
* @param {String} from
* @param {String} to
* @api private
*/
require.alias = function(from, to) {
if (!require.modules.hasOwnProperty(from)) {
throw new Error('Failed to alias "' + from + '", it does not exist');
}
require.aliases[to] = from;
};
/**
* Return a require function relative to the `parent` path.
*
* @param {String} parent
* @return {Function}
* @api private
*/
require.relative = function(parent) {
var p = require.normalize(parent, '..');
/**
* lastIndexOf helper.
*/
function lastIndexOf(arr, obj) {
var i = arr.length;
while (i--) {
if (arr[i] === obj) return i;
}
return -1;
}
/**
* The relative require() itself.
*/
function localRequire(path) {
var resolved = localRequire.resolve(path);
return require(resolved, parent, path);
}
/**
* Resolve relative to the parent.
*/
localRequire.resolve = function(path) {
var c = path.charAt(0);
if ('/' == c) return path.slice(1);
if ('.' == c) return require.normalize(p, path);
// resolve deps by returning
// the dep in the nearest "deps"
// directory
var segs = parent.split('/');
var i = lastIndexOf(segs, 'deps') + 1;
if (!i) i = 0;
path = segs.slice(0, i + 1).join('/') + '/deps/' + path;
return path;
};
/**
* Check if module is defined at `path`.
*/
localRequire.exists = function(path) {
return require.modules.hasOwnProperty(localRequire.resolve(path));
};
return localRequire;
};
require.register("component-emitter/index.js", function(exports, require, module){
/**
* Expose `Emitter`.
*/
module.exports = Emitter;
/**
* Initialize a new `Emitter`.
*
* @api public
*/
function Emitter(obj) {
if (obj) return mixin(obj);
};
/**
* Mixin the emitter properties.
*
* @param {Object} obj
* @return {Object}
* @api private
*/
function mixin(obj) {
for (var key in Emitter.prototype) {
obj[key] = Emitter.prototype[key];
}
return obj;
}
/**
* Listen on the given `event` with `fn`.
*
* @param {String} event
* @param {Function} fn
* @return {Emitter}
* @api public
*/
Emitter.prototype.on = function(event, fn){
this._callbacks = this._callbacks || {};
(this._callbacks[event] = this._callbacks[event] || [])
.push(fn);
return this;
};
/**
* Adds an `event` listener that will be invoked a single
* time then automatically removed.
*
* @param {String} event
* @param {Function} fn
* @return {Emitter}
* @api public
*/
Emitter.prototype.once = function(event, fn){
var self = this;
this._callbacks = this._callbacks || {};
function on() {
self.off(event, on);
fn.apply(this, arguments);
}
fn._off = on;
this.on(event, on);
return this;
};
/**
* Remove the given callback for `event` or all
* registered callbacks.
*
* @param {String} event
* @param {Function} fn
* @return {Emitter}
* @api public
*/
Emitter.prototype.off =
Emitter.prototype.removeListener =
Emitter.prototype.removeAllListeners = function(event, fn){
this._callbacks = this._callbacks || {};
var callbacks = this._callbacks[event];
if (!callbacks) return this;
// remove all handlers
if (1 == arguments.length) {
delete this._callbacks[event];
return this;
}
// remove specific handler
var i = callbacks.indexOf(fn._off || fn);
if (~i) callbacks.splice(i, 1);
return this;
};
/**
* Emit `event` with the given args.
*
* @param {String} event
* @param {Mixed} ...
* @return {Emitter}
*/
Emitter.prototype.emit = function(event){
this._callbacks = this._callbacks || {};
var args = [].slice.call(arguments, 1)
, callbacks = this._callbacks[event];
if (callbacks) {
callbacks = callbacks.slice(0);
for (var i = 0, len = callbacks.length; i < len; ++i) {
callbacks[i].apply(this, args);
}
}
return this;
};
/**
* Return array of callbacks for `event`.
*
* @param {String} event
* @return {Array}
* @api public
*/
Emitter.prototype.listeners = function(event){
this._callbacks = this._callbacks || {};
return this._callbacks[event] || [];
};
/**
* Check if this emitter has `event` handlers.
*
* @param {String} event
* @return {Boolean}
* @api public
*/
Emitter.prototype.hasListeners = function(event){
return !! this.listeners(event).length;
};
});
require.register("dropzone/index.js", function(exports, require, module){
/**
* Exposing dropzone
*/
module.exports = require("./lib/dropzone.js");
});
require.register("dropzone/lib/dropzone.js", function(exports, require, module){
/*
#
# More info at [www.dropzonejs.com](http://www.dropzonejs.com)
#
# Copyright (c) 2012, Matias Meno
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
#
*/
(function() {
var Dropzone, Em, camelize, contentLoaded, detectVerticalSquash, drawImageIOSFix, noop, without,
__hasProp = {}.hasOwnProperty,
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
__slice = [].slice;
Em = typeof Emitter !== "undefined" && Emitter !== null ? Emitter : require("emitter");
noop = function() {};
Dropzone = (function(_super) {
var extend;
__extends(Dropzone, _super);
/*
This is a list of all available events you can register on a dropzone object.
You can register an event handler like this:
dropzone.on("dragEnter", function() { });
*/
Dropzone.prototype.events = ["drop", "dragstart", "dragend", "dragenter", "dragover", "dragleave", "addedfile", "removedfile", "thumbnail", "error", "errormultiple", "processing", "processingmultiple", "uploadprogress", "totaluploadprogress", "sending", "sendingmultiple", "success", "successmultiple", "canceled", "canceledmultiple", "complete", "completemultiple", "reset", "maxfilesexceeded", "maxfilesreached"];
Dropzone.prototype.defaultOptions = {
url: null,
method: "post",
withCredentials: false,
parallelUploads: 2,
uploadMultiple: false,
maxFilesize: 256,
paramName: "file",
createImageThumbnails: true,
maxThumbnailFilesize: 10,
thumbnailWidth: 100,
thumbnailHeight: 100,
maxFiles: null,
params: {},
clickable: true,
ignoreHiddenFiles: true,
acceptedFiles: null,
acceptedMimeTypes: null,
autoProcessQueue: true,
addRemoveLinks: false,
previewsContainer: null,
dictDefaultMessage: "Drop files here to upload",
dictFallbackMessage: "Your browser does not support drag'n'drop file uploads.",
dictFallbackText: "Please use the fallback form below to upload your files like in the olden days.",
dictFileTooBig: "File is too big ({{filesize}}MiB). Max filesize: {{maxFilesize}}MiB.",
dictInvalidFileType: "You can't upload files of this type.",
dictResponseError: "Server responded with {{statusCode}} code.",
dictCancelUpload: "Cancel upload",
dictCancelUploadConfirmation: "Are you sure you want to cancel this upload?",
dictRemoveFile: "Remove file",
dictRemoveFileConfirmation: null,
dictMaxFilesExceeded: "You can not upload any more files.",
accept: function(file, done) {
return done();
},
init: function() {
return noop;
},
forceFallback: false,
fallback: function() {
var child, messageElement, span, _i, _len, _ref;
this.element.className = "" + this.element.className + " dz-browser-not-supported";
_ref = this.element.getElementsByTagName("div");
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
child = _ref[_i];
if (/(^| )dz-message($| )/.test(child.className)) {
messageElement = child;
child.className = "dz-message";
continue;
}
}
if (!messageElement) {
messageElement = Dropzone.createElement("<div class=\"dz-message\"><span></span></div>");
this.element.appendChild(messageElement);
}
span = messageElement.getElementsByTagName("span")[0];
if (span) {
span.textContent = this.options.dictFallbackMessage;
}
return this.element.appendChild(this.getFallbackForm());
},
resize: function(file) {
var info, srcRatio, trgRatio;
info = {
srcX: 0,
srcY: 0,
srcWidth: file.width,
srcHeight: file.height
};
srcRatio = file.width / file.height;
trgRatio = this.options.thumbnailWidth / this.options.thumbnailHeight;
if (file.height < this.options.thumbnailHeight || file.width < this.options.thumbnailWidth) {
info.trgHeight = info.srcHeight;
info.trgWidth = info.srcWidth;
} else {
if (srcRatio > trgRatio) {
info.srcHeight = file.height;
info.srcWidth = info.srcHeight * trgRatio;
} else {
info.srcWidth = file.width;
info.srcHeight = info.srcWidth / trgRatio;
}
}
info.srcX = (file.width - info.srcWidth) / 2;
info.srcY = (file.height - info.srcHeight) / 2;
return info;
},
/*
Those functions register themselves to the events on init and handle all
the user interface specific stuff. Overwriting them won't break the upload
but can break the way it's displayed.
You can overwrite them if you don't like the default behavior. If you just
want to add an additional event handler, register it on the dropzone object
and don't overwrite those options.
*/
drop: function(e) {
return this.element.classList.remove("dz-drag-hover");
},
dragstart: noop,
dragend: function(e) {
return this.element.classList.remove("dz-drag-hover");
},
dragenter: function(e) {
return this.element.classList.add("dz-drag-hover");
},
dragover: function(e) {
return this.element.classList.add("dz-drag-hover");
},
dragleave: function(e) {
return this.element.classList.remove("dz-drag-hover");
},
paste: noop,
reset: function() {
return this.element.classList.remove("dz-started");
},
addedfile: function(file) {
var node, removeFileEvent, removeLink, _i, _j, _k, _len, _len1, _len2, _ref, _ref1, _ref2, _results,
_this = this;
if (this.element === this.previewsContainer) {
this.element.classList.add("dz-started");
}
file.previewElement = Dropzone.createElement(this.options.previewTemplate.trim());
file.previewTemplate = file.previewElement;
this.previewsContainer.appendChild(file.previewElement);
_ref = file.previewElement.querySelectorAll("[data-dz-name]");
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
node = _ref[_i];
node.textContent = file.name;
}
_ref1 = file.previewElement.querySelectorAll("[data-dz-size]");
for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) {
node = _ref1[_j];
node.innerHTML = this.filesize(file.size);
}
if (this.options.addRemoveLinks) {
file._removeLink = Dropzone.createElement("<a class=\"dz-remove\" href=\"javascript:undefined;\" data-dz-remove>" + this.options.dictRemoveFile + "</a>");
file.previewElement.appendChild(file._removeLink);
}
removeFileEvent = function(e) {
e.preventDefault();
e.stopPropagation();
if (file.status === Dropzone.UPLOADING) {
return Dropzone.confirm(_this.options.dictCancelUploadConfirmation, function() {
return _this.removeFile(file);
});
} else {
if (_this.options.dictRemoveFileConfirmation) {
return Dropzone.confirm(_this.options.dictRemoveFileConfirmation, function() {
return _this.removeFile(file);
});
} else {
return _this.removeFile(file);
}
}
};
_ref2 = file.previewElement.querySelectorAll("[data-dz-remove]");
_results = [];
for (_k = 0, _len2 = _ref2.length; _k < _len2; _k++) {
removeLink = _ref2[_k];
_results.push(removeLink.addEventListener("click", removeFileEvent));
}
return _results;
},
removedfile: function(file) {
var _ref;
if ((_ref = file.previewElement) != null) {
_ref.parentNode.removeChild(file.previewElement);
}
return this._updateMaxFilesReachedClass();
},
thumbnail: function(file, dataUrl) {
var thumbnailElement, _i, _len, _ref, _results;
file.previewElement.classList.remove("dz-file-preview");
file.previewElement.classList.add("dz-image-preview");
_ref = file.previewElement.querySelectorAll("[data-dz-thumbnail]");
_results = [];
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
thumbnailElement = _ref[_i];
thumbnailElement.alt = file.name;
_results.push(thumbnailElement.src = dataUrl);
}
return _results;
},
error: function(file, message) {
var node, _i, _len, _ref, _results;
file.previewElement.classList.add("dz-error");
if (typeof message !== "String" && message.error) {
message = message.error;
}
_ref = file.previewElement.querySelectorAll("[data-dz-errormessage]");
_results = [];
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
node = _ref[_i];
_results.push(node.textContent = message);
}
return _results;
},
errormultiple: noop,
processing: function(file) {
file.previewElement.classList.add("dz-processing");
if (file._removeLink) {
return file._removeLink.textContent = this.options.dictCancelUpload;
}
},
processingmultiple: noop,
uploadprogress: function(file, progress, bytesSent) {
var node, _i, _len, _ref, _results;
_ref = file.previewElement.querySelectorAll("[data-dz-uploadprogress]");
_results = [];
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
node = _ref[_i];
_results.push(node.style.width = "" + progress + "%");
}
return _results;
},
totaluploadprogress: noop,
sending: noop,
sendingmultiple: noop,
success: function(file) {
return file.previewElement.classList.add("dz-success");
},
successmultiple: noop,
canceled: function(file) {
return this.emit("error", file, "Upload canceled.");
},
canceledmultiple: noop,
complete: function(file) {
if (file._removeLink) {
return file._removeLink.textContent = this.options.dictRemoveFile;
}
},
completemultiple: noop,
maxfilesexceeded: noop,
maxfilesreached: noop,
previewTemplate: "<div class=\"dz-preview dz-file-preview\">\n <div class=\"dz-details\">\n <div class=\"dz-filename\"><span data-dz-name></span></div>\n <div class=\"dz-size\" data-dz-size></div>\n <img data-dz-thumbnail />\n </div>\n <div class=\"dz-progress\"><span class=\"dz-upload\" data-dz-uploadprogress></span></div>\n <div class=\"dz-success-mark\"><span>✔</span></div>\n <div class=\"dz-error-mark\"><span>✘</span></div>\n <div class=\"dz-error-message\"><span data-dz-errormessage></span></div>\n</div>"
};
extend = function() {
var key, object, objects, target, val, _i, _len;
target = arguments[0], objects = 2 <= arguments.length ? __slice.call(arguments, 1) : [];
for (_i = 0, _len = objects.length; _i < _len; _i++) {
object = objects[_i];
for (key in object) {
val = object[key];
target[key] = val;
}
}
return target;
};
function Dropzone(element, options) {
var elementOptions, fallback, _ref;
this.element = element;
this.version = Dropzone.version;
this.defaultOptions.previewTemplate = this.defaultOptions.previewTemplate.replace(/\n*/g, "");
this.clickableElements = [];
this.listeners = [];
this.files = [];
if (typeof this.element === "string") {
this.element = document.querySelector(this.element);
}
if (!(this.element && (this.element.nodeType != null))) {
throw new Error("Invalid dropzone element.");
}
if (this.element.dropzone) {
throw new Error("Dropzone already attached.");
}
Dropzone.instances.push(this);
this.element.dropzone = this;
elementOptions = (_ref = Dropzone.optionsForElement(this.element)) != null ? _ref : {};
this.options = extend({}, this.defaultOptions, elementOptions, options != null ? options : {});
if (this.options.forceFallback || !Dropzone.isBrowserSupported()) {
return this.options.fallback.call(this);
}
if (this.options.url == null) {
this.options.url = this.element.getAttribute("action");
}
if (!this.options.url) {
throw new Error("No URL provided.");
}
if (this.options.acceptedFiles && this.options.acceptedMimeTypes) {
throw new Error("You can't provide both 'acceptedFiles' and 'acceptedMimeTypes'. 'acceptedMimeTypes' is deprecated.");
}
if (this.options.acceptedMimeTypes) {
this.options.acceptedFiles = this.options.acceptedMimeTypes;
delete this.options.acceptedMimeTypes;
}
this.options.method = this.options.method.toUpperCase();
if ((fallback = this.getExistingFallback()) && fallback.parentNode) {
fallback.parentNode.removeChild(fallback);
}
if (this.options.previewsContainer) {
this.previewsContainer = Dropzone.getElement(this.options.previewsContainer, "previewsContainer");
} else {
this.previewsContainer = this.element;
}
if (this.options.clickable) {
if (this.options.clickable === true) {
this.clickableElements = [this.element];
} else {
this.clickableElements = Dropzone.getElements(this.options.clickable, "clickable");
}
}
this.init();
}
Dropzone.prototype.getAcceptedFiles = function() {
var file, _i, _len, _ref, _results;
_ref = this.files;
_results = [];
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
file = _ref[_i];
if (file.accepted) {
_results.push(file);
}
}
return _results;
};
Dropzone.prototype.getRejectedFiles = function() {
var file, _i, _len, _ref, _results;
_ref = this.files;
_results = [];
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
file = _ref[_i];
if (!file.accepted) {
_results.push(file);
}
}
return _results;
};
Dropzone.prototype.getQueuedFiles = function() {
var file, _i, _len, _ref, _results;
_ref = this.files;
_results = [];
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
file = _ref[_i];
if (file.status === Dropzone.QUEUED) {
_results.push(file);
}
}
return _results;
};
Dropzone.prototype.getUploadingFiles = function() {
var file, _i, _len, _ref, _results;
_ref = this.files;
_results = [];
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
file = _ref[_i];
if (file.status === Dropzone.UPLOADING) {
_results.push(file);
}
}
return _results;
};
Dropzone.prototype.init = function() {
var eventName, noPropagation, setupHiddenFileInput, _i, _len, _ref, _ref1,
_this = this;
if (this.element.tagName === "form") {
this.element.setAttribute("enctype", "multipart/form-data");
}
if (this.element.classList.contains("dropzone") && !this.element.querySelector(".dz-message")) {
this.element.appendChild(Dropzone.createElement("<div class=\"dz-default dz-message\"><span>" + this.options.dictDefaultMessage + "</span></div>"));
}
if (this.clickableElements.length) {
setupHiddenFileInput = function() {
if (_this.hiddenFileInput) {
document.body.removeChild(_this.hiddenFileInput);
}
_this.hiddenFileInput = document.createElement("input");
_this.hiddenFileInput.setAttribute("type", "file");
if ((_this.options.maxFiles == null) || _this.options.maxFiles > 1) {
_this.hiddenFileInput.setAttribute("multiple", "multiple");
}
if (_this.options.acceptedFiles != null) {
_this.hiddenFileInput.setAttribute("accept", _this.options.acceptedFiles);
}
_this.hiddenFileInput.style.visibility = "hidden";
_this.hiddenFileInput.style.position = "absolute";
_this.hiddenFileInput.style.top = "0";
_this.hiddenFileInput.style.left = "0";
_this.hiddenFileInput.style.height = "0";
_this.hiddenFileInput.style.width = "0";
document.body.appendChild(_this.hiddenFileInput);
return _this.hiddenFileInput.addEventListener("change", function() {
var file, files, _i, _len;
files = _this.hiddenFileInput.files;
if (files.length) {
for (_i = 0, _len = files.length; _i < _len; _i++) {
file = files[_i];
_this.addFile(file);
}
}
return setupHiddenFileInput();
});
};
setupHiddenFileInput();
}
this.URL = (_ref = window.URL) != null ? _ref : window.webkitURL;
_ref1 = this.events;
for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
eventName = _ref1[_i];
this.on(eventName, this.options[eventName]);
}
this.on("uploadprogress", function() {
return _this.updateTotalUploadProgress();
});
this.on("removedfile", function() {
return _this.updateTotalUploadProgress();
});
this.on("canceled", function(file) {
return _this.emit("complete", file);
});
this.on("complete", function(file) {
if (_this.getUploadingFiles().length === 0 && _this.getQueuedFiles().length === 0) {
return setTimeout((function() {
return _this.emit("queuecomplete");
}), 0);
}
});
noPropagation = function(e) {
e.stopPropagation();
if (e.preventDefault) {
return e.preventDefault();
} else {
return e.returnValue = false;
}
};
this.listeners = [
{
element: this.element,
events: {
"dragstart": function(e) {
return _this.emit("dragstart", e);
},
"dragenter": function(e) {
noPropagation(e);
return _this.emit("dragenter", e);
},
"dragover": function(e) {
var efct;
try {
efct = e.dataTransfer.effectAllowed;
} catch (_error) {}
e.dataTransfer.dropEffect = 'move' === efct || 'linkMove' === efct ? 'move' : 'copy';
noPropagation(e);
return _this.emit("dragover", e);
},
"dragleave": function(e) {
return _this.emit("dragleave", e);
},
"drop": function(e) {
noPropagation(e);
return _this.drop(e);
},
"dragend": function(e) {
return _this.emit("dragend", e);
}
}
}
];
this.clickableElements.forEach(function(clickableElement) {
return _this.listeners.push({
element: clickableElement,
events: {
"click": function(evt) {
if ((clickableElement !== _this.element) || (evt.target === _this.element || Dropzone.elementInside(evt.target, _this.element.querySelector(".dz-message")))) {
return _this.hiddenFileInput.click();
}
}
}
});
});
this.enable();
return this.options.init.call(this);
};
Dropzone.prototype.destroy = function() {
var _ref;
this.disable();
this.removeAllFiles(true);
if ((_ref = this.hiddenFileInput) != null ? _ref.parentNode : void 0) {
this.hiddenFileInput.parentNode.removeChild(this.hiddenFileInput);
this.hiddenFileInput = null;
}
delete this.element.dropzone;
return Dropzone.instances.splice(Dropzone.instances.indexOf(this), 1);
};
Dropzone.prototype.updateTotalUploadProgress = function() {
var acceptedFiles, file, totalBytes, totalBytesSent, totalUploadProgress, _i, _len, _ref;
totalBytesSent = 0;
totalBytes = 0;
acceptedFiles = this.getAcceptedFiles();
if (acceptedFiles.length) {
_ref = this.getAcceptedFiles();
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
file = _ref[_i];
totalBytesSent += file.upload.bytesSent;
totalBytes += file.upload.total;
}
totalUploadProgress = 100 * totalBytesSent / totalBytes;
} else {
totalUploadProgress = 100;
}
return this.emit("totaluploadprogress", totalUploadProgress, totalBytes, totalBytesSent);
};
Dropzone.prototype.getFallbackForm = function() {
var existingFallback, fields, fieldsString, form;
if (existingFallback = this.getExistingFallback()) {
return existingFallback;
}
fieldsString = "<div class=\"dz-fallback\">";
if (this.options.dictFallbackText) {
fieldsString += "<p>" + this.options.dictFallbackText + "</p>";
}
fieldsString += "<input type=\"file\" name=\"" + this.options.paramName + (this.options.uploadMultiple ? "[]" : "") + "\" " + (this.options.uploadMultiple ? 'multiple="multiple"' : void 0) + " /><input type=\"submit\" value=\"Upload!\"></div>";
fields = Dropzone.createElement(fieldsString);
if (this.element.tagName !== "FORM") {
form = Dropzone.createElement("<form action=\"" + this.options.url + "\" enctype=\"multipart/form-data\" method=\"" + this.options.method + "\"></form>");
form.appendChild(fields);
} else {
this.element.setAttribute("enctype", "multipart/form-data");
this.element.setAttribute("method", this.options.method);
}
return form != null ? form : fields;
};
Dropzone.prototype.getExistingFallback = function() {
var fallback, getFallback, tagName, _i, _len, _ref;
getFallback = function(elements) {
var el, _i, _len;
for (_i = 0, _len = elements.length; _i < _len; _i++) {
el = elements[_i];
if (/(^| )fallback($| )/.test(el.className)) {
return el;
}
}
};
_ref = ["div", "form"];
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
tagName = _ref[_i];
if (fallback = getFallback(this.element.getElementsByTagName(tagName))) {
return fallback;
}
}
};
Dropzone.prototype.setupEventListeners = function() {
var elementListeners, event, listener, _i, _len, _ref, _results;
_ref = this.listeners;
_results = [];
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
elementListeners = _ref[_i];
_results.push((function() {
var _ref1, _results1;
_ref1 = elementListeners.events;
_results1 = [];
for (event in _ref1) {
listener = _ref1[event];
_results1.push(elementListeners.element.addEventListener(event, listener, false));
}
return _results1;
})());
}
return _results;
};
Dropzone.prototype.removeEventListeners = function() {
var elementListeners, event, listener, _i, _len, _ref, _results;
_ref = this.listeners;
_results = [];
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
elementListeners = _ref[_i];
_results.push((function() {
var _ref1, _results1;
_ref1 = elementListeners.events;
_results1 = [];
for (event in _ref1) {
listener = _ref1[event];
_results1.push(elementListeners.element.removeEventListener(event, listener, false));
}
return _results1;
})());
}
return _results;
};
Dropzone.prototype.disable = function() {
var file, _i, _len, _ref, _results;
this.clickableElements.forEach(function(element) {
return element.classList.remove("dz-clickable");
});
this.removeEventListeners();
_ref = this.files;
_results = [];
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
file = _ref[_i];
_results.push(this.cancelUpload(file));
}
return _results;
};
Dropzone.prototype.enable = function() {
this.clickableElements.forEach(function(element) {
return element.classList.add("dz-clickable");
});
return this.setupEventListeners();
};
Dropzone.prototype.filesize = function(size) {
var string;
if (size >= 1024 * 1024 * 1024 * 1024 / 10) {
size = size / (1024 * 1024 * 1024 * 1024 / 10);
string = "TiB";
} else if (size >= 1024 * 1024 * 1024 / 10) {
size = size / (1024 * 1024 * 1024 / 10);
string = "GiB";
} else if (size >= 1024 * 1024 / 10) {
size = size / (1024 * 1024 / 10);
string = "MiB";
} else if (size >= 1024 / 10) {
size = size / (1024 / 10);
string = "KiB";
} else {
size = size * 10;
string = "b";
}
return "<strong>" + (Math.round(size) / 10) + "</strong> " + string;
};
Dropzone.prototype._updateMaxFilesReachedClass = function() {
if ((this.options.maxFiles != null) && this.getAcceptedFiles().length >= this.options.maxFiles) {
if (this.getAcceptedFiles().length === this.options.maxFiles) {
this.emit('maxfilesreached', this.files);
}
return this.element.classList.add("dz-max-files-reached");
} else {
return this.element.classList.remove("dz-max-files-reached");
}
};
Dropzone.prototype.drop = function(e) {
var files, items;
if (!e.dataTransfer) {
return;
}
this.emit("drop", e);
files = e.dataTransfer.files;
if (files.length) {
items = e.dataTransfer.items;
if (items && items.length && (items[0].webkitGetAsEntry != null)) {
this._addFilesFromItems(items);
} else {
this.handleFiles(files);
}
}
};
Dropzone.prototype.paste = function(e) {
var items, _ref;
if ((e != null ? (_ref = e.clipboardData) != null ? _ref.items : void 0 : void 0) == null) {
return;
}
this.emit("paste", e);
items = e.clipboardData.items;
if (items.length) {
return this._addFilesFromItems(items);
}
};
Dropzone.prototype.handleFiles = function(files) {
var file, _i, _len, _results;
_results = [];
for (_i = 0, _len = files.length; _i < _len; _i++) {
file = files[_i];
_results.push(this.addFile(file));
}
return _results;
};
Dropzone.prototype._addFilesFromItems = function(items) {
var entry, item, _i, _len, _results;
_results = [];
for (_i = 0, _len = items.length; _i < _len; _i++) {
item = items[_i];
if ((item.webkitGetAsEntry != null) && (entry = item.webkitGetAsEntry())) {
if (entry.isFile) {
_results.push(this.addFile(item.getAsFile()));
} else if (entry.isDirectory) {
_results.push(this._addFilesFromDirectory(entry, entry.name));
} else {
_results.push(void 0);
}
} else if (item.getAsFile != null) {
if ((item.kind == null) || item.kind === "file") {
_results.push(this.addFile(item.getAsFile()));
} else {
_results.push(void 0);
}
} else {
_results.push(void 0);
}
}
return _results;
};
Dropzone.prototype._addFilesFromDirectory = function(directory, path) {
var dirReader, entriesReader,
_this = this;
dirReader = directory.createReader();
entriesReader = function(entries) {
var entry, _i, _len;
for (_i = 0, _len = entries.length; _i < _len; _i++) {
entry = entries[_i];
if (entry.isFile) {
entry.file(function(file) {
if (_this.options.ignoreHiddenFiles && file.name.substring(0, 1) === '.') {
return;
}
file.fullPath = "" + path + "/" + file.name;
return _this.addFile(file);
});
} else if (entry.isDirectory) {
_this._addFilesFromDirectory(entry, "" + path + "/" + entry.name);
}
}
};
return dirReader.readEntries(entriesReader, function(error) {
return typeof console !== "undefined" && console !== null ? typeof console.log === "function" ? console.log(error) : void 0 : void 0;
});
};
Dropzone.prototype.accept = function(file, done) {
if (file.size > this.options.maxFilesize * 1024 * 1024) {
return done(this.options.dictFileTooBig.replace("{{filesize}}", Math.round(file.size / 1024 / 10.24) / 100).replace("{{maxFilesize}}", this.options.maxFilesize));
} else if (!Dropzone.isValidFile(file, this.options.acceptedFiles)) {
return done(this.options.dictInvalidFileType);
} else if ((this.options.maxFiles != null) && this.getAcceptedFiles().length >= this.options.maxFiles) {
done(this.options.dictMaxFilesExceeded.replace("{{maxFiles}}", this.options.maxFiles));
return this.emit("maxfilesexceeded", file);
} else {
return this.options.accept.call(this, file, done);
}
};
Dropzone.prototype.addFile = function(file) {
var _this = this;
file.upload = {
progress: 0,
total: file.size,
bytesSent: 0
};
this.files.push(file);
file.status = Dropzone.ADDED;
this.emit("addedfile", file);
this._enqueueThumbnail(file);
return this.accept(file, function(error) {
if (error) {
file.accepted = false;
_this._errorProcessing([file], error);
} else {
_this.enqueueFile(file);
}
return _this._updateMaxFilesReachedClass();
});
};
Dropzone.prototype.enqueueFiles = function(files) {
var file, _i, _len;
for (_i = 0, _len = files.length; _i < _len; _i++) {
file = files[_i];
this.enqueueFile(file);
}
return null;
};
Dropzone.prototype.enqueueFile = function(file) {
var _this = this;
file.accepted = true;
if (file.status === Dropzone.ADDED) {
file.status = Dropzone.QUEUED;
if (this.options.autoProcessQueue) {
return setTimeout((function() {
return _this.processQueue();
}), 0);
}
} else {
throw new Error("This file can't be queued because it has already been processed or was rejected.");
}
};
Dropzone.prototype._thumbnailQueue = [];
Dropzone.prototype._processingThumbnail = false;
Dropzone.prototype._enqueueThumbnail = function(file) {
var _this = this;
if (this.options.createImageThumbnails && file.type.match(/image.*/) && file.size <= this.options.maxThumbnailFilesize * 1024 * 1024) {
this._thumbnailQueue.push(file);
return setTimeout((function() {
return _this._processThumbnailQueue();
}), 0);
}
};
Dropzone.prototype._processThumbnailQueue = function() {
var _this = this;
if (this._processingThumbnail || this._thumbnailQueue.length === 0) {
return;
}
this._processingThumbnail = true;
return this.createThumbnail(this._thumbnailQueue.shift(), function() {
_this._processingThumbnail = false;
return _this._processThumbnailQueue();
});
};
Dropzone.prototype.removeFile = function(file) {
if (file.status === Dropzone.UPLOADING) {
this.cancelUpload(file);
}
this.files = without(this.files, file);
this.emit("removedfile", file);
if (this.files.length === 0) {
return this.emit("reset");
}
};
Dropzone.prototype.removeAllFiles = function(cancelIfNecessary) {
var file, _i, _len, _ref;
if (cancelIfNecessary == null) {
cancelIfNecessary = false;
}
_ref = this.files.slice();
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
file = _ref[_i];
if (file.status !== Dropzone.UPLOADING || cancelIfNecessary) {
this.removeFile(file);
}
}
return null;
};
Dropzone.prototype.createThumbnail = function(file, callback) {
var fileReader,
_this = this;
fileReader = new FileReader;
fileReader.onload = function() {
var img;
img = document.createElement("img");
img.onload = function() {
var canvas, ctx, resizeInfo, thumbnail, _ref, _ref1, _ref2, _ref3;
file.width = img.width;
file.height = img.height;
resizeInfo = _this.options.resize.call(_this, file);
if (resizeInfo.trgWidth == null) {
resizeInfo.trgWidth = _this.options.thumbnailWidth;
}
if (resizeInfo.trgHeight == null) {
resizeInfo.trgHeight = _this.options.thumbnailHeight;
}
canvas = document.createElement("canvas");
ctx = canvas.getContext("2d");
canvas.width = resizeInfo.trgWidth;
canvas.height = resizeInfo.trgHeight;
drawImageIOSFix(ctx, img, (_ref = resizeInfo.srcX) != null ? _ref : 0, (_ref1 = resizeInfo.srcY) != null ? _ref1 : 0, resizeInfo.srcWidth, resizeInfo.srcHeight, (_ref2 = resizeInfo.trgX) != null ? _ref2 : 0, (_ref3 = resizeInfo.trgY) != null ? _ref3 : 0, resizeInfo.trgWidth, resizeInfo.trgHeight);
thumbnail = canvas.toDataURL("image/png");
_this.emit("thumbnail", file, thumbnail);
if (callback != null) {
return callback();
}
};
return img.src = fileReader.result;
};
return fileReader.readAsDataURL(file);
};
Dropzone.prototype.processQueue = function() {
var i, parallelUploads, processingLength, queuedFiles;
parallelUploads = this.options.parallelUploads;
processingLength = this.getUploadingFiles().length;
i = processingLength;
if (processingLength >= parallelUploads) {
return;
}
queuedFiles = this.getQueuedFiles();
if (!(queuedFiles.length > 0)) {
return;
}
if (this.options.uploadMultiple) {
return this.processFiles(queuedFiles.slice(0, parallelUploads - processingLength));
} else {
while (i < parallelUploads) {
if (!queuedFiles.length) {
return;
}
this.processFile(queuedFiles.shift());
i++;
}
}
};
Dropzone.prototype.processFile = function(file) {
return this.processFiles([file]);
};
Dropzone.prototype.processFiles = function(files) {
var file, _i, _len;
for (_i = 0, _len = files.length; _i < _len; _i++) {
file = files[_i];
file.processing = true;
file.status = Dropzone.UPLOADING;
this.emit("processing", file);
}
if (this.options.uploadMultiple) {
this.emit("processingmultiple", files);
}
return this.uploadFiles(files);
};
Dropzone.prototype._getFilesWithXhr = function(xhr) {
var file, files;
return files = (function() {
var _i, _len, _ref, _results;
_ref = this.files;
_results = [];
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
file = _ref[_i];
if (file.xhr === xhr) {
_results.push(file);
}
}
return _results;
}).call(this);
};
Dropzone.prototype.cancelUpload = function(file) {
var groupedFile, groupedFiles, _i, _j, _len, _len1, _ref;
if (file.status === Dropzone.UPLOADING) {
groupedFiles = this._getFilesWithXhr(file.xhr);
for (_i = 0, _len = groupedFiles.length; _i < _len; _i++) {
groupedFile = groupedFiles[_i];
groupedFile.status = Dropzone.CANCELED;
}
file.xhr.abort();
for (_j = 0, _len1 = groupedFiles.length; _j < _len1; _j++) {
groupedFile = groupedFiles[_j];
this.emit("canceled", groupedFile);
}
if (this.options.uploadMultiple) {
this.emit("canceledmultiple", groupedFiles);
}
} else if ((_ref = file.status) === Dropzone.ADDED || _ref === Dropzone.QUEUED) {
file.status = Dropzone.CANCELED;
this.emit("canceled", file);
if (this.options.uploadMultiple) {
this.emit("canceledmultiple", [file]);
}
}
if (this.options.autoProcessQueue) {
return this.processQueue();
}
};
Dropzone.prototype.uploadFile = function(file) {
return this.uploadFiles([file]);
};
Dropzone.prototype.uploadFiles = function(files) {
var file, formData, handleError, headerName, headerValue, headers, input, inputName, inputType, key, option, progressObj, response, updateProgress, value, xhr, _i, _j, _k, _l, _len, _len1, _len2, _len3, _len4, _m, _ref, _ref1, _ref2, _ref3, _ref4,
_this = this;
xhr = new XMLHttpRequest();
for (_i = 0, _len = files.length; _i < _len; _i++) {
file = files[_i];
file.xhr = xhr;
}
xhr.open(this.options.method, this.options.url, true);
xhr.withCredentials = !!this.options.withCredentials;
response = null;
handleError = function() {
var _j, _len1, _results;
_results = [];
for (_j = 0, _len1 = files.length; _j < _len1; _j++) {
file = files[_j];
_results.push(_this._errorProcessing(files, response || _this.options.dictResponseError.replace("{{statusCode}}", xhr.status), xhr));
}
return _results;
};
updateProgress = function(e) {
var allFilesFinished, progress, _j, _k, _l, _len1, _len2, _len3, _results;
if (e != null) {
progress = 100 * e.loaded / e.total;
for (_j = 0, _len1 = files.length; _j < _len1; _j++) {
file = files[_j];
file.upload = {
progress: progress,
total: e.total,
bytesSent: e.loaded
};
}
} else {
allFilesFinished = true;
progress = 100;
for (_k = 0, _len2 = files.length; _k < _len2; _k++) {
file = files[_k];
if (!(file.upload.progress === 100 && file.upload.bytesSent === file.upload.total)) {
allFilesFinished = false;
}
file.upload.progress = progress;
file.upload.bytesSent = file.upload.total;
}
if (allFilesFinished) {
return;
}
}
_results = [];
for (_l = 0, _len3 = files.length; _l < _len3; _l++) {
file = files[_l];
_results.push(_this.emit("uploadprogress", file, progress, file.upload.bytesSent));
}
return _results;
};
xhr.onload = function(e) {
var _ref;
if (files[0].status === Dropzone.CANCELED) {
return;
}
if (xhr.readyState !== 4) {
return;
}
response = xhr.responseText;
if (xhr.getResponseHeader("content-type") && ~xhr.getResponseHeader("content-type").indexOf("application/json")) {
try {
response = JSON.parse(response);
} catch (_error) {
e = _error;
response = "Invalid JSON response from server.";
}
}
updateProgress();
if (!((200 <= (_ref = xhr.status) && _ref < 300))) {
return handleError();
} else {
return _this._finished(files, response, e);
}
};
xhr.onerror = function() {
if (files[0].status === Dropzone.CANCELED) {
return;
}
return handleError();
};
progressObj = (_ref = xhr.upload) != null ? _ref : xhr;
progressObj.onprogress = updateProgress;
headers = {
"Accept": "application/json",
"Cache-Control": "no-cache",
"X-Requested-With": "XMLHttpRequest"
};
if (this.options.headers) {
extend(headers, this.options.headers);
}
for (headerName in headers) {
headerValue = headers[headerName];
xhr.setRequestHeader(headerName, headerValue);
}
formData = new FormData();
if (this.options.params) {
_ref1 = this.options.params;
for (key in _ref1) {
value = _ref1[key];
formData.append(key, value);
}
}
for (_j = 0, _len1 = files.length; _j < _len1; _j++) {
file = files[_j];
this.emit("sending", file, xhr, formData);
}
if (this.options.uploadMultiple) {
this.emit("sendingmultiple", files, xhr, formData);
}
if (this.element.tagName === "FORM") {
_ref2 = this.element.querySelectorAll("input, textarea, select, button");
for (_k = 0, _len2 = _ref2.length; _k < _len2; _k++) {
input = _ref2[_k];
inputName = input.getAttribute("name");
inputType = input.getAttribute("type");
if (input.tagName === "SELECT" && input.hasAttribute("multiple")) {
_ref3 = input.options;
for (_l = 0, _len3 = _ref3.length; _l < _len3; _l++) {
option = _ref3[_l];
if (option.selected) {
formData.append(inputName, option.value);
}
}
} else if (!inputType || ((_ref4 = inputType.toLowerCase()) !== "checkbox" && _ref4 !== "radio") || input.checked) {
formData.append(inputName, input.value);
}
}
}
for (_m = 0, _len4 = files.length; _m < _len4; _m++) {
file = files[_m];
formData.append("" + this.options.paramName + (this.options.uploadMultiple ? "[]" : ""), file, file.name);
}
return xhr.send(formData);
};
Dropzone.prototype._finished = function(files, responseText, e) {
var file, _i, _len;
for (_i = 0, _len = files.length; _i < _len; _i++) {
file = files[_i];
file.status = Dropzone.SUCCESS;
this.emit("success", file, responseText, e);
this.emit("complete", file);
}
if (this.options.uploadMultiple) {
this.emit("successmultiple", files, responseText, e);
this.emit("completemultiple", files);
}
if (this.options.autoProcessQueue) {
return this.processQueue();
}
};
Dropzone.prototype._errorProcessing = function(files, message, xhr) {
var file, _i, _len;
for (_i = 0, _len = files.length; _i < _len; _i++) {
file = files[_i];
file.status = Dropzone.ERROR;
this.emit("error", file, message, xhr);
this.emit("complete", file);
}
if (this.options.uploadMultiple) {
this.emit("errormultiple", files, message, xhr);
this.emit("completemultiple", files);
}
if (this.options.autoProcessQueue) {
return this.processQueue();
}
};
return Dropzone;
})(Em);
Dropzone.version = "3.8.4";
Dropzone.options = {};
Dropzone.optionsForElement = function(element) {
if (element.getAttribute("id")) {
return Dropzone.options[camelize(element.getAttribute("id"))];
} else {
return void 0;
}
};
Dropzone.instances = [];
Dropzone.forElement = function(element) {
if (typeof element === "string") {
element = document.querySelector(element);
}
if ((element != null ? element.dropzone : void 0) == null) {
throw new Error("No Dropzone found for given element. This is probably because you're trying to access it before Dropzone had the time to initialize. Use the `init` option to setup any additional observers on your Dropzone.");
}
return element.dropzone;
};
Dropzone.autoDiscover = true;
Dropzone.discover = function() {
var checkElements, dropzone, dropzones, _i, _len, _results;
if (document.querySelectorAll) {
dropzones = document.querySelectorAll(".dropzone");
} else {
dropzones = [];
checkElements = function(elements) {
var el, _i, _len, _results;
_results = [];
for (_i = 0, _len = elements.length; _i < _len; _i++) {
el = elements[_i];
if (/(^| )dropzone($| )/.test(el.className)) {
_results.push(dropzones.push(el));
} else {
_results.push(void 0);
}
}
return _results;
};
checkElements(document.getElementsByTagName("div"));
checkElements(document.getElementsByTagName("form"));
}
_results = [];
for (_i = 0, _len = dropzones.length; _i < _len; _i++) {
dropzone = dropzones[_i];
if (Dropzone.optionsForElement(dropzone) !== false) {
_results.push(new Dropzone(dropzone));
} else {
_results.push(void 0);
}
}
return _results;
};
Dropzone.blacklistedBrowsers = [/opera.*Macintosh.*version\/12/i];
Dropzone.isBrowserSupported = function() {
var capableBrowser, regex, _i, _len, _ref;
capableBrowser = true;
if (window.File && window.FileReader && window.FileList && window.Blob && window.FormData && document.querySelector) {
if (!("classList" in document.createElement("a"))) {
capableBrowser = false;
} else {
_ref = Dropzone.blacklistedBrowsers;
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
regex = _ref[_i];
if (regex.test(navigator.userAgent)) {
capableBrowser = false;
continue;
}
}
}
} else {
capableBrowser = false;
}
return capableBrowser;
};
without = function(list, rejectedItem) {
var item, _i, _len, _results;
_results = [];
for (_i = 0, _len = list.length; _i < _len; _i++) {
item = list[_i];
if (item !== rejectedItem) {
_results.push(item);
}
}
return _results;
};
camelize = function(str) {
return str.replace(/[\-_](\w)/g, function(match) {
return match[1].toUpperCase();
});
};
Dropzone.createElement = function(string) {
var div;
div = document.createElement("div");
div.innerHTML = string;
return div.childNodes[0];
};
Dropzone.elementInside = function(element, container) {
if (element === container) {
return true;
}
while (element = element.parentNode) {
if (element === container) {
return true;
}
}
return false;
};
Dropzone.getElement = function(el, name) {
var element;
if (typeof el === "string") {
element = document.querySelector(el);
} else if (el.nodeType != null) {
element = el;
}
if (element == null) {
throw new Error("Invalid `" + name + "` option provided. Please provide a CSS selector or a plain HTML element.");
}
return element;
};
Dropzone.getElements = function(els, name) {
var e, el, elements, _i, _j, _len, _len1, _ref;
if (els instanceof Array) {
elements = [];
try {
for (_i = 0, _len = els.length; _i < _len; _i++) {
el = els[_i];
elements.push(this.getElement(el, name));
}
} catch (_error) {
e = _error;
elements = null;
}
} else if (typeof els === "string") {
elements = [];
_ref = document.querySelectorAll(els);
for (_j = 0, _len1 = _ref.length; _j < _len1; _j++) {
el = _ref[_j];
elements.push(el);
}
} else if (els.nodeType != null) {
elements = [els];
}
if (!((elements != null) && elements.length)) {
throw new Error("Invalid `" + name + "` option provided. Please provide a CSS selector, a plain HTML element or a list of those.");
}
return elements;
};
Dropzone.confirm = function(question, accepted, rejected) {
if (window.confirm(question)) {
return accepted();
} else if (rejected != null) {
return rejected();
}
};
Dropzone.isValidFile = function(file, acceptedFiles) {
var baseMimeType, mimeType, validType, _i, _len;
if (!acceptedFiles) {
return true;
}
acceptedFiles = acceptedFiles.split(",");
mimeType = file.type;
baseMimeType = mimeType.replace(/\/.*$/, "");
for (_i = 0, _len = acceptedFiles.length; _i < _len; _i++) {
validType = acceptedFiles[_i];
validType = validType.trim();
if (validType.charAt(0) === ".") {
if (file.name.toLowerCase().indexOf(validType.toLowerCase(), file.name.length - validType.length) !== -1) {
return true;
}
} else if (/\/\*$/.test(validType)) {
if (baseMimeType === validType.replace(/\/.*$/, "")) {
return true;
}
} else {
if (mimeType === validType) {
return true;
}
}
}
return false;
};
if (typeof jQuery !== "undefined" && jQuery !== null) {
jQuery.fn.dropzone = function(options) {
return this.each(function() {
return new Dropzone(this, options);
});
};
}
if (typeof module !== "undefined" && module !== null) {
module.exports = Dropzone;
} else {
window.Dropzone = Dropzone;
}
Dropzone.ADDED = "added";
Dropzone.QUEUED = "queued";
Dropzone.ACCEPTED = Dropzone.QUEUED;
Dropzone.UPLOADING = "uploading";
Dropzone.PROCESSING = Dropzone.UPLOADING;
Dropzone.CANCELED = "canceled";
Dropzone.ERROR = "error";
Dropzone.SUCCESS = "success";
/*
Bugfix for iOS 6 and 7
Source: http://stackoverflow.com/questions/11929099/html5-canvas-drawimage-ratio-bug-ios
based on the work of https://github.com/stomita/ios-imagefile-megapixel
*/
detectVerticalSquash = function(img) {
var alpha, canvas, ctx, data, ey, ih, iw, py, ratio, sy;
iw = img.naturalWidth;
ih = img.naturalHeight;
canvas = document.createElement("canvas");
canvas.width = 1;
canvas.height = ih;
ctx = canvas.getContext("2d");
ctx.drawImage(img, 0, 0);
data = ctx.getImageData(0, 0, 1, ih).data;
sy = 0;
ey = ih;
py = ih;
while (py > sy) {
alpha = data[(py - 1) * 4 + 3];
if (alpha === 0) {
ey = py;
} else {
sy = py;
}
py = (ey + sy) >> 1;
}
ratio = py / ih;
if (ratio === 0) {
return 1;
} else {
return ratio;
}
};
drawImageIOSFix = function(ctx, img, sx, sy, sw, sh, dx, dy, dw, dh) {
var vertSquashRatio;
vertSquashRatio = detectVerticalSquash(img);
return ctx.drawImage(img, sx, sy, sw, sh, dx, dy, dw, dh / vertSquashRatio);
};
/*
# contentloaded.js
#
# Author: Diego Perini (diego.perini at gmail.com)
# Summary: cross-browser wrapper for DOMContentLoaded
# Updated: 20101020
# License: MIT
# Version: 1.2
#
# URL:
# http://javascript.nwbox.com/ContentLoaded/
# http://javascript.nwbox.com/ContentLoaded/MIT-LICENSE
*/
contentLoaded = function(win, fn) {
var add, doc, done, init, poll, pre, rem, root, top;
done = false;
top = true;
doc = win.document;
root = doc.documentElement;
add = (doc.addEventListener ? "addEventListener" : "attachEvent");
rem = (doc.addEventListener ? "removeEventListener" : "detachEvent");
pre = (doc.addEventListener ? "" : "on");
init = function(e) {
if (e.type === "readystatechange" && doc.readyState !== "complete") {
return;
}
(e.type === "load" ? win : doc)[rem](pre + e.type, init, false);
if (!done && (done = true)) {
return fn.call(win, e.type || e);
}
};
poll = function() {
var e;
try {
root.doScroll("left");
} catch (_error) {
e = _error;
setTimeout(poll, 50);
return;
}
return init("poll");
};
if (doc.readyState !== "complete") {
if (doc.createEventObject && root.doScroll) {
try {
top = !win.frameElement;
} catch (_error) {}
if (top) {
poll();
}
}
doc[add](pre + "DOMContentLoaded", init, false);
doc[add](pre + "readystatechange", init, false);
return win[add](pre + "load", init, false);
}
};
Dropzone._autoDiscoverFunction = function() {
if (Dropzone.autoDiscover) {
return Dropzone.discover();
}
};
contentLoaded(window, Dropzone._autoDiscoverFunction);
}).call(this);
});
require.alias("component-emitter/index.js", "dropzone/deps/emitter/index.js");
require.alias("component-emitter/index.js", "emitter/index.js");
if (typeof exports == "object") {
module.exports = require("dropzone");
} else if (typeof define == "function" && define.amd) {
define(function(){ return require("dropzone"); });
} else {
this["Dropzone"] = require("dropzone");
}})();
Dropzone.autoDiscover = false;
\ No newline at end of file
/* ------------------------------------------------------------------------
Class: prettyPhoto
Use: Lightbox clone for jQuery
Author: Stephane Caron (http://www.no-margin-for-errors.com)
Version: 3.1.5
------------------------------------------------------------------------- */
(function(e){function t(){var e=location.href;hashtag=e.indexOf("#prettyPhoto")!==-1?decodeURI(e.substring(e.indexOf("#prettyPhoto")+1,e.length)):false;return hashtag}function n(){if(typeof theRel=="undefined")return;location.hash=theRel+"/"+rel_index+"/"}function r(){if(location.href.indexOf("#prettyPhoto")!==-1)location.hash="prettyPhoto"}function i(e,t){e=e.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var n="[\\?&]"+e+"=([^&#]*)";var r=new RegExp(n);var i=r.exec(t);return i==null?"":i[1]}e.prettyPhoto={version:"3.1.5"};e.fn.prettyPhoto=function(s){function g(){e(".pp_loaderIcon").hide();projectedTop=scroll_pos["scrollTop"]+(d/2-a["containerHeight"]/2);if(projectedTop<0)projectedTop=0;$ppt.fadeTo(settings.animation_speed,1);$pp_pic_holder.find(".pp_content").animate({height:a["contentHeight"],width:a["contentWidth"]},settings.animation_speed);$pp_pic_holder.animate({top:projectedTop,left:v/2-a["containerWidth"]/2<0?0:v/2-a["containerWidth"]/2,width:a["containerWidth"]},settings.animation_speed,function(){$pp_pic_holder.find(".pp_hoverContainer,#fullResImage").height(a["height"]).width(a["width"]);$pp_pic_holder.find(".pp_fade").fadeIn(settings.animation_speed);if(isSet&&S(pp_images[set_position])=="image"){$pp_pic_holder.find(".pp_hoverContainer").show()}else{$pp_pic_holder.find(".pp_hoverContainer").hide()}if(settings.allow_expand){if(a["resized"]){e("a.pp_expand,a.pp_contract").show()}else{e("a.pp_expand").hide()}}if(settings.autoplay_slideshow&&!m&&!f)e.prettyPhoto.startSlideshow();settings.changepicturecallback();f=true});C();s.ajaxcallback()}function y(t){$pp_pic_holder.find("#pp_full_res object,#pp_full_res embed").css("visibility","hidden");$pp_pic_holder.find(".pp_fade").fadeOut(settings.animation_speed,function(){e(".pp_loaderIcon").show();t()})}function b(t){t>1?e(".pp_nav").show():e(".pp_nav").hide()}function w(e,t){resized=false;E(e,t);imageWidth=e,imageHeight=t;if((p>v||h>d)&&doresize&&settings.allow_resize&&!u){resized=true,fitting=false;while(!fitting){if(p>v){imageWidth=v-200;imageHeight=t/e*imageWidth}else if(h>d){imageHeight=d-200;imageWidth=e/t*imageHeight}else{fitting=true}h=imageHeight,p=imageWidth}if(p>v||h>d){w(p,h)}E(imageWidth,imageHeight)}return{width:Math.floor(imageWidth),height:Math.floor(imageHeight),containerHeight:Math.floor(h),containerWidth:Math.floor(p)+settings.horizontal_padding*2,contentHeight:Math.floor(l),contentWidth:Math.floor(c),resized:resized}}function E(t,n){t=parseFloat(t);n=parseFloat(n);$pp_details=$pp_pic_holder.find(".pp_details");$pp_details.width(t);detailsHeight=parseFloat($pp_details.css("marginTop"))+parseFloat($pp_details.css("marginBottom"));$pp_details=$pp_details.clone().addClass(settings.theme).width(t).appendTo(e("body")).css({position:"absolute",top:-1e4});detailsHeight+=$pp_details.height();detailsHeight=detailsHeight<=34?36:detailsHeight;$pp_details.remove();$pp_title=$pp_pic_holder.find(".ppt");$pp_title.width(t);titleHeight=parseFloat($pp_title.css("marginTop"))+parseFloat($pp_title.css("marginBottom"));$pp_title=$pp_title.clone().appendTo(e("body")).css({position:"absolute",top:-1e4});titleHeight+=$pp_title.height();$pp_title.remove();l=n+detailsHeight;c=t;h=l+titleHeight+$pp_pic_holder.find(".pp_top").height()+$pp_pic_holder.find(".pp_bottom").height();p=t}function S(e){if(e.match(/youtube\.com\/watch/i)||e.match(/youtu\.be/i)){return"youtube"}else if(e.match(/vimeo\.com/i)){return"vimeo"}else if(e.match(/\b.mov\b/i)){return"quicktime"}else if(e.match(/\b.swf\b/i)){return"flash"}else if(e.match(/\biframe=true\b/i)){return"iframe"}else if(e.match(/\bajax=true\b/i)){return"ajax"}else if(e.match(/\bcustom=true\b/i)){return"custom"}else if(e.substr(0,1)=="#"){return"inline"}else{return"image"}}function x(){if(doresize&&typeof $pp_pic_holder!="undefined"){scroll_pos=T();contentHeight=$pp_pic_holder.height(),contentwidth=$pp_pic_holder.width();projectedTop=d/2+scroll_pos["scrollTop"]-contentHeight/2;if(projectedTop<0)projectedTop=0;if(contentHeight>d)return;$pp_pic_holder.css({top:projectedTop,left:v/2+scroll_pos["scrollLeft"]-contentwidth/2})}}function T(){if(self.pageYOffset){return{scrollTop:self.pageYOffset,scrollLeft:self.pageXOffset}}else if(document.documentElement&&document.documentElement.scrollTop){return{scrollTop:document.documentElement.scrollTop,scrollLeft:document.documentElement.scrollLeft}}else if(document.body){return{scrollTop:document.body.scrollTop,scrollLeft:document.body.scrollLeft}}}function N(){d=e(window).height(),v=e(window).width();if(typeof $pp_overlay!="undefined")$pp_overlay.height(e(document).height()).width(v)}function C(){if(isSet&&settings.overlay_gallery&&S(pp_images[set_position])=="image"){itemWidth=52+5;navWidth=settings.theme=="facebook"||settings.theme=="pp_default"?50:30;itemsPerPage=Math.floor((a["containerWidth"]-100-navWidth)/itemWidth);itemsPerPage=itemsPerPage<pp_images.length?itemsPerPage:pp_images.length;totalPage=Math.ceil(pp_images.length/itemsPerPage)-1;if(totalPage==0){navWidth=0;$pp_gallery.find(".pp_arrow_next,.pp_arrow_previous").hide()}else{$pp_gallery.find(".pp_arrow_next,.pp_arrow_previous").show()}galleryWidth=itemsPerPage*itemWidth;fullGalleryWidth=pp_images.length*itemWidth;$pp_gallery.css("margin-left",-(galleryWidth/2+navWidth/2)).find("div:first").width(galleryWidth+5).find("ul").width(fullGalleryWidth).find("li.selected").removeClass("selected");goToPage=Math.floor(set_position/itemsPerPage)<totalPage?Math.floor(set_position/itemsPerPage):totalPage;e.prettyPhoto.changeGalleryPage(goToPage);$pp_gallery_li.filter(":eq("+set_position+")").addClass("selected")}else{$pp_pic_holder.find(".pp_content").unbind("mouseenter mouseleave")}}function k(t){if(settings.social_tools)facebook_like_link=settings.social_tools.replace("{location_href}",encodeURIComponent(location.href));settings.markup=settings.markup.replace("{pp_social}","");e("body").append(settings.markup);$pp_pic_holder=e(".pp_pic_holder"),$ppt=e(".ppt"),$pp_overlay=e("div.pp_overlay");if(isSet&&settings.overlay_gallery){currentGalleryPage=0;toInject="";for(var n=0;n<pp_images.length;n++){if(!pp_images[n].match(/\b(jpg|jpeg|png|gif)\b/gi)){classname="default";img_src=""}else{classname="";img_src=pp_images[n]}toInject+="<li class='"+classname+"'><a href='#'><img src='"+img_src+"' width='50' alt='' /></a></li>"}toInject=settings.gallery_markup.replace(/{gallery}/g,toInject);$pp_pic_holder.find("#pp_full_res").after(toInject);$pp_gallery=e(".pp_pic_holder .pp_gallery"),$pp_gallery_li=$pp_gallery.find("li");$pp_gallery.find(".pp_arrow_next").click(function(){e.prettyPhoto.changeGalleryPage("next");e.prettyPhoto.stopSlideshow();return false});$pp_gallery.find(".pp_arrow_previous").click(function(){e.prettyPhoto.changeGalleryPage("previous");e.prettyPhoto.stopSlideshow();return false});$pp_pic_holder.find(".pp_content").hover(function(){$pp_pic_holder.find(".pp_gallery:not(.disabled)").fadeIn()},function(){$pp_pic_holder.find(".pp_gallery:not(.disabled)").fadeOut()});itemWidth=52+5;$pp_gallery_li.each(function(t){e(this).find("a").click(function(){e.prettyPhoto.changePage(t);e.prettyPhoto.stopSlideshow();return false})})}if(settings.slideshow){$pp_pic_holder.find(".pp_nav").prepend('<a href="#" class="pp_play">Play</a>');$pp_pic_holder.find(".pp_nav .pp_play").click(function(){e.prettyPhoto.startSlideshow();return false})}$pp_pic_holder.attr("class","pp_pic_holder "+settings.theme);$pp_overlay.css({opacity:0,height:e(document).height(),width:e(window).width()}).bind("click",function(){if(!settings.modal)e.prettyPhoto.close()});e("a.pp_close").bind("click",function(){e.prettyPhoto.close();return false});if(settings.allow_expand){e("a.pp_expand").bind("click",function(t){if(e(this).hasClass("pp_expand")){e(this).removeClass("pp_expand").addClass("pp_contract");doresize=false}else{e(this).removeClass("pp_contract").addClass("pp_expand");doresize=true}y(function(){e.prettyPhoto.open()});return false})}$pp_pic_holder.find(".pp_previous, .pp_nav .pp_arrow_previous").bind("click",function(){e.prettyPhoto.changePage("previous");e.prettyPhoto.stopSlideshow();return false});$pp_pic_holder.find(".pp_next, .pp_nav .pp_arrow_next").bind("click",function(){e.prettyPhoto.changePage("next");e.prettyPhoto.stopSlideshow();return false});x()}s=jQuery.extend({hook:"rel",animation_speed:"fast",ajaxcallback:function(){},slideshow:5e3,autoplay_slideshow:false,opacity:.8,show_title:true,allow_resize:true,allow_expand:true,default_width:500,default_height:344,counter_separator_label:"/",theme:"pp_default",horizontal_padding:20,hideflash:false,wmode:"opaque",autoplay:true,modal:false,deeplinking:true,overlay_gallery:true,overlay_gallery_max:30,keyboard_shortcuts:true,changepicturecallback:function(){},callback:function(){},ie6_fallback:true,markup:'<div class="pp_pic_holder"> <div class="ppt"> </div> <div class="pp_top"> <div class="pp_left"></div> <div class="pp_middle"></div> <div class="pp_right"></div> </div> <div class="pp_content_container"> <div class="pp_left"> <div class="pp_right"> <div class="pp_content"> <div class="pp_loaderIcon"></div> <div class="pp_fade"> <a href="#" class="pp_expand" title="Expand the image">Expand</a> <div class="pp_hoverContainer"> <a class="pp_next" href="#">next</a> <a class="pp_previous" href="#">previous</a> </div> <div id="pp_full_res"></div> <div class="pp_details"> <div class="pp_nav"> <a href="#" class="pp_arrow_previous">Previous</a> <p class="currentTextHolder">0/0</p> <a href="#" class="pp_arrow_next">Next</a> </div> <p class="pp_description"></p> <div class="pp_social">{pp_social}</div> <a class="pp_close" href="#">Close</a> </div> </div> </div> </div> </div> </div> <div class="pp_bottom"> <div class="pp_left"></div> <div class="pp_middle"></div> <div class="pp_right"></div> </div> </div> <div class="pp_overlay"></div>',gallery_markup:'<div class="pp_gallery"> <a href="#" class="pp_arrow_previous">Previous</a> <div> <ul> {gallery} </ul> </div> <a href="#" class="pp_arrow_next">Next</a> </div>',image_markup:'<img id="fullResImage" src="{path}" />',flash_markup:'<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="{width}" height="{height}"><param name="wmode" value="{wmode}" /><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="{path}" /><embed src="{path}" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="{width}" height="{height}" wmode="{wmode}"></embed></object>',quicktime_markup:'<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab" height="{height}" width="{width}"><param name="src" value="{path}"><param name="autoplay" value="{autoplay}"><param name="type" value="video/quicktime"><embed src="{path}" height="{height}" width="{width}" autoplay="{autoplay}" type="video/quicktime" pluginspage="http://www.apple.com/quicktime/download/"></embed></object>',iframe_markup:'<iframe src ="{path}" width="{width}" height="{height}" frameborder="no"></iframe>',inline_markup:'<div class="pp_inline">{content}</div>',custom_markup:"",social_tools:'<div class="twitter"><a href="http://twitter.com/share" class="twitter-share-button" data-count="none">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><div class="facebook"><iframe src="//www.facebook.com/plugins/like.php?locale=en_US&href={location_href}&layout=button_count&show_faces=true&width=500&action=like&font&colorscheme=light&height=23" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:500px; height:23px;" allowTransparency="true"></iframe></div>'},s);var o=this,u=false,a,f,l,c,h,p,d=e(window).height(),v=e(window).width(),m;doresize=true,scroll_pos=T();e(window).unbind("resize.prettyphoto").bind("resize.prettyphoto",function(){x();N()});if(s.keyboard_shortcuts){e(document).unbind("keydown.prettyphoto").bind("keydown.prettyphoto",function(t){if(typeof $pp_pic_holder!="undefined"){if($pp_pic_holder.is(":visible")){switch(t.keyCode){case 37:e.prettyPhoto.changePage("previous");t.preventDefault();break;case 39:e.prettyPhoto.changePage("next");t.preventDefault();break;case 27:if(!settings.modal)e.prettyPhoto.close();t.preventDefault();break}}}})}e.prettyPhoto.initialize=function(){settings=s;if(settings.theme=="pp_default")settings.horizontal_padding=16;theRel=e(this).attr(settings.hook);galleryRegExp=/\[(?:.*)\]/;isSet=galleryRegExp.exec(theRel)?true:false;pp_images=isSet?jQuery.map(o,function(t,n){if(e(t).attr(settings.hook).indexOf(theRel)!=-1)return e(t).attr("href")}):e.makeArray(e(this).attr("href"));pp_titles=isSet?jQuery.map(o,function(t,n){if(e(t).attr(settings.hook).indexOf(theRel)!=-1)return e(t).find("img").attr("alt")?e(t).find("img").attr("alt"):""}):e.makeArray(e(this).find("img").attr("alt"));pp_descriptions=isSet?jQuery.map(o,function(t,n){if(e(t).attr(settings.hook).indexOf(theRel)!=-1)return e(t).attr("title")?e(t).attr("title"):""}):e.makeArray(e(this).attr("title"));if(pp_images.length>settings.overlay_gallery_max)settings.overlay_gallery=false;set_position=jQuery.inArray(e(this).attr("href"),pp_images);rel_index=isSet?set_position:e("a["+settings.hook+"^='"+theRel+"']").index(e(this));k(this);if(settings.allow_resize)e(window).bind("scroll.prettyphoto",function(){x()});e.prettyPhoto.open();return false};e.prettyPhoto.open=function(t){if(typeof settings=="undefined"){settings=s;pp_images=e.makeArray(arguments[0]);pp_titles=arguments[1]?e.makeArray(arguments[1]):e.makeArray("");pp_descriptions=arguments[2]?e.makeArray(arguments[2]):e.makeArray("");isSet=pp_images.length>1?true:false;set_position=arguments[3]?arguments[3]:0;k(t.target)}if(settings.hideflash)e("object,embed,iframe[src*=youtube],iframe[src*=vimeo]").css("visibility","hidden");b(e(pp_images).size());e(".pp_loaderIcon").show();if(settings.deeplinking)n();if(settings.social_tools){facebook_like_link=settings.social_tools.replace("{location_href}",encodeURIComponent(location.href));$pp_pic_holder.find(".pp_social").html(facebook_like_link)}if($ppt.is(":hidden"))$ppt.css("opacity",0).show();$pp_overlay.show().fadeTo(settings.animation_speed,settings.opacity);$pp_pic_holder.find(".currentTextHolder").text(set_position+1+settings.counter_separator_label+e(pp_images).size());if(typeof pp_descriptions[set_position]!="undefined"&&pp_descriptions[set_position]!=""){$pp_pic_holder.find(".pp_description").show().html(unescape(pp_descriptions[set_position]))}else{$pp_pic_holder.find(".pp_description").hide()}movie_width=parseFloat(i("width",pp_images[set_position]))?i("width",pp_images[set_position]):settings.default_width.toString();movie_height=parseFloat(i("height",pp_images[set_position]))?i("height",pp_images[set_position]):settings.default_height.toString();u=false;if(movie_height.indexOf("%")!=-1){movie_height=parseFloat(e(window).height()*parseFloat(movie_height)/100-150);u=true}if(movie_width.indexOf("%")!=-1){movie_width=parseFloat(e(window).width()*parseFloat(movie_width)/100-150);u=true}$pp_pic_holder.fadeIn(function(){settings.show_title&&pp_titles[set_position]!=""&&typeof pp_titles[set_position]!="undefined"?$ppt.html(unescape(pp_titles[set_position])):$ppt.html(" ");imgPreloader="";skipInjection=false;switch(S(pp_images[set_position])){case"image":imgPreloader=new Image;nextImage=new Image;if(isSet&&set_position<e(pp_images).size()-1)nextImage.src=pp_images[set_position+1];prevImage=new Image;if(isSet&&pp_images[set_position-1])prevImage.src=pp_images[set_position-1];$pp_pic_holder.find("#pp_full_res")[0].innerHTML=settings.image_markup.replace(/{path}/g,pp_images[set_position]);imgPreloader.onload=function(){a=w(imgPreloader.width,imgPreloader.height);g()};imgPreloader.onerror=function(){alert("Image cannot be loaded. Make sure the path is correct and image exist.");e.prettyPhoto.close()};imgPreloader.src=pp_images[set_position];break;case"youtube":a=w(movie_width,movie_height);movie_id=i("v",pp_images[set_position]);if(movie_id==""){movie_id=pp_images[set_position].split("youtu.be/");movie_id=movie_id[1];if(movie_id.indexOf("?")>0)movie_id=movie_id.substr(0,movie_id.indexOf("?"));if(movie_id.indexOf("&")>0)movie_id=movie_id.substr(0,movie_id.indexOf("&"))}movie="http://www.youtube.com/embed/"+movie_id;i("rel",pp_images[set_position])?movie+="?rel="+i("rel",pp_images[set_position]):movie+="?rel=1";if(settings.autoplay)movie+="&autoplay=1";toInject=settings.iframe_markup.replace(/{width}/g,a["width"]).replace(/{height}/g,a["height"]).replace(/{wmode}/g,settings.wmode).replace(/{path}/g,movie);break;case"vimeo":a=w(movie_width,movie_height);movie_id=pp_images[set_position];var t=/http(s?):\/\/(www\.)?vimeo.com\/(\d+)/;var n=movie_id.match(t);movie="http://player.vimeo.com/video/"+n[3]+"?title=0&byline=0&portrait=0";if(settings.autoplay)movie+="&autoplay=1;";vimeo_width=a["width"]+"/embed/?moog_width="+a["width"];toInject=settings.iframe_markup.replace(/{width}/g,vimeo_width).replace(/{height}/g,a["height"]).replace(/{path}/g,movie);break;case"quicktime":a=w(movie_width,movie_height);a["height"]+=15;a["contentHeight"]+=15;a["containerHeight"]+=15;toInject=settings.quicktime_markup.replace(/{width}/g,a["width"]).replace(/{height}/g,a["height"]).replace(/{wmode}/g,settings.wmode).replace(/{path}/g,pp_images[set_position]).replace(/{autoplay}/g,settings.autoplay);break;case"flash":a=w(movie_width,movie_height);flash_vars=pp_images[set_position];flash_vars=flash_vars.substring(pp_images[set_position].indexOf("flashvars")+10,pp_images[set_position].length);filename=pp_images[set_position];filename=filename.substring(0,filename.indexOf("?"));toInject=settings.flash_markup.replace(/{width}/g,a["width"]).replace(/{height}/g,a["height"]).replace(/{wmode}/g,settings.wmode).replace(/{path}/g,filename+"?"+flash_vars);break;case"iframe":a=w(movie_width,movie_height);frame_url=pp_images[set_position];frame_url=frame_url.substr(0,frame_url.indexOf("iframe")-1);toInject=settings.iframe_markup.replace(/{width}/g,a["width"]).replace(/{height}/g,a["height"]).replace(/{path}/g,frame_url);break;case"ajax":doresize=false;a=w(movie_width,movie_height);doresize=true;skipInjection=true;e.get(pp_images[set_position],function(e){toInject=settings.inline_markup.replace(/{content}/g,e);$pp_pic_holder.find("#pp_full_res")[0].innerHTML=toInject;g()});break;case"custom":a=w(movie_width,movie_height);toInject=settings.custom_markup;break;case"inline":myClone=e(pp_images[set_position]).clone().append('<br clear="all" />').css({width:settings.default_width}).wrapInner('<div id="pp_full_res"><div class="pp_inline"></div></div>').appendTo(e("body")).show();doresize=false;a=w(e(myClone).width(),e(myClone).height());doresize=true;e(myClone).remove();toInject=settings.inline_markup.replace(/{content}/g,e(pp_images[set_position]).html());break}if(!imgPreloader&&!skipInjection){$pp_pic_holder.find("#pp_full_res")[0].innerHTML=toInject;g()}});return false};e.prettyPhoto.changePage=function(t){currentGalleryPage=0;if(t=="previous"){set_position--;if(set_position<0)set_position=e(pp_images).size()-1}else if(t=="next"){set_position++;if(set_position>e(pp_images).size()-1)set_position=0}else{set_position=t}rel_index=set_position;if(!doresize)doresize=true;if(settings.allow_expand){e(".pp_contract").removeClass("pp_contract").addClass("pp_expand")}y(function(){e.prettyPhoto.open()})};e.prettyPhoto.changeGalleryPage=function(e){if(e=="next"){currentGalleryPage++;if(currentGalleryPage>totalPage)currentGalleryPage=0}else if(e=="previous"){currentGalleryPage--;if(currentGalleryPage<0)currentGalleryPage=totalPage}else{currentGalleryPage=e}slide_speed=e=="next"||e=="previous"?settings.animation_speed:0;slide_to=currentGalleryPage*itemsPerPage*itemWidth;$pp_gallery.find("ul").animate({left:-slide_to},slide_speed)};e.prettyPhoto.startSlideshow=function(){if(typeof m=="undefined"){$pp_pic_holder.find(".pp_play").unbind("click").removeClass("pp_play").addClass("pp_pause").click(function(){e.prettyPhoto.stopSlideshow();return false});m=setInterval(e.prettyPhoto.startSlideshow,settings.slideshow)}else{e.prettyPhoto.changePage("next")}};e.prettyPhoto.stopSlideshow=function(){$pp_pic_holder.find(".pp_pause").unbind("click").removeClass("pp_pause").addClass("pp_play").click(function(){e.prettyPhoto.startSlideshow();return false});clearInterval(m);m=undefined};e.prettyPhoto.close=function(){if($pp_overlay.is(":animated"))return;e.prettyPhoto.stopSlideshow();$pp_pic_holder.stop().find("object,embed").css("visibility","hidden");e("div.pp_pic_holder,div.ppt,.pp_fade").fadeOut(settings.animation_speed,function(){e(this).remove()});$pp_overlay.fadeOut(settings.animation_speed,function(){if(settings.hideflash)e("object,embed,iframe[src*=youtube],iframe[src*=vimeo]").css("visibility","visible");e(this).remove();e(window).unbind("scroll.prettyphoto");r();settings.callback();doresize=true;f=false;delete settings})};if(!pp_alreadyInitialized&&t()){pp_alreadyInitialized=true;hashIndex=t();hashRel=hashIndex;hashIndex=hashIndex.substring(hashIndex.indexOf("/")+1,hashIndex.length-1);hashRel=hashRel.substring(0,hashRel.indexOf("/"));setTimeout(function(){e("a["+s.hook+"^='"+hashRel+"']:eq("+hashIndex+")").trigger("click")},50)}return this.unbind("click.prettyphoto").bind("click.prettyphoto",e.prettyPhoto.initialize)};})(jQuery);var pp_alreadyInitialized=false
\ No newline at end of file
.ancimage {
/*display:table;*/
/* background-color: #6A6D6D;*/
margin: 0px;
padding: 0px;
}
.ancimage > div {
/*width: 50%;*/
/*float: left;*/
}
.ancimage > .ancimage-dropzone {
/*width:150px;*/
/*height: 100%;*/
min-height: 100px;
/* min-width: 100px;*/
min-width: 90%;
text-align: center;
background-color: white;
color: #6A6D6D;
margin:0px;
margin-top:1px;
padding:10px;
}
.ancimage > .ancimage-dropzone > div.preview-database-image {
color: #6A6D6D;
}
.ancimage > .ancimage-dropzone > .preview-database-image {
text-align: center;
}
.ancimage > .ancimage-dropzone > img,
.ancimage > .ancimage-dropzone > .preview-database-image > img {
/*width:200px;*/
max-width: 125px;
max-height: 150px;
}
/* The MIT License */
.dropzone,
.dropzone *,
.dropzone-previews,
.dropzone-previews * {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.dropzone {
position: relative;
border: 1px solid rgba(0,0,0,0.08);
background: rgba(0,0,0,0.02);
padding: 1em;
}
.dropzone.dz-clickable {
cursor: pointer;
}
.dropzone.dz-clickable .dz-message,
.dropzone.dz-clickable .dz-message span {
cursor: pointer;
}
.dropzone.dz-clickable * {
cursor: default;
}
.dropzone .dz-message {
opacity: 1;
-ms-filter: none;
filter: none;
}
.dropzone.dz-drag-hover {
border-color: rgba(0,0,0,0.15);
background: rgba(0,0,0,0.04);
}
.dropzone.dz-started .dz-message {
display: none;
}
.dropzone .dz-preview,
.dropzone-previews .dz-preview {
background: rgba(255,255,255,0.8);
position: relative;
display: inline-block;
margin: 17px;
vertical-align: top;
border: 1px solid #acacac;
padding: 6px 6px 6px 6px;
}
.dropzone .dz-preview.dz-file-preview [data-dz-thumbnail],
.dropzone-previews .dz-preview.dz-file-preview [data-dz-thumbnail] {
display: none;
}
.dropzone .dz-preview .dz-details,
.dropzone-previews .dz-preview .dz-details {
width: 100px;
height: 100px;
position: relative;
background: #ebebeb;
padding: 5px;
margin-bottom: 22px;
}
.dropzone .dz-preview .dz-details .dz-filename,
.dropzone-previews .dz-preview .dz-details .dz-filename {
overflow: hidden;
height: 100%;
}
.dropzone .dz-preview .dz-details img,
.dropzone-previews .dz-preview .dz-details img {
position: absolute;
top: 0;
left: 0;
width: 100px;
height: 100px;
}
.dropzone .dz-preview .dz-details .dz-size,
.dropzone-previews .dz-preview .dz-details .dz-size {
position: absolute;
bottom: -28px;
left: 3px;
height: 28px;
line-height: 28px;
}
.dropzone .dz-preview.dz-error .dz-error-mark,
.dropzone-previews .dz-preview.dz-error .dz-error-mark {
display: block;
}
.dropzone .dz-preview.dz-success .dz-success-mark,
.dropzone-previews .dz-preview.dz-success .dz-success-mark {
display: block;
}
.dropzone .dz-preview:hover .dz-details img,
.dropzone-previews .dz-preview:hover .dz-details img {
display: none;
}
.dropzone .dz-preview .dz-success-mark,
.dropzone-previews .dz-preview .dz-success-mark,
.dropzone .dz-preview .dz-error-mark,
.dropzone-previews .dz-preview .dz-error-mark {
display: none;
position: absolute;
width: 40px;
height: 40px;
font-size: 30px;
text-align: center;
right: -10px;
top: -10px;
}
.dropzone .dz-preview .dz-success-mark,
.dropzone-previews .dz-preview .dz-success-mark {
color: #8cc657;
}
.dropzone .dz-preview .dz-error-mark,
.dropzone-previews .dz-preview .dz-error-mark {
color: #ee162d;
}
.dropzone .dz-preview .dz-progress,
.dropzone-previews .dz-preview .dz-progress {
position: absolute;
top: 100px;
left: 6px;
right: 6px;
height: 6px;
background: #d7d7d7;
display: none;
}
.dropzone .dz-preview .dz-progress .dz-upload,
.dropzone-previews .dz-preview .dz-progress .dz-upload {
display: block;
position: absolute;
top: 0;
bottom: 0;
left: 0;
width: 0%;
background-color: #8cc657;
}
.dropzone .dz-preview.dz-processing .dz-progress,
.dropzone-previews .dz-preview.dz-processing .dz-progress {
display: block;
}
.dropzone .dz-preview .dz-error-message,
.dropzone-previews .dz-preview .dz-error-message {
display: none;
position: absolute;
top: -5px;
left: -20px;
background: rgba(245,245,245,0.8);
padding: 8px 10px;
color: #800;
min-width: 140px;
max-width: 500px;
z-index: 500;
}
.dropzone .dz-preview:hover.dz-error .dz-error-message,
.dropzone-previews .dz-preview:hover.dz-error .dz-error-message {
display: block;
}
.dropzone {
border: 1px solid rgba(0,0,0,0.03);
/*min-height: 360px;*/
-webkit-border-radius: 3px;
border-radius: 3px;
background: rgba(0,0,0,0.03);
padding: 23px;
}
.dropzone .dz-default.dz-message {
opacity: 1;
-ms-filter: none;
filter: none;
-webkit-transition: opacity 0.3s ease-in-out;
-moz-transition: opacity 0.3s ease-in-out;
-o-transition: opacity 0.3s ease-in-out;
-ms-transition: opacity 0.3s ease-in-out;
transition: opacity 0.3s ease-in-out;
background-image: url("../images/spritemap.png");
background-repeat: no-repeat;
background-position: 0 0;
position: absolute;
width: 428px;
height: 123px;
margin-left: -214px;
margin-top: -61.5px;
top: 50%;
left: 50%;
}
@media all and (-webkit-min-device-pixel-ratio:1.5),(min--moz-device-pixel-ratio:1.5),(-o-min-device-pixel-ratio:1.5/1),(min-device-pixel-ratio:1.5),(min-resolution:138dpi),(min-resolution:1.5dppx) {
.dropzone .dz-default.dz-message {
background-image: url("../images/spritemap@2x.png");
-webkit-background-size: 428px 406px;
-moz-background-size: 428px 406px;
background-size: 428px 406px;
}
}
.dropzone .dz-default.dz-message span {
display: none;
}
.dropzone.dz-square .dz-default.dz-message {
background-position: 0 -123px;
width: 268px;
margin-left: -134px;
height: 174px;
margin-top: -87px;
}
.dropzone.dz-drag-hover .dz-message {
opacity: 0.15;
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=15)";
filter: alpha(opacity=15);
}
.dropzone.dz-started .dz-message {
display: block;
opacity: 0;
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
filter: alpha(opacity=0);
}
.dropzone .dz-preview,
.dropzone-previews .dz-preview {
-webkit-box-shadow: 1px 1px 4px rgba(0,0,0,0.16);
box-shadow: 1px 1px 4px rgba(0,0,0,0.16);
font-size: 14px;
}
.dropzone .dz-preview.dz-image-preview:hover .dz-details img,
.dropzone-previews .dz-preview.dz-image-preview:hover .dz-details img {
display: block;
opacity: 0.1;
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=10)";
filter: alpha(opacity=10);
}
.dropzone .dz-preview.dz-success .dz-success-mark,
.dropzone-previews .dz-preview.dz-success .dz-success-mark {
opacity: 1;
-ms-filter: none;
filter: none;
}
.dropzone .dz-preview.dz-error .dz-error-mark,
.dropzone-previews .dz-preview.dz-error .dz-error-mark {
opacity: 1;
-ms-filter: none;
filter: none;
}
.dropzone .dz-preview.dz-error .dz-progress .dz-upload,
.dropzone-previews .dz-preview.dz-error .dz-progress .dz-upload {
background: #ee1e2d;
}
.dropzone .dz-preview .dz-error-mark,
.dropzone-previews .dz-preview .dz-error-mark,
.dropzone .dz-preview .dz-success-mark,
.dropzone-previews .dz-preview .dz-success-mark {
display: block;
opacity: 0;
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
filter: alpha(opacity=0);
-webkit-transition: opacity 0.4s ease-in-out;
-moz-transition: opacity 0.4s ease-in-out;
-o-transition: opacity 0.4s ease-in-out;
-ms-transition: opacity 0.4s ease-in-out;
transition: opacity 0.4s ease-in-out;
background-image: url("../images/spritemap.png");
background-repeat: no-repeat;
}
@media all and (-webkit-min-device-pixel-ratio:1.5),(min--moz-device-pixel-ratio:1.5),(-o-min-device-pixel-ratio:1.5/1),(min-device-pixel-ratio:1.5),(min-resolution:138dpi),(min-resolution:1.5dppx) {
.dropzone .dz-preview .dz-error-mark,
.dropzone-previews .dz-preview .dz-error-mark,
.dropzone .dz-preview .dz-success-mark,
.dropzone-previews .dz-preview .dz-success-mark {
background-image: url("../images/spritemap@2x.png");
-webkit-background-size: 428px 406px;
-moz-background-size: 428px 406px;
background-size: 428px 406px;
}
}
.dropzone .dz-preview .dz-error-mark span,
.dropzone-previews .dz-preview .dz-error-mark span,
.dropzone .dz-preview .dz-success-mark span,
.dropzone-previews .dz-preview .dz-success-mark span {
display: none;
}
.dropzone .dz-preview .dz-error-mark,
.dropzone-previews .dz-preview .dz-error-mark {
background-position: -268px -123px;
}
.dropzone .dz-preview .dz-success-mark,
.dropzone-previews .dz-preview .dz-success-mark {
background-position: -268px -163px;
}
.dropzone .dz-preview .dz-progress .dz-upload,
.dropzone-previews .dz-preview .dz-progress .dz-upload {
-webkit-animation: loading 0.4s linear infinite;
-moz-animation: loading 0.4s linear infinite;
-o-animation: loading 0.4s linear infinite;
-ms-animation: loading 0.4s linear infinite;
animation: loading 0.4s linear infinite;
-webkit-transition: width 0.3s ease-in-out;
-moz-transition: width 0.3s ease-in-out;
-o-transition: width 0.3s ease-in-out;
-ms-transition: width 0.3s ease-in-out;
transition: width 0.3s ease-in-out;
-webkit-border-radius: 2px;
border-radius: 2px;
position: absolute;
top: 0;
left: 0;
width: 0%;
height: 100%;
background-image: url("../images/spritemap.png");
background-repeat: repeat-x;
background-position: 0px -400px;
}
@media all and (-webkit-min-device-pixel-ratio:1.5),(min--moz-device-pixel-ratio:1.5),(-o-min-device-pixel-ratio:1.5/1),(min-device-pixel-ratio:1.5),(min-resolution:138dpi),(min-resolution:1.5dppx) {
.dropzone .dz-preview .dz-progress .dz-upload,
.dropzone-previews .dz-preview .dz-progress .dz-upload {
background-image: url("../images/spritemap@2x.png");
-webkit-background-size: 428px 406px;
-moz-background-size: 428px 406px;
background-size: 428px 406px;
}
}
.dropzone .dz-preview.dz-success .dz-progress,
.dropzone-previews .dz-preview.dz-success .dz-progress {
display: block;
opacity: 0;
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
filter: alpha(opacity=0);
-webkit-transition: opacity 0.4s ease-in-out;
-moz-transition: opacity 0.4s ease-in-out;
-o-transition: opacity 0.4s ease-in-out;
-ms-transition: opacity 0.4s ease-in-out;
transition: opacity 0.4s ease-in-out;
}
.dropzone .dz-preview .dz-error-message,
.dropzone-previews .dz-preview .dz-error-message {
display: block;
opacity: 0;
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
filter: alpha(opacity=0);
-webkit-transition: opacity 0.3s ease-in-out;
-moz-transition: opacity 0.3s ease-in-out;
-o-transition: opacity 0.3s ease-in-out;
-ms-transition: opacity 0.3s ease-in-out;
transition: opacity 0.3s ease-in-out;
}
.dropzone .dz-preview:hover.dz-error .dz-error-message,
.dropzone-previews .dz-preview:hover.dz-error .dz-error-message {
opacity: 1;
-ms-filter: none;
filter: none;
}
.dropzone a.dz-remove,
.dropzone-previews a.dz-remove {
background-image: -webkit-linear-gradient(top, #fafafa, #eee);
background-image: -moz-linear-gradient(top, #fafafa, #eee);
background-image: -o-linear-gradient(top, #fafafa, #eee);
background-image: -ms-linear-gradient(top, #fafafa, #eee);
background-image: linear-gradient(to bottom, #fafafa, #eee);
-webkit-border-radius: 2px;
border-radius: 2px;
border: 1px solid #eee;
text-decoration: none;
display: block;
padding: 4px 5px;
text-align: center;
color: #aaa;
margin-top: 26px;
}
.dropzone a.dz-remove:hover,
.dropzone-previews a.dz-remove:hover {
color: #666;
}
@-moz-keyframes loading {
0% {
background-position: 0 -400px;
}
100% {
background-position: -7px -400px;
}
}
@-webkit-keyframes loading {
0% {
background-position: 0 -400px;
}
100% {
background-position: -7px -400px;
}
}
@-o-keyframes loading {
0% {
background-position: 0 -400px;
}
100% {
background-position: -7px -400px;
}
}
@-ms-keyframes loading {
0% {
background-position: 0 -400px;
}
100% {
background-position: -7px -400px;
}
}
@keyframes loading {
0% {
background-position: 0 -400px;
}
100% {
background-position: -7px -400px;
}
}
\ No newline at end of file
div.pp_default .pp_top,div.pp_default .pp_top .pp_middle,div.pp_default .pp_top .pp_left,div.pp_default .pp_top .pp_right,div.pp_default .pp_bottom,div.pp_default .pp_bottom .pp_left,div.pp_default .pp_bottom .pp_middle,div.pp_default .pp_bottom .pp_right{height:13px}
div.pp_default .pp_top .pp_left{background:url(../images/prettyPhoto/default/sprite.png) -78px -93px no-repeat}
div.pp_default .pp_top .pp_middle{background:url(../images/prettyPhoto/default/sprite_x.png) top left repeat-x}
div.pp_default .pp_top .pp_right{background:url(../images/prettyPhoto/default/sprite.png) -112px -93px no-repeat}
div.pp_default .pp_content .ppt{color:#f8f8f8}
div.pp_default .pp_content_container .pp_left{background:url(../images/prettyPhoto/default/sprite_y.png) -7px 0 repeat-y;padding-left:13px}
div.pp_default .pp_content_container .pp_right{background:url(../images/prettyPhoto/default/sprite_y.png) top right repeat-y;padding-right:13px}
div.pp_default .pp_next:hover{background:url(../images/prettyPhoto/default/sprite_next.png) center right no-repeat;cursor:pointer}
div.pp_default .pp_previous:hover{background:url(../images/prettyPhoto/default/sprite_prev.png) center left no-repeat;cursor:pointer}
div.pp_default .pp_expand{background:url(../images/prettyPhoto/default/sprite.png) 0 -29px no-repeat;cursor:pointer;width:28px;height:28px}
div.pp_default .pp_expand:hover{background:url(../images/prettyPhoto/default/sprite.png) 0 -56px no-repeat;cursor:pointer}
div.pp_default .pp_contract{background:url(../images/prettyPhoto/default/sprite.png) 0 -84px no-repeat;cursor:pointer;width:28px;height:28px}
div.pp_default .pp_contract:hover{background:url(../images/prettyPhoto/default/sprite.png) 0 -113px no-repeat;cursor:pointer}
div.pp_default .pp_close{width:30px;height:30px;background:url(../images/prettyPhoto/default/sprite.png) 2px 1px no-repeat;cursor:pointer}
div.pp_default .pp_gallery ul li a{background:url(../images/prettyPhoto/default/default_thumb.png) center center #f8f8f8;border:1px solid #aaa}
div.pp_default .pp_social{margin-top:7px}
div.pp_default .pp_gallery a.pp_arrow_previous,div.pp_default .pp_gallery a.pp_arrow_next{position:static;left:auto}
div.pp_default .pp_nav .pp_play,div.pp_default .pp_nav .pp_pause{background:url(../images/prettyPhoto/default/sprite.png) -51px 1px no-repeat;height:30px;width:30px}
div.pp_default .pp_nav .pp_pause{background-position:-51px -29px}
div.pp_default a.pp_arrow_previous,div.pp_default a.pp_arrow_next{background:url(../images/prettyPhoto/default/sprite.png) -31px -3px no-repeat;height:20px;width:20px;margin:4px 0 0}
div.pp_default a.pp_arrow_next{left:52px;background-position:-82px -3px}
div.pp_default .pp_content_container .pp_details{margin-top:5px}
div.pp_default .pp_nav{clear:none;height:30px;width:110px;position:relative}
div.pp_default .pp_nav .currentTextHolder{font-family:Georgia;font-style:italic;color:#999;font-size:11px;left:75px;line-height:25px;position:absolute;top:2px;margin:0;padding:0 0 0 10px}
div.pp_default .pp_close:hover,div.pp_default .pp_nav .pp_play:hover,div.pp_default .pp_nav .pp_pause:hover,div.pp_default .pp_arrow_next:hover,div.pp_default .pp_arrow_previous:hover{opacity:0.7}
div.pp_default .pp_description{font-size:11px;font-weight:700;line-height:14px;margin:5px 50px 5px 0}
div.pp_default .pp_bottom .pp_left{background:url(../images/prettyPhoto/default/sprite.png) -78px -127px no-repeat}
div.pp_default .pp_bottom .pp_middle{background:url(../images/prettyPhoto/default/sprite_x.png) bottom left repeat-x}
div.pp_default .pp_bottom .pp_right{background:url(../images/prettyPhoto/default/sprite.png) -112px -127px no-repeat}
div.pp_default .pp_loaderIcon{background:url(../images/prettyPhoto/default/loader.gif) center center no-repeat}
div.light_rounded .pp_top .pp_left{background:url(../images/prettyPhoto/light_rounded/sprite.png) -88px -53px no-repeat}
div.light_rounded .pp_top .pp_right{background:url(../images/prettyPhoto/light_rounded/sprite.png) -110px -53px no-repeat}
div.light_rounded .pp_next:hover{background:url(../images/prettyPhoto/light_rounded/btnNext.png) center right no-repeat;cursor:pointer}
div.light_rounded .pp_previous:hover{background:url(../images/prettyPhoto/light_rounded/btnPrevious.png) center left no-repeat;cursor:pointer}
div.light_rounded .pp_expand{background:url(../images/prettyPhoto/light_rounded/sprite.png) -31px -26px no-repeat;cursor:pointer}
div.light_rounded .pp_expand:hover{background:url(../images/prettyPhoto/light_rounded/sprite.png) -31px -47px no-repeat;cursor:pointer}
div.light_rounded .pp_contract{background:url(../images/prettyPhoto/light_rounded/sprite.png) 0 -26px no-repeat;cursor:pointer}
div.light_rounded .pp_contract:hover{background:url(../images/prettyPhoto/light_rounded/sprite.png) 0 -47px no-repeat;cursor:pointer}
div.light_rounded .pp_close{width:75px;height:22px;background:url(../images/prettyPhoto/light_rounded/sprite.png) -1px -1px no-repeat;cursor:pointer}
div.light_rounded .pp_nav .pp_play{background:url(../images/prettyPhoto/light_rounded/sprite.png) -1px -100px no-repeat;height:15px;width:14px}
div.light_rounded .pp_nav .pp_pause{background:url(../images/prettyPhoto/light_rounded/sprite.png) -24px -100px no-repeat;height:15px;width:14px}
div.light_rounded .pp_arrow_previous{background:url(../images/prettyPhoto/light_rounded/sprite.png) 0 -71px no-repeat}
div.light_rounded .pp_arrow_next{background:url(../images/prettyPhoto/light_rounded/sprite.png) -22px -71px no-repeat}
div.light_rounded .pp_bottom .pp_left{background:url(../images/prettyPhoto/light_rounded/sprite.png) -88px -80px no-repeat}
div.light_rounded .pp_bottom .pp_right{background:url(../images/prettyPhoto/light_rounded/sprite.png) -110px -80px no-repeat}
div.dark_rounded .pp_top .pp_left{background:url(../images/prettyPhoto/dark_rounded/sprite.png) -88px -53px no-repeat}
div.dark_rounded .pp_top .pp_right{background:url(../images/prettyPhoto/dark_rounded/sprite.png) -110px -53px no-repeat}
div.dark_rounded .pp_content_container .pp_left{background:url(../images/prettyPhoto/dark_rounded/contentPattern.png) top left repeat-y}
div.dark_rounded .pp_content_container .pp_right{background:url(../images/prettyPhoto/dark_rounded/contentPattern.png) top right repeat-y}
div.dark_rounded .pp_next:hover{background:url(../images/prettyPhoto/dark_rounded/btnNext.png) center right no-repeat;cursor:pointer}
div.dark_rounded .pp_previous:hover{background:url(../images/prettyPhoto/dark_rounded/btnPrevious.png) center left no-repeat;cursor:pointer}
div.dark_rounded .pp_expand{background:url(../images/prettyPhoto/dark_rounded/sprite.png) -31px -26px no-repeat;cursor:pointer}
div.dark_rounded .pp_expand:hover{background:url(../images/prettyPhoto/dark_rounded/sprite.png) -31px -47px no-repeat;cursor:pointer}
div.dark_rounded .pp_contract{background:url(../images/prettyPhoto/dark_rounded/sprite.png) 0 -26px no-repeat;cursor:pointer}
div.dark_rounded .pp_contract:hover{background:url(../images/prettyPhoto/dark_rounded/sprite.png) 0 -47px no-repeat;cursor:pointer}
div.dark_rounded .pp_close{width:75px;height:22px;background:url(../images/prettyPhoto/dark_rounded/sprite.png) -1px -1px no-repeat;cursor:pointer}
div.dark_rounded .pp_description{margin-right:85px;color:#fff}
div.dark_rounded .pp_nav .pp_play{background:url(../images/prettyPhoto/dark_rounded/sprite.png) -1px -100px no-repeat;height:15px;width:14px}
div.dark_rounded .pp_nav .pp_pause{background:url(../images/prettyPhoto/dark_rounded/sprite.png) -24px -100px no-repeat;height:15px;width:14px}
div.dark_rounded .pp_arrow_previous{background:url(../images/prettyPhoto/dark_rounded/sprite.png) 0 -71px no-repeat}
div.dark_rounded .pp_arrow_next{background:url(../images/prettyPhoto/dark_rounded/sprite.png) -22px -71px no-repeat}
div.dark_rounded .pp_bottom .pp_left{background:url(../images/prettyPhoto/dark_rounded/sprite.png) -88px -80px no-repeat}
div.dark_rounded .pp_bottom .pp_right{background:url(../images/prettyPhoto/dark_rounded/sprite.png) -110px -80px no-repeat}
div.dark_rounded .pp_loaderIcon{background:url(../images/prettyPhoto/dark_rounded/loader.gif) center center no-repeat}
div.dark_square .pp_left,div.dark_square .pp_middle,div.dark_square .pp_right,div.dark_square .pp_content{background:#000}
div.dark_square .pp_description{color:#fff;margin:0 85px 0 0}
div.dark_square .pp_loaderIcon{background:url(../images/prettyPhoto/dark_square/loader.gif) center center no-repeat}
div.dark_square .pp_expand{background:url(../images/prettyPhoto/dark_square/sprite.png) -31px -26px no-repeat;cursor:pointer}
div.dark_square .pp_expand:hover{background:url(../images/prettyPhoto/dark_square/sprite.png) -31px -47px no-repeat;cursor:pointer}
div.dark_square .pp_contract{background:url(../images/prettyPhoto/dark_square/sprite.png) 0 -26px no-repeat;cursor:pointer}
div.dark_square .pp_contract:hover{background:url(../images/prettyPhoto/dark_square/sprite.png) 0 -47px no-repeat;cursor:pointer}
div.dark_square .pp_close{width:75px;height:22px;background:url(../images/prettyPhoto/dark_square/sprite.png) -1px -1px no-repeat;cursor:pointer}
div.dark_square .pp_nav{clear:none}
div.dark_square .pp_nav .pp_play{background:url(../images/prettyPhoto/dark_square/sprite.png) -1px -100px no-repeat;height:15px;width:14px}
div.dark_square .pp_nav .pp_pause{background:url(../images/prettyPhoto/dark_square/sprite.png) -24px -100px no-repeat;height:15px;width:14px}
div.dark_square .pp_arrow_previous{background:url(../images/prettyPhoto/dark_square/sprite.png) 0 -71px no-repeat}
div.dark_square .pp_arrow_next{background:url(../images/prettyPhoto/dark_square/sprite.png) -22px -71px no-repeat}
div.dark_square .pp_next:hover{background:url(../images/prettyPhoto/dark_square/btnNext.png) center right no-repeat;cursor:pointer}
div.dark_square .pp_previous:hover{background:url(../images/prettyPhoto/dark_square/btnPrevious.png) center left no-repeat;cursor:pointer}
div.light_square .pp_expand{background:url(../images/prettyPhoto/light_square/sprite.png) -31px -26px no-repeat;cursor:pointer}
div.light_square .pp_expand:hover{background:url(../images/prettyPhoto/light_square/sprite.png) -31px -47px no-repeat;cursor:pointer}
div.light_square .pp_contract{background:url(../images/prettyPhoto/light_square/sprite.png) 0 -26px no-repeat;cursor:pointer}
div.light_square .pp_contract:hover{background:url(../images/prettyPhoto/light_square/sprite.png) 0 -47px no-repeat;cursor:pointer}
div.light_square .pp_close{width:75px;height:22px;background:url(../images/prettyPhoto/light_square/sprite.png) -1px -1px no-repeat;cursor:pointer}
div.light_square .pp_nav .pp_play{background:url(../images/prettyPhoto/light_square/sprite.png) -1px -100px no-repeat;height:15px;width:14px}
div.light_square .pp_nav .pp_pause{background:url(../images/prettyPhoto/light_square/sprite.png) -24px -100px no-repeat;height:15px;width:14px}
div.light_square .pp_arrow_previous{background:url(../images/prettyPhoto/light_square/sprite.png) 0 -71px no-repeat}
div.light_square .pp_arrow_next{background:url(../images/prettyPhoto/light_square/sprite.png) -22px -71px no-repeat}
div.light_square .pp_next:hover{background:url(../images/prettyPhoto/light_square/btnNext.png) center right no-repeat;cursor:pointer}
div.light_square .pp_previous:hover{background:url(../images/prettyPhoto/light_square/btnPrevious.png) center left no-repeat;cursor:pointer}
div.facebook .pp_top .pp_left{background:url(../images/prettyPhoto/facebook/sprite.png) -88px -53px no-repeat}
div.facebook .pp_top .pp_middle{background:url(../images/prettyPhoto/facebook/contentPatternTop.png) top left repeat-x}
div.facebook .pp_top .pp_right{background:url(../images/prettyPhoto/facebook/sprite.png) -110px -53px no-repeat}
div.facebook .pp_content_container .pp_left{background:url(../images/prettyPhoto/facebook/contentPatternLeft.png) top left repeat-y}
div.facebook .pp_content_container .pp_right{background:url(../images/prettyPhoto/facebook/contentPatternRight.png) top right repeat-y}
div.facebook .pp_expand{background:url(../images/prettyPhoto/facebook/sprite.png) -31px -26px no-repeat;cursor:pointer}
div.facebook .pp_expand:hover{background:url(../images/prettyPhoto/facebook/sprite.png) -31px -47px no-repeat;cursor:pointer}
div.facebook .pp_contract{background:url(../images/prettyPhoto/facebook/sprite.png) 0 -26px no-repeat;cursor:pointer}
div.facebook .pp_contract:hover{background:url(../images/prettyPhoto/facebook/sprite.png) 0 -47px no-repeat;cursor:pointer}
div.facebook .pp_close{width:22px;height:22px;background:url(../images/prettyPhoto/facebook/sprite.png) -1px -1px no-repeat;cursor:pointer}
div.facebook .pp_description{margin:0 37px 0 0}
div.facebook .pp_loaderIcon{background:url(../images/prettyPhoto/facebook/loader.gif) center center no-repeat}
div.facebook .pp_arrow_previous{background:url(../images/prettyPhoto/facebook/sprite.png) 0 -71px no-repeat;height:22px;margin-top:0;width:22px}
div.facebook .pp_arrow_previous.disabled{background-position:0 -96px;cursor:default}
div.facebook .pp_arrow_next{background:url(../images/prettyPhoto/facebook/sprite.png) -32px -71px no-repeat;height:22px;margin-top:0;width:22px}
div.facebook .pp_arrow_next.disabled{background-position:-32px -96px;cursor:default}
div.facebook .pp_nav{margin-top:0}
div.facebook .pp_nav p{font-size:15px;padding:0 3px 0 4px}
div.facebook .pp_nav .pp_play{background:url(../images/prettyPhoto/facebook/sprite.png) -1px -123px no-repeat;height:22px;width:22px}
div.facebook .pp_nav .pp_pause{background:url(../images/prettyPhoto/facebook/sprite.png) -32px -123px no-repeat;height:22px;width:22px}
div.facebook .pp_next:hover{background:url(../images/prettyPhoto/facebook/btnNext.png) center right no-repeat;cursor:pointer}
div.facebook .pp_previous:hover{background:url(../images/prettyPhoto/facebook/btnPrevious.png) center left no-repeat;cursor:pointer}
div.facebook .pp_bottom .pp_left{background:url(../images/prettyPhoto/facebook/sprite.png) -88px -80px no-repeat}
div.facebook .pp_bottom .pp_middle{background:url(../images/prettyPhoto/facebook/contentPatternBottom.png) top left repeat-x}
div.facebook .pp_bottom .pp_right{background:url(../images/prettyPhoto/facebook/sprite.png) -110px -80px no-repeat}
div.pp_pic_holder a:focus{outline:none}
div.pp_overlay{background:#000;display:none;left:0;position:absolute;top:0;width:100%;z-index:9500}
div.pp_pic_holder{display:none;position:absolute;width:100px;z-index:10000}
.pp_content{height:40px;min-width:40px}
* html .pp_content{width:40px}
.pp_content_container{position:relative;text-align:left;width:100%}
.pp_content_container .pp_left{padding-left:20px}
.pp_content_container .pp_right{padding-right:20px}
.pp_content_container .pp_details{float:left;margin:10px 0 2px}
.pp_description{display:none;margin:0}
.pp_social{float:left;margin:0}
.pp_social .facebook{float:left;margin-left:5px;width:55px;overflow:hidden}
.pp_social .twitter{float:left}
.pp_nav{clear:right;float:left;margin:3px 10px 0 0}
.pp_nav p{float:left;white-space:nowrap;margin:2px 4px}
.pp_nav .pp_play,.pp_nav .pp_pause{float:left;margin-right:4px;text-indent:-10000px}
a.pp_arrow_previous,a.pp_arrow_next{display:block;float:left;height:15px;margin-top:3px;overflow:hidden;text-indent:-10000px;width:14px}
.pp_hoverContainer{position:absolute;top:0;width:100%;z-index:2000}
.pp_gallery{display:none;left:50%;margin-top:-50px;position:absolute;z-index:10000}
.pp_gallery div{float:left;overflow:hidden;position:relative}
.pp_gallery ul{float:left;height:35px;position:relative;white-space:nowrap;margin:0 0 0 5px;padding:0}
.pp_gallery ul a{border:1px rgba(0,0,0,0.5) solid;display:block;float:left;height:33px;overflow:hidden}
.pp_gallery ul a img{border:0}
.pp_gallery li{display:block;float:left;margin:0 5px 0 0;padding:0}
.pp_gallery li.default a{background:url(../images/prettyPhoto/facebook/default_thumbnail.gif) 0 0 no-repeat;display:block;height:33px;width:50px}
.pp_gallery .pp_arrow_previous,.pp_gallery .pp_arrow_next{margin-top:7px!important}
a.pp_next{background:url(../images/prettyPhoto/light_rounded/btnNext.png) 10000px 10000px no-repeat;display:block;float:right;height:100%;text-indent:-10000px;width:49%}
a.pp_previous{background:url(../images/prettyPhoto/light_rounded/btnNext.png) 10000px 10000px no-repeat;display:block;float:left;height:100%;text-indent:-10000px;width:49%}
a.pp_expand,a.pp_contract{cursor:pointer;display:none;height:20px;position:absolute;right:30px;text-indent:-10000px;top:10px;width:20px;z-index:20000}
a.pp_close{position:absolute;right:0;top:0;display:block;line-height:22px;text-indent:-10000px}
.pp_loaderIcon{display:block;height:24px;left:50%;position:absolute;top:50%;width:24px;margin:-12px 0 0 -12px}
#pp_full_res{line-height:1!important}
#pp_full_res .pp_inline{text-align:left}
#pp_full_res .pp_inline p{margin:0 0 15px}
div.ppt{color:#fff;display:none;font-size:17px;z-index:9999;margin:0 0 5px 15px}
div.pp_default .pp_content,div.light_rounded .pp_content{background-color:#fff}
div.pp_default #pp_full_res .pp_inline,div.light_rounded .pp_content .ppt,div.light_rounded #pp_full_res .pp_inline,div.light_square .pp_content .ppt,div.light_square #pp_full_res .pp_inline,div.facebook .pp_content .ppt,div.facebook #pp_full_res .pp_inline{color:#000}
div.pp_default .pp_gallery ul li a:hover,div.pp_default .pp_gallery ul li.selected a,.pp_gallery ul a:hover,.pp_gallery li.selected a{border-color:#fff}
div.pp_default .pp_details,div.light_rounded .pp_details,div.dark_rounded .pp_details,div.dark_square .pp_details,div.light_square .pp_details,div.facebook .pp_details{position:relative}
div.light_rounded .pp_top .pp_middle,div.light_rounded .pp_content_container .pp_left,div.light_rounded .pp_content_container .pp_right,div.light_rounded .pp_bottom .pp_middle,div.light_square .pp_left,div.light_square .pp_middle,div.light_square .pp_right,div.light_square .pp_content,div.facebook .pp_content{background:#fff}
div.light_rounded .pp_description,div.light_square .pp_description{margin-right:85px}
div.light_rounded .pp_gallery a.pp_arrow_previous,div.light_rounded .pp_gallery a.pp_arrow_next,div.dark_rounded .pp_gallery a.pp_arrow_previous,div.dark_rounded .pp_gallery a.pp_arrow_next,div.dark_square .pp_gallery a.pp_arrow_previous,div.dark_square .pp_gallery a.pp_arrow_next,div.light_square .pp_gallery a.pp_arrow_previous,div.light_square .pp_gallery a.pp_arrow_next{margin-top:12px!important}
div.light_rounded .pp_arrow_previous.disabled,div.dark_rounded .pp_arrow_previous.disabled,div.dark_square .pp_arrow_previous.disabled,div.light_square .pp_arrow_previous.disabled{background-position:0 -87px;cursor:default}
div.light_rounded .pp_arrow_next.disabled,div.dark_rounded .pp_arrow_next.disabled,div.dark_square .pp_arrow_next.disabled,div.light_square .pp_arrow_next.disabled{background-position:-22px -87px;cursor:default}
div.light_rounded .pp_loaderIcon,div.light_square .pp_loaderIcon{background:url(../images/prettyPhoto/light_rounded/loader.gif) center center no-repeat}
div.dark_rounded .pp_top .pp_middle,div.dark_rounded .pp_content,div.dark_rounded .pp_bottom .pp_middle{background:url(../images/prettyPhoto/dark_rounded/contentPattern.png) top left repeat}
div.dark_rounded .currentTextHolder,div.dark_square .currentTextHolder{color:#c4c4c4}
div.dark_rounded #pp_full_res .pp_inline,div.dark_square #pp_full_res .pp_inline{color:#fff}
.pp_top,.pp_bottom{height:20px;position:relative}
* html .pp_top,* html .pp_bottom{padding:0 20px}
.pp_top .pp_left,.pp_bottom .pp_left{height:20px;left:0;position:absolute;width:20px}
.pp_top .pp_middle,.pp_bottom .pp_middle{height:20px;left:20px;position:absolute;right:20px}
* html .pp_top .pp_middle,* html .pp_bottom .pp_middle{left:0;position:static}
.pp_top .pp_right,.pp_bottom .pp_right{height:20px;left:auto;position:absolute;right:0;top:0;width:20px}
.pp_fade,.pp_gallery li.default a img{display:none}
\ No newline at end of file
.ancimage-customer_galleriesmanager > .col2-set > .col-1 {
width:450px;
margin-right: 150px;
}
.ancimage-customer_galleriesmanager > .col2-set > .col-2 {
width:252px;
}
#ancimage-customer_showNcImageForm * .preview-database-image > img {
width:100%;
}
#ancimage-customer_showNcImageForm * .ancimage {
padding-bottom: 20px;
}
div.anctable.showncimageform * div.value{
width:340px;
}
div.anctable.showncimageform * div.label{
width:100px;
}
.anctable > .ancimage {
border-style: solid;
border-color: #5EBD00;
border-width: 2px;
}
#product_addtocart_form > .product-shop > .product-options-bottom,
#ancimage-customer_showNcImageForm * .buttons {
margin-left: auto;
margin-right: 0px;
}
#product_addtocart_form > .product-shop > .product-options-bottom > .button{
margin-left: 2px;
margin-right: 2px;
width: 150px;
}
/*
* app/design/frontend/template/customer_galleriesown.phtml
*
* div.ancimage-customer_galleriesown
* > div.ancimage-gallerie-header
* > div.ancimage-gallerie-content
* > div.ancimage-gallerie-content-view - welche ajax technisch reloaded wird
* > ul.gallery.AncGalleryImages
* > a.ancimage-showNcImageForm
* > div.anc_image_wrapper
* > img.anc-image-draggable.ui-draggable
* > script type="text/javascript"
*/
.ancimage-customer_galleriescategory,
.ancimage-customer_galleriesown {
border-style: solid;
border-color: #959797;
border-width: 1px;
}
.ui-accordion-header-active {
background-color: #6A6D6D;
}
.ancimage-gallerie-subheader{
color: #5EBD00;
/* border-bottom-color: #959797 ;
border-bottom-style: solid;
border-bottom-width: 1px;*/
display: table;
width:100%;
padding: 2px;
}
.ancimage-gallerie-subheader > div {
width:50%;
padding:0px;
float: left;
/* padding-top: 2px;
padding-bottom: 2px;*/
}
.ancimage-gallerie-subheader > .ancimage-dropzone {
text-align: left;
padding:0px;
/*padding-left: 4px;*/
}
.ancimage-customer_galleriesown > .ancimage-gallerie-subheader > .ancimage-dropzone > .dz-default {
background-position: 0 0;
background-repeat: no-repeat;
filter: none;
height: 100%;
/*left: 50%;*/
margin: 0px;
padding: 0px;
opacity: 1;
position: static;
top: 0px;
transition: opacity 0.3s ease-in-out 0s;
width: 100%;
}
.ancimage-gallerie-subheader > .ancimage-gallerie-subheader-category {
float: right;
text-align: right;
padding-right: 16px;
}
.ancimage-gallerie-content {
margin-top: 1px;
background-color: #6A6D6D;
color: white;
margin-top: 1px;
margin-bottom: 1px;
}
.ancimage-gallerie-content-view {
height: 237px;
overflow-y: scroll;
background-color: #D0D1D0;
}
.AncGalleryImages {
margin: 0px;
padding: 0px;
text-align: justify;
}
.AncGalleryImages * {
margin: 0px;
padding: 0px;
}
.AncGalleryImages > .anc_image_wrapper {
height:55px;
width:55px;
overflow:hidden;
display: inline-block;
border-right-style: solid;
border-bottom-style: solid;
border-top-style: solid;
border-color: #959797;
border-width: 1px;
}
.AncGalleryImages > .anc_image_wrapper > a > img {
min-height:62px;
min-width:62px;
max-height: 85px;
max-width: 85px;
margin-top:-5px;
margin-left:-5px;
}
.ui-selected {
background-color: #6A6D6D;
color:white;
border:1px solid transparent;
}
.ui-state-focus {
cursor:pointer;
}
.ui-selecting {
cursor:pointer;
/*background-color: green;*/
border: 1px dotted #aaa;
}
.ui-unselecting {
background-color: #eee;
border: 1px dotted #aaa;
}
// ###################################################################
// menu
#menu {
margin: 0;
padding: 0;
}
#menu li {
float:left;
list-style:none;
padding: 0;
margin: 0;
text-decoration:none;
z-index: 800;
/*font-weight: bold;*/
width:100%;
text-align: right;
}
#menu li img {
height: 7px;
padding-right: 16px;
}
#menu li ul {
display:block;
position:absolute;
padding:5px 0px;
background:#f0f0f0;
z-index: 800;
font-weight: normal;
}
#menu li ul li {
float:none;
margin:0px;
padding:0px;
z-index: 800;
/*margin-left: 5px;*/
padding-right: 10px;
width:100px;
}
// ###################################################################
// anc_image_type
.ancimage-ancimage > .anc-productview-type * .ancimage-info {
padding-top: 10px;
padding-bottom: 10px;
}
#ancimage-imageeditorarea-id {
margin: 0px;
padding: 0px;
}
#ancimage-imageeditorarea-id > .ancimage-dropzone {
margin:0px;
padding:0px;
border-color: #5ebd00;
border-style: solid;
border-width: 4px;
}
#ancimage-imageeditorarea-id > .ancimage-dropzone > .cropControls {
right: -65px;
top: -40px;
background-color: rgba(0, 0, 0, 0);
}
#ancimage-imageeditorarea-id > .ancimage-dropzone > .cropControls > i {
background-image: url("/skin/frontend/base/default/images/anc/image/spvzoom.png");
}
#ancimage-imageeditorarea-id > .ancimage-dropzone > .cropControls > .cropControlZoomMuchOut {
background-position: 0 0;
}
#ancimage-imageeditorarea-id > .ancimage-dropzone > .cropControls > .cropControlZoomMuchIn {
background-position: 30px 0;
}
#ancimage-imageeditorarea-id > .ancimage-dropzone > .preview-database-image {
text-align: center;
color: #6A6D6D;
}
#product_addtocart_form * .ancSPImage_KEY_cropfile,
#product_addtocart_form * .ancSPImage_KEY_cropH,
#product_addtocart_form * .ancSPImage_KEY_cropW,
#product_addtocart_form * .ancSPImage_KEY_imgH,
#product_addtocart_form * .ancSPImage_KEY_imgInitH,
#product_addtocart_form * .ancSPImage_KEY_imgInitW,
#product_addtocart_form * .ancSPImage_KEY_imgW,
#product_addtocart_form * .ancSPImage_KEY_imgX1,
#product_addtocart_form * .ancSPImage_KEY_imgY1{
display: none;
}
\ No newline at end of file
/* The MIT License */
.dropzone,
.dropzone *,
.dropzone-previews,
.dropzone-previews * {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.dropzone {
position: relative;
border: 1px solid rgba(0,0,0,0.08);
background: rgba(0,0,0,0.02);
padding: 1em;
}
.dropzone.dz-clickable {
cursor: pointer;
}
.dropzone.dz-clickable .dz-message,
.dropzone.dz-clickable .dz-message span {
cursor: pointer;
}
.dropzone.dz-clickable * {
cursor: default;
}
.dropzone .dz-message {
opacity: 1;
-ms-filter: none;
filter: none;
}
.dropzone.dz-drag-hover {
border-color: rgba(0,0,0,0.15);
background: rgba(0,0,0,0.04);
}
.dropzone.dz-started .dz-message {
display: none;
}
.dropzone .dz-preview,
.dropzone-previews .dz-preview {
background: rgba(255,255,255,0.8);
position: relative;
display: inline-block;
margin: 17px;
vertical-align: top;
border: 1px solid #acacac;
padding: 6px 6px 6px 6px;
}
.dropzone .dz-preview.dz-file-preview [data-dz-thumbnail],
.dropzone-previews .dz-preview.dz-file-preview [data-dz-thumbnail] {
display: none;
}
.dropzone .dz-preview .dz-details,
.dropzone-previews .dz-preview .dz-details {
width: 100px;
height: 100px;
position: relative;
background: #ebebeb;
padding: 5px;
margin-bottom: 22px;
}
.dropzone .dz-preview .dz-details .dz-filename,
.dropzone-previews .dz-preview .dz-details .dz-filename {
overflow: hidden;
height: 100%;
}
.dropzone .dz-preview .dz-details img,
.dropzone-previews .dz-preview .dz-details img {
position: absolute;
top: 0;
left: 0;
width: 100px;
height: 100px;
}
.dropzone .dz-preview .dz-details .dz-size,
.dropzone-previews .dz-preview .dz-details .dz-size {
position: absolute;
bottom: -28px;
left: 3px;
height: 28px;
line-height: 28px;
}
.dropzone .dz-preview.dz-error .dz-error-mark,
.dropzone-previews .dz-preview.dz-error .dz-error-mark {
display: block;
}
.dropzone .dz-preview.dz-success .dz-success-mark,
.dropzone-previews .dz-preview.dz-success .dz-success-mark {
display: block;
}
.dropzone .dz-preview:hover .dz-details img,
.dropzone-previews .dz-preview:hover .dz-details img {
display: none;
}
.dropzone .dz-preview .dz-success-mark,
.dropzone-previews .dz-preview .dz-success-mark,
.dropzone .dz-preview .dz-error-mark,
.dropzone-previews .dz-preview .dz-error-mark {
display: none;
position: absolute;
width: 40px;
height: 40px;
font-size: 30px;
text-align: center;
right: -10px;
top: -10px;
}
.dropzone .dz-preview .dz-success-mark,
.dropzone-previews .dz-preview .dz-success-mark {
color: #8cc657;
}
.dropzone .dz-preview .dz-error-mark,
.dropzone-previews .dz-preview .dz-error-mark {
color: #ee162d;
}
.dropzone .dz-preview .dz-progress,
.dropzone-previews .dz-preview .dz-progress {
position: absolute;
top: 100px;
left: 6px;
right: 6px;
height: 6px;
background: #d7d7d7;
display: none;
}
.dropzone .dz-preview .dz-progress .dz-upload,
.dropzone-previews .dz-preview .dz-progress .dz-upload {
display: block;
position: absolute;
top: 0;
bottom: 0;
left: 0;
width: 0%;
background-color: #8cc657;
}
.dropzone .dz-preview.dz-processing .dz-progress,
.dropzone-previews .dz-preview.dz-processing .dz-progress {
display: block;
}
.dropzone .dz-preview .dz-error-message,
.dropzone-previews .dz-preview .dz-error-message {
display: none;
position: absolute;
top: -5px;
left: -20px;
background: rgba(245,245,245,0.8);
padding: 8px 10px;
color: #800;
min-width: 140px;
max-width: 500px;
z-index: 500;
}
.dropzone .dz-preview:hover.dz-error .dz-error-message,
.dropzone-previews .dz-preview:hover.dz-error .dz-error-message {
display: block;
}
.dropzone {
border: 1px solid rgba(0,0,0,0.03);
/*min-height: 360px;*/
-webkit-border-radius: 3px;
border-radius: 3px;
background: rgba(0,0,0,0.03);
padding: 23px;
}
.dropzone .dz-default.dz-message {
opacity: 1;
-ms-filter: none;
filter: none;
-webkit-transition: opacity 0.3s ease-in-out;
-moz-transition: opacity 0.3s ease-in-out;
-o-transition: opacity 0.3s ease-in-out;
-ms-transition: opacity 0.3s ease-in-out;
transition: opacity 0.3s ease-in-out;
/*background-image: url("../images/spritemap.png");*/
background-repeat: no-repeat;
background-position: 0 0;
position: absolute;
width: 428px;
height: 123px;
margin-left: -214px;
margin-top: -61.5px;
top: 50%;
left: 50%;
}
@media all and (-webkit-min-device-pixel-ratio:1.5),(min--moz-device-pixel-ratio:1.5),(-o-min-device-pixel-ratio:1.5/1),(min-device-pixel-ratio:1.5),(min-resolution:138dpi),(min-resolution:1.5dppx) {
.dropzone .dz-default.dz-message {
background-image: url("../images/spritemap@2x.png");
-webkit-background-size: 428px 406px;
-moz-background-size: 428px 406px;
background-size: 428px 406px;
}
}
.dropzone.dz-square .dz-default.dz-message {
background-position: 0 -123px;
width: 268px;
margin-left: -134px;
height: 174px;
margin-top: -87px;
}
.dropzone.dz-drag-hover .dz-message {
opacity: 0.15;
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=15)";
filter: alpha(opacity=15);
}
.dropzone.dz-started .dz-message {
display: block;
opacity: 0;
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
filter: alpha(opacity=0);
}
.dropzone .dz-preview,
.dropzone-previews .dz-preview {
-webkit-box-shadow: 1px 1px 4px rgba(0,0,0,0.16);
box-shadow: 1px 1px 4px rgba(0,0,0,0.16);
font-size: 14px;
}
.dropzone .dz-preview.dz-image-preview:hover .dz-details img,
.dropzone-previews .dz-preview.dz-image-preview:hover .dz-details img {
display: block;
opacity: 0.1;
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=10)";
filter: alpha(opacity=10);
}
.dropzone .dz-preview.dz-success .dz-success-mark,
.dropzone-previews .dz-preview.dz-success .dz-success-mark {
opacity: 1;
-ms-filter: none;
filter: none;
}
.dropzone .dz-preview.dz-error .dz-error-mark,
.dropzone-previews .dz-preview.dz-error .dz-error-mark {
opacity: 1;
-ms-filter: none;
filter: none;
}
.dropzone .dz-preview.dz-error .dz-progress .dz-upload,
.dropzone-previews .dz-preview.dz-error .dz-progress .dz-upload {
background: #ee1e2d;
}
.dropzone .dz-preview .dz-error-mark,
.dropzone-previews .dz-preview .dz-error-mark,
.dropzone .dz-preview .dz-success-mark,
.dropzone-previews .dz-preview .dz-success-mark {
display: block;
opacity: 0;
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
filter: alpha(opacity=0);
-webkit-transition: opacity 0.4s ease-in-out;
-moz-transition: opacity 0.4s ease-in-out;
-o-transition: opacity 0.4s ease-in-out;
-ms-transition: opacity 0.4s ease-in-out;
transition: opacity 0.4s ease-in-out;
/*background-image: url("../images/spritemap.png");*/
background-repeat: no-repeat;
}
@media all and (-webkit-min-device-pixel-ratio:1.5),(min--moz-device-pixel-ratio:1.5),(-o-min-device-pixel-ratio:1.5/1),(min-device-pixel-ratio:1.5),(min-resolution:138dpi),(min-resolution:1.5dppx) {
.dropzone .dz-preview .dz-error-mark,
.dropzone-previews .dz-preview .dz-error-mark,
.dropzone .dz-preview .dz-success-mark,
.dropzone-previews .dz-preview .dz-success-mark {
background-image: url("../images/spritemap@2x.png");
-webkit-background-size: 428px 406px;
-moz-background-size: 428px 406px;
background-size: 428px 406px;
}
}
.dropzone .dz-preview .dz-error-mark span,
.dropzone-previews .dz-preview .dz-error-mark span,
.dropzone .dz-preview .dz-success-mark span,
.dropzone-previews .dz-preview .dz-success-mark span {
display: none;
}
.dropzone .dz-preview .dz-error-mark,
.dropzone-previews .dz-preview .dz-error-mark {
background-position: -268px -123px;
}
.dropzone .dz-preview .dz-success-mark,
.dropzone-previews .dz-preview .dz-success-mark {
background-position: -268px -163px;
}
.dropzone .dz-preview .dz-progress .dz-upload,
.dropzone-previews .dz-preview .dz-progress .dz-upload {
-webkit-animation: loading 0.4s linear infinite;
-moz-animation: loading 0.4s linear infinite;
-o-animation: loading 0.4s linear infinite;
-ms-animation: loading 0.4s linear infinite;
animation: loading 0.4s linear infinite;
-webkit-transition: width 0.3s ease-in-out;
-moz-transition: width 0.3s ease-in-out;
-o-transition: width 0.3s ease-in-out;
-ms-transition: width 0.3s ease-in-out;
transition: width 0.3s ease-in-out;
-webkit-border-radius: 2px;
border-radius: 2px;
position: absolute;
top: 0;
left: 0;
width: 0%;
height: 100%;
/*background-image: url("../images/spritemap.png");*/
background-repeat: repeat-x;
background-position: 0px -400px;
}
@media all and (-webkit-min-device-pixel-ratio:1.5),(min--moz-device-pixel-ratio:1.5),(-o-min-device-pixel-ratio:1.5/1),(min-device-pixel-ratio:1.5),(min-resolution:138dpi),(min-resolution:1.5dppx) {
.dropzone .dz-preview .dz-progress .dz-upload,
.dropzone-previews .dz-preview .dz-progress .dz-upload {
background-image: url("../images/spritemap@2x.png");
-webkit-background-size: 428px 406px;
-moz-background-size: 428px 406px;
background-size: 428px 406px;
}
}
.dropzone .dz-preview.dz-success .dz-progress,
.dropzone-previews .dz-preview.dz-success .dz-progress {
display: block;
opacity: 0;
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
filter: alpha(opacity=0);
-webkit-transition: opacity 0.4s ease-in-out;
-moz-transition: opacity 0.4s ease-in-out;
-o-transition: opacity 0.4s ease-in-out;
-ms-transition: opacity 0.4s ease-in-out;
transition: opacity 0.4s ease-in-out;
}
.dropzone .dz-preview .dz-error-message,
.dropzone-previews .dz-preview .dz-error-message {
display: block;
opacity: 0;
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
filter: alpha(opacity=0);
-webkit-transition: opacity 0.3s ease-in-out;
-moz-transition: opacity 0.3s ease-in-out;
-o-transition: opacity 0.3s ease-in-out;
-ms-transition: opacity 0.3s ease-in-out;
transition: opacity 0.3s ease-in-out;
}
.dropzone .dz-preview:hover.dz-error .dz-error-message,
.dropzone-previews .dz-preview:hover.dz-error .dz-error-message {
opacity: 1;
-ms-filter: none;
filter: none;
}
.dropzone a.dz-remove,
.dropzone-previews a.dz-remove {
background-image: -webkit-linear-gradient(top, #fafafa, #eee);
background-image: -moz-linear-gradient(top, #fafafa, #eee);
background-image: -o-linear-gradient(top, #fafafa, #eee);
background-image: -ms-linear-gradient(top, #fafafa, #eee);
background-image: linear-gradient(to bottom, #fafafa, #eee);
-webkit-border-radius: 2px;
border-radius: 2px;
border: 1px solid #eee;
text-decoration: none;
display: block;
padding: 4px 5px;
text-align: center;
color: #aaa;
margin-top: 26px;
}
.dropzone a.dz-remove:hover,
.dropzone-previews a.dz-remove:hover {
color: #666;
}
@-moz-keyframes loading {
0% {
background-position: 0 -400px;
}
100% {
background-position: -7px -400px;
}
}
@-webkit-keyframes loading {
0% {
background-position: 0 -400px;
}
100% {
background-position: -7px -400px;
}
}
@-o-keyframes loading {
0% {
background-position: 0 -400px;
}
100% {
background-position: -7px -400px;
}
}
@-ms-keyframes loading {
0% {
background-position: 0 -400px;
}
100% {
background-position: -7px -400px;
}
}
@keyframes loading {
0% {
background-position: 0 -400px;
}
100% {
background-position: -7px -400px;
}
}
\ No newline at end of file
div.pp_default .pp_top,div.pp_default .pp_top .pp_middle,div.pp_default .pp_top .pp_left,div.pp_default .pp_top .pp_right,div.pp_default .pp_bottom,div.pp_default .pp_bottom .pp_left,div.pp_default .pp_bottom .pp_middle,div.pp_default .pp_bottom .pp_right{height:13px}
div.pp_default .pp_top .pp_left{background:url(../images/prettyPhoto/default/sprite.png) -78px -93px no-repeat}
div.pp_default .pp_top .pp_middle{background:url(../images/prettyPhoto/default/sprite_x.png) top left repeat-x}
div.pp_default .pp_top .pp_right{background:url(../images/prettyPhoto/default/sprite.png) -112px -93px no-repeat}
div.pp_default .pp_content .ppt{color:#f8f8f8}
div.pp_default .pp_content_container .pp_left{background:url(../images/prettyPhoto/default/sprite_y.png) -7px 0 repeat-y;padding-left:13px}
div.pp_default .pp_content_container .pp_right{background:url(../images/prettyPhoto/default/sprite_y.png) top right repeat-y;padding-right:13px}
div.pp_default .pp_next:hover{background:url(../images/prettyPhoto/default/sprite_next.png) center right no-repeat;cursor:pointer}
div.pp_default .pp_previous:hover{background:url(../images/prettyPhoto/default/sprite_prev.png) center left no-repeat;cursor:pointer}
div.pp_default .pp_expand{background:url(../images/prettyPhoto/default/sprite.png) 0 -29px no-repeat;cursor:pointer;width:28px;height:28px}
div.pp_default .pp_expand:hover{background:url(../images/prettyPhoto/default/sprite.png) 0 -56px no-repeat;cursor:pointer}
div.pp_default .pp_contract{background:url(../images/prettyPhoto/default/sprite.png) 0 -84px no-repeat;cursor:pointer;width:28px;height:28px}
div.pp_default .pp_contract:hover{background:url(../images/prettyPhoto/default/sprite.png) 0 -113px no-repeat;cursor:pointer}
div.pp_default .pp_close{width:30px;height:30px;background:url(../images/prettyPhoto/default/sprite.png) 2px 1px no-repeat;cursor:pointer}
div.pp_default .pp_gallery ul li a{background:url(../images/prettyPhoto/default/default_thumb.png) center center #f8f8f8;border:1px solid #aaa}
div.pp_default .pp_social{margin-top:7px}
div.pp_default .pp_gallery a.pp_arrow_previous,div.pp_default .pp_gallery a.pp_arrow_next{position:static;left:auto}
div.pp_default .pp_nav .pp_play,div.pp_default .pp_nav .pp_pause{background:url(../images/prettyPhoto/default/sprite.png) -51px 1px no-repeat;height:30px;width:30px}
div.pp_default .pp_nav .pp_pause{background-position:-51px -29px}
div.pp_default a.pp_arrow_previous,div.pp_default a.pp_arrow_next{background:url(../images/prettyPhoto/default/sprite.png) -31px -3px no-repeat;height:20px;width:20px;margin:4px 0 0}
div.pp_default a.pp_arrow_next{left:52px;background-position:-82px -3px}
div.pp_default .pp_content_container .pp_details{margin-top:5px}
div.pp_default .pp_nav{clear:none;height:30px;width:110px;position:relative}
div.pp_default .pp_nav .currentTextHolder{font-family:Georgia;font-style:italic;color:#999;font-size:11px;left:75px;line-height:25px;position:absolute;top:2px;margin:0;padding:0 0 0 10px}
div.pp_default .pp_close:hover,div.pp_default .pp_nav .pp_play:hover,div.pp_default .pp_nav .pp_pause:hover,div.pp_default .pp_arrow_next:hover,div.pp_default .pp_arrow_previous:hover{opacity:0.7}
div.pp_default .pp_description{font-size:11px;font-weight:700;line-height:14px;margin:5px 50px 5px 0}
div.pp_default .pp_bottom .pp_left{background:url(../images/prettyPhoto/default/sprite.png) -78px -127px no-repeat}
div.pp_default .pp_bottom .pp_middle{background:url(../images/prettyPhoto/default/sprite_x.png) bottom left repeat-x}
div.pp_default .pp_bottom .pp_right{background:url(../images/prettyPhoto/default/sprite.png) -112px -127px no-repeat}
div.pp_default .pp_loaderIcon{background:url(../images/prettyPhoto/default/loader.gif) center center no-repeat}
div.light_rounded .pp_top .pp_left{background:url(../images/prettyPhoto/light_rounded/sprite.png) -88px -53px no-repeat}
div.light_rounded .pp_top .pp_right{background:url(../images/prettyPhoto/light_rounded/sprite.png) -110px -53px no-repeat}
div.light_rounded .pp_next:hover{background:url(../images/prettyPhoto/light_rounded/btnNext.png) center right no-repeat;cursor:pointer}
div.light_rounded .pp_previous:hover{background:url(../images/prettyPhoto/light_rounded/btnPrevious.png) center left no-repeat;cursor:pointer}
div.light_rounded .pp_expand{background:url(../images/prettyPhoto/light_rounded/sprite.png) -31px -26px no-repeat;cursor:pointer}
div.light_rounded .pp_expand:hover{background:url(../images/prettyPhoto/light_rounded/sprite.png) -31px -47px no-repeat;cursor:pointer}
div.light_rounded .pp_contract{background:url(../images/prettyPhoto/light_rounded/sprite.png) 0 -26px no-repeat;cursor:pointer}
div.light_rounded .pp_contract:hover{background:url(../images/prettyPhoto/light_rounded/sprite.png) 0 -47px no-repeat;cursor:pointer}
div.light_rounded .pp_close{width:75px;height:22px;background:url(../images/prettyPhoto/light_rounded/sprite.png) -1px -1px no-repeat;cursor:pointer}
div.light_rounded .pp_nav .pp_play{background:url(../images/prettyPhoto/light_rounded/sprite.png) -1px -100px no-repeat;height:15px;width:14px}
div.light_rounded .pp_nav .pp_pause{background:url(../images/prettyPhoto/light_rounded/sprite.png) -24px -100px no-repeat;height:15px;width:14px}
div.light_rounded .pp_arrow_previous{background:url(../images/prettyPhoto/light_rounded/sprite.png) 0 -71px no-repeat}
div.light_rounded .pp_arrow_next{background:url(../images/prettyPhoto/light_rounded/sprite.png) -22px -71px no-repeat}
div.light_rounded .pp_bottom .pp_left{background:url(../images/prettyPhoto/light_rounded/sprite.png) -88px -80px no-repeat}
div.light_rounded .pp_bottom .pp_right{background:url(../images/prettyPhoto/light_rounded/sprite.png) -110px -80px no-repeat}
div.dark_rounded .pp_top .pp_left{background:url(../images/prettyPhoto/dark_rounded/sprite.png) -88px -53px no-repeat}
div.dark_rounded .pp_top .pp_right{background:url(../images/prettyPhoto/dark_rounded/sprite.png) -110px -53px no-repeat}
div.dark_rounded .pp_content_container .pp_left{background:url(../images/prettyPhoto/dark_rounded/contentPattern.png) top left repeat-y}
div.dark_rounded .pp_content_container .pp_right{background:url(../images/prettyPhoto/dark_rounded/contentPattern.png) top right repeat-y}
div.dark_rounded .pp_next:hover{background:url(../images/prettyPhoto/dark_rounded/btnNext.png) center right no-repeat;cursor:pointer}
div.dark_rounded .pp_previous:hover{background:url(../images/prettyPhoto/dark_rounded/btnPrevious.png) center left no-repeat;cursor:pointer}
div.dark_rounded .pp_expand{background:url(../images/prettyPhoto/dark_rounded/sprite.png) -31px -26px no-repeat;cursor:pointer}
div.dark_rounded .pp_expand:hover{background:url(../images/prettyPhoto/dark_rounded/sprite.png) -31px -47px no-repeat;cursor:pointer}
div.dark_rounded .pp_contract{background:url(../images/prettyPhoto/dark_rounded/sprite.png) 0 -26px no-repeat;cursor:pointer}
div.dark_rounded .pp_contract:hover{background:url(../images/prettyPhoto/dark_rounded/sprite.png) 0 -47px no-repeat;cursor:pointer}
div.dark_rounded .pp_close{width:75px;height:22px;background:url(../images/prettyPhoto/dark_rounded/sprite.png) -1px -1px no-repeat;cursor:pointer}
div.dark_rounded .pp_description{margin-right:85px;color:#fff}
div.dark_rounded .pp_nav .pp_play{background:url(../images/prettyPhoto/dark_rounded/sprite.png) -1px -100px no-repeat;height:15px;width:14px}
div.dark_rounded .pp_nav .pp_pause{background:url(../images/prettyPhoto/dark_rounded/sprite.png) -24px -100px no-repeat;height:15px;width:14px}
div.dark_rounded .pp_arrow_previous{background:url(../images/prettyPhoto/dark_rounded/sprite.png) 0 -71px no-repeat}
div.dark_rounded .pp_arrow_next{background:url(../images/prettyPhoto/dark_rounded/sprite.png) -22px -71px no-repeat}
div.dark_rounded .pp_bottom .pp_left{background:url(../images/prettyPhoto/dark_rounded/sprite.png) -88px -80px no-repeat}
div.dark_rounded .pp_bottom .pp_right{background:url(../images/prettyPhoto/dark_rounded/sprite.png) -110px -80px no-repeat}
div.dark_rounded .pp_loaderIcon{background:url(../images/prettyPhoto/dark_rounded/loader.gif) center center no-repeat}
div.dark_square .pp_left,div.dark_square .pp_middle,div.dark_square .pp_right,div.dark_square .pp_content{background:#000}
div.dark_square .pp_description{color:#fff;margin:0 85px 0 0}
div.dark_square .pp_loaderIcon{background:url(../images/prettyPhoto/dark_square/loader.gif) center center no-repeat}
div.dark_square .pp_expand{background:url(../images/prettyPhoto/dark_square/sprite.png) -31px -26px no-repeat;cursor:pointer}
div.dark_square .pp_expand:hover{background:url(../images/prettyPhoto/dark_square/sprite.png) -31px -47px no-repeat;cursor:pointer}
div.dark_square .pp_contract{background:url(../images/prettyPhoto/dark_square/sprite.png) 0 -26px no-repeat;cursor:pointer}
div.dark_square .pp_contract:hover{background:url(../images/prettyPhoto/dark_square/sprite.png) 0 -47px no-repeat;cursor:pointer}
div.dark_square .pp_close{width:75px;height:22px;background:url(../images/prettyPhoto/dark_square/sprite.png) -1px -1px no-repeat;cursor:pointer}
div.dark_square .pp_nav{clear:none}
div.dark_square .pp_nav .pp_play{background:url(../images/prettyPhoto/dark_square/sprite.png) -1px -100px no-repeat;height:15px;width:14px}
div.dark_square .pp_nav .pp_pause{background:url(../images/prettyPhoto/dark_square/sprite.png) -24px -100px no-repeat;height:15px;width:14px}
div.dark_square .pp_arrow_previous{background:url(../images/prettyPhoto/dark_square/sprite.png) 0 -71px no-repeat}
div.dark_square .pp_arrow_next{background:url(../images/prettyPhoto/dark_square/sprite.png) -22px -71px no-repeat}
div.dark_square .pp_next:hover{background:url(../images/prettyPhoto/dark_square/btnNext.png) center right no-repeat;cursor:pointer}
div.dark_square .pp_previous:hover{background:url(../images/prettyPhoto/dark_square/btnPrevious.png) center left no-repeat;cursor:pointer}
div.light_square .pp_expand{background:url(../images/prettyPhoto/light_square/sprite.png) -31px -26px no-repeat;cursor:pointer}
div.light_square .pp_expand:hover{background:url(../images/prettyPhoto/light_square/sprite.png) -31px -47px no-repeat;cursor:pointer}
div.light_square .pp_contract{background:url(../images/prettyPhoto/light_square/sprite.png) 0 -26px no-repeat;cursor:pointer}
div.light_square .pp_contract:hover{background:url(../images/prettyPhoto/light_square/sprite.png) 0 -47px no-repeat;cursor:pointer}
div.light_square .pp_close{width:75px;height:22px;background:url(../images/prettyPhoto/light_square/sprite.png) -1px -1px no-repeat;cursor:pointer}
div.light_square .pp_nav .pp_play{background:url(../images/prettyPhoto/light_square/sprite.png) -1px -100px no-repeat;height:15px;width:14px}
div.light_square .pp_nav .pp_pause{background:url(../images/prettyPhoto/light_square/sprite.png) -24px -100px no-repeat;height:15px;width:14px}
div.light_square .pp_arrow_previous{background:url(../images/prettyPhoto/light_square/sprite.png) 0 -71px no-repeat}
div.light_square .pp_arrow_next{background:url(../images/prettyPhoto/light_square/sprite.png) -22px -71px no-repeat}
div.light_square .pp_next:hover{background:url(../images/prettyPhoto/light_square/btnNext.png) center right no-repeat;cursor:pointer}
div.light_square .pp_previous:hover{background:url(../images/prettyPhoto/light_square/btnPrevious.png) center left no-repeat;cursor:pointer}
div.facebook .pp_top .pp_left{background:url(../images/prettyPhoto/facebook/sprite.png) -88px -53px no-repeat}
div.facebook .pp_top .pp_middle{background:url(../images/prettyPhoto/facebook/contentPatternTop.png) top left repeat-x}
div.facebook .pp_top .pp_right{background:url(../images/prettyPhoto/facebook/sprite.png) -110px -53px no-repeat}
div.facebook .pp_content_container .pp_left{background:url(../images/prettyPhoto/facebook/contentPatternLeft.png) top left repeat-y}
div.facebook .pp_content_container .pp_right{background:url(../images/prettyPhoto/facebook/contentPatternRight.png) top right repeat-y}
div.facebook .pp_expand{background:url(../images/prettyPhoto/facebook/sprite.png) -31px -26px no-repeat;cursor:pointer}
div.facebook .pp_expand:hover{background:url(../images/prettyPhoto/facebook/sprite.png) -31px -47px no-repeat;cursor:pointer}
div.facebook .pp_contract{background:url(../images/prettyPhoto/facebook/sprite.png) 0 -26px no-repeat;cursor:pointer}
div.facebook .pp_contract:hover{background:url(../images/prettyPhoto/facebook/sprite.png) 0 -47px no-repeat;cursor:pointer}
div.facebook .pp_close{width:22px;height:22px;background:url(../images/prettyPhoto/facebook/sprite.png) -1px -1px no-repeat;cursor:pointer}
div.facebook .pp_description{margin:0 37px 0 0}
div.facebook .pp_loaderIcon{background:url(../images/prettyPhoto/facebook/loader.gif) center center no-repeat}
div.facebook .pp_arrow_previous{background:url(../images/prettyPhoto/facebook/sprite.png) 0 -71px no-repeat;height:22px;margin-top:0;width:22px}
div.facebook .pp_arrow_previous.disabled{background-position:0 -96px;cursor:default}
div.facebook .pp_arrow_next{background:url(../images/prettyPhoto/facebook/sprite.png) -32px -71px no-repeat;height:22px;margin-top:0;width:22px}
div.facebook .pp_arrow_next.disabled{background-position:-32px -96px;cursor:default}
div.facebook .pp_nav{margin-top:0}
div.facebook .pp_nav p{font-size:15px;padding:0 3px 0 4px}
div.facebook .pp_nav .pp_play{background:url(../images/prettyPhoto/facebook/sprite.png) -1px -123px no-repeat;height:22px;width:22px}
div.facebook .pp_nav .pp_pause{background:url(../images/prettyPhoto/facebook/sprite.png) -32px -123px no-repeat;height:22px;width:22px}
div.facebook .pp_next:hover{background:url(../images/prettyPhoto/facebook/btnNext.png) center right no-repeat;cursor:pointer}
div.facebook .pp_previous:hover{background:url(../images/prettyPhoto/facebook/btnPrevious.png) center left no-repeat;cursor:pointer}
div.facebook .pp_bottom .pp_left{background:url(../images/prettyPhoto/facebook/sprite.png) -88px -80px no-repeat}
div.facebook .pp_bottom .pp_middle{background:url(../images/prettyPhoto/facebook/contentPatternBottom.png) top left repeat-x}
div.facebook .pp_bottom .pp_right{background:url(../images/prettyPhoto/facebook/sprite.png) -110px -80px no-repeat}
div.pp_pic_holder a:focus{outline:none}
div.pp_overlay{background:#000;display:none;left:0;position:absolute;top:0;width:100%;z-index:9500}
div.pp_pic_holder{display:none;position:absolute;width:100px;z-index:10000}
.pp_content{height:40px;min-width:40px}
* html .pp_content{width:40px}
.pp_content_container{position:relative;text-align:left;width:100%}
.pp_content_container .pp_left{padding-left:20px}
.pp_content_container .pp_right{padding-right:20px}
.pp_content_container .pp_details{float:left;margin:10px 0 2px}
.pp_description{display:none;margin:0}
.pp_social{float:left;margin:0}
.pp_social .facebook{float:left;margin-left:5px;width:55px;overflow:hidden}
.pp_social .twitter{float:left}
.pp_nav{clear:right;float:left;margin:3px 10px 0 0}
.pp_nav p{float:left;white-space:nowrap;margin:2px 4px}
.pp_nav .pp_play,.pp_nav .pp_pause{float:left;margin-right:4px;text-indent:-10000px}
a.pp_arrow_previous,a.pp_arrow_next{display:block;float:left;height:15px;margin-top:3px;overflow:hidden;text-indent:-10000px;width:14px}
.pp_hoverContainer{position:absolute;top:0;width:100%;z-index:2000}
.pp_gallery{display:none;left:50%;margin-top:-50px;position:absolute;z-index:10000}
.pp_gallery div{float:left;overflow:hidden;position:relative}
.pp_gallery ul{float:left;height:35px;position:relative;white-space:nowrap;margin:0 0 0 5px;padding:0}
.pp_gallery ul a{border:1px rgba(0,0,0,0.5) solid;display:block;float:left;height:33px;overflow:hidden}
.pp_gallery ul a img{border:0}
.pp_gallery li{display:block;float:left;margin:0 5px 0 0;padding:0}
.pp_gallery li.default a{background:url(../images/prettyPhoto/facebook/default_thumbnail.gif) 0 0 no-repeat;display:block;height:33px;width:50px}
.pp_gallery .pp_arrow_previous,.pp_gallery .pp_arrow_next{margin-top:7px!important}
a.pp_next{background:url(../images/prettyPhoto/light_rounded/btnNext.png) 10000px 10000px no-repeat;display:block;float:right;height:100%;text-indent:-10000px;width:49%}
a.pp_previous{background:url(../images/prettyPhoto/light_rounded/btnNext.png) 10000px 10000px no-repeat;display:block;float:left;height:100%;text-indent:-10000px;width:49%}
a.pp_expand,a.pp_contract{cursor:pointer;display:none;height:20px;position:absolute;right:30px;text-indent:-10000px;top:10px;width:20px;z-index:20000}
a.pp_close{position:absolute;right:0;top:0;display:block;line-height:22px;text-indent:-10000px}
.pp_loaderIcon{display:block;height:24px;left:50%;position:absolute;top:50%;width:24px;margin:-12px 0 0 -12px}
#pp_full_res{line-height:1!important}
#pp_full_res .pp_inline{text-align:left}
#pp_full_res .pp_inline p{margin:0 0 15px}
div.ppt{color:#fff;display:none;font-size:17px;z-index:9999;margin:0 0 5px 15px}
div.pp_default .pp_content,div.light_rounded .pp_content{background-color:#fff}
div.pp_default #pp_full_res .pp_inline,div.light_rounded .pp_content .ppt,div.light_rounded #pp_full_res .pp_inline,div.light_square .pp_content .ppt,div.light_square #pp_full_res .pp_inline,div.facebook .pp_content .ppt,div.facebook #pp_full_res .pp_inline{color:#000}
div.pp_default .pp_gallery ul li a:hover,div.pp_default .pp_gallery ul li.selected a,.pp_gallery ul a:hover,.pp_gallery li.selected a{border-color:#fff}
div.pp_default .pp_details,div.light_rounded .pp_details,div.dark_rounded .pp_details,div.dark_square .pp_details,div.light_square .pp_details,div.facebook .pp_details{position:relative}
div.light_rounded .pp_top .pp_middle,div.light_rounded .pp_content_container .pp_left,div.light_rounded .pp_content_container .pp_right,div.light_rounded .pp_bottom .pp_middle,div.light_square .pp_left,div.light_square .pp_middle,div.light_square .pp_right,div.light_square .pp_content,div.facebook .pp_content{background:#fff}
div.light_rounded .pp_description,div.light_square .pp_description{margin-right:85px}
div.light_rounded .pp_gallery a.pp_arrow_previous,div.light_rounded .pp_gallery a.pp_arrow_next,div.dark_rounded .pp_gallery a.pp_arrow_previous,div.dark_rounded .pp_gallery a.pp_arrow_next,div.dark_square .pp_gallery a.pp_arrow_previous,div.dark_square .pp_gallery a.pp_arrow_next,div.light_square .pp_gallery a.pp_arrow_previous,div.light_square .pp_gallery a.pp_arrow_next{margin-top:12px!important}
div.light_rounded .pp_arrow_previous.disabled,div.dark_rounded .pp_arrow_previous.disabled,div.dark_square .pp_arrow_previous.disabled,div.light_square .pp_arrow_previous.disabled{background-position:0 -87px;cursor:default}
div.light_rounded .pp_arrow_next.disabled,div.dark_rounded .pp_arrow_next.disabled,div.dark_square .pp_arrow_next.disabled,div.light_square .pp_arrow_next.disabled{background-position:-22px -87px;cursor:default}
div.light_rounded .pp_loaderIcon,div.light_square .pp_loaderIcon{background:url(../images/prettyPhoto/light_rounded/loader.gif) center center no-repeat}
div.dark_rounded .pp_top .pp_middle,div.dark_rounded .pp_content,div.dark_rounded .pp_bottom .pp_middle{background:url(../images/prettyPhoto/dark_rounded/contentPattern.png) top left repeat}
div.dark_rounded .currentTextHolder,div.dark_square .currentTextHolder{color:#c4c4c4}
div.dark_rounded #pp_full_res .pp_inline,div.dark_square #pp_full_res .pp_inline{color:#fff}
.pp_top,.pp_bottom{height:20px;position:relative}
* html .pp_top,* html .pp_bottom{padding:0 20px}
.pp_top .pp_left,.pp_bottom .pp_left{height:20px;left:0;position:absolute;width:20px}
.pp_top .pp_middle,.pp_bottom .pp_middle{height:20px;left:20px;position:absolute;right:20px}
* html .pp_top .pp_middle,* html .pp_bottom .pp_middle{left:0;position:static}
.pp_top .pp_right,.pp_bottom .pp_right{height:20px;left:auto;position:absolute;right:0;top:0;width:20px}
.pp_fade,.pp_gallery li.default a img{display:none}
\ No newline at end of file
No preview for this file type
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!