Commit a15b08fd by netz.coop

GPL

0 parents
Showing with 4878 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_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 - 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
This diff is collapsed. Click to expand it.
/**
* @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
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!