/*
* Ext JS Library 2.0.1
* Copyright(c) 2006-2008, Ext JS, LLC.
* licensing@extjs.com
*
* http://extjs.com/license
*/
var win;
var candleStore;
function openGallery(gid) { //global, because used in galleryList.php
if (gid>0) {
imageStore.proxy.conn.url = 'xml.php?type=getPhotoList&gid='+gid;
imageStore.load(); //reloads the images
if(!win){
win = new Ext.Window({
applyTo : 'dead-gallery-detail',
layout : 'fit',
width : 500,
height : 400,
closeAction :'hide',
plain : true,
title: "Name der Galerie",
items: [view],
buttons: [{
text : 'Schließen',
handler : function() {win.hide();}
}]
});
}
/*
win.on('show',function(){
win.center();
});
*/
win.show();
//Ext.get('dead-gallery-detail').update("789");
//win.body.dom.innerHTML="123";
}
}
var imageData = Ext.data.Record.create([
{name: 'mid', type: 'int'},
{name: 'gid', type:'int'},
{name: 'title', type: 'string'},
{name: 'image', type: 'string'},
{name: 'imageweb', type: 'string'},
{name: 'imageSmall', type: 'string'},
{name: 'status', type: 'string'},
{name: 'hide', type:'int'}
]);
var imageStore = new Ext.data.Store({
url: 'xml.php?type=editMediaList>ype=photo&gid=nothing', //shows nothing in the first step
//url: 'xml.php?type=editMediaList&uid=>ype=photo',
reader: new Ext.data.XmlReader({record: 'media'}, imageData)
//sortInfo:{field:'title', direction:'ASC'}
//autoLoad: true
});
Ext.onReady(function() {
Ext.getBody().on('click', function(eventObject, domObject, listenerOptions) {
Shadowbox.clearCache();
parts = domObject.id.split("_");
mid = parts[1];
firstLinkToShow = document.getElementById("mid_"+mid);
//Shadowbox.clearCache();
Shadowbox.setup();
Shadowbox.open(firstLinkToShow);
//Shadowbox.open();
win.hide();
//console.debug(domObject.attributes[2].value); // log callback function params to Firebug
}, this, {delegate: '.shadowboxImage'});
});
var view = new Ext.DataView({
itemSelector: 'div.thumb-wrap',
style:'overflow:auto',
multiSelect: true,
//plugins: new Ext.DataView.DragSelector({dragSafe:true}),
store: imageStore,
loadingText: 'Galerie wird geladen...' ,
//store: new Ext.data.JsonStore({
// url: '../view/get-images.php',
// autoLoad: true,
// root: 'images',
// id:'name',
// fields:[
// 'name', 'url',
// {name: 'shortName', mapping: 'name', convert: shortName}
// ]
//}),
tpl: new Ext.XTemplate(
'{name}