code stringlengths 1 2.01M | repo_name stringlengths 3 62 | path stringlengths 1 267 | language stringclasses 231
values | license stringclasses 13
values | size int64 1 2.01M |
|---|---|---|---|---|---|
/*--------------------------------------------------------------------------*
| Copyright (C) 2014 Christopher Kohlhaas |
| |
| 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. A copy of the license has been included with |
| these distribution in the COPYING file, if not go to www.fsf.org |
| |
| As a special exception, you are granted the permissions to link this |
| program with every library, which license fulfills the Open Source |
| Definition as published by the Open Source Initiative (OSI). |
*--------------------------------------------------------------------------*/
package org.rapla.entities;
import java.util.Collection;
import java.util.Iterator;
import java.util.Map;
import java.util.TreeMap;
/** Some entities (especially dynamic-types and attributes)
can have multiple names to allow easier reuse of created schemas or
support for multi-language-environments.
@see MultiLanguageNamed
*/
public class MultiLanguageName implements java.io.Serializable {
// Don't forget to increase the serialVersionUID when you change the fields
private static final long serialVersionUID = 1;
Map<String,String> mapLocales = new TreeMap<String,String>();
transient private boolean readOnly;
public MultiLanguageName(String language,String translation) {
setName(language,translation);
}
public MultiLanguageName(String[][] data) {
for (int i=0;i<data.length;i++)
setName(data[i][0],data[i][1]);
}
public MultiLanguageName() {
}
public void setReadOnly() {
this.readOnly = true;
}
public boolean isReadOnly() {
return this.readOnly;
}
public String getName(String language) {
if ( language == null)
{
language = "en";
}
String result = mapLocales.get(language);
if (result == null) {
result = mapLocales.get("en");
}
if (result == null) {
Iterator<String> it = mapLocales.values().iterator();
if (it.hasNext())
result = it.next();
}
if (result == null) {
result = "";
}
return result;
}
public void setName(String language,String translation) {
checkWritable();
setNameWithoutReadCheck(language, translation);
}
private void checkWritable() {
if ( isReadOnly() )
throw new ReadOnlyException("Can't modify this multilanguage name.");
}
public void setTo(MultiLanguageName newName) {
checkWritable();
mapLocales = new TreeMap<String,String>(newName.mapLocales);
}
public Collection<String> getAvailableLanguages() {
return mapLocales.keySet();
}
public Object clone() {
MultiLanguageName newName= new MultiLanguageName();
newName.mapLocales.putAll(mapLocales);
return newName;
}
public String toString() {
return getName("en");
}
@Deprecated
public void setNameWithoutReadCheck(String language, String translation) {
if (translation != null && !translation.trim().equals("")) {
mapLocales.put(language,translation.trim());
} else {
mapLocales.remove(language);
}
}
}
| 04900db4-clienttest | src/org/rapla/entities/MultiLanguageName.java | Java | gpl3 | 3,633 |
/*--------------------------------------------------------------------------*
| Copyright (C) 2014 Christopher Kohlhaas |
| |
| 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. A copy of the license has been included with |
| these distribution in the COPYING file, if not go to www.fsf.org |
| |
| As a special exception, you are granted the permissions to link this |
| program with every library, which license fulfills the Open Source |
| Definition as published by the Open Source Initiative (OSI). |
*--------------------------------------------------------------------------*/
package org.rapla.entities;
public interface Annotatable {
void setAnnotation(String key, String annotation) throws IllegalAnnotationException;
//<T extends RaplaAnnotation> String getAnnotation(Class<T> annotation);
//<T extends RaplaAnnotation> String getAnnotation(Class<T> annotation, T defaultValue);
String getAnnotation(String key);
String getAnnotation(String key, String defaultValue);
String[] getAnnotationKeys();
}
| 04900db4-clienttest | src/org/rapla/entities/Annotatable.java | Java | gpl3 | 1,396 |
/*--------------------------------------------------------------------------*
| Copyright (C) 2014 Christopher Kohlhaas |
| |
| 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. A copy of the license has been included with |
| these distribution in the COPYING file, if not go to www.fsf.org |
| |
| As a special exception, you are granted the permissions to link this |
| program with every library, which license fulfills the Open Source |
| Definition as published by the Open Source Initiative (OSI). |
*--------------------------------------------------------------------------*/
package org.rapla.entities;
public interface Entity<T> extends RaplaObject<T> {
/** returns true, if the passed object is an instance of Entity
* and has the same id as the object. If both Entities have
* no ids, the == operator will be applied.
*/
String getId();
boolean isIdentical(Entity id2);
/** @deprecated as of rapla 1.8 there can be multiple persistant versions of an object. You can still use isReadOnly to test if the object is editable
* returns if the instance of the entity is persisant and the cache or just a local copy.
* Persistant objects are usably not editable and are updated in a multiuser system.
* Persistant instances with the same id should therefore have the same content and
* <code>persistant1.isIdentical(persistant2)</code> implies <code>persistant1 == persistant2</code>.
* A non persistant instance has never the same reference as the persistant entity with the same id.
* <code>persistant1.isIdentical(nonPersitant1)</code> implies <code>persistant1 != nonPersistant2</code>.
* As
*/
@Deprecated
boolean isPersistant();
boolean isReadOnly();
public static Entity<?>[] ENTITY_ARRAY = new Entity[0];
}
| 04900db4-clienttest | src/org/rapla/entities/Entity.java | Java | gpl3 | 2,182 |
/*--------------------------------------------------------------------------*
| Copyright (C) 2014 Christopher Kohlhaas |
| |
| 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. A copy of the license has been included with |
| these distribution in the COPYING file, if not go to www.fsf.org |
| |
| As a special exception, you are granted the permissions to link this |
| program with every library, which license fulfills the Open Source |
| Definition as published by the Open Source Initiative (OSI). |
*--------------------------------------------------------------------------*/
package org.rapla.entities;
import org.rapla.framework.RaplaException;
public class IllegalAnnotationException extends RaplaException {
private static final long serialVersionUID = 1L;
public IllegalAnnotationException(String text)
{
super(text);
}
public IllegalAnnotationException(String text, Exception ex)
{
super(text, ex);
}
}
| 04900db4-clienttest | src/org/rapla/entities/IllegalAnnotationException.java | Java | gpl3 | 1,322 |
/*--------------------------------------------------------------------------*
| Copyright (C) 2014 Christopher Kohlhaas |
| |
| 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. A copy of the license has been included with |
| these distribution in the COPYING file, if not go to www.fsf.org |
| |
| As a special exception, you are granted the permissions to link this |
| program with every library, which license fulfills the Open Source |
| Definition as published by the Open Source Initiative (OSI). |
*--------------------------------------------------------------------------*/
package org.rapla.entities.internal;
import java.util.Collection;
import java.util.Date;
import java.util.Locale;
import org.rapla.entities.Category;
import org.rapla.entities.Entity;
import org.rapla.entities.RaplaType;
import org.rapla.entities.User;
import org.rapla.entities.domain.Allocatable;
import org.rapla.entities.dynamictype.Attribute;
import org.rapla.entities.dynamictype.Classification;
import org.rapla.entities.storage.internal.SimpleEntity;
import org.rapla.framework.RaplaException;
public class UserImpl extends SimpleEntity implements User, ModifiableTimestamp
{
private String username = "";
private String email = "";
private String name = "";
private boolean admin = false;
private Date lastChanged;
private Date createDate;
// The resolved references
transient private Category[] groups;
final public RaplaType<User> getRaplaType() {return TYPE;}
UserImpl() {
this(null,null);
}
public UserImpl(Date createDate,Date lastChanged)
{
this.createDate = createDate;
this.lastChanged = lastChanged;
}
public Date getLastChanged() {
return lastChanged;
}
@Deprecated
public Date getLastChangeTime() {
return lastChanged;
}
public Date getCreateTime() {
return createDate;
}
public void setLastChanged(Date date) {
checkWritable();
lastChanged = date;
}
public boolean isAdmin() {return admin;}
public String getName()
{
final Allocatable person = getPerson();
if ( person != null)
{
return person.getName( null );
}
return name;
}
public String getEmail() {
final Allocatable person = getPerson();
if ( person != null)
{
final Classification classification = person.getClassification();
final Attribute attribute = classification.getAttribute("email");
return attribute != null ? (String)classification.getValue(attribute) : null;
}
return email;
}
public String getUsername() {
return username;
}
public String toString()
{
return getUsername();
}
public void setName(String name) {
checkWritable();
this.name = name;
}
public void setEmail(String email) {
checkWritable();
this.email = email;
}
public void setUsername(String username) {
checkWritable();
this.username = username;
}
public void setAdmin(boolean bAdmin) {
checkWritable();
this.admin=bAdmin;
}
public String getName(Locale locale)
{
final Allocatable person = getPerson();
if ( person != null)
{
return person.getName(locale);
}
final String name = getName();
if ( name == null || name.length() == 0)
{
return getUsername();
}
else
{
return name;
}
}
public void addGroup(Category group) {
checkWritable();
if ( isRefering("groups", group.getId()))
{
return;
}
groups = null;
add("groups",group);
}
public boolean removeGroup(Category group) {
checkWritable();
return removeId(group.getId());
}
public Category[] getGroups() {
updateGroupArray();
return groups;
}
public boolean belongsTo( Category group )
{
for (Category uGroup:getGroups())
{
if (group.equals( uGroup) || group.isAncestorOf( uGroup))
{
return true;
}
}
return false;
}
private void updateGroupArray() {
if (groups != null)
return;
synchronized ( this )
{
Collection<Category> groupList = getList("groups", Category.class);
groups = groupList.toArray(Category.CATEGORY_ARRAY);
}
}
public User clone() {
UserImpl clone = new UserImpl();
super.deepClone(clone);
clone.groups = null;
clone.username = username;
clone.name = name;
clone.email = email;
clone.admin = admin;
clone.lastChanged = lastChanged;
clone.createDate = createDate;
return clone;
}
public int compareTo(User o) {
int result = toString().compareTo( o.toString());
if (result != 0)
{
return result;
}
else
{
return super.compareTo( o);
}
}
public void setPerson(Allocatable person) throws RaplaException
{
checkWritable();
if ( person == null)
{
putEntity("person", null);
return;
}
final Classification classification = person.getClassification();
final Attribute attribute = classification.getAttribute("email");
final String email = attribute != null ? (String)classification.getValue(attribute) : null;
if ( email == null || email.length() == 0)
{
throw new RaplaException("Email of " + person + " not set. Linking to user needs an email ");
}
else
{
this.email = email;
putEntity("person", (Entity) person);
setName(person.getClassification().getName(null));
}
}
public Allocatable getPerson()
{
final Allocatable person = getEntity("person", Allocatable.class);
return person;
}
}
| 04900db4-clienttest | src/org/rapla/entities/internal/UserImpl.java | Java | gpl3 | 6,506 |
<body>
Contains the default implementations of the persistent entity-objects in rapla.
@see <A HREF="http://rapla.sourceforge.net/">rapla.sourceforge.net</A>
</body>
| 04900db4-clienttest | src/org/rapla/entities/internal/package.html | HTML | gpl3 | 168 |
/*--------------------------------------------------------------------------*
| Copyright (C) 2014 Christopher Kohlhaas |
| |
| 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. A copy of the license has been included with |
| these distribution in the COPYING file, if not go to www.fsf.org |
| |
| As a special exception, you are granted the permissions to link this |
| program with every library, which license fulfills the Open Source |
| Definition as published by the Open Source Initiative (OSI). |
*--------------------------------------------------------------------------*/
package org.rapla.entities.internal;
import java.util.Collection;
import java.util.Date;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.LinkedHashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Set;
import org.rapla.components.util.Assert;
import org.rapla.entities.Category;
import org.rapla.entities.Entity;
import org.rapla.entities.EntityNotFoundException;
import org.rapla.entities.IllegalAnnotationException;
import org.rapla.entities.MultiLanguageName;
import org.rapla.entities.RaplaObject;
import org.rapla.entities.RaplaType;
import org.rapla.entities.storage.EntityResolver;
import org.rapla.entities.storage.ParentEntity;
import org.rapla.entities.storage.internal.SimpleEntity;
final public class CategoryImpl extends SimpleEntity implements Category, ParentEntity, ModifiableTimestamp
{
private MultiLanguageName name = new MultiLanguageName();
private String key;
Set<CategoryImpl> childs = new LinkedHashSet<CategoryImpl>();
private Date lastChanged;
private Date createDate;
private Map<String,String> annotations = new LinkedHashMap<String,String>();
private transient Category parent;
CategoryImpl()
{
}
public CategoryImpl(Date createDate, Date lastChanged) {
this.createDate = createDate;
this.lastChanged = lastChanged;
}
@Override
public void setResolver(EntityResolver resolver) {
super.setResolver(resolver);
for (CategoryImpl child:childs)
{
child.setParent( this);
}
}
@Override
public void addEntity(Entity entity) {
childs.add( (CategoryImpl) entity);
}
public Date getLastChanged() {
return lastChanged;
}
@Deprecated
public Date getLastChangeTime() {
return lastChanged;
}
public Date getCreateTime() {
return createDate;
}
public void setLastChanged(Date date) {
checkWritable();
lastChanged = date;
for ( CategoryImpl child:childs)
{
child.setLastChanged( date);
}
}
public RaplaType<Category> getRaplaType() {return TYPE;}
void setParent(CategoryImpl parent) {
putEntity("parent", parent);
this.parent = parent;
}
public void removeParent()
{
removeWithKey("parent");
this.parent = null;
}
public Category getParent()
{
if ( parent == null)
{
parent = getEntity("parent", Category.class);
}
return parent;
}
public Category[] getCategories() {
return childs.toArray(Category.CATEGORY_ARRAY);
}
@SuppressWarnings("unchecked")
public Collection<CategoryImpl> getSubEntities() {
return childs;
}
public boolean isAncestorOf(Category category) {
if (category == null)
return false;
if (category.getParent() == null)
return false;
if (category.getParent().equals(this))
return true;
else
return isAncestorOf(category.getParent());
}
public Category getCategory(String key) {
for (Entity ref: getSubEntities())
{
Category cat = (Category) ref;
if (cat.getKey().equals(key))
return cat;
}
return null;
}
public boolean hasCategory(Category category) {
return childs.contains(category);
}
public void addCategory(Category category) {
checkWritable();
Assert.isTrue(category.getParent() == null || category.getParent().equals(this)
,"Category is already attached to a parent");
CategoryImpl categoryImpl = (CategoryImpl)category;
if ( resolver != null)
{
Assert.isTrue( !categoryImpl.isAncestorOf( this), "Can't add a parent category to one of its ancestors.");
}
addEntity( (Entity) category);
categoryImpl.setParent(this);
}
public int getRootPathLength() {
Category parent = getParent();
if ( parent == null)
{
return 0;
}
else
{
int parentDepth = parent.getRootPathLength();
return parentDepth + 1;
}
}
public int getDepth() {
int max = 0;
Category[] categories = getCategories();
for (int i=0;i<categories.length;i++) {
int depth = categories[i].getDepth();
if (depth > max)
max = depth;
}
return max + 1;
}
public void removeCategory(Category category) {
checkWritable();
if ( findCategory( category ) == null)
return;
childs.remove(category);
//if (category.getParent().equals(this))
((CategoryImpl)category).setParent(null);
}
public Category findCategory(Category copy) {
return (Category) super.findEntity((Entity)copy);
}
public MultiLanguageName getName() {
return name;
}
public void setReadOnly() {
super.setReadOnly( );
name.setReadOnly( );
}
public String getName(Locale locale) {
if ( locale == null)
{
locale = Locale.getDefault();
}
return name.getName(locale.getLanguage());
}
public String getKey() {
return key;
}
public void setKey(String key) {
checkWritable();
this.key = key;
}
public String getPath(Category rootCategory,Locale locale) {
StringBuffer buf = new StringBuffer();
if (rootCategory != null && this.equals(rootCategory))
return "";
if (this.getParent() != null) {
String path = this.getParent().getPath(rootCategory,locale);
buf.append(path);
if (path.length()>0)
buf.append('/');
}
buf.append(this.getName(locale));
return buf.toString();
}
public List<String> getKeyPath(Category rootCategory) {
LinkedList<String> result = new LinkedList<String>();
if (rootCategory != null && this.equals(rootCategory))
return result;
Category cat = this;
while (cat.getParent() != null)
{
Category parent = cat.getParent();
result.addFirst( parent.getKey());
cat = parent;
if ( parent == this)
{
throw new IllegalStateException("Parent added as own child");
}
}
result.add( getKey());
return result;
}
public String toString() {
MultiLanguageName name = getName();
if (name != null) {
return name.toString() + " ID='" + getId() + "'";
} else {
return getKey() + " " + getId();
}
}
public String getPathForCategory(Category searchCategory) throws EntityNotFoundException {
List<String> keyPath = getPathForCategory(searchCategory, true);
return getKeyPathString(keyPath);
}
public static String getKeyPathString(List<String> keyPath) {
StringBuffer buf = new StringBuffer();
for (String category:keyPath)
{
buf.append('/');
buf.append(category);
}
if ( buf.length() > 0)
{
buf.deleteCharAt(0);
}
String pathForCategory = buf.toString();
return pathForCategory ;
}
public List<String> getPathForCategory(Category searchCategory, boolean fail) throws EntityNotFoundException {
LinkedList<String> result = new LinkedList<String>();
Category category = searchCategory;
Category parent = category.getParent();
if (category == this)
return result;
if (parent == null)
throw new EntityNotFoundException("Category has no parents!");
while (true) {
String entry ="category[key='" + category.getKey() + "']";
result.addFirst(entry);
parent = category.getParent();
category = parent;
if (parent == null)
{
if ( fail)
{
throw new EntityNotFoundException("Category not found!" + searchCategory);
}
return null;
}
if (parent.equals(this))
break;
}
return result;
}
public Category getCategoryFromPath(String path) throws EntityNotFoundException {
int start = 0;
int end = 0;
int pos = 0;
Category category = this;
while (category != null) {
start = path.indexOf("'",pos) + 1;
if (start==0)
break;
end = path.indexOf("'",start);
if (end < 0)
throw new EntityNotFoundException("Invalid xpath expression: " + path);
String key = path.substring(start,end);
category = category.getCategory(key);
pos = end + 1;
}
if (category == null)
throw new EntityNotFoundException("could not resolve category xpath expression: " + path);
return category;
}
public Category findCategory(Object copy) {
return (Category) super.findEntity((Entity)copy);
}
public String getAnnotation(String key) {
return annotations.get(key);
}
public String getAnnotation(String key, String defaultValue) {
String annotation = getAnnotation( key );
return annotation != null ? annotation : defaultValue;
}
public void setAnnotation(String key,String annotation) throws IllegalAnnotationException {
checkWritable();
if (annotation == null) {
annotations.remove(key);
return;
}
annotations.put(key,annotation);
}
public String[] getAnnotationKeys() {
return annotations.keySet().toArray(RaplaObject.EMPTY_STRING_ARRAY);
}
@SuppressWarnings("unchecked")
public Category clone() {
CategoryImpl clone = new CategoryImpl();
super.deepClone(clone);
clone.name = (MultiLanguageName) name.clone();
clone.parent = parent;
clone.annotations = (HashMap<String,String>) ((HashMap<String,String>)annotations).clone();
clone.key = key;
clone.lastChanged = lastChanged;
clone.createDate = createDate;
for (Entity ref:clone.getSubEntities())
{
((CategoryImpl)ref).setParent(clone);
}
return clone;
}
public int compareTo(Object o) {
if ( o == this )
{
return 0;
}
if ( equals( o ))
{
return 0;
}
Category c1= this;
Category c2= (Category) o;
if ( c1.isAncestorOf( c2))
{
return -1;
}
if ( c2.isAncestorOf( c1))
{
return 1;
}
while ( c1.getRootPathLength() > c2.getRootPathLength())
{
c1 = c1.getParent();
}
while ( c2.getRootPathLength() > c2.getRootPathLength())
{
c2 = c2.getParent();
}
while ( c1.getParent() != null && c2.getParent() != null && (!c1.getParent().equals( c2.getParent())))
{
c1 = c1.getParent();
c2 = c2.getParent();
}
//now the two categories have the same parent
if ( c1.getParent() == null || c2.getParent() == null)
{
return super.compareTo( o);
}
Category parent = c1.getParent();
// We look who is first in the list
Category[] categories = parent.getCategories();
for ( Category category: categories)
{
if ( category.equals( c1))
{
return -1;
}
if ( category.equals( c2))
{
return 1;
}
}
return super.compareTo( o);
}
public void replace(Category category) {
String id = category.getId();
CategoryImpl existingEntity = (CategoryImpl) findEntityForId(id);
if ( existingEntity != null)
{
LinkedHashSet<CategoryImpl> newChilds = new LinkedHashSet<CategoryImpl>();
for ( CategoryImpl child: childs)
{
newChilds.add( ( child != existingEntity) ? child: (CategoryImpl)category);
}
childs = newChilds;
}
}
}
| 04900db4-clienttest | src/org/rapla/entities/internal/CategoryImpl.java | Java | gpl3 | 13,186 |
/*--------------------------------------------------------------------------*
| Copyright (C) 2006 Gereon Fassbender, Christopher Kohlhaas |
| |
| 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. A copy of the license has been included with |
| these distribution in the COPYING file, if not go to www.fsf.org . |
| |
| As a special exception, you are granted the permissions to link this |
| program with every library, which license fulfills the Open Source |
| Definition as published by the Open Source Initiative (OSI). |
*--------------------------------------------------------------------------*/
package org.rapla.entities.internal;
import java.util.Date;
import org.rapla.entities.Timestamp;
import org.rapla.entities.User;
public interface ModifiableTimestamp extends Timestamp {
/** updates the last-changed timestamp */
void setLastChanged(Date date);
void setLastChangedBy( User user);
}
| 04900db4-clienttest | src/org/rapla/entities/internal/ModifiableTimestamp.java | Java | gpl3 | 1,249 |
/*--------------------------------------------------------------------------*
| Copyright (C) 2014 Christopher Kohlhaas |
| |
| 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. A copy of the license has been included with |
| these distribution in the COPYING file, if not go to www.fsf.org |
| |
| As a special exception, you are granted the permissions to link this |
| program with every library, which license fulfills the Open Source |
| Definition as published by the Open Source Initiative (OSI). |
*--------------------------------------------------------------------------*/
package org.rapla.entities;
/** This Exception is thrown when the application
wants to write to a read-only entity. You should use
the edit method to get a writable version of the entity.
*/
public class ReadOnlyException extends RuntimeException {
private static final long serialVersionUID = 1L;
public ReadOnlyException(Object object) {
super("Can't modify entity [" + object + "]. Use the edit-method to get a writable version!");
}
}
| 04900db4-clienttest | src/org/rapla/entities/ReadOnlyException.java | Java | gpl3 | 1,411 |
package org.rapla.framework;
import java.util.HashMap;
public class RaplaDefaultContext implements RaplaContext
{
private final HashMap<String,Object> contextObjects = new HashMap<String,Object>();
protected final RaplaContext parent;
public RaplaDefaultContext()
{
this( null );
}
public RaplaDefaultContext( final RaplaContext parent )
{
this.parent = parent;
}
/**
* @throws RaplaContextException
*/
protected Object lookup( final String key ) throws RaplaContextException
{
return contextObjects.get( key );
}
protected boolean has( final String key )
{
return contextObjects.get( key ) != null;
}
public <T> void put(Class<T> componentRole, T instance) {
contextObjects.put(componentRole.getName(), instance );
}
public <T> void put(TypedComponentRole<T> componentRole, T instance) {
contextObjects.put(componentRole.getId(), instance );
}
public boolean has(Class<?> componentRole) {
if (has(componentRole.getName()))
{
return true;
}
return parent != null && parent.has( componentRole);
}
public boolean has(TypedComponentRole<?> componentRole) {
if (has( componentRole.getId()))
{
return true;
}
return parent != null && parent.has( componentRole);
}
@SuppressWarnings("unchecked")
public <T> T lookup(Class<T> componentRole) throws RaplaContextException {
final String key = componentRole.getName();
T lookup = (T) lookup(key);
if ( lookup == null)
{
if ( parent != null)
{
return parent.lookup( componentRole);
}
else
{
throw new RaplaContextException( key );
}
}
return lookup;
}
@SuppressWarnings("unchecked")
public <T> T lookup(TypedComponentRole<T> componentRole) throws RaplaContextException {
final String key = componentRole.getId();
T lookup = (T) lookup(key);
if ( lookup == null)
{
if ( parent != null)
{
return parent.lookup( componentRole);
}
else
{
throw new RaplaContextException( key );
}
}
return lookup;
}
// @SuppressWarnings("unchecked")
// public <T> T lookup(TypedComponentRole<T> componentRole, String hint) throws RaplaContextException {
// String key = componentRole.getId()+ "/" + hint;
// T lookup = (T) lookup(key);
// if ( lookup == null)
// {
// if ( parent != null)
// {
// return parent.lookup( componentRole, hint);
// }
// else
// {
// throw new RaplaContextException( key );
// }
// }
// return lookup;
// }
}
| 04900db4-clienttest | src/org/rapla/framework/RaplaDefaultContext.java | Java | gpl3 | 3,019 |
<body>
<p>This package contains the framework, that is
responsible for component creation with dependency injection.
It also provides the basic services for the plugin facility
of Rapla.</p>
<p>
It combines functionality of the avalon framework with that
of the pico container. It was programmed to fit the need of Rapla
but contains no domain knowledge. It can also
be used in other Software.
</p>
</body>
| 04900db4-clienttest | src/org/rapla/framework/package.html | HTML | gpl3 | 409 |
package org.rapla.framework;
public class ConfigurationException extends Exception {
private static final long serialVersionUID = 1L;
public ConfigurationException(String string, Throwable exception) {
super( string, exception);
}
public ConfigurationException(String string) {
super( string );
}
}
| 04900db4-clienttest | src/org/rapla/framework/ConfigurationException.java | Java | gpl3 | 355 |
/*--------------------------------------------------------------------------*
| Copyright (C) 2014 Christopher Kohlhaas |
| |
| 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. A copy of the license has been included with |
| these distribution in the COPYING file, if not go to www.fsf.org |
| |
| As a special exception, you are granted the permissions to link this |
| program with every library, which license fulfills the Open Source |
| Definition as published by the Open Source Initiative (OSI). |
*--------------------------------------------------------------------------*/
package org.rapla.framework;
/** the base-class for all Rapla specific Exceptions */
public class RaplaException extends Exception {
private static final long serialVersionUID = 1L;
public RaplaException(String text) {
super(text);
}
public RaplaException(Throwable throwable) {
super(throwable.getMessage(),throwable);
}
public RaplaException(String text,Throwable ex) {
super(text,ex);
}
}
| 04900db4-clienttest | src/org/rapla/framework/RaplaException.java | Java | gpl3 | 1,402 |
package org.rapla.framework;
public class RaplaSynchronizationException extends RaplaException {
private static final long serialVersionUID = 1L;
public RaplaSynchronizationException(String text) {
super(text);
}
public RaplaSynchronizationException(Throwable ex) {
super( ex.getMessage(), ex);
}
}
| 04900db4-clienttest | src/org/rapla/framework/RaplaSynchronizationException.java | Java | gpl3 | 328 |
package org.rapla.framework;
public interface Configuration {
String getName();
Configuration getChild(String name);
Configuration[] getChildren(String name);
Configuration[] getChildren();
String getValue() throws ConfigurationException;
String getValue(String defaultValue);
boolean getValueAsBoolean(boolean defaultValue);
long getValueAsLong(int defaultValue);
int getValueAsInteger(int defaultValue);
String getAttribute(String name) throws ConfigurationException;
String getAttribute(String name, String defaultValue);
boolean getAttributeAsBoolean(String string, boolean defaultValue);
String[] getAttributeNames();
public Configuration find( String localName);
public Configuration find( String attributeName, String attributeValue);
}
| 04900db4-clienttest | src/org/rapla/framework/Configuration.java | Java | gpl3 | 836 |
package org.rapla.framework;
public class SimpleProvider<T> implements Provider<T>
{
T value;
public T get() {
return value;
}
public void setValue(T value)
{
this.value = value;
}
} | 04900db4-clienttest | src/org/rapla/framework/SimpleProvider.java | Java | gpl3 | 212 |
package org.rapla.framework;
public interface Disposable {
public void dispose();
}
| 04900db4-clienttest | src/org/rapla/framework/Disposable.java | Java | gpl3 | 94 |
package org.rapla.framework.logger;
public class NullLogger extends AbstractLogger {
public NullLogger() {
super(LEVEL_FATAL);
}
public Logger getChildLogger(String childLoggerName) {
return this;
}
protected void write(int logLevel, String message, Throwable cause) {
}
}
| 04900db4-clienttest | src/org/rapla/framework/logger/NullLogger.java | Java | gpl3 | 335 |
package org.rapla.framework.logger;
public class ConsoleLogger extends AbstractLogger {
String prefix;
public ConsoleLogger(int logLevel)
{
super(logLevel);
}
public ConsoleLogger(String prefix,int logLevel)
{
super(logLevel);
this.prefix = prefix;
}
public ConsoleLogger()
{
this(LEVEL_INFO);
}
public Logger getChildLogger(String prefix)
{
String newPrefix = prefix;
if ( this.prefix != null)
{
newPrefix = this.prefix + "." + prefix;
}
return new ConsoleLogger( newPrefix, logLevel);
}
String getLogLevelString(int logLevel)
{
switch (logLevel)
{
case LEVEL_DEBUG: return "DEBUG";
case LEVEL_INFO: return "INFO";
case LEVEL_WARN: return "WARN";
case LEVEL_ERROR: return "ERROR";
case LEVEL_FATAL: return "FATAL";
}
return "";
}
protected void write(int logLevel, String message, Throwable cause)
{
String logLevelString = getLogLevelString( logLevel );
StringBuffer buf = new StringBuffer();
buf.append( logLevelString );
buf.append( " " );
if ( prefix != null)
{
buf.append( prefix);
buf.append( ": " );
}
if ( message != null)
{
buf.append( message);
if ( cause != null)
{
buf.append( ": " );
}
}
while( cause!= null)
{
StackTraceElement[] stackTrace = cause.getStackTrace();
buf.append( cause.getMessage());
buf.append( "\n" );
for ( StackTraceElement element:stackTrace)
{
buf.append(" ");
buf.append( element.toString());
buf.append( "\n");
}
cause = cause.getCause();
if ( cause != null)
{
buf.append(" caused by ");
buf.append( cause.getMessage());
buf.append( " " );
}
}
System.out.println(buf.toString());
}
}
| 04900db4-clienttest | src/org/rapla/framework/logger/ConsoleLogger.java | Java | gpl3 | 2,342 |
package org.rapla.framework.logger;
public interface Logger {
boolean isDebugEnabled();
void debug(String message);
void info(String message);
void warn(String message);
void warn(String message, Throwable cause);
void error(String message);
void error(String message, Throwable cause);
Logger getChildLogger(String childLoggerName);
}
| 04900db4-clienttest | src/org/rapla/framework/logger/Logger.java | Java | gpl3 | 391 |
package org.rapla.framework.logger;
public abstract class AbstractLogger implements Logger{
protected int logLevel;
public static final int LEVEL_FATAL = 4;
public static final int LEVEL_ERROR = 3;
public static final int LEVEL_WARN = 2;
public static final int LEVEL_INFO = 1;
public static final int LEVEL_DEBUG = 0;
public AbstractLogger(int logLevel) {
this.logLevel = logLevel;
}
public void error(String message, Throwable cause) {
log( LEVEL_ERROR,message, cause);
}
private void log(int logLevel, String message) {
log( logLevel, message, null);
}
private void log(int logLevel, String message, Throwable cause)
{
if ( logLevel < this.logLevel)
{
return;
}
write( logLevel, message, cause);
}
protected abstract void write(int logLevel, String message, Throwable cause);
public void debug(String message) {
log( LEVEL_DEBUG,message);
}
public void info(String message) {
log( LEVEL_INFO,message);
}
public void warn(String message) {
log( LEVEL_WARN,message);
}
public void warn(String message, Throwable cause) {
log( LEVEL_WARN,message, cause);
}
public void error(String message) {
log( LEVEL_ERROR,message);
}
public void fatalError(String message) {
log( LEVEL_FATAL,message);
}
public void fatalError(String message, Throwable cause) {
log( LEVEL_FATAL,message, cause);
}
public boolean isDebugEnabled() {
return logLevel<= LEVEL_DEBUG;
}
}
| 04900db4-clienttest | src/org/rapla/framework/logger/AbstractLogger.java | Java | gpl3 | 1,757 |
/*--------------------------------------------------------------------------*
| Copyright (C) 2014 Christopher Kohlhaas |
| |
| 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. A copy of the license has been included with |
| these distribution in the COPYING file, if not go to www.fsf.org |
| |
| As a special exception, you are granted the permissions to link this |
| program with every library, which license fulfills the Open Source |
| Definition as published by the Open Source Initiative (OSI). |
*--------------------------------------------------------------------------*/
package org.rapla.framework;
import java.util.Collection;
public interface Container extends Disposable
{
StartupEnvironment getStartupEnvironment();
RaplaContext getContext();
/** lookup an named component from the raplaserver.xconf */
<T> T lookup(Class<T> componentRole, String hint) throws RaplaContextException;
<T,I extends T> void addContainerProvidedComponent(Class<T> roleInterface,Class<I> implementingClass);
<T,I extends T> void addContainerProvidedComponent(Class<T> roleInterface,Class<I> implementingClass, Configuration config);
<T,I extends T> void addContainerProvidedComponent(TypedComponentRole<T> roleInterface, Class<I> implementingClass);
<T,I extends T> void addContainerProvidedComponent(TypedComponentRole<T> roleInterface, Class<I> implementingClass, Configuration config);
/** lookup all services for this role*/
<T> Collection<T> lookupServicesFor(TypedComponentRole<T> extensionPoint) throws RaplaContextException;
/** lookup all services for this role*/
<T> Collection<T> lookupServicesFor(Class<T> role) throws RaplaContextException;
}
| 04900db4-clienttest | src/org/rapla/framework/Container.java | Java | gpl3 | 2,083 |
/*--------------------------------------------------------------------------*
| Copyright (C) 2014 Christopher Kohlhaas |
| |
| 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. A copy of the license has been included with |
| these distribution in the COPYING file, if not go to www.fsf.org |
| |
| As a special exception, you are granted the permissions to link this |
| program with every library, which license fulfills the Open Source |
| Definition as published by the Open Source Initiative (OSI). |
*--------------------------------------------------------------------------*/
package org.rapla.framework;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.FilenameFilter;
import java.io.IOException;
import java.io.Writer;
import java.net.URL;
import java.util.ArrayList;
import java.util.Collection;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Stack;
import org.rapla.framework.logger.Logger;
/** Helper Class for automated creation of the rapla-plugin.list in the
* META-INF directory. Can be used in the build environment.
*/
public class ServiceListCreator {
public static void main (String[] args) {
try {
String sourceDir = args[0];
String destDir = (args.length>1) ? args[1] : sourceDir;
processDir(sourceDir,destDir);
} catch (IOException e) {
throw new RuntimeException( e.getMessage());
} catch (ClassNotFoundException e) {
throw new RuntimeException( e.getMessage());
}
}
public static void processDir(String srcDir,String destFile)
throws ClassNotFoundException, IOException
{
File topDir = new File(srcDir);
List<String> list = findPluginClasses(topDir, null);
Writer writer = new BufferedWriter(new FileWriter( destFile ));
try
{
for ( String className:list)
{
System.out.println("Found PluginDescriptor for " + className);
writer.write( className );
writer.write( "\n" );
}
} finally {
writer.close();
}
}
public static List<String> findPluginClasses(File topDir,Logger logger)
throws ClassNotFoundException {
List<String> list = new ArrayList<String>();
Stack<File> stack = new Stack<File>();
stack.push(topDir);
while (!stack.empty()) {
File file = stack.pop();
if (file.isDirectory()) {
File[] files = file.listFiles();
for (int i=0;i<files.length;i++)
stack.push(files[i]);
} else {
String name = file.getName();
if (file.getAbsolutePath().contains("rapla") && (name.endsWith("Plugin.class") || name.endsWith("PluginServer.class"))) {
String absolut = file.getAbsolutePath();
String relativePath = absolut.substring(topDir.getAbsolutePath().length());
String pathName = relativePath.substring(1,relativePath.length()-".class".length());
String className = pathName.replace(File.separatorChar,'.');
try
{
Class<?> pluginClass = ServiceListCreator.class.getClassLoader().loadClass(className );
if (!pluginClass.isInterface() ) {
if ( PluginDescriptor.class.isAssignableFrom(pluginClass)) {
list.add( className);
} else {
if ( logger != null)
{
logger.warn("No PluginDescriptor found for Class " + className );
}
}
}
}
catch (NoClassDefFoundError ex)
{
System.out.println(ex.getMessage());
}
}
}
}
return list;
}
/** lookup for plugin classes in classpath*/
public static Collection<String> findPluginClasses(Logger logger)
throws ClassNotFoundException {
Collection<String> result = new LinkedHashSet<String>();
URL mainDir = ServiceListCreator.class.getResource("/");
if ( mainDir != null)
{
String classpath = System.getProperty("java.class.path");
final String[] split;
if (classpath != null)
{
split = classpath.split(""+File.pathSeparatorChar);
}
else
{
split = new String[] { mainDir.toExternalForm()};
}
for ( String path: split)
{
File pluginPath = new File(path);
List<String> foundInClasspathEntry = findPluginClasses(pluginPath, logger);
result.addAll(foundInClasspathEntry);
}
}
return result;
}
/** lookup for plugin classes in classpath*/
public static Collection<File> findPluginWebappfolders(Logger logger)
throws ClassNotFoundException {
Collection<File> result = new LinkedHashSet<File>();
URL mainDir = ServiceListCreator.class.getResource("/");
if ( mainDir != null)
{
String classpath = System.getProperty("java.class.path");
final String[] split;
if (classpath != null)
{
split = classpath.split(""+File.pathSeparatorChar);
}
else
{
split = new String[] { mainDir.toExternalForm()};
}
FilenameFilter filter = new FilenameFilter() {
@Override
public boolean accept(File dir, String name) {
return name != null && name.equals("war");
}
};
for ( String path: split)
{
File pluginPath = new File(path);
List<String> foundInClasspathEntry = findPluginClasses(pluginPath, logger);
if ( foundInClasspathEntry.size() > 0)
{
File parent = pluginPath.getParentFile().getAbsoluteFile();
int depth= 0;
while ( parent != null && parent.isDirectory())
{
File[] listFiles = parent.listFiles( filter);
if (listFiles != null && listFiles.length == 1)
{
result.add( listFiles[0]);
}
depth ++;
if ( depth > 5)
{
break;
}
parent = parent.getParentFile();
}
}
}
}
return result;
}
}
| 04900db4-clienttest | src/org/rapla/framework/ServiceListCreator.java | Java | gpl3 | 6,541 |
/*--------------------------------------------------------------------------*
| Copyright (C) 2014 Christopher Kohlhaas |
| |
| 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. A copy of the license has been included with |
| these distribution in the COPYING file, if not go to www.fsf.org |
| |
| As a special exception, you are granted the permissions to link this |
| program with every library, which license fulfills the Open Source |
| Definition as published by the Open Source Initiative (OSI). |
*--------------------------------------------------------------------------*/
package org.rapla.framework;
public interface PluginDescriptor<T extends Container>{
public void provideServices(T container, Configuration configuration) throws RaplaContextException;
}
| 04900db4-clienttest | src/org/rapla/framework/PluginDescriptor.java | Java | gpl3 | 1,127 |
package org.rapla.framework;
public interface RaplaContext
{
/** Returns a reference to the requested object (e.g. a component instance).
* throws a RaplaContextException if the object can't be returned. This could have
* different reasons: For example it is not found in the context, or there has been
* a problem during the component creation.
*/
<T> T lookup(Class<T> componentRole) throws RaplaContextException;
boolean has(Class<?> clazz);
<T> T lookup(TypedComponentRole<T> componentRole) throws RaplaContextException;
//<T> T lookup(TypedComponentRole<T> componentRole, String hint) throws RaplaContextException;
boolean has(TypedComponentRole<?> componentRole);
}
| 04900db4-clienttest | src/org/rapla/framework/RaplaContext.java | Java | gpl3 | 717 |
package org.rapla.framework;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
public class DefaultConfiguration implements Configuration {
Map<String,String> attributes = new LinkedHashMap<String, String>();
List<DefaultConfiguration> children = new ArrayList<DefaultConfiguration>();
String value;
String name;
public DefaultConfiguration()
{
}
public DefaultConfiguration(String localName) {
this.name = localName;
}
public DefaultConfiguration(String localName, String value) {
this.name = localName;
if ( value != null)
{
this.value = value;
}
}
public DefaultConfiguration(Configuration config)
{
this.name = config.getName();
for (Configuration conf: config.getChildren())
{
children.add( new DefaultConfiguration( conf));
}
this.value = ((DefaultConfiguration)config).value;
attributes.putAll(((DefaultConfiguration)config).attributes);
}
public void addChild(Configuration configuration) {
children.add( (DefaultConfiguration) configuration);
}
public void setAttribute(String name, boolean value) {
attributes.put( name, value ? "true" : "false");
}
public void setAttribute(String name, String value) {
attributes.put( name, value);
}
public void setValue(String value) {
this.value = value;
}
public void setValue(int intValue) {
this.value = Integer.toString( intValue);
}
public void setValue(boolean selected) {
this.value = Boolean.toString( selected);
}
public DefaultConfiguration getMutableChild(String name, boolean create) {
for (DefaultConfiguration child:children)
{
if ( child.getName().equals( name))
{
return child;
}
}
if ( create )
{
DefaultConfiguration newConfig = new DefaultConfiguration( name);
children.add( newConfig);
return newConfig;
}
else
{
return null;
}
}
public void removeChild(Configuration child) {
children.remove( child);
}
public String getName()
{
return name;
}
public Configuration getChild(String name)
{
for (DefaultConfiguration child:children)
{
if ( child.getName().equals( name))
{
return child;
}
}
return new DefaultConfiguration( name);
}
public Configuration[] getChildren(String name) {
List<Configuration> result = new ArrayList<Configuration>();
for (DefaultConfiguration child:children)
{
if ( child.getName().equals( name))
{
result.add( child);
}
}
return result.toArray( new Configuration[] {});
}
public Configuration[] getChildren()
{
return children.toArray( new Configuration[] {});
}
public String getValue() throws ConfigurationException {
if ( value == null)
{
throw new ConfigurationException("Value not set in configuration " + name);
}
return value;
}
public String getValue(String defaultValue) {
if ( value == null)
{
return defaultValue;
}
return value;
}
public boolean getValueAsBoolean(boolean defaultValue) {
if ( value == null)
{
return defaultValue;
}
if ( value.equalsIgnoreCase("yes"))
{
return true;
}
if ( value.equalsIgnoreCase("no"))
{
return false;
}
return Boolean.parseBoolean( value);
}
public long getValueAsLong(int defaultValue) {
if ( value == null)
{
return defaultValue;
}
return Long.parseLong( value);
}
public int getValueAsInteger(int defaultValue) {
if ( value == null)
{
return defaultValue;
}
return Integer.parseInt( value);
}
public String getAttribute(String name) throws ConfigurationException {
String value = attributes.get(name);
if ( value == null)
{
throw new ConfigurationException("Attribute " + name + " not found ");
}
return value;
}
public String getAttribute(String name, String defaultValue) {
String value = attributes.get(name);
if ( value == null)
{
return defaultValue;
}
return value;
}
public boolean getAttributeAsBoolean(String string, boolean defaultValue) {
String value = getAttribute(string, defaultValue ? "true": "false");
return Boolean.parseBoolean( value);
}
public String[] getAttributeNames() {
String[] attributeNames = attributes.keySet().toArray( new String[] {});
return attributeNames;
}
public Configuration find( String localName) {
Configuration[] childList= getChildren();
for ( int i=0;i<childList.length;i++) {
if (childList[i].getName().equals( localName)) {
return childList[i];
}
}
return null;
}
public Configuration find( String attributeName, String attributeValue) {
Configuration[] childList= getChildren();
for ( int i=0;i<childList.length;i++) {
String attribute = childList[i].getAttribute( attributeName,null);
if (attributeValue.equals( attribute)) {
return childList[i];
}
}
return null;
}
public DefaultConfiguration replace( Configuration newChild) throws ConfigurationException {
Configuration find = find( newChild.getName());
if ( find == null)
{
throw new ConfigurationException(" could not find " + newChild.getName());
}
return replace( find, newChild );
}
public DefaultConfiguration replace( Configuration oldChild, Configuration newChild) {
String localName = getName();
DefaultConfiguration newConfig = newConfiguration(localName);
boolean present = false;
Configuration[] childList= getChildren();
for ( int i=0;i<childList.length;i++) {
if (childList[i] != oldChild) {
newConfig.addChild( childList[i]);
} else {
present = true;
newConfig.addChild( newChild );
}
}
if (!present) {
newConfig.addChild( newChild );
}
return newConfig;
}
protected DefaultConfiguration newConfiguration(String localName) {
return new DefaultConfiguration( localName);
}
public DefaultConfiguration add( Configuration newChild) {
String localName = getName();
DefaultConfiguration newConfig = newConfiguration(localName);
boolean present = false;
Configuration[] childList= getChildren();
for ( int i=0;i<childList.length;i++) {
if (childList[i] == newChild) {
present = true;
}
}
if (!present) {
newConfig.addChild( newChild );
}
return newConfig;
}
/**
* @param configuration
* @throws ConfigurationException
*/
public DefaultConfiguration remove(Configuration configuration) {
String localName = getName();
DefaultConfiguration newConfig = newConfiguration(localName);
Configuration[] childList= getChildren();
for ( int i=0;i<childList.length;i++) {
if (childList[i] != configuration) {
newConfig.addChild( childList[i]);
}
}
return newConfig;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((attributes == null) ? 0 : attributes.hashCode());
result = prime * result + ((children == null) ? 0 : children.hashCode());
result = prime * result + ((name == null) ? 0 : name.hashCode());
result = prime * result + ((value == null) ? 0 : value.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
DefaultConfiguration other = (DefaultConfiguration) obj;
if (attributes == null) {
if (other.attributes != null)
return false;
} else if (!attributes.equals(other.attributes))
return false;
if (children == null) {
if (other.children != null)
return false;
} else if (!children.equals(other.children))
return false;
if (name == null) {
if (other.name != null)
return false;
} else if (!name.equals(other.name))
return false;
if (value == null) {
if (other.value != null)
return false;
} else if (!value.equals(other.value))
return false;
return true;
}
@Override
public String toString() {
StringBuilder buf = new StringBuilder();
buf.append( name);
if (attributes.size() > 0)
{
buf.append( "[");
boolean first= true;
for ( Map.Entry<String, String> entry: attributes.entrySet())
{
if (!first)
{
buf.append( ", ");
}
else
{
first = false;
}
buf.append(entry.getKey());
buf.append( "='");
buf.append(entry.getValue());
buf.append( "'");
}
buf.append( "]");
}
buf.append( "{");
boolean first= true;
for ( Configuration child:children)
{
if (first)
{
buf.append("\n");
first =false;
}
buf.append( child.toString());
buf.append("\n");
}
if ( value != null)
{
buf.append( value);
}
buf.append( "}");
return buf.toString();
}
}
| 04900db4-clienttest | src/org/rapla/framework/DefaultConfiguration.java | Java | gpl3 | 10,661 |
package org.rapla.framework;
@SuppressWarnings("unused")
public class TypedComponentRole<T> {
String id;
public TypedComponentRole(String id) {
this.id = id.intern();
}
public String getId()
{
return id;
}
public String toString()
{
return id;
}
public boolean equals(Object obj)
{
if (obj == null)
{
return false;
}
if ( !(obj instanceof TypedComponentRole))
{
return false;
}
return id.equals(obj.toString());
}
@Override
public int hashCode() {
return id.hashCode();
}
}
| 04900db4-clienttest | src/org/rapla/framework/TypedComponentRole.java | Java | gpl3 | 636 |
package org.rapla.framework;
import java.net.URL;
import org.rapla.framework.logger.Logger;
public interface StartupEnvironment
{
int CONSOLE = 1;
int WEBSTART = 2;
int APPLET = 3;
Configuration getStartupConfiguration() throws RaplaException;
URL getDownloadURL() throws RaplaException;
URL getConfigURL() throws RaplaException;
/** either EMBEDDED, CONSOLE, WEBSTART, APPLET,SERVLET or CLIENT */
int getStartupMode();
URL getContextRootURL() throws RaplaException;
Logger getBootstrapLogger();
} | 04900db4-clienttest | src/org/rapla/framework/StartupEnvironment.java | Java | gpl3 | 550 |
package org.rapla.framework;
import java.util.Calendar;
import java.util.Date;
import java.util.Locale;
import java.util.TimeZone;
import org.rapla.components.util.SerializableDateTimeFormat;
/** This class contains all locale specific information for Rapla. Like
<ul>
<li>Selected language.</li>
<li>Selected country.</li>
<li>Available languages (if the user has the possibility to choose a language)</li>
<li>TimeZone for appointments (This is always GMT+0)</li>
</ul>
<p>
Also it provides basic formating information for the dates.
</p>
<p>
Configuration is done in the rapla.xconf:
<pre>
<locale>
<languages default="de">
<language>de</language>
<language>en</language>
</languages>
<country>US</country>
</locale>
</pre>
If languages default is not set, the system default wil be used.<br>
If country code is not set, the system default will be used.<br>
</p>
<p>
Rapla hasn't a support for different Timezones yet.
if you look into RaplaLocale you find
3 timzones in Rapla:
</p>
<ul>
<li>{@link RaplaLocale#getTimeZone}</li>
<li>{@link RaplaLocale#getSystemTimeZone}</li>
<li>{@link RaplaLocale#getImportExportTimeZone}</li>
</ul>
*/
public interface RaplaLocale
{
TypedComponentRole<String> LANGUAGE_ENTRY = new TypedComponentRole<String>("org.rapla.language");
String[] getAvailableLanguages();
/** creates a calendar initialized with the Rapla timezone ( that is always GMT+0 for Rapla ) and the selected locale*/
Calendar createCalendar();
String formatTime( Date date );
Date fromUTCTimestamp(Date timestamp);
/** sets time to 0:00:00 or 24:00:00 */
Date toDate( Date date, boolean fillDate );
/** sets time to 0:00:00
* Warning month is zero based so January is 0
* @deprecated use toRaplaDate*/
Date toDate( int year, int month, int date );
/**
* month is 1-12 January is 1
*/
Date toRaplaDate( int year, int month, int date );
/** sets date to 0:00:00 */
Date toTime( int hour, int minute, int second );
/** Uses the first date parameter for year, month, date information and
the second for hour, minutes, second, millisecond information.*/
Date toDate( Date date, Date time );
/** format long with the local NumberFormat */
String formatNumber( long number );
/** format without year */
String formatDateShort( Date date );
/** format with locale DateFormat.SHORT */
String formatDate( Date date );
/** format with locale DateFormat.MEDIUM */
String formatDateLong( Date date );
String formatTimestamp(Date timestamp);
@Deprecated
String formatTimestamp(Date timestamp, TimeZone timezone);
/** Abbreviation of locale weekday name of date. */
String getWeekday( Date date );
/** Monthname of date. */
String getMonth( Date date );
String getCharsetNonUtf();
/**
This method always returns GMT+0. This is used for all internal calls. All dates and times are stored internaly with this Timezone.
Rapla can't work with timezones but to use the Date api it needs a timezone, so GMT+0 is used, because it doesn't have DaylightSavingTimes which would confuse the conflict detection. This timezone (GMT+0) is only used internaly and never shown in Rapla. Rapla only displays the time e.g. 10:00am without the timezone.
*/
TimeZone getTimeZone();
/**
returns the timezone of the system where Rapla is running (java default)
this is used on the server for storing the dates in mysql. Prior to 1.7 Rapla always switched the system time to gmt for the mysql api. But now the dates are converted from GMT+0 to system time before storing.
Converted meens: 10:00am GMT+0 Raplatime is converted to 10:00am Europe/Berlin, if thats the system timezone. When loading 10:00am Europe/Berlin is converted back to 10:00am GMT+0.
This timezone is also used for the timestamps, so created-at and last-changed dates are always stored in system time.
Also the logging api uses this timezone and now logs are in system time.
@see RaplaLocale#toRaplaTime(TimeZone, long)
@deprecated only used internally by the storage api
*/
@Deprecated
TimeZone getSystemTimeZone();
/**
returns the timezone configured via main options, this is per default the system timezon. This timezone is used for ical/exchange import/export
If Rapla will support timezones in the future, than this will be the default timezone for all times. Now its only used on import and export. It works as with system time above. 10:00am GMT+0 is converted to 10:00am of the configured timezone on export and on import all times are converted to GMT+0.
@see RaplaLocale#toRaplaTime(TimeZone, long)
@deprecated moved to ImportExportLocale
*/
@Deprecated
TimeZone getImportExportTimeZone();
/**
@deprecated moved to TimeZoneConverter
*/
@Deprecated
long fromRaplaTime(TimeZone timeZone,long raplaTime);
/**
@deprecated moved to TimeZoneConverter
*/
@Deprecated
long toRaplaTime(TimeZone timeZone,long time);
/**
@deprecated moved to TimeZoneConverter
*/
@Deprecated
Date fromRaplaTime(TimeZone timeZone,Date raplaTime);
/**
* converts a common Date object into a Date object that
* assumes that the user (being in the given timezone) is in the
* UTC-timezone by adding the offset between UTC and the given timezone.
*
* <pre>
* Example: If you pass the Date "2013 Jan 15 11:00:00 UTC"
* and the TimeZone "GMT+1", this method will return a Date
* "2013 Jan 15 12:00:00 UTC" which is effectivly 11:00:00 GMT+1
* </pre>
*
* @param timeZone
* the orgin timezone
* @param time
* the Date object in the passed timezone
* @see RaplaLocale#fromRaplaTime
@deprecated moved to TimeZoneConverter
*/
Date toRaplaTime(TimeZone timeZone,Date time);
Locale getLocale();
SerializableDateTimeFormat getSerializableFormat();
} | 04900db4-clienttest | src/org/rapla/framework/RaplaLocale.java | Java | gpl3 | 6,038 |
/*--------------------------------------------------------------------------*
| Copyright (C) 2014 Christopher Kohlhaas |
| |
| 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. A copy of the license has been included with |
| these distribution in the COPYING file, if not go to www.fsf.org |
| |
| As a special exception, you are granted the permissions to link this |
| program with every library, which license fulfills the Open Source |
| Definition as published by the Open Source Initiative (OSI). |
*--------------------------------------------------------------------------*/
package org.rapla.framework.internal;
import java.text.DateFormat;
import java.text.FieldPosition;
import java.text.NumberFormat;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.Locale;
import java.util.TimeZone;
import org.rapla.components.util.DateTools;
import org.rapla.components.xmlbundle.LocaleSelector;
import org.rapla.components.xmlbundle.impl.LocaleSelectorImpl;
import org.rapla.framework.Configuration;
import org.rapla.framework.logger.Logger;
public class RaplaLocaleImpl extends AbstractRaplaLocale {
TimeZone zone;
TimeZone systemTimezone;
TimeZone importExportTimeZone;
LocaleSelector localeSelector = new LocaleSelectorImpl();
String[] availableLanguages;
String COUNTRY = "country";
String LANGUAGES = "languages";
String LANGUAGE = "language";
String CHARSET = "charset";
String charsetForHtml;
public RaplaLocaleImpl(Configuration config,Logger logger )
{
String selectedCountry = config.getChild( COUNTRY).getValue(Locale.getDefault().getCountry() );
Configuration languageConfig = config.getChild( LANGUAGES );
Configuration[] languages = languageConfig.getChildren( LANGUAGE );
charsetForHtml = config.getChild(CHARSET).getValue("iso-8859-15");
availableLanguages = new String[languages.length];
for ( int i=0;i<languages.length;i++ ) {
availableLanguages[i] = languages[i].getValue("en");
}
String selectedLanguage = languageConfig.getAttribute( "default", Locale.getDefault().getLanguage() );
if (selectedLanguage.trim().length() == 0)
selectedLanguage = Locale.getDefault().getLanguage();
localeSelector.setLocale( new Locale(selectedLanguage, selectedCountry) );
zone = DateTools.getTimeZone();
systemTimezone = TimeZone.getDefault();
importExportTimeZone = systemTimezone;
logger.info("Configured Locale= " + getLocaleSelector().getLocale().toString());
}
public TimeZone getSystemTimeZone() {
return systemTimezone;
}
public LocaleSelector getLocaleSelector() {
return localeSelector;
}
public Date fromUTCTimestamp(Date date)
{
Date raplaTime = toRaplaTime( importExportTimeZone,date );
return raplaTime;
}
/* (non-Javadoc)
* @see org.rapla.common.IRaplaLocale#getAvailableLanguages()
*/
public String[] getAvailableLanguages() {
return availableLanguages;
}
/* (non-Javadoc)
* @see org.rapla.common.IRaplaLocale#createCalendar()
*/
public Calendar createCalendar() {
return Calendar.getInstance( zone, getLocale() );
}
/* (non-Javadoc)
* @see org.rapla.common.IRaplaLocale#formatTime(java.util.Date)
*/
public String formatTime( Date date ) {
Locale locale = getLocale();
TimeZone timezone = getTimeZone();
DateFormat format = DateFormat.getTimeInstance( DateFormat.SHORT, locale );
format.setTimeZone( timezone );
String formatTime = format.format( date );
return formatTime;
}
/* (non-Javadoc)
* @see org.rapla.common.IRaplaLocale#formatNumber(long)
*/
public String formatNumber( long number ) {
Locale locale = getLocale();
return NumberFormat.getInstance( locale).format(number );
}
/* (non-Javadoc)
* @see org.rapla.common.IRaplaLocale#formatDateShort(java.util.Date)
*/
public String formatDateShort( Date date ) {
Locale locale = getLocale();
TimeZone timezone = zone;
StringBuffer buf = new StringBuffer();
FieldPosition fieldPosition = new FieldPosition( DateFormat.YEAR_FIELD );
DateFormat format = DateFormat.getDateInstance( DateFormat.SHORT, locale );
format.setTimeZone( timezone );
buf = format.format(date,
buf,
fieldPosition
);
if ( fieldPosition.getEndIndex()<buf.length() ) {
buf.delete( fieldPosition.getBeginIndex(), fieldPosition.getEndIndex()+1 );
} else if ( (fieldPosition.getBeginIndex()>=0) ) {
buf.delete( fieldPosition.getBeginIndex(), fieldPosition.getEndIndex() );
}
String result = buf.toString();
return result;
}
/* (non-Javadoc)
* @see org.rapla.common.IRaplaLocale#formatDate(java.util.Date)
*/
public String formatDate( Date date ) {
TimeZone timezone = zone;
Locale locale = getLocale();
DateFormat format = DateFormat.getDateInstance( DateFormat.SHORT, locale );
format.setTimeZone( timezone );
return format.format( date );
}
/* (non-Javadoc)
* @see org.rapla.common.IRaplaLocale#formatDateLong(java.util.Date)
*/
public String formatDateLong( Date date ) {
TimeZone timezone = zone;
Locale locale = getLocale();
DateFormat format = DateFormat.getDateInstance( DateFormat.MEDIUM, locale );
format.setTimeZone( timezone );
String dateFormat = format.format( date);
return dateFormat + " (" + getWeekday(date) + ")";
}
@Deprecated
public String formatTimestamp( Date date, TimeZone timezone )
{
Locale locale = getLocale();
StringBuffer buf = new StringBuffer();
{
DateFormat format = DateFormat.getDateInstance( DateFormat.SHORT, locale );
format.setTimeZone( timezone );
String formatDate= format.format( date );
buf.append( formatDate);
}
buf.append(" ");
{
DateFormat format = DateFormat.getTimeInstance( DateFormat.SHORT, locale );
format.setTimeZone( timezone );
String formatTime = format.format( date );
buf.append( formatTime);
}
return buf.toString();
}
/* (non-Javadoc)
* @see org.rapla.common.IRaplaLocale#getWeekday(java.util.Date)
*/
public String getWeekday( Date date ) {
TimeZone timeZone = getTimeZone();
Locale locale = getLocale();
SimpleDateFormat format = new SimpleDateFormat( "EE", locale );
format.setTimeZone( timeZone );
return format.format( date );
}
/* (non-Javadoc)
* @see org.rapla.common.IRaplaLocale#getMonth(java.util.Date)
*/
public String getMonth( Date date ) {
TimeZone timeZone = getTimeZone();
Locale locale = getLocale();
SimpleDateFormat format = new SimpleDateFormat( "MMMMM", locale );
format.setTimeZone( timeZone );
return format.format( date );
}
/* (non-Javadoc)
* @see org.rapla.common.IRaplaLocale#getTimeZone()
*/
public TimeZone getTimeZone() {
return zone;
}
public TimeZone getImportExportTimeZone() {
return importExportTimeZone;
}
public void setImportExportTimeZone(TimeZone importExportTimeZone) {
this.importExportTimeZone = importExportTimeZone;
}
/* (non-Javadoc)
* @see org.rapla.common.IRaplaLocale#getLocale()
*/
public Locale getLocale() {
return localeSelector.getLocale();
}
public String getCharsetNonUtf()
{
return charsetForHtml;
}
}
| 04900db4-clienttest | src/org/rapla/framework/internal/RaplaLocaleImpl.java | Java | gpl3 | 7,997 |
/*--------------------------------------------------------------------------*
| Copyright (C) 2014 Christopher Kohlhaas |
| |
| 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. A copy of the license has been included with |
| these distribution in the COPYING file, if not go to www.fsf.org |
| |
| As a special exception, you are granted the permissions to link this |
| program with every library, which license fulfills the Open Source |
| Definition as published by the Open Source Initiative (OSI). |
*--------------------------------------------------------------------------*/
package org.rapla.framework.internal;
import java.lang.reflect.Constructor;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.TreeMap;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.ScheduledFuture;
import java.util.concurrent.Semaphore;
import java.util.concurrent.ThreadFactory;
import java.util.concurrent.TimeUnit;
import javax.jws.WebService;
import org.rapla.components.util.Cancelable;
import org.rapla.components.util.Command;
import org.rapla.components.util.CommandScheduler;
import org.rapla.framework.Configuration;
import org.rapla.framework.ConfigurationException;
import org.rapla.framework.Container;
import org.rapla.framework.Disposable;
import org.rapla.framework.RaplaContext;
import org.rapla.framework.RaplaContextException;
import org.rapla.framework.RaplaDefaultContext;
import org.rapla.framework.RaplaException;
import org.rapla.framework.StartupEnvironment;
import org.rapla.framework.TypedComponentRole;
import org.rapla.framework.logger.Logger;
import org.rapla.storage.dbrm.RemoteServiceCaller;
/** Base class for the ComponentContainers in Rapla.
* Containers are the RaplaMainContainer, the Client- and the Server-Service
*/
public class ContainerImpl implements Container
{
protected Container m_parent;
protected RaplaDefaultContext m_context;
protected Configuration m_config;
protected List<ComponentHandler> m_componentHandler = Collections.synchronizedList(new ArrayList<ComponentHandler>());
protected Map<String,RoleEntry> m_roleMap = Collections.synchronizedMap(new LinkedHashMap<String,RoleEntry>());
Logger logger;
public ContainerImpl(RaplaContext parentContext, Configuration config, Logger logger) throws RaplaException {
m_config = config;
// if ( parentContext.has(Logger.class ) )
// {
// logger = parentContext.lookup( Logger.class);
// }
// else
// {
// logger = new ConsoleLogger(ConsoleLogger.LEVEL_INFO);
// }
this.logger = logger;
if ( parentContext.has(Container.class )) {
m_parent = parentContext.lookup( Container.class);
}
m_context = new RaplaDefaultContext(parentContext) {
@Override
protected Object lookup(String role) throws RaplaContextException {
ComponentHandler handler = getHandler( role );
if ( handler != null ) {
return handler.get();
}
return null;
}
@Override
protected boolean has(String role) {
if (getHandler( role ) != null)
return true;
return false;
}
};
addContainerProvidedComponentInstance(Logger.class,logger);
init( );
}
@SuppressWarnings("unchecked")
public <T> T lookup(Class<T> componentRole, String hint) throws RaplaContextException {
String key = componentRole.getName()+ "/" + hint;
ComponentHandler handler = getHandler( key );
if ( handler != null ) {
return (T) handler.get();
}
if ( m_parent != null)
{
return m_parent.lookup(componentRole, hint);
}
throw new RaplaContextException( key );
}
public Logger getLogger()
{
return logger;
}
protected void init() throws RaplaException {
configure( m_config );
addContainerProvidedComponentInstance( Container.class, this );
addContainerProvidedComponentInstance( Logger.class, getLogger());
}
public StartupEnvironment getStartupEnvironment() {
try
{
return getContext().lookup( StartupEnvironment.class);
}
catch ( RaplaContextException e )
{
throw new IllegalStateException(" Container not initialized with a startup environment");
}
}
protected void configure( final Configuration config )
throws RaplaException
{
Map<String,ComponentInfo> m_componentInfos = getComponentInfos();
final Configuration[] elements = config.getChildren();
for ( int i = 0; i < elements.length; i++ )
{
final Configuration element = elements[i];
final String id = element.getAttribute( "id", null );
if ( null == id )
{
// Only components with an id attribute are treated as components.
getLogger().debug( "Ignoring configuration for component, " + element.getName()
+ ", because the id attribute is missing." );
}
else
{
final String className;
final String[] roles;
if ( "component".equals( element.getName() ) )
{
try {
className = element.getAttribute( "class" );
Configuration[] roleConfigs = element.getChildren("roles");
roles = new String[ roleConfigs.length ];
for ( int j=0;j< roles.length;j++) {
roles[j] = roleConfigs[j].getValue();
}
} catch ( ConfigurationException ex) {
throw new RaplaException( ex);
}
}
else
{
String configName = element.getName();
final ComponentInfo roleEntry = m_componentInfos.get( configName );
if ( null == roleEntry )
{
final String message = "No class found matching configuration name " + "[name: " + element.getName() + "]";
getLogger().error( message );
continue;
}
roles = roleEntry.getRoles();
className = roleEntry.getClassname();
}
if ( getLogger().isDebugEnabled() )
{
getLogger().debug( "Configuration processed for: " + className );
}
Logger logger = this.logger.getChildLogger( id );
ComponentHandler handler =new ComponentHandler( element, className, logger);
for ( int j=0;j< roles.length;j++) {
String roleName = (roles[j]);
addHandler( roleName, id, handler );
}
}
}
}
protected Map<String,ComponentInfo> getComponentInfos() {
return Collections.emptyMap();
}
public <T, I extends T> void addContainerProvidedComponent(Class<T> roleInterface, Class<I> implementingClass) {
addContainerProvidedComponent(roleInterface, implementingClass, null, (Configuration)null);
}
public <T, I extends T> void addContainerProvidedComponent(Class<T> roleInterface, Class<I> implementingClass, Configuration config) {
addContainerProvidedComponent(roleInterface, implementingClass, null,config);
}
public <T, I extends T> void addContainerProvidedComponent(TypedComponentRole<T> roleInterface, Class<I> implementingClass) {
addContainerProvidedComponent(roleInterface, implementingClass, (Configuration) null);
}
public <T, I extends T> void addContainerProvidedComponent(TypedComponentRole<T> roleInterface, Class<I> implementingClass, Configuration config) {
addContainerProvidedComponent( roleInterface, implementingClass, null, config);
}
public <T, I extends T> void addContainerProvidedComponentInstance(TypedComponentRole<T> roleInterface, I implementingInstance) {
addContainerProvidedComponentInstance(roleInterface.getId(), implementingInstance, null);
}
public <T, I extends T> void addContainerProvidedComponentInstance(Class<T> roleInterface, I implementingInstance) {
addContainerProvidedComponentInstance(roleInterface, implementingInstance, implementingInstance.toString());
}
public <T> Collection< T> lookupServicesFor(TypedComponentRole<T> role) throws RaplaContextException {
Collection<T> list = new LinkedHashSet<T>();
for (T service: getAllServicesForThisContainer(role)) {
list.add(service);
}
if ( m_parent != null)
{
for (T service:m_parent.lookupServicesFor(role))
{
list.add( service);
}
}
return list;
}
public <T> Collection<T> lookupServicesFor(Class<T> role) throws RaplaContextException {
Collection<T> list = new LinkedHashSet<T>();
for (T service:getAllServicesForThisContainer(role)) {
list.add( service);
}
if ( m_parent != null)
{
for (T service:m_parent.lookupServicesFor(role))
{
list.add( service);
}
}
return list;
}
protected <T, I extends T> void addContainerProvidedComponentInstance(Class<T> roleInterface, I implementingInstance, String hint) {
addContainerProvidedComponentInstance(roleInterface.getName(), implementingInstance, hint);
}
protected <T, I extends T> void addContainerProvidedComponent(Class<T> roleInterface, Class<I> implementingClass, String hint, Configuration config) {
addContainerProvidedComponent( roleInterface.getName(), implementingClass.getName(), hint, config);
}
private <T, I extends T> void addContainerProvidedComponent(TypedComponentRole<T> roleInterface, Class<I> implementingClass, String hint, Configuration config)
{
addContainerProvidedComponent( roleInterface.getId(), implementingClass.getName(), hint, config);
}
synchronized private void addContainerProvidedComponent(String role,String classname, String hint,Configuration config) {
addContainerProvidedComponent( new String[] {role}, classname, hint, config);
}
synchronized private void addContainerProvidedComponentInstance(String role,Object componentInstance,String hint) {
addHandler( role, hint, new ComponentHandler(componentInstance));
}
synchronized private void addContainerProvidedComponent(String[] roles,String classname,String hint, Configuration config) {
ComponentHandler handler = new ComponentHandler( config, classname, getLogger() );
for ( int i=0;i<roles.length;i++) {
addHandler( roles[i], hint, handler);
}
}
protected <T> Collection<T> getAllServicesForThisContainer(TypedComponentRole<T> role) {
RoleEntry entry = m_roleMap.get( role.getId() );
return getAllServicesForThisContainer( entry);
}
protected <T> Collection<T> getAllServicesForThisContainer(Class<T> role) {
RoleEntry entry = m_roleMap.get( role.getName() );
return getAllServicesForThisContainer( entry);
}
private <T> Collection<T> getAllServicesForThisContainer(RoleEntry entry) {
if ( entry == null)
{
return Collections.emptyList();
}
List<T> result = new ArrayList<T>();
Set<String> hintSet = entry.getHintSet();
for (String hint: hintSet)
{
ComponentHandler handler = entry.getHandler(hint);
try
{
Object service = handler.get();
// we can safely cast here because the method is only called from checked methods
@SuppressWarnings("unchecked")
T casted = (T)service;
result.add(casted);
}
catch (Exception e)
{
Throwable ex = e;
while( ex.getCause() != null)
{
ex = ex.getCause();
}
getLogger().error("Could not initialize component " + handler + " due to " + ex.getMessage() + " removing from service list" , e);
entry.remove(hint);
}
}
return result;
}
/**
* @param roleName
* @param hint
* @param handler
*/
private void addHandler(String roleName, String hint, ComponentHandler handler) {
m_componentHandler.add( handler);
RoleEntry entry = m_roleMap.get( roleName );
if ( entry == null)
entry = new RoleEntry(roleName);
entry.put( hint , handler);
m_roleMap.put( roleName, entry);
}
ComponentHandler getHandler( String role) {
int hintSeperator = role.indexOf('/');
String roleName = role;
String hint = null;
if ( hintSeperator > 0 ) {
roleName = role.substring( 0, hintSeperator );
hint = role.substring( hintSeperator + 1 );
}
return getHandler( roleName, hint );
}
ComponentHandler getHandler( String role,Object hint) {
RoleEntry entry = m_roleMap.get( role );
if ( entry == null)
{
return null;
}
ComponentHandler handler = entry.getHandler( hint );
if ( handler != null)
{
return handler;
}
if ( hint == null || hint.equals("*" ) )
return entry.getFirstHandler();
// Try the first accessible handler
return null;
}
protected final class DefaultScheduler implements CommandScheduler {
private final ScheduledExecutorService executor;
private DefaultScheduler() {
final ScheduledExecutorService executor = Executors.newScheduledThreadPool(5,new ThreadFactory() {
public Thread newThread(Runnable r) {
Thread thread = new Thread(r);
String name = thread.getName();
if ( name == null)
{
name = "";
}
thread.setName("raplascheduler-" + name.toLowerCase().replaceAll("thread", "").replaceAll("-|\\[|\\]", ""));
thread.setDaemon(true);
return thread;
}
});
this.executor = executor;
}
public Cancelable schedule(Command command, long delay)
{
Runnable task = createTask(command);
return schedule(task, delay);
}
public Cancelable schedule(Runnable task, long delay) {
if (executor.isShutdown())
{
RaplaException ex = new RaplaException("Can't schedule command because executer is already shutdown " + task.toString());
getLogger().error(ex.getMessage(), ex);
return createCancable( null);
}
TimeUnit unit = TimeUnit.MILLISECONDS;
ScheduledFuture<?> schedule = executor.schedule(task, delay, unit);
return createCancable( schedule);
}
private Cancelable createCancable(final ScheduledFuture<?> schedule) {
return new Cancelable() {
public void cancel() {
if ( schedule != null)
{
schedule.cancel(true);
}
}
};
}
public Cancelable schedule(Runnable task, long delay, long period) {
if (executor.isShutdown())
{
RaplaException ex = new RaplaException("Can't schedule command because executer is already shutdown " + task.toString());
getLogger().error(ex.getMessage(), ex);
return createCancable( null);
}
TimeUnit unit = TimeUnit.MILLISECONDS;
ScheduledFuture<?> schedule = executor.scheduleAtFixedRate(task, delay, period, unit);
return createCancable( schedule);
}
public Cancelable schedule(Command command, long delay, long period)
{
Runnable task = createTask(command);
return schedule(task, delay, period);
}
public void cancel() {
try{
getLogger().info("Stopping scheduler thread.");
List<Runnable> shutdownNow = executor.shutdownNow();
for ( Runnable task: shutdownNow)
{
long delay = -1;
if ( task instanceof ScheduledFuture)
{
ScheduledFuture scheduledFuture = (ScheduledFuture) task;
delay = scheduledFuture.getDelay( TimeUnit.SECONDS);
}
if ( delay <=0)
{
getLogger().warn("Interrupted active task " + task );
}
}
getLogger().info("Stopped scheduler thread.");
}
catch ( Throwable ex)
{
getLogger().warn(ex.getMessage());
}
// we give the update threads some time to execute
try
{
Thread.sleep( 50);
}
catch (InterruptedException e)
{
}
}
}
class RoleEntry {
Map<String,ComponentHandler> componentMap = Collections.synchronizedMap(new LinkedHashMap<String,ComponentHandler>());
ComponentHandler firstEntry;
int generatedHintCounter = 0;
String roleName;
RoleEntry(String roleName) {
this.roleName = roleName;
}
String generateHint()
{
return roleName + "_" +generatedHintCounter++;
}
void put( String hint, ComponentHandler handler ){
if ( hint == null)
{
hint = generateHint();
}
synchronized (this) {
componentMap.put( hint, handler);
}
if (firstEntry == null)
firstEntry = handler;
}
void remove(String hint)
{
componentMap.remove( hint);
}
Set<String> getHintSet() {
// we return a clone to avoid concurrent modification exception
synchronized (this) {
LinkedHashSet<String> result = new LinkedHashSet<String>(componentMap.keySet());
return result;
}
}
ComponentHandler getHandler(Object hint) {
return componentMap.get( hint );
}
ComponentHandler getFirstHandler() {
return firstEntry;
}
public String toString()
{
return componentMap.toString();
}
}
public RaplaContext getContext() {
return m_context;
}
boolean disposing;
public void dispose() {
// prevent reentrence in dispose
synchronized ( this)
{
if ( disposing)
{
getLogger().warn("Disposing is called twice",new RaplaException(""));
return;
}
disposing = true;
}
try
{
removeAllComponents();
}
finally
{
disposing = false;
}
}
protected void removeAllComponents() {
Iterator<ComponentHandler> it = new ArrayList<ComponentHandler>(m_componentHandler).iterator();
while ( it.hasNext() ) {
it.next().dispose();
}
m_componentHandler.clear();
m_roleMap.clear();
}
@SuppressWarnings({ "unchecked", "rawtypes" })
Constructor findDependantConstructor(Class componentClass) {
Constructor[] constructors= componentClass.getConstructors();
TreeMap<Integer,Constructor> constructorMap = new TreeMap<Integer, Constructor>();
for (Constructor constructor:constructors) {
Class[] types = constructor.getParameterTypes();
boolean compatibleParameters = true;
for (int j=0; j< types.length; j++ ) {
Class type = types[j];
if (!( type.isAssignableFrom( RaplaContext.class) || type.isAssignableFrom( Configuration.class) || type.isAssignableFrom(Logger.class) || type.isAnnotationPresent(WebService.class) || getContext().has( type)))
{
compatibleParameters = false;
}
}
if ( compatibleParameters )
{
//return constructor;
constructorMap.put( types.length, constructor);
}
}
// return the constructor with the most paramters
if (!constructorMap.isEmpty())
{
return constructorMap.lastEntry().getValue();
}
return null;
}
/** Instantiates a class and passes the config, logger and the parent context to the object if needed by the constructor.
* This concept is taken form pico container.*/
@SuppressWarnings({ "rawtypes", "unchecked" })
protected Object instanciate( String componentClassName, Configuration config, Logger logger ) throws RaplaContextException
{
RaplaContext context = m_context;
Class componentClass;
try {
componentClass = Class.forName( componentClassName );
} catch (ClassNotFoundException e1) {
throw new RaplaContextException("Component class " + componentClassName + " not found." , e1);
}
Constructor c = findDependantConstructor( componentClass );
Object[] params = null;
if ( c != null) {
Class[] types = c.getParameterTypes();
params = new Object[ types.length ];
for (int i=0; i< types.length; i++ ) {
Class type = types[i];
Object p;
if ( type.isAssignableFrom( RaplaContext.class)) {
p = context;
} else if ( type.isAssignableFrom( Configuration.class)) {
p = config;
} else if ( type.isAssignableFrom( Logger.class)) {
p = logger;
} else if ( type.isAnnotationPresent(WebService.class)) {
RemoteServiceCaller lookup = context.lookup(RemoteServiceCaller.class);
p = lookup.getRemoteMethod( type);
} else {
Class guessedRole = type;
if ( context.has( guessedRole )) {
p = context.lookup( guessedRole );
} else {
throw new RaplaContextException(componentClass, "Can't statisfy constructor dependency " + type.getName() );
}
}
params[i] = p;
}
}
try {
final Object component;
if ( c!= null) {
component = c.newInstance( params);
} else {
component = componentClass.newInstance();
}
return component;
}
catch (Exception e)
{
throw new RaplaContextException(componentClassName + " could not be initialized due to " + e.getMessage(), e);
}
}
protected class ComponentHandler implements Disposable {
protected Configuration config;
protected Logger logger;
protected Object component;
protected String componentClassName;
boolean dispose = true;
protected ComponentHandler( Object component) {
this.component = component;
this.dispose = false;
}
protected ComponentHandler( Configuration config, String componentClass, Logger logger) {
this.config = config;
this.componentClassName = componentClass;
this.logger = logger;
}
Semaphore instanciating = new Semaphore(1);
Object get() throws RaplaContextException {
if ( component != null)
{
return component;
}
boolean acquired;
try {
acquired = instanciating.tryAcquire(60,TimeUnit.SECONDS);
} catch (InterruptedException e) {
throw new RaplaContextException("Timeout while waiting for instanciation of " + componentClassName );
}
if ( !acquired)
{
throw new RaplaContextException("Instanciating component " + componentClassName + " twice. Possible a cyclic dependency.",new RaplaException(""));
}
else
{
try
{
// test again, maybe instanciated by another thread
if ( component != null)
{
return component;
}
component = instanciate( componentClassName, config, logger );
return component;
}
finally
{
instanciating.release();
}
}
}
boolean disposing;
public void dispose() {
// prevent reentrence in dispose
synchronized ( this)
{
if ( disposing)
{
getLogger().warn("Disposing is called twice",new RaplaException(""));
return;
}
disposing = true;
}
try
{
if (component instanceof Disposable)
{
if ( component == ContainerImpl.this)
{
return;
}
((Disposable) component).dispose();
}
} catch ( Exception ex) {
getLogger().error("Error disposing component ", ex );
}
finally
{
disposing = false;
}
}
public String toString()
{
if ( component != null)
{
return component.toString();
}
if ( componentClassName != null)
{
return componentClassName.toString();
}
return super.toString();
}
}
protected Runnable createTask(final Command command) {
Runnable timerTask = new Runnable() {
public void run() {
try {
command.execute();
} catch (Exception e) {
getLogger().error( e.getMessage(), e);
}
}
public String toString()
{
return command.toString();
}
};
return timerTask;
}
protected CommandScheduler createCommandQueue() {
CommandScheduler commandQueue = new DefaultScheduler();
return commandQueue;
}
}
| 04900db4-clienttest | src/org/rapla/framework/internal/ContainerImpl.java | Java | gpl3 | 26,542 |
/*--------------------------------------------------------------------------*
| Copyright (C) 2014 Christopher Kohlhaas |
| |
| 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. A copy of the license has been included with |
| these distribution in the COPYING file, if not go to www.fsf.org |
| |
| As a special exception, you are granted the permissions to link this |
| program with every library, which license fulfills the Open Source |
| Definition as published by the Open Source Initiative (OSI). |
*--------------------------------------------------------------------------*/
package org.rapla.framework.internal;
public class ComponentInfo {
String className;
String[] roles;
public ComponentInfo(String className) {
this( className, className );
}
public ComponentInfo(String className, String roleName) {
this( className, new String[] {roleName} );
}
public ComponentInfo(String className, String[] roleNames) {
this.className = className;
this.roles = roleNames;
}
public String[] getRoles() {
return roles;
}
public String getClassname() {
return className;
}
}
| 04900db4-clienttest | src/org/rapla/framework/internal/ComponentInfo.java | Java | gpl3 | 1,535 |
/*--------------------------------------------------------------------------*
| Copyright (C) 2006 Gereon Fassbender, Christopher Kohlhaas |
| |
| 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. A copy of the license has been included with |
| these distribution in the COPYING file, if not go to www.fsf.org |
| |
| As a special exception, you are granted the permissions to link this |
| program with every library, which license fulfills the Open Source |
| Definition as published by the Open Source Initiative (OSI). |
*--------------------------------------------------------------------------*/
package org.rapla.framework.internal;
import java.io.EOFException;
import java.io.File;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.StringReader;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLConnection;
import java.util.HashMap;
import java.util.Map;
import org.rapla.components.util.Assert;
import org.rapla.components.util.JNLPUtil;
import org.rapla.components.util.xml.RaplaContentHandler;
import org.rapla.components.util.xml.RaplaErrorHandler;
import org.rapla.components.util.xml.RaplaNonValidatedInput;
import org.rapla.components.util.xml.RaplaSAXHandler;
import org.rapla.components.util.xml.XMLReaderAdapter;
import org.rapla.framework.Configuration;
import org.rapla.framework.RaplaException;
import org.rapla.framework.logger.Logger;
import org.rapla.framework.logger.NullLogger;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
import org.xml.sax.SAXParseException;
import org.xml.sax.XMLReader;
/** Tools for configuring the rapla-system. */
public abstract class ConfigTools
{
/** parse startup parameters. The parse format:
<pre>
[-?|-c PATH_TO_CONFIG_FILE] [ACTION]
</pre>
Possible map entries:
<ul>
<li>config: the config-file</li>
<li>action: the start action</li>
</ul>
@return a map with the parameter-entries or null if format is invalid or -? is used
*/
public static Map<String,String> parseParams( String[] args )
{
boolean bInvalid = false;
Map<String,String> map = new HashMap<String,String>();
String config = null;
String action = null;
// Investigate the passed arguments
for ( int i = 0; i < args.length; i++ )
{
if ( args[i].toLowerCase().equals( "-c" ) )
{
if ( i + 1 == args.length )
{
bInvalid = true;
break;
}
config = args[++i];
continue;
}
if ( args[i].toLowerCase().equals( "-?" ) )
{
bInvalid = true;
break;
}
if ( args[i].toLowerCase().substring( 0, 1 ).equals( "-" ) )
{
bInvalid = true;
break;
}
action = args[i].toLowerCase();
}
if ( bInvalid )
{
return null;
}
if ( config != null )
map.put( "config", config );
if ( action != null )
map.put( "action", action );
return map;
}
/** Creates a configuration from a URL.*/
public static Configuration createConfig( String configURL ) throws RaplaException
{
try
{
URLConnection conn = new URL( configURL).openConnection();
InputStreamReader stream = new InputStreamReader(conn.getInputStream());
StringBuilder builder = new StringBuilder();
//System.out.println( "File Content:");
int s= -1;
do {
s = stream.read();
// System.out.print( (char)s );
if ( s != -1)
{
builder.append( (char) s );
}
} while ( s != -1);
stream.close();
Assert.notNull( stream );
Logger logger = new NullLogger();
RaplaNonValidatedInput parser = new RaplaReaderImpl();
final SAXConfigurationHandler handler = new SAXConfigurationHandler();
String xml = builder.toString();
parser.read(xml, handler, logger);
Configuration config = handler.getConfiguration();
Assert.notNull( config );
return config;
}
catch ( EOFException ex )
{
throw new RaplaException( "Can't load configuration-file at " + configURL );
}
catch ( Exception ex )
{
throw new RaplaException( ex );
}
}
static public class RaplaReaderImpl implements RaplaNonValidatedInput
{
public void read(String xml, RaplaSAXHandler handler, Logger logger) throws RaplaException
{
InputSource source = new InputSource( new StringReader(xml));
try {
XMLReader reader = XMLReaderAdapter.createXMLReader(false);
reader.setContentHandler( new RaplaContentHandler(handler));
reader.parse(source );
reader.setErrorHandler( new RaplaErrorHandler( logger));
} catch (SAXException ex) {
Throwable cause = ex.getException();
if (cause instanceof SAXParseException) {
ex = (SAXParseException) cause;
cause = ex.getException();
}
if (ex instanceof SAXParseException) {
throw new RaplaException("Line: " + ((SAXParseException)ex).getLineNumber()
+ " Column: "+ ((SAXParseException)ex).getColumnNumber() + " "
+ ((cause != null) ? cause.getMessage() : ex.getMessage())
,(cause != null) ? cause : ex );
}
if (cause == null) {
throw new RaplaException( ex);
}
if (cause instanceof RaplaException)
throw (RaplaException) cause;
else
throw new RaplaException( cause);
} catch (IOException ex) {
throw new RaplaException( ex.getMessage(), ex);
}
}
}
/** Creates an configuration URL from a configuration path.
If path is null the URL of the defaultPropertiesFile
will be returned.
*/
public static URL configFileToURL( String path, String defaultPropertiesFile ) throws RaplaException
{
URL configURL = null;
try
{
if ( path != null )
{
File file = new File( path );
if ( file.exists() )
{
configURL = ( file.getCanonicalFile() ).toURI().toURL();
}
}
if ( configURL == null )
{
configURL = ConfigTools.class.getClassLoader().getResource( defaultPropertiesFile );
if ( configURL == null )
{
File file = new File( defaultPropertiesFile );
if ( !file.exists() )
{
file = new File( "war/WEB-INF/" + defaultPropertiesFile );
}
if ( !file.exists() )
{
file = new File( "war/webclient/" + defaultPropertiesFile );
}
if ( file.exists() )
{
configURL = file.getCanonicalFile().toURI().toURL();
}
}
}
}
catch ( MalformedURLException ex )
{
throw new RaplaException( "malformed config path" + path );
}
catch ( IOException ex )
{
throw new RaplaException( "Can't resolve config path" + path );
}
if ( configURL == null )
{
throw new RaplaException( defaultPropertiesFile
+ " not found on classpath and in working folder "
+ " Path config file with -c argument. "
+ " For more information start rapla -? or read the api-docs." );
}
return configURL;
}
/** Creates an configuration URL from a configuration filename and
the webstart codebae.
If filename is null the URL of the defaultPropertiesFile
will be returned.
*/
public static URL webstartConfigToURL( String defaultPropertiesFilename ) throws RaplaException
{
try
{
URL base = JNLPUtil.getCodeBase();
URL configURL = new URL( base, defaultPropertiesFilename );
return configURL;
}
catch ( Exception ex )
{
throw new RaplaException( "Can't get configuration file in webstart mode." );
}
}
}
| 04900db4-clienttest | src/org/rapla/framework/internal/ConfigTools.java | Java | gpl3 | 9,197 |
/*--------------------------------------------------------------------------*
| Copyright (C) 2013 Christopher Kohlhaas |
| |
| 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. A copy of the license has been included with |
| these distribution in the COPYING file, if not go to www.fsf.org |
| |
| As a special exception, you are granted the permissions to link this |
| program with every library, which license fulfills the Open Source |
| Definition as published by the Open Source Initiative (OSI). |
*--------------------------------------------------------------------------*/
package org.rapla.framework.internal;
import org.rapla.framework.Provider;
import org.slf4j.ILoggerFactory;
import org.slf4j.LoggerFactory;
import org.slf4j.spi.LocationAwareLogger;
@SuppressWarnings("restriction")
public class Slf4jAdapter implements Provider<org.rapla.framework.logger.Logger> {
static ILoggerFactory logManager = LoggerFactory.getILoggerFactory();
static public org.rapla.framework.logger.Logger getLoggerForCategory(String categoryName) {
LocationAwareLogger loggerForCategory = (LocationAwareLogger)logManager.getLogger(categoryName);
return new Wrapper(loggerForCategory, categoryName);
}
public org.rapla.framework.logger.Logger get() {
return getLoggerForCategory( "rapla");
}
static class Wrapper implements org.rapla.framework.logger.Logger{
LocationAwareLogger logger;
String id;
public Wrapper( LocationAwareLogger loggerForCategory, String id) {
this.logger = loggerForCategory;
this.id = id;
}
public boolean isDebugEnabled() {
return logger.isDebugEnabled();
}
public void debug(String message) {
log(LocationAwareLogger.DEBUG_INT, message);
}
public void info(String message) {
log( LocationAwareLogger.INFO_INT, message);
}
private void log(int infoInt, String message) {
log( infoInt, message, null);
}
private void log( int level, String message,Throwable t) {
Object[] argArray = null;
String fqcn = Wrapper.class.getName();
logger.log(null, fqcn, level,message,argArray, t);
}
public void warn(String message) {
log( LocationAwareLogger.WARN_INT, message);
}
public void warn(String message, Throwable cause) {
log( LocationAwareLogger.WARN_INT, message, cause);
}
public void error(String message) {
log( LocationAwareLogger.ERROR_INT, message);
}
public void error(String message, Throwable cause) {
log( LocationAwareLogger.ERROR_INT, message, cause);
}
public org.rapla.framework.logger.Logger getChildLogger(String childLoggerName)
{
String childId = id + "." + childLoggerName;
return getLoggerForCategory( childId);
}
}
}
| 04900db4-clienttest | src/org/rapla/framework/internal/Slf4jAdapter.java | Java | gpl3 | 3,398 |
/*--------------------------------------------------------------------------*
| Copyright (C) 2013 Christopher Kohlhaas |
| |
| 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. A copy of the license has been included with |
| these distribution in the COPYING file, if not go to www.fsf.org |
| |
| As a special exception, you are granted the permissions to link this |
| program with every library, which license fulfills the Open Source |
| Definition as published by the Open Source Initiative (OSI). |
*--------------------------------------------------------------------------*/
package org.rapla.framework.internal;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.rapla.framework.Provider;
public class RaplaJDKLoggingAdapter implements Provider<org.rapla.framework.logger.Logger> {
public org.rapla.framework.logger.Logger get() {
final Logger logger = getLogger( "rapla");
return new Wrapper(logger, "rapla");
}
static private java.util.logging.Logger getLogger(String categoryName)
{
Logger logger = Logger.getLogger(categoryName);
return logger;
}
static String WRAPPER_NAME = RaplaJDKLoggingAdapter.class.getName();
class Wrapper implements org.rapla.framework.logger.Logger{
java.util.logging.Logger logger;
String id;
public Wrapper( java.util.logging.Logger logger, String id) {
this.logger = logger;
this.id = id;
}
public boolean isDebugEnabled() {
return logger.isLoggable(Level.CONFIG);
}
public void debug(String message) {
log(Level.CONFIG, message);
}
public void info(String message) {
log(Level.INFO, message);
}
public void warn(String message) {
log(Level.WARNING,message);
}
public void warn(String message, Throwable cause) {
log(Level.WARNING,message, cause);
}
public void error(String message) {
log(Level.SEVERE, message);
}
public void error(String message, Throwable cause) {
log(Level.SEVERE, message, cause);
}
private void log(Level level,String message) {
log(level, message, null);
}
private void log(Level level,String message, Throwable cause) {
StackTraceElement[] stackTrace = new Throwable().getStackTrace();
String sourceClass = null;
String sourceMethod =null;
for (StackTraceElement element:stackTrace)
{
String classname = element.getClassName();
if ( !classname.startsWith(WRAPPER_NAME))
{
sourceClass=classname;
sourceMethod =element.getMethodName();
break;
}
}
logger.logp(level,sourceClass, sourceMethod,message, cause);
}
public org.rapla.framework.logger.Logger getChildLogger(String childLoggerName)
{
String childId = id+ "." + childLoggerName;
Logger childLogger = getLogger( childId);
return new Wrapper( childLogger, childId);
}
}
}
| 04900db4-clienttest | src/org/rapla/framework/internal/RaplaJDKLoggingAdapter.java | Java | gpl3 | 3,626 |
package org.rapla.framework.internal;
import org.rapla.framework.ConfigurationException;
import org.rapla.framework.RaplaContext;
import org.rapla.framework.RaplaContextException;
import org.rapla.framework.TypedComponentRole;
public class ContextTools {
/** resolves a context value in the passed string.
If the string begins with <code>${</code> the method will lookup the String-Object in the context and returns it.
If it doesn't, the method returns the unmodified string.
Example:
<code>resolveContext("${download-server}")</code> returns the same as
context.get("download-server").toString();
@throws ConfigurationException when no contex-object was found for the given variable.
*/
public static String resolveContext( String s, RaplaContext context ) throws RaplaContextException
{
return ContextTools.resolveContextObject(s, context).toString();
}
public static Object resolveContextObject( String s, RaplaContext context ) throws RaplaContextException
{
StringBuffer value = new StringBuffer();
s = s.trim();
int startToken = s.indexOf( "${" );
if ( startToken < 0 )
return s;
int endToken = s.indexOf( "}", startToken );
String token = s.substring( startToken + 2, endToken );
String preToken = s.substring( 0, startToken );
String unresolvedRest = s.substring( endToken + 1 );
TypedComponentRole<Object> untypedIdentifier = new TypedComponentRole<Object>(token);
Object lookup = context.lookup( untypedIdentifier );
if ( preToken.length() == 0 && unresolvedRest.length() == 0 )
{
return lookup;
}
String contextObject = lookup.toString();
value.append( preToken );
String stringRep = contextObject.toString();
value.append( stringRep );
Object resolvedRest = resolveContext(unresolvedRest, context );
value.append( resolvedRest.toString());
return value.toString();
}
}
| 04900db4-clienttest | src/org/rapla/framework/internal/ContextTools.java | Java | gpl3 | 1,966 |
package org.rapla.framework.internal;
import java.util.Date;
import java.util.TimeZone;
import org.rapla.components.util.DateTools;
import org.rapla.components.util.SerializableDateTimeFormat;
import org.rapla.framework.RaplaLocale;
public abstract class AbstractRaplaLocale implements RaplaLocale {
public String formatTimestamp( Date date )
{
Date raplaDate = fromUTCTimestamp(date);
StringBuffer buf = new StringBuffer();
{
String formatDate= formatDate( raplaDate );
buf.append( formatDate);
}
buf.append(" ");
{
String formatTime = formatTime( raplaDate );
buf.append( formatTime);
}
return buf.toString();
}
/* (non-Javadoc)
* @see org.rapla.common.IRaplaLocale#toDate(java.util.Date, boolean)
*/
public Date toDate( Date date, boolean fillDate ) {
Date result = DateTools.cutDate(DateTools.addDay(date));
return result;
//
// Calendar cal1 = createCalendar();
// cal1.setTime( date );
// if ( fillDate ) {
// cal1.add( Calendar.DATE, 1);
// }
// cal1.set( Calendar.HOUR_OF_DAY, 0 );
// cal1.set( Calendar.MINUTE, 0 );
// cal1.set( Calendar.SECOND, 0 );
// cal1.set( Calendar.MILLISECOND, 0 );
// return cal1.getTime();
}
@Deprecated
public Date toDate( int year,int month, int day ) {
Date result = toRaplaDate(year, month+1, day);
return result;
}
public Date toRaplaDate( int year,int month, int day ) {
Date result = new Date(DateTools.toDate(year, month, day));
return result;
}
public Date toTime( int hour,int minute, int second ) {
Date result = new Date(DateTools.toTime(hour, minute, second));
return result;
}
/* (non-Javadoc)
* @see org.rapla.common.IRaplaLocale#toDate(java.util.Date, java.util.Date)
*/
public Date toDate( Date date, Date time ) {
long millisTime = time.getTime() - DateTools.cutDate( time.getTime());
Date result = new Date( DateTools.cutDate(date.getTime()) + millisTime);
return result;
// Calendar cal1 = createCalendar();
// Calendar cal2 = createCalendar();
// cal1.setTime( date );
// cal2.setTime( time );
// cal1.set( Calendar.HOUR_OF_DAY, cal2.get(Calendar.HOUR_OF_DAY) );
// cal1.set( Calendar.MINUTE, cal2.get(Calendar.MINUTE) );
// cal1.set( Calendar.SECOND, cal2.get(Calendar.SECOND) );
// cal1.set( Calendar.MILLISECOND, cal2.get(Calendar.MILLISECOND) );
// return cal1.getTime();
}
public long fromRaplaTime(TimeZone timeZone,long raplaTime)
{
long offset = getOffset(timeZone, raplaTime);
return raplaTime - offset;
}
public long toRaplaTime(TimeZone timeZone,long time)
{
long offset = getOffset(timeZone,time);
return time + offset;
}
public Date fromRaplaTime(TimeZone timeZone,Date raplaTime)
{
return new Date( fromRaplaTime(timeZone, raplaTime.getTime()));
}
public Date toRaplaTime(TimeZone timeZone,Date time)
{
return new Date( toRaplaTime(timeZone, time.getTime()));
}
private long getOffset(TimeZone timeZone,long time) {
long offsetSystem;
long offsetRapla;
{
// Calendar cal =Calendar.getInstance( timeZone);
// cal.setTimeInMillis( time );
// int zoneOffset = cal.get(Calendar.ZONE_OFFSET);
// int dstOffset = cal.get(Calendar.DST_OFFSET);
offsetSystem = timeZone.getOffset(time);
}
{
TimeZone utc = getTimeZone();
// Calendar cal =Calendar.getInstance( utc);
// cal.setTimeInMillis( time );
// offsetRapla = cal.get(Calendar.ZONE_OFFSET) + cal.get(Calendar.DST_OFFSET);
offsetRapla = utc.getOffset(time);
}
return offsetSystem - offsetRapla;
}
public SerializableDateTimeFormat getSerializableFormat()
{
return new SerializableDateTimeFormat();
}
}
| 04900db4-clienttest | src/org/rapla/framework/internal/AbstractRaplaLocale.java | Java | gpl3 | 3,876 |
package org.rapla.framework.internal;
import java.util.Map;
import java.util.Stack;
import org.rapla.components.util.xml.RaplaSAXAttributes;
import org.rapla.components.util.xml.RaplaSAXHandler;
import org.rapla.components.util.xml.RaplaSAXParseException;
import org.rapla.framework.Configuration;
import org.rapla.framework.DefaultConfiguration;
public class SAXConfigurationHandler implements RaplaSAXHandler
{
final Stack<DefaultConfiguration> configStack = new Stack<DefaultConfiguration>();
Configuration parsedConfiguration;
public Configuration getConfiguration()
{
return parsedConfiguration;
}
public void startElement(String namespaceURI, String localName,
RaplaSAXAttributes atts) throws RaplaSAXParseException
{
DefaultConfiguration defaultConfiguration = new DefaultConfiguration(localName);
for ( Map.Entry<String,String> entry :atts.getMap().entrySet())
{
String name = entry.getKey();
String value = entry.getValue();
defaultConfiguration.setAttribute( name, value);
}
configStack.push( defaultConfiguration);
}
public void endElement(
String namespaceURI,
String localName
) throws RaplaSAXParseException
{
DefaultConfiguration current =configStack.pop();
if ( configStack.isEmpty())
{
parsedConfiguration = current;
}
else
{
DefaultConfiguration parent = configStack.peek();
parent.addChild( current);
}
}
public void characters(char[] ch, int start, int length) {
DefaultConfiguration peek = configStack.peek();
String value = peek.getValue(null);
StringBuffer buf = new StringBuffer();
if ( value != null)
{
buf.append( value);
}
buf.append( ch, start, length);
String string = buf.toString();
if ( string.trim().length() > 0)
{
peek.setValue( string);
}
}
}
| 04900db4-clienttest | src/org/rapla/framework/internal/SAXConfigurationHandler.java | Java | gpl3 | 2,038 |
/*--------------------------------------------------------------------------*
| Copyright (C) 2014 Christopher Kohlhaas |
| |
| 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. A copy of the license has been included with |
| these distribution in the COPYING file, if not go to www.fsf.org |
| |
| As a special exception, you are granted the permissions to link this |
| program with every library, which license fulfills the Open Source |
| Definition as published by the Open Source Initiative (OSI). |
*--------------------------------------------------------------------------*/
package org.rapla.framework.internal;
import java.util.HashMap;
import org.rapla.client.ClientServiceContainer;
import org.rapla.client.internal.RaplaClientServiceImpl;
import org.rapla.components.xmlbundle.I18nBundle;
import org.rapla.components.xmlbundle.impl.I18nBundleImpl;
import org.rapla.facade.ClientFacade;
import org.rapla.facade.internal.FacadeImpl;
import org.rapla.storage.CachableStorageOperator;
import org.rapla.storage.ImportExportManager;
import org.rapla.storage.StorageOperator;
import org.rapla.storage.dbrm.RemoteOperator;
public class RaplaMetaConfigInfo extends HashMap<String,ComponentInfo> {
private static final long serialVersionUID = 1L;
public RaplaMetaConfigInfo() {
put( "rapla-client", new ComponentInfo(RaplaClientServiceImpl.class.getName(),ClientServiceContainer.class.getName()));
put( "resource-bundle",new ComponentInfo(I18nBundleImpl.class.getName(),I18nBundle.class.getName()));
put( "facade",new ComponentInfo(FacadeImpl.class.getName(),ClientFacade.class.getName()));
put( "remote-storage",new ComponentInfo(RemoteOperator.class.getName(),new String[] {StorageOperator.class.getName(), CachableStorageOperator.class.getName()}));
// now the server configurations
put( "rapla-server", new ComponentInfo("org.rapla.server.internal.ServerServiceImpl",new String[]{"org.rapla.server.ServerServiceContainer"}));
put( "file-storage",new ComponentInfo("org.rapla.storage.dbfile.FileOperator",new String[] {StorageOperator.class.getName(), CachableStorageOperator.class.getName()}));
put( "db-storage",new ComponentInfo("org.rapla.storage.dbsql.DBOperator",new String[] {StorageOperator.class.getName(), CachableStorageOperator.class.getName()}));
put( "sql-storage",new ComponentInfo("org.rapla.storage.dbsql.DBOperator",new String[] {StorageOperator.class.getName(), CachableStorageOperator.class.getName()}));
put( "importexport", new ComponentInfo("org.rapla.storage.impl.server.ImportExportManagerImpl",ImportExportManager.class.getName()));
}
}
| 04900db4-clienttest | src/org/rapla/framework/internal/RaplaMetaConfigInfo.java | Java | gpl3 | 3,027 |
package org.rapla.framework;
public class RaplaContextException
extends RaplaException
{
private static final long serialVersionUID = 1L;
public RaplaContextException( final String key ) {
super( "Unable to provide implementation for " + key + " " );
}
public RaplaContextException( final Class<?> clazz, final String message ) {
super("Unable to provide implementation for " + clazz.getName() + " " + message);
}
public RaplaContextException( final String message, final Throwable throwable )
{
super( message, throwable );
}
}
| 04900db4-clienttest | src/org/rapla/framework/RaplaContextException.java | Java | gpl3 | 611 |
package org.rapla.framework;
public interface Provider<T> {
T get();
}
| 04900db4-clienttest | src/org/rapla/framework/Provider.java | Java | gpl3 | 78 |
/* Javadoc style sheet */
/*
Overall document style
*/
body {
background-color:#ffffff;
color:#353833;
font-family:Arial, Helvetica, sans-serif;
font-size:76%;
margin:0;
}
a:link, a:visited {
text-decoration:none;
color:#4c6b87;
}
a:hover, a:focus {
text-decoration:none;
color:#bb7a2a;
}
a:active {
text-decoration:none;
color:#4c6b87;
}
a[name] {
color:#353833;
}
a[name]:hover {
text-decoration:none;
color:#353833;
}
pre {
font-size:1.3em;
}
h1 {
font-size:1.8em;
}
h2 {
font-size:1.5em;
}
h3 {
font-size:1.4em;
}
h4 {
font-size:1.3em;
}
h5 {
font-size:1.2em;
}
h6 {
font-size:1.1em;
}
ul {
list-style-type:disc;
}
code, tt {
font-size:1.2em;
}
dt code {
font-size:1.2em;
}
table tr td dt code {
font-size:1.2em;
vertical-align:top;
}
sup {
font-size:.6em;
}
/*
Document title and Copyright styles
*/
.clear {
clear:both;
height:0px;
overflow:hidden;
}
.aboutLanguage {
float:right;
padding:0px 21px;
font-size:.8em;
z-index:200;
margin-top:-7px;
}
.legalCopy {
margin-left:.5em;
}
.bar a, .bar a:link, .bar a:visited, .bar a:active {
color:#FFFFFF;
text-decoration:none;
}
.bar a:hover, .bar a:focus {
color:#bb7a2a;
}
.tab {
background-color:#0066FF;
background-image:url(resources/titlebar.gif);
background-position:left top;
background-repeat:no-repeat;
color:#ffffff;
padding:8px;
width:5em;
font-weight:bold;
}
/*
Navigation bar styles
*/
.bar {
background-image:url(resources/background.gif);
background-repeat:repeat-x;
color:#FFFFFF;
padding:.8em .5em .4em .8em;
height:auto;/*height:1.8em;*/
font-size:1em;
margin:0;
}
.topNav {
background-image:url(resources/background.gif);
background-repeat:repeat-x;
color:#FFFFFF;
float:left;
padding:0;
width:100%;
clear:right;
height:2.8em;
padding-top:10px;
overflow:hidden;
}
.bottomNav {
margin-top:10px;
background-image:url(resources/background.gif);
background-repeat:repeat-x;
color:#FFFFFF;
float:left;
padding:0;
width:100%;
clear:right;
height:2.8em;
padding-top:10px;
overflow:hidden;
}
.subNav {
background-color:#dee3e9;
border-bottom:1px solid #9eadc0;
float:left;
width:100%;
overflow:hidden;
}
.subNav div {
clear:left;
float:left;
padding:0 0 5px 6px;
}
ul.navList, ul.subNavList {
float:left;
margin:0 25px 0 0;
padding:0;
}
ul.navList li{
list-style:none;
float:left;
padding:3px 6px;
}
ul.subNavList li{
list-style:none;
float:left;
font-size:90%;
}
.topNav a:link, .topNav a:active, .topNav a:visited, .bottomNav a:link, .bottomNav a:active, .bottomNav a:visited {
color:#FFFFFF;
text-decoration:none;
}
.topNav a:hover, .bottomNav a:hover {
text-decoration:none;
color:#bb7a2a;
}
.navBarCell1Rev {
background-image:url(resources/tab.gif);
background-color:#a88834;
color:#FFFFFF;
margin: auto 5px;
border:1px solid #c9aa44;
}
/*
Page header and footer styles
*/
.header, .footer {
clear:both;
margin:0 20px;
padding:5px 0 0 0;
}
.indexHeader {
margin:10px;
position:relative;
}
.indexHeader h1 {
font-size:1.3em;
}
.title {
color:#2c4557;
margin:10px 0;
}
.subTitle {
margin:5px 0 0 0;
}
.header ul {
margin:0 0 25px 0;
padding:0;
}
.footer ul {
margin:20px 0 5px 0;
}
.header ul li, .footer ul li {
list-style:none;
font-size:1.2em;
}
/*
Heading styles
*/
div.details ul.blockList ul.blockList ul.blockList li.blockList h4, div.details ul.blockList ul.blockList ul.blockListLast li.blockList h4 {
background-color:#dee3e9;
border-top:1px solid #9eadc0;
border-bottom:1px solid #9eadc0;
margin:0 0 6px -8px;
padding:2px 5px;
}
ul.blockList ul.blockList ul.blockList li.blockList h3 {
background-color:#dee3e9;
border-top:1px solid #9eadc0;
border-bottom:1px solid #9eadc0;
margin:0 0 6px -8px;
padding:2px 5px;
}
ul.blockList ul.blockList li.blockList h3 {
padding:0;
margin:15px 0;
}
ul.blockList li.blockList h2 {
padding:0px 0 20px 0;
}
/*
Page layout container styles
*/
.contentContainer, .sourceContainer, .classUseContainer, .serializedFormContainer, .constantValuesContainer {
clear:both;
padding:10px 20px;
position:relative;
}
.indexContainer {
margin:10px;
position:relative;
font-size:1.0em;
}
.indexContainer h2 {
font-size:1.1em;
padding:0 0 3px 0;
}
.indexContainer ul {
margin:0;
padding:0;
}
.indexContainer ul li {
list-style:none;
}
.contentContainer .description dl dt, .contentContainer .details dl dt, .serializedFormContainer dl dt {
font-size:1.1em;
font-weight:bold;
margin:10px 0 0 0;
color:#4E4E4E;
}
.contentContainer .description dl dd, .contentContainer .details dl dd, .serializedFormContainer dl dd {
margin:10px 0 10px 20px;
}
.serializedFormContainer dl.nameValue dt {
margin-left:1px;
font-size:1.1em;
display:inline;
font-weight:bold;
}
.serializedFormContainer dl.nameValue dd {
margin:0 0 0 1px;
font-size:1.1em;
display:inline;
}
/*
List styles
*/
ul.horizontal li {
display:inline;
font-size:0.9em;
}
ul.inheritance {
margin:0;
padding:0;
}
ul.inheritance li {
display:inline;
list-style:none;
}
ul.inheritance li ul.inheritance {
margin-left:15px;
padding-left:15px;
padding-top:1px;
}
ul.blockList, ul.blockListLast {
margin:10px 0 10px 0;
padding:0;
}
ul.blockList li.blockList, ul.blockListLast li.blockList {
list-style:none;
margin-bottom:25px;
}
ul.blockList ul.blockList li.blockList, ul.blockList ul.blockListLast li.blockList {
padding:0px 20px 5px 10px;
border:1px solid #9eadc0;
background-color:#f9f9f9;
}
ul.blockList ul.blockList ul.blockList li.blockList, ul.blockList ul.blockList ul.blockListLast li.blockList {
padding:0 0 5px 8px;
background-color:#ffffff;
border:1px solid #9eadc0;
border-top:none;
}
ul.blockList ul.blockList ul.blockList ul.blockList li.blockList {
margin-left:0;
padding-left:0;
padding-bottom:15px;
border:none;
border-bottom:1px solid #9eadc0;
}
ul.blockList ul.blockList ul.blockList ul.blockList li.blockListLast {
list-style:none;
border-bottom:none;
padding-bottom:0;
}
table tr td dl, table tr td dl dt, table tr td dl dd {
margin-top:0;
margin-bottom:1px;
}
/*
Table styles
*/
.contentContainer table, .classUseContainer table, .constantValuesContainer table {
border-bottom:1px solid #9eadc0;
width:100%;
}
.contentContainer ul li table, .classUseContainer ul li table, .constantValuesContainer ul li table {
width:100%;
}
.contentContainer .description table, .contentContainer .details table {
border-bottom:none;
}
.contentContainer ul li table th.colOne, .contentContainer ul li table th.colFirst, .contentContainer ul li table th.colLast, .classUseContainer ul li table th, .constantValuesContainer ul li table th, .contentContainer ul li table td.colOne, .contentContainer ul li table td.colFirst, .contentContainer ul li table td.colLast, .classUseContainer ul li table td, .constantValuesContainer ul li table td{
vertical-align:top;
padding-right:20px;
}
.contentContainer ul li table th.colLast, .classUseContainer ul li table th.colLast,.constantValuesContainer ul li table th.colLast,
.contentContainer ul li table td.colLast, .classUseContainer ul li table td.colLast,.constantValuesContainer ul li table td.colLast,
.contentContainer ul li table th.colOne, .classUseContainer ul li table th.colOne,
.contentContainer ul li table td.colOne, .classUseContainer ul li table td.colOne {
padding-right:3px;
}
.overviewSummary caption, .packageSummary caption, .contentContainer ul.blockList li.blockList caption, .summary caption, .classUseContainer caption, .constantValuesContainer caption {
position:relative;
text-align:left;
background-repeat:no-repeat;
color:#FFFFFF;
font-weight:bold;
clear:none;
overflow:hidden;
padding:0px;
margin:0px;
}
caption a:link, caption a:hover, caption a:active, caption a:visited {
color:#FFFFFF;
}
.overviewSummary caption span, .packageSummary caption span, .contentContainer ul.blockList li.blockList caption span, .summary caption span, .classUseContainer caption span, .constantValuesContainer caption span {
white-space:nowrap;
padding-top:8px;
padding-left:8px;
display:block;
float:left;
background-image:url(resources/titlebar.gif);
height:18px;
}
.overviewSummary .tabEnd, .packageSummary .tabEnd, .contentContainer ul.blockList li.blockList .tabEnd, .summary .tabEnd, .classUseContainer .tabEnd, .constantValuesContainer .tabEnd {
width:10px;
background-image:url(resources/titlebar_end.gif);
background-repeat:no-repeat;
background-position:top right;
position:relative;
float:left;
}
ul.blockList ul.blockList li.blockList table {
margin:0 0 12px 0px;
width:100%;
}
.tableSubHeadingColor {
background-color: #EEEEFF;
}
.altColor {
background-color:#eeeeef;
}
.rowColor {
background-color:#ffffff;
}
.overviewSummary td, .packageSummary td, .contentContainer ul.blockList li.blockList td, .summary td, .classUseContainer td, .constantValuesContainer td {
text-align:left;
padding:3px 3px 3px 7px;
}
th.colFirst, th.colLast, th.colOne, .constantValuesContainer th {
background:#dee3e9;
border-top:1px solid #9eadc0;
border-bottom:1px solid #9eadc0;
text-align:left;
padding:3px 3px 3px 7px;
}
td.colOne a:link, td.colOne a:active, td.colOne a:visited, td.colOne a:hover, td.colFirst a:link, td.colFirst a:active, td.colFirst a:visited, td.colFirst a:hover, td.colLast a:link, td.colLast a:active, td.colLast a:visited, td.colLast a:hover, .constantValuesContainer td a:link, .constantValuesContainer td a:active, .constantValuesContainer td a:visited, .constantValuesContainer td a:hover {
font-weight:bold;
}
td.colFirst, th.colFirst {
border-left:1px solid #9eadc0;
white-space:nowrap;
}
td.colLast, th.colLast {
border-right:1px solid #9eadc0;
}
td.colOne, th.colOne {
border-right:1px solid #9eadc0;
border-left:1px solid #9eadc0;
}
table.overviewSummary {
padding:0px;
margin-left:0px;
}
table.overviewSummary td.colFirst, table.overviewSummary th.colFirst,
table.overviewSummary td.colOne, table.overviewSummary th.colOne {
width:25%;
vertical-align:middle;
}
table.packageSummary td.colFirst, table.overviewSummary th.colFirst {
width:25%;
vertical-align:middle;
}
/*
Content styles
*/
.description pre {
margin-top:0;
}
.deprecatedContent {
margin:0;
padding:10px 0;
}
.docSummary {
padding:0;
}
/*
Formatting effect styles
*/
.sourceLineNo {
color:green;
padding:0 30px 0 0;
}
h1.hidden {
visibility:hidden;
overflow:hidden;
font-size:.9em;
}
.block {
display:block;
margin:3px 0 0 0;
}
.strong {
font-weight:bold;
}
| 04900db4-clienttest | javadoc/stylesheet.css | CSS | gpl3 | 11,613 |
#!/bin/sh
#
# Usage:
#
# for a list of all available build-targets type
# ./build.sh -projecthelp
#
chmod u+x ./bin/antRun
chmod u+x ./bin/ant
export ANT_HOME=.
$PWD/bin/ant -logger org.apache.tools.ant.NoBannerLogger -emacs $@
| 04900db4-clienttest | build.sh | Shell | gpl3 | 234 |
@echo off
:: -------------------------------------------------------------------------
:: build.bat Skript for Rapla
::
::
:: Usage:
:: for a list of all available build-targets type
:: .\build.bat -projecthelp
if not "%ANT_HOME%" =="" goto gotAntHome
set JAVA_HOME=C:\entwicklung\Java\jdk1.7.0_51
set ANT_HOME=.
:gotAntHome
call %ANT_HOME%\bin\ant.bat %1 %2 %3 %4 %5 %6
pause
| 04900db4-clienttest | build.bat | Batchfile | gpl3 | 379 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title></title>
<meta http-equiv="refresh" content="0;URL=rapla">
</head>
<body>
</body>
</html>
| 04900db4-clienttest | war/redirect.html | HTML | gpl3 | 191 |
/* Use this file to customize the Rapla HTML Pages to your style */
body {
font:12px/18px "Lucida Grande","Lucida Sans Unicode",Arial,Verdana,sans-serif;
color: #333333;
}
/* Button Appearance */
.button {
border:none;
cursor:pointer;
display:inline-block;
overflow:visible;
padding:0;
margin:0;
height:29px;
background:url("images/button.gif") right top;
}
.button a, .button input {
font-size: 13px;
font-weight: bold;
font-family: Arial,Helvetica,Helvetica Neue,Verdana,sans-serif;
text-decoration:none;
color: #FFFFFF !important;
cursor:pointer;
outline:none;
overflow:visible;
white-space:nowrap;
border:none;
display:inline-block;
padding: 0 18px;
margin:0 !important;
line-height:29px;
height:29px;
width:auto;
background:url("images/button.gif") no-repeat left top;
}
/* Browser fixes */
.button input::-moz-focus-inner {
padding: 0;
border: none;
}
.menuEntry
{
padding-top:5px;
padding-bottom:5px;
}
/* You can also customize the calendar
.month_table {
background-color: #FFFFAA;
}
*/ | 04900db4-clienttest | war/default.css | CSS | gpl3 | 1,048 |
#calendar * {
font-family: Helvetica,Arial,Verdana,sans-serif;
}
a, a:visited{
color: black;
text-decoration: none;
}
a:hover{
color: black;
background-color: #FFFF88;
}
#calendar a span.tooltip {
display: none;
}
#calendar a span td {
padding: 0px;
font-size: small;
color: black;
}
#calendar a td {
padding: 0px;
font-size: small;
color: black;
}
#legend {
align: center;
border-width: 0px;
}
#legend a span {
display: none;
}
#legend a span td {
padding: 0px;
font-size: small;
color: black;
}
#calendar {
width: 100%;
}
/** calendar tooltip */
#calendar a:hover span.tooltip {
display: block;
bottom: 0.5em;
right: 0.5em;
padding: .5em;
z-index: 1;
font-size: small;
color: black;
background-color: #FFFF88;
/* Doesn't work in IE */
position: fixed;
width: 500px;
border: 2px solid #000000;
}
/* woraround for IE */
#calendar a:hover span.tooltip {
// position: absolute;
}
/** legend tooltip */
#legend a:hover span {
display: block;
bottom: 0.5em;
right: 0.5em;
padding: .5em;
z-index: 1;
font-size: small;
color: black;
background-color: #FFFF88;
/* Doesn't work in IE
position: fixed;
width: auto;
*/
position: absolute;
width: 500px;
border: 2px solid #000000;
}
.title {
text-align:center;
}
.datechooser {
text-align:center;
}
.week_table {
width: 100%;
empty-cells: show;
border-spacing:0px;
border-bottom-width:3px;
border-bottom-style:solid;
border-right-width:1px;
border-right-style:solid;
padding:0px;
border-color:black;
/* workaround for IE */
// border-collapse:collapse;
background-color: #FFFFFF;
}
.week_emptycell_black {
font-size:9px;
margin: 0px;
border-top-style:solid;
border-top-width:1px;
border-left-width:0px;
border-right-width:0px;
padding-left: 0px;
padding-right: 0px;
}
.week_separatorcell_black {
font-size:9px;
border-top-width:1px;
border-top-style:solid;
border-left-width:0px;
border-right-width:1px;
border-right-style:solid;
padding-left: 1px;
border-right-color: #CCCCCC;
}
.week_smallseparatorcell_black {
font-size:9px;
border-left-width:0px;
border-right-width:0px;
border-top-width:1px;
border-top-style:solid;
padding-left: 1px;
padding-right: 1px;
margin-left: 0px;
margin-right: 0px;
}
.week_emptycell {
font-size:9px;
margin: 0px;
border-color:#CCCCCC;
border-top-style:solid;
border-top-width:1px;
border-left-width:0px;
border-right-width:0px;
padding-left: 0px;
padding-right: 0px;
}
.week_emptynolinecell {
margin: 0px;
border-width:0px;
}
.week_separatorcell {
font-size:9px;
border-top-width:1px;
border-color:#CCCCCC;
border-top-style:solid;
border-left-width:0px;
border-right-width:1px;
border-right-style:solid;
padding-left: 1px;
}
.week_separatornolinecell {
margin: 0px;
border-width:0px;
border-color:#CCCCCC;
border-right-width:1px;
border-right-style:solid;
padding-left: 1px;
}
.week_smallseparatorcell {
font-size:9px;
border-color:#CCCCCC;
border-left-width:0px;
border-right-width:0px;
border-top-width:1px;
border-top-style:solid;
padding-left: 1px;
padding-right: 1px;
margin-left: 0px;
margin-right: 0px;
}
.week_smallseparatornolinecell {
margin: 0px;
border-width:0px;
}
.week_header {
background-color: #DDDDDD;
text-align: left;
padding-left: 5px;
padding-right: 5px;
border-right-width:1px;
border-right-style:solid;
border-left-width:1px;
border-left-style:solid;
border-top-width:1px;
border-top-style:solid;
border-bottom-width:1px;
border-bottom-style:solid;
}
.week_number {
font-size: 0.9em;
padding-left: 10px;
padding-right: 10px;
text-align: center;
white-space: nowrap;
border-left-width: 0px;
border-top-width: 0px;
border-right-width: 1px;
border-bottom-width: 1px;
border-style: solid;
}
.week_times {
background-color: #DDDDDD;
text-align:right;
padding-right: 7px;
vertical-align: top;
border-left-width:1px;
border-right-width:1px;
border-top-width:1px;
border-left-style:solid;
border-right-style:solid;
border-top-style:solid;
width:10%;
}
.week_cell {
margin: 0px;
border-color:#CCCCCC;
border-top-style:solid;
border-top-width:1px;
padding: 0px;
padding-bottom: 1px;
}
.week_block {
margin: 0px;
padding-left: 2px;
padding-right: 2px;
padding-top: 0px;
border-left-width:1px;
border-right-width:1px;
border-bottom-width:1px;
border-top-width:1px;
border-left-style:solid;
border-right-style:solid;
border-bottom-style:solid;
border-top-style:solid;
border-radius:5px;
font-size: 9pt;
min-height:100%;
height:100%;
cursor: pointer;
-moz-box-shadow: 0px 1px 4px rgba(0,0,0,.3);
-webkit-box-shadow: 0px 1px 4px rgba(0,0,0,.3);
box-shadow: 0px 1px 4px rgba(0,0,0,.3);
text-shadow: none;
text-decoration: none;
}
.month_table {
width: 100%;
background-color: #FFFFFF;
empty-cells: show;
border-spacing:0px;
/* workaround for IE */
// border-collapse:collapse;
border: 1px;
border-left: 1px solid;
}
.month_header {
background-color: #DDDDDD;
text-align: center;
border-top-width:1px;
border-left-width:0px;
border-right-width:1px;
border-bottom-width:1px;
border-style:solid;
}
.month_cell {
border-width:0px;
border-left-width:0px;
border-right-width:1px;
border-bottom-width:1px;
border-style:solid;
padding:0px;
}
.month_block {
font-size: 8pt;
/*
border:1px;
*/
border-bottom-color: black;
border-bottom-style: solid;
border-bottom-width: 1px;
border-right-color: black;
border-right-style: solid;
border-right-width: 1px;
line-height: 115%;
border-radius:4px;
}
.person {
font-family: Verdana;
font-weight: bold;
}
.resource {
font-size: 10pt;
}
.link {
text-decoration: underline;
}
.eventtable
{
width:100%;
}
@page {
size: auto;
}
@media print {
.datechooser {
display: none;
}
}
| 04900db4-clienttest | war/calendar.css | CSS | gpl3 | 6,232 |
<?php
/**
* 通用控制器类
*
* @package 01CMS
* @subpackage admin
* @author rolong at vip.qq.com
* @version 1.0.0
* @link http://www.01cms.com
*/
class CommonController extends Controller
{
function __construct ()
{
parent::__construct();
}
/**
* 验证码
*
* @access public
*/
function validateCode ()
{
Session::validateCode();
}
}
| 01cms | 01cms/branches/v1.0/www/controller/CommonController.php | PHP | asf20 | 464 |
<?php
/**
* 前台访问控制器类
*
* @package 01CMS
* @subpackage www
* @author rolong at vip.qq.com
* @version 1.0.0
* @link http://www.01cms.com
*/
class DataController extends Controller
{
public $keyWord;
public $templateDir;
function __construct()
{
parent::__construct();
$this->templateDir = ROOT_PATH . '/template/' . $this->Load->var['style'];
}
function test ()
{
//
}
function index ()
{
model("Html")->indexHtml();
}
function category ($id = 0, $start = 0)
{
model("Html")->showCategoryHtml($id, $start);
}
function archive ($id = 0, $start = 0)
{
model("Html")->showArchiveHtml($id, $start);
}
function search ()
{
$query = $this->Load->query('k');
$k = $query['k'];
$k = trim($k);
if (strlen($k) < 3)
{
showInfo('关键词不能少于3字节或2个汉字');
}
$this->keyWord = $k;
$this->table = '@@__archive_archive';
$this->where = "`title` like '%{$k}%' or `desc` like '%{$k}%'";
$this->dealListsControllerMethod = 'highLight';
$this->baseUrl = BOOT_URL . '/search';
$this->action('lists');
}
function highLight ($lists = '')
{
if (is_array($lists))
{
$count = count($lists);
for ($i = 0; $i < $count; $i ++)
{
$lists[$i]->title = str_replace($this->keyWord, '<span>' . $this->keyWord . '</span>', $lists[$i]->title);
$lists[$i]->desc = str_replace($this->keyWord, '<span>' . $this->keyWord . '</span>', $lists[$i]->desc);
}
return $lists;
}
return FALSE;
}
} | 01cms | 01cms/branches/v1.0/www/controller/DataController.php | PHP | asf20 | 1,884 |
<?php
/**
* 前台动态访问首页 - 入口文件
*
* 入口文件须定义以下常量(_PATH后缀表示物理路径,_DIR和_URL表示用于访问的地址):
*
* ROOT_PATH 安装路径
* ROOT_DIR 安装目录
* BOOT_DIR 入口目录
* BOOT_URL 入口地址
* PUBLIC_PATH 公共静态资源路径
* PUBLIC_DIR 公共静态资源目录
* APP_PATH 定义APP路径
* SYS_PATH 定义01MVC框架路径
*
* @package 01CMS
* @subpackage www
* @author rolong at vip.qq.com
* @version 1.0.0
* @link http://www.01cms.com
*/
//以下两行可以注释掉
ini_set('display_errors', 'on');
error_reporting(E_ALL);
$_SERVER['PATH_INFO'] = (empty($_SERVER['PATH_INFO']) || trim($_SERVER['PATH_INFO'],'/') == '') ? '/data' : $_SERVER['PATH_INFO'];
$port = ($_SERVER['SERVER_PORT'] == '80') ? '' : ':' . $_SERVER['SERVER_PORT'];
$curUrl = 'http://' . $_SERVER['SERVER_NAME'] . $port . $_SERVER['SCRIPT_NAME'];
define('ROOT_PATH', ereg_replace('[\\/]+', '/', dirname(__FILE__)));
define('APP_PATH', ROOT_PATH . '/www');
define('SYS_PATH', ROOT_PATH . '/01mvc');
define('BOOT_DIR', str_replace('/' . basename($curUrl), '', $curUrl));
define('BOOT_URL', BOOT_DIR . '/io.php');
define('ROOT_DIR', BOOT_DIR);
define('PUBLIC_PATH', ROOT_PATH . '/public');
define('PUBLIC_DIR', BOOT_DIR . '/public');
if (file_exists(ROOT_PATH . '/install/install.txt'))
{
header('location:' . ROOT_DIR . '/install');
}
//启动...
require SYS_PATH . '/boot.php';
//END
| 01cms | 01cms/branches/v1.0/index.php | PHP | asf20 | 1,558 |
<?php
/**
* 前台动态访问首页 - 入口文件
*
* 入口文件须定义以下常量(_PATH后缀表示物理路径,_DIR和_URL表示用于访问的地址):
*
* ROOT_PATH 安装路径
* ROOT_DIR 安装目录
* BOOT_DIR 入口目录
* BOOT_URL 入口地址
* PUBLIC_PATH 公共静态资源路径
* PUBLIC_DIR 公共静态资源目录
* APP_PATH 定义APP路径
* SYS_PATH 定义01MVC框架路径
*
* @package 01CMS
* @subpackage www
* @author rolong at vip.qq.com
* @version 1.0.0
* @link http://www.01cms.com
*/
//以下两行可以注释掉
ini_set('display_errors', 'on');
error_reporting(E_ALL);
$_SERVER['PATH_INFO'] = (empty($_SERVER['PATH_INFO']) || trim($_SERVER['PATH_INFO'],'/') == '') ? '/data' : $_SERVER['PATH_INFO'];
$port = ($_SERVER['SERVER_PORT'] == '80') ? '' : ':' . $_SERVER['SERVER_PORT'];
$curUrl = 'http://' . $_SERVER['SERVER_NAME'] . $port . $_SERVER['SCRIPT_NAME'];
define('ROOT_PATH', ereg_replace('[\\/]+', '/', dirname(__FILE__)));
define('APP_PATH', ROOT_PATH . '/www');
define('SYS_PATH', ROOT_PATH . '/01mvc');
define('BOOT_DIR', str_replace('/' . basename($curUrl), '', $curUrl));
define('BOOT_URL', $curUrl);
define('ROOT_DIR', BOOT_DIR);
define('PUBLIC_PATH', ROOT_PATH . '/public');
define('PUBLIC_DIR', BOOT_DIR . '/public');
//启动...
require SYS_PATH . '/boot.php';
//END | 01cms | 01cms/branches/v1.0/io.php | PHP | asf20 | 1,431 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>{:$i->title}</title>
<link href="{:$smarty.const.PUBLIC_DIR}/common/style/admin.css" rel="stylesheet" type="text/css" />
<style type="text/css">
th {text-align:right; width:75px;}
td {text-align:left;}
</style>
</head>
<body>
<div class="wrapper">
<div class="title shadow titleBg">
<table width="100%" border="0" cellspacing="1">
<tr>
<td><h1> {:$i->title} => {:if $i->p[0] eq "mod"}修改{:elseif $i->p[0] eq "add"}添加{:/if} </h1></td>
</tr>
</table>
</div>
<div class="content shadow">
<form>
<table width="100%" border="0" cellspacing="1">
<tr>
<th nowrap="nowrap">广告名称:</th>
<td><input name="name" type="text" id="name" value="{:$i->data->name}" size="30" class="posted check" /></td>
</tr>
<tr>
<th nowrap="nowrap">广告期限:</th>
<td>
<select name="exp" id="exp" onchange="if(this.value == 1)$('#timeArea').show();else $('#timeArea').hide();" class="posted"><option value="0" {:if $i->data->exp == 0}selected="selected"{:/if}>永久有效</option><option value="1" {:if $i->data->exp == 1}selected="selected"{:/if}>设定时间</option></select>
<span id="timeArea"{:if $i->data->exp == 0} class="hidden"{:/if}>
<input value="{:$smarty.now|date_format:'%Y-%m-%d'} 00:00:00" name="startTime" id="startTime" size="18" class="posted" /> →
<input value="{:$smarty.now|date_format:'%Y-%m-%d'} 23:59:59" name="endTime" id="endTime" size="18" class="posted" />
</span>
</td>
</tr>
<tr>
<th nowrap="nowrap">广告代码:</th>
<td><textarea name="code" rows="5" id="code" class="posted check">{:$i->data->code}</textarea></td>
</tr>
<tr>
<th nowrap="nowrap">过期内容:</th>
<td><textarea name="expContent" rows="2" id="expContent" class="posted">{:$i->data->expContent}</textarea></td>
</tr>
<tr>
<th nowrap="nowrap"> </th>
<td>
<input type="submit" value=" 提 交 " />
<input type="reset" onclick="history.go(-1);" value=" 返 回 " /> </td>
</tr>
</table>
</form>
</div>
</div>
<link href="{:$smarty.const.PUBLIC_DIR}/common/style/ui.all.css" rel="stylesheet" type="text/css" />
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/jquery-1.4.2.min.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/jquery.tools.min.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.core.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.draggable.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.dialog.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.datepicker.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/jquery.post.js"></script>
<script language="javascript" type="text/javascript">
$(document).ready(function(){
$(".helpTip").tooltip().dynamic();
$("form").post({
sendUrl:'{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/{:if $i->p[0] eq "mod"}update/{:$i->p[1]}{:elseif $i->p[0] eq "add"}insert{:/if}',
goUrl:'{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/lists'
});
$("#startTime").datepicker({ dateFormat: 'yy-mm-dd', minDate: '+0', changeMonth: true, changeYear: true,onSelect: function(dateText) { this.value += ' 00:00:00' }});
$("#endTime").datepicker({ dateFormat: 'yy-mm-dd' , minDate: '+0', changeMonth: true, changeYear: true,onSelect: function(dateText) { this.value += ' 23:59:59' } });
});
</script>
</body>
</html>
| 01cms | 01cms/branches/v1.0/01cms/view/App/adMod.tpl | Smarty | asf20 | 4,243 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>{:$i->title}</title>
<link href="{:$smarty.const.PUBLIC_DIR}/common/style/admin.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div class="wrapper">
<div class="title shadow titleBg">
<table width="100%" border="0" cellspacing="1">
<tr>
<td><h1> {:$i->title} <span>[<a href="{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/add/0/{:$i->categoryId}/{:$i->channelId}">添加</a>]</span></h1></td>
</tr>
</table>
</div>
<div class="title shadow">
<table width="100%" border="0" cellspacing="1">
<tr>
<td><form action="{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/lists/" method="get">
ID:<input class="keyWord" name="id" type="text" value="{:$i->keyWord.id}" size="8" />
名称:<input class="keyWord" name="name" type="text" value="{:$i->keyWord.name}" size="20" />
<input name="" value="搜 索" type="submit" />
<input name="" type="reset" value="清 除" onclick="$('.keyWord').each(function(){this.value = '';});return false;" />
<input name="" type="reset" value="全 部" onclick="window.location.href='{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/lists/';return false;" />
</form></td>
</tr>
</table>
</div>
<div class="content shadow">
<table width="100%" border="0" cellspacing="1">
<tr class="titleBg">
<th scope="col">#ID</th>
<th scope="col" width="40">选择</th>
<th class="textL" scope="col">广告名称</th>
<th scope="col">有效时间</th>
<th scope="col">操作</th>
</tr>
{:foreach item=item from=$i->lists}<tr>
<td>{:$item->id}</td>
<td><input name="sel[]" type="checkbox" value="{:$item->id}" class="noBorder" /></td>
<td class="textL"><a href="{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/mod/{:$item->id}">{:$item->name}</a></td>
<td>{:if $item->exp}{:$item->startTime|date_format:"%Y-%m-%d %H:%M"} - {:$item->endTime|date_format:"%Y-%m-%d %H:%M"}{:else}永久有效{:/if}</td>
<td>
<a href="{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/mod/{:$item->id}">修改</a>
| <a onclick="del({:$item->id});return false;" href="#@">删除</a></td>
</tr>{:/foreach}
<tr>
<td colspan="5" class="lightGreyBg textL"> <a href="#@" onclick="selAll('sel[]');">全选</a> | <a href="#@" onclick="selAnti('sel[]');">反选</a> | <a href="#@" onclick="del(0,'sel[]');">删除</a> | <a href="#@" onclick="updateHtml(-1);">更新</a> | {:$i->pagesCode}</td>
</tr>
</table>
</div>
</div>
<link href="{:$smarty.const.PUBLIC_DIR}/common/style/tooltip.css" rel="stylesheet" type="text/css" />
<link href="{:$smarty.const.PUBLIC_DIR}/common/style/ui.all.css" rel="stylesheet" type="text/css" />
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/jquery.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.core.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.draggable.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.resizable.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.dialog.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/jquery.tooltip.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/common.js"></script>
<script language="javascript" type="text/javascript">
function updateHtml(id)
{
if(id == -1)
{
id = getSel('sel[]');
if(id == '')
{
alert('您还没有选中要更新的记录');
return false;
}
}
getDialog('{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/updateHtml/'+id);
}
function del(id, name)
{
var ids='';
if(name != undefined)
{
$("input:checked[name='"+name+"']").each(function(i){
ids+=this.value+',';
});
ids = ids.substr(0,ids.length-1);
}
else if(id > 0)
{
ids = id;
}
if(ids.length==0)
{
alert('您还没有选中要删除的记录');
return false;
}
if(confirm('确定要删除ID为'+ids+'的记录?'))
{
getDialog('{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/del/'+ids, '{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/lists/0/{:$i->p[2]}/{:$i->p[3]}');
}
return false;
}
</script>
</body>
</html>
| 01cms | 01cms/branches/v1.0/01cms/view/App/ad.tpl | Smarty | asf20 | 4,827 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>{:$i->title}</title>
<link href="{:$smarty.const.PUBLIC_DIR}/common/style/admin.css" rel="stylesheet" type="text/css" />
<style type="text/css">
th {text-align:right; width:75px;}
td {text-align:left;}
</style>
</head>
<body>
<div class="wrapper">
<div class="title shadow titleBg">
<table width="100%" border="0" cellspacing="1">
<tr>
<td><h1> {:$i->title} => {:if $i->p[0] eq "mod"}修改{:elseif $i->p[0] eq "add"}添加{:/if} </h1></td>
</tr>
</table>
</div>
<div class="content shadow">
<form>
<table width="100%" border="0" cellspacing="1">
<tr>
<th nowrap="nowrap">广告名称:</th>
<td><input name="name" type="text" id="name" value="" size="30" class="posted check" /></td>
</tr>
<tr>
<th nowrap="nowrap">广告期限:</th>
<td>
<select name="exp" id="exp" onchange="if(this.value == 1)$('#timeArea').show();else $('#timeArea').hide();"><option value="0" selected="selected">永久有效</option><option value="1">设定时间</option></select>
<span id="timeArea" class="hidden">
<input value="{:$smarty.now|date_format:'%Y-%m-%d'} 00:00:00" name="startTime" id="startTime" size="18" /> →
<input value="{:$smarty.now|date_format:'%Y-%m-%d'} 23:59:59" name="endTime" id="endTime" size="18" />
</span>
</td>
</tr>
<tr>
<th nowrap="nowrap">广告代码:</th>
<td><textarea name="code" rows="5" id="code" class="posted check"></textarea></td>
</tr>
<tr>
<th nowrap="nowrap">过期内容:</th>
<td><textarea name="expContent" rows="2" id="expContent" class="posted"></textarea></td>
</tr>
<tr>
<th nowrap="nowrap"> </th>
<td>
<input type="submit" value=" 提 交 " />
<input type="reset" onclick="history.go(-1);" value=" 返 回 " /> </td>
</tr>
</table>
</form>
</div>
</div>
<link href="{:$smarty.const.PUBLIC_DIR}/common/style/ui.all.css" rel="stylesheet" type="text/css" />
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/jquery-1.4.2.min.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/jquery.tools.min.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.core.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.draggable.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.dialog.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.datepicker.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/jquery.post.js"></script>
<script language="javascript" type="text/javascript">
$(document).ready(function(){
$(".helpTip").tooltip().dynamic();
$("form").post({
sendUrl:'{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/{:if $i->p[0] eq "mod"}update/{:$i->p[1]}{:elseif $i->p[0] eq "add"}insert{:/if}',
goUrl:'{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/lists'
});
$("#startTime").datepicker({ dateFormat: 'yy-mm-dd', minDate: '+0', changeMonth: true, changeYear: true,onSelect: function(dateText) { this.value += ' 00:00:00' }});
$("#endTime").datepicker({ dateFormat: 'yy-mm-dd' , minDate: '+0', changeMonth: true, changeYear: true,onSelect: function(dateText) { this.value += ' 23:59:59' } });
});
</script>
</body>
</html>
| 01cms | 01cms/branches/v1.0/01cms/view/App/adAdd.tpl | Smarty | asf20 | 4,031 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>Welcome to 01CMS ...</title>
</head>
<body>
<h1>Welcome to 01CMS ...</h1>
</body>
</html>
| 01cms | 01cms/branches/v1.0/01cms/view/Index/index.html | HTML | asf20 | 353 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>Welcome to 01CMS ...</title>
</head>
<body>
<h1>Welcome to 01CMS ...</h1>
</body>
</html>
| 01cms | 01cms/branches/v1.0/01cms/view/Index/index.tpl | Smarty | asf20 | 353 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>{:$i->title}</title>
<link href="{:$smarty.const.PUBLIC_DIR}/common/style/admin.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div class="wrapper">
<div class="title shadow titleBg">
<table width="100%" border="0" cellspacing="1">
<tr>
<td><h1> {:$i->title} <span>[<a href="{:$smarty.const.BOOT_URL}/{:$i->c}/revert">还原</a>]</span></h1></td>
</tr>
</table>
</div>
<div class="content shadow">
<form action="{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/backup" method="post" />
<table width="100%" border="0" cellspacing="1">
<tr class="titleBg">
<th scope="col">选择</th>
<th scope="col" class="textL">表名(记录数)</th>
<th scope="col">操作</th>
<th scope="col">选择</th>
<th scope="col" class="textL">表名(记录数)</th>
<th scope="col">操作</th>
</tr>
{:foreach item=item from=$i->tables}<tr>
<td class="left"><input name="selected[]" {:$item.left.checked} type="checkbox" value="{:$item.left.name}" class="noBorder" /></td>
<td class="left" style="text-align:left;">{:$item.left.name}({:$item.left.count})</td>
<td class="left">
<a href="#@" onClick="getDialog('{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/optimize/{:$item.left.name}');">优化</a> |
<a href="#@" onClick="getDialog('{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/repair/{:$item.left.name}');">修复</a> |
<a href="#@" onClick="getDialog('{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/showCreate/{:$item.left.name}','top');">结构</a>
</td>
{:if $item.right.name != ''}
<td class="right"><input name="selected[]" {:$item.right.checked} type="checkbox" value="{:$item.right.name}" class="noBorder" /></td>
<td class="right" style="text-align:left;">{:$item.right.name}({:$item.right.count})</td>
<td class="right">
<a href="#@" onClick="getDialog('{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/optimize/{:$item.right.name}');">优化</a> |
<a href="#@" onClick="getDialog('{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/repair/{:$item.right.name}');">修复</a> |
<a href="#@" onClick="getDialog('{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/showCreate/{:$item.right.name}','top');">结构</a>
</td>
{:else}
<td> </td><td> </td><td> </td>
{:/if}
</tr>{:/foreach}
<tr>
<td colspan="6" class="lightGreyBg textL"> <a href="#@" onclick="return selAll('selected[]');">全选</a> | <a href="#@" onclick="return selAnti('selected[]');">反选</a> | <a href="#@" id="submit" onclick="if(confirm('确定要开始备份所选数据?'))document.forms[0].submit();else return false;">开始备份</a></td>
</tr>
</table>
</form>
</div>
</div>
<link href="{:$smarty.const.PUBLIC_DIR}/common/style/ui.all.css" rel="stylesheet" type="text/css" />
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/jquery.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.core.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.draggable.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.resizable.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.dialog.js"></script>
<script language="javascript" type="text/javascript">
function getDialog(url, position)
{
if(url == undefined) { url = ''; }
if(position == undefined) { position = 'center'; }
if($('.ui-dialog').length > 0)
{
$('.ui-dialog').remove();
}
$('<div class="ui-dialog-message" style="text-align:left;"><span class="ui-dialog-loading"> </span>正在处理,请稍候...</div>').dialog({
title:'提示信息',
resizable : true,
width : "auto",
position : position
});
if(url != '')
{
$.ajax({
type : 'get',
dataType : 'json',
url : url,
success : function(response)
{
$(".ui-dialog-message").html(response.message);
}
});
}
}
function selAll(name)
{
$("input[name='"+name+"']").attr("checked", true);
return false;
}
function selAnti(name)
{
$("input[name='"+name+"']").each(function(i){
this.checked=!this.checked;
});
return false;
}
$(document).ready(function(){
$(".content table .left,.content table .right")
.mouseover(function(){
if($(this).attr('class') == 'left' || $(this).attr('class') == 'left selected')
{
$(this).parent().find(".left").removeClass("selected");
$(this).parent().find(".left").addClass("titleBg");
}
else if($(this).attr('class') == 'right' || $(this).attr('class') == 'right selected')
{
$(this).parent().find(".right").removeClass("selected");
$(this).parent().find(".right").addClass("titleBg");
}
})
.mouseout(function(){
if($(this).attr('class') == 'left titleBg')
{
$(this).parent().find(".left").removeClass("titleBg");
}
else if($(this).attr('class') == 'right titleBg')
{
$(this).parent().find(".right").removeClass("titleBg");
}
})
});
</script>
</body>
</html>
| 01cms | 01cms/branches/v1.0/01cms/view/Database/backup.tpl | Smarty | asf20 | 5,661 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>{:$i->title}</title>
<link href="{:$smarty.const.PUBLIC_DIR}/common/style/admin.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div class="wrapper">
<div class="title shadow titleBg">
<table width="100%" border="0" cellspacing="1">
<tr>
<td><h1> {:$i->title} <span>[<a href="{:$smarty.const.BOOT_URL}/{:$i->c}/backup">备份</a>]</span></h1></td>
</tr>
</table>
</div>
<div class="content shadow">
<form action="{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/revert" method="post" />
<table width="100%" border="0" cellspacing="1">
<tr class="titleBg">
<th scope="col">选择</th>
<th scope="col" class="textL">备份文件</th>
<th scope="col">选择</th>
<th scope="col" class="textL">备份文件</th>
</tr>
{:foreach item=item from=$i->tables}<tr>
<td class="left"><input name="selected[]" {:$item.left.checked} type="checkbox" value="{:$item.left.name}" class="noBorder" /></td>
<td class="left" style="text-align:left;">{:$item.left.name}</td>
{:if $item.right.name != ''}
<td class="right"><input name="selected[]" {:$item.right.checked} type="checkbox" value="{:$item.right.name}" class="noBorder" /></td>
<td class="right" style="text-align:left;">{:$item.right.name}</td>
{:else}
<td> </td><td> </td>
{:/if}
</tr>
{:foreachelse}
<tr>
<td colspan="4">没有找到备份文件</td>
</tr>
{:/foreach}
<tr>
<td colspan="4" class="lightGreyBg textL"> <a href="#@" onclick="return selAll('selected[]');">全选</a> | <a href="#@" onclick="return selAnti('selected[]');">反选</a> | {:if $i->structFile != ''}<input onclick="if(!this.checked)alert('不还原表结构信息可能会导致数据插入时出错(如自增ID重复)');" id="struct" name="struct" {:$i->structChecked} type="checkbox" value="{:$i->structFile}" class="noBorder" /><label for="struct">还原表结构</label> | {:/if}<input id="del" name="del" {:$i->delChecked} type="checkbox" value="1" class="noBorder" /><label for="del">还原后删除备份文件</label> | <a href="#@" id="submit" onclick="if(checked()&&confirm('确定要开始还原所选数据?'))document.forms[0].submit();else return false;">开始还原</a></td>
</tr>
</table>
</form>
</div>
</div>
<link href="{:$smarty.const.PUBLIC_DIR}/common/style/ui.all.css" rel="stylesheet" type="text/css" />
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/jquery.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.core.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.draggable.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.resizable.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.dialog.js"></script>
<script language="javascript" type="text/javascript">
function getDialog(url)
{
if(url == undefined) { url = ''; }
if($('.ui-dialog').length > 0)
{
$('.ui-dialog').remove();
}
$('<div class="ui-dialog-message" style="text-align:left;"><span class="ui-dialog-loading"> </span>正在处理,请稍候...</div>').dialog({
title:'提示信息',
resizable : true,
width : "auto",
position : "top"
});
if(url != '')
{
$.ajax({
type : 'get',
dataType : 'json',
url : url,
success : function(response)
{
$(".ui-dialog-message").html(response.message);
}
});
}
}
function selAll(name)
{
$("input[name='"+name+"']").attr("checked", true);
return false;
}
function selAnti(name)
{
$("input[name='"+name+"']").each(function(i){
this.checked=!this.checked;
});
return false;
}
function checked()
{
var ids='';
$("input:checked[name='selected[]']").each(function(i){
ids+=this.value+',';
});
if(ids.length==0)
{
alert('没有找到备份文件');
return false;
}
return true;
}
$(document).ready(function(){
$(".content table .left,.content table .right")
.mouseover(function(){
if($(this).attr('class') == 'left' || $(this).attr('class') == 'left selected')
{
$(this).parent().find(".left").removeClass("selected");
$(this).parent().find(".left").addClass("titleBg");
}
else if($(this).attr('class') == 'right' || $(this).attr('class') == 'right selected')
{
$(this).parent().find(".right").removeClass("selected");
$(this).parent().find(".right").addClass("titleBg");
}
})
.mouseout(function(){
if($(this).attr('class') == 'left titleBg')
{
$(this).parent().find(".left").removeClass("titleBg");
}
else if($(this).attr('class') == 'right titleBg')
{
$(this).parent().find(".right").removeClass("titleBg");
}
})
});
</script>
</body>
</html>
| 01cms | 01cms/branches/v1.0/01cms/view/Database/revert.tpl | Smarty | asf20 | 5,351 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>{:$i->title}</title>
<link href="{:$smarty.const.PUBLIC_DIR}/common/style/admin.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
th { text-align:right; }
td { text-align:left; }
-->
</style>
</head>
<body>
<div class="wrapper">
<div class="title shadow titleBg">
<table width="100%" border="0" cellspacing="1">
<tr>
<td><h1> {:$i->title} => {:if $i->p[0] eq "mod"}修改{:elseif $i->p[0] eq "add"}
添加{:/if} </h1></td>
</tr>
</table>
</div>
<div class="content shadow">
<form>
<table width="100%" border="0" cellspacing="1">
<tr>
<th width="20%">变量名:</th>
<td width="80%"><input name="name" type="text" id="name" value="{:$i->data->name}" size="20" class="posted check" /> *</td>
</tr>
<tr>
<th width="20%">类 型:</th>
<td width="80%">
<select name="type" id="type" class="posted check">
<option value="1" {:if $i->data->type == 1}selected="selected"{:/if}>数字</option>
<option value="2" {:if $i->data->type == 2}selected="selected"{:/if}>单行字符</option>
<option value="3" {:if $i->data->type == 3}selected="selected"{:/if}>多行字符</option>
</select>
</td>
</tr>
<tr>
<th>变量值:</th>
<td id="valueTd">
{:if $i->data->type == 1}
<input name="value" type="text" id="value" value="{:$i->data->value|htmlspecialchars}" size="60" class="posted check" />
{:elseif $i->data->type == 3}
<textarea name="value" cols="" rows="5" class="posted check">{:$i->data->value|htmlspecialchars}</textarea>
{:else}
<input name="value" type="text" id="value" value="{:$i->data->value|htmlspecialchars}" size="60" class="posted check" />
{:/if} *</td>
</tr>
<tr>
<th width="20%">说 明:</th>
<td width="80%"><input name="info" type="text" id="info" value="{:$i->data->info}" size="60" class="posted" /></td>
</tr>
<tr>
<th> </th>
<td><input type="submit" id="submit" value=" 提 交 " />
<input type="reset" onclick="history.go(-1);" value=" 返 回 " /></td>
</tr>
</table>
</form>
</div>
</div>
<link href="{:$smarty.const.PUBLIC_DIR}/common/style/ui.all.css" rel="stylesheet" type="text/css" />
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/jquery.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.core.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.draggable.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.dialog.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/jquery.post.js"></script>
<script language="javascript" type="text/javascript">
$(document).ready(function(){
$("#type").change(function(){
switch(this.value)
{
case '1':$("#valueTd").html('<input name="value" type="text" id="value" value="{:$i->data->value|htmlspecialchars}" size="8" class="posted check" /> *');break;
case '2':$("#valueTd").html('<input name="value" type="text" id="value" value="{:$i->data->value|htmlspecialchars}" size="60" class="posted check" /> *');break;
case '3':$("#valueTd").html('<textarea name="value" cols="" rows="3" class="posted check">{:$i->data->value|htmlspecialchars}</textarea>');break;
}
});
$("form").post({
sendUrl:'{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/{:if $i->p[0] eq "mod"}update/{:$i->p[1]}{:elseif $i->p[0] eq "add"}insert{:/if}',
goUrl:'{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/lists/-1'
});
});
</script>
</body>
</html>
| 01cms | 01cms/branches/v1.0/01cms/view/Setting/varsMod.tpl | Smarty | asf20 | 4,269 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>{:$i->title}</title>
<link href="{:$smarty.const.PUBLIC_DIR}/common/style/admin.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div class="wrapper">
<div class="title shadow titleBg">
<table width="100%" border="0" cellspacing="1">
<tr>
<td><h1> {:$i->title} <span>[<a href="{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/add">添加</a>]</span></h1></td>
</tr>
</table>
</div>
<div class="content shadow">
<table width="100%" border="0" cellspacing="1">
<tr class="titleBg">
<th scope="col">选择</th>
<th scope="col" class="textL">变量名</th>
<th scope="col" class="textL">变量值</th>
<th scope="col">操作</th>
</tr>
{:foreach item=item from=$i->lists}<tr>
<td><input title="ID:{:$item->id}" name="selected[]" type="checkbox" value="{:$item->id}" class="noBorder" /></td>
<td class="textL">{:$item->name} {:if $item->info}[<a href="#@" class="helpTip" title="{:$item->info}">?</a>]{:/if}</td>
<td class="textL">
{:if $item->type == 1}
<input name="value" type="text" id="value" value="{:$item->value|htmlspecialchars}" size="60" class="posted" readonly="readonly" />
{:elseif $item->type == 3}
<textarea name="value" cols="" rows="3" class="posted" readonly="readonly">{:$item->value|htmlspecialchars}</textarea>
{:else}
<input name="value" type="text" id="value" value="{:$item->value|htmlspecialchars}" size="60" class="posted" readonly="readonly" />
{:/if}</td>
<td><a href="{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/mod/{:$item->id}">修改</a> | <a onclick="return del({:$item->id});" href="#@">删除</a></td>
</tr>{:/foreach}
<tr>
<td colspan="4" class="lightGreyBg textL"> <a href="#@" onclick="return selAll('selected[]');">全选</a> | <a href="#@" onclick="return selAnti('selected[]');">反选</a> | <a href="#@" onclick="return dels('selected[]');">删除</a> | {:$i->pagesCode}</td>
</tr>
</table>
</div>
</div>
<link href="{:$smarty.const.PUBLIC_DIR}/common/style/tooltip.css" rel="stylesheet" type="text/css" />
<link href="{:$smarty.const.PUBLIC_DIR}/common/style/ui.all.css" rel="stylesheet" type="text/css" />
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/jquery.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.core.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.draggable.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.resizable.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.dialog.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/jquery.tooltip.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/common.js"></script>
<script language="javascript" type="text/javascript">
function dels(name)
{
var ids='';
$("input:checked[name='"+name+"']").each(function(i){
ids+=this.value+',';
});
if(ids.length==0)
{
alert('您还没有选中要删除的记录');
return false;
}
ids = ids.substr(0,ids.length-1)
if(confirm('确定要删除ID为'+ids+'的记录?'))
{
getDialog('{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/del/'+ids, '{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/lists/1');
}
return false;
}
function del(id)
{
if(confirm('确定要删除ID为'+id+'的记录?'))
{
getDialog('{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/del/'+id, '{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/lists/-1');
}
return false;
}
$(document).ready(function() {
$(".helpTip").tooltip({cssClass:"tooltip", xOffset:30, opacity:5});
});
</script>
</body>
</html>
| 01cms | 01cms/branches/v1.0/01cms/view/Setting/vars.tpl | Smarty | asf20 | 4,287 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>{:$i->title}</title>
<link href="{:$smarty.const.PUBLIC_DIR}/common/style/admin.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
th {text-align:right;}
td {text-align:left;}
-->
</style>
</head>
<body>
<div class="wrapper">
<div class="title shadow titleBg">
<table width="100%" border="0" cellspacing="1">
<tr>
<td><h1> {:$i->title} => {:if $i->p[0] eq "mod"}修改{:elseif $i->p[0] eq "add"}
添加{:/if} </h1></td>
</tr>
</table>
</div>
<div class="content shadow">
<form>
<table width="100%" border="0" cellspacing="1">
<tr>
<th width="20%">变量名:</th>
<td width="80%">
<input name="name" type="text" id="name" value="" size="20" class="posted check" /> *
</td>
</tr>
<tr>
<th width="20%">类 型:</th>
<td width="80%">
<select name="type" id="type" class="posted check">
<option value="1">数字</option>
<option value="2" selected="selected">单行字符</option>
<option value="3">多行字符</option>
</select>
</td>
</tr>
<tr>
<th>变量值:</th>
<td id="valueTd">
<input name="value" type="text" id="value" value="" size="60" class="posted check" /> *
</td>
</tr>
<tr>
<th width="20%">说 明:</th>
<td width="80%"><input name="info" type="text" id="info" value="" size="60" class="posted" /></td>
</tr>
<tr>
<th> </th>
<td><input type="submit" id="submit" value=" 提 交 " />
<input type="reset" onclick="history.go(-1);" value=" 返 回 " /> </td>
</tr>
</table>
</form>
</div>
</div>
<link href="{:$smarty.const.PUBLIC_DIR}/common/style/ui.all.css" rel="stylesheet" type="text/css" />
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/jquery.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.core.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.draggable.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.dialog.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/jquery.post.js"></script>
<script language="javascript" type="text/javascript">
$(document).ready(function(){
$("#type").change(function(){
switch(this.value)
{
case '1':$("#valueTd").html('<input name="value" type="text" id="value" value="" size="8" class="posted check" /> *');break;
case '2':$("#valueTd").html('<input name="value" type="text" id="value" value="" size="60" class="posted check" /> *');break;
case '3':$("#valueTd").html('<textarea name="value" cols="" rows="3" class="posted check"></textarea>');break;
}
});
$("form").post({
sendUrl:'{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/{:if $i->p[0] eq "mod"}update/{:$i->p[1]}{:elseif $i->p[0] eq "add"}insert{:/if}',
goUrl:'{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/lists/1'
});
});
</script>
</body>
</html>
| 01cms | 01cms/branches/v1.0/01cms/view/Setting/varsAdd.tpl | Smarty | asf20 | 3,641 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>{:$i->title}</title>
<link href="{:$smarty.const.PUBLIC_DIR}/common/style/admin.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
th { text-align:right; }
td { text-align:left; }
-->
</style>
</head>
<body>
<div class="wrapper">
<div class="title shadow titleBg">
<table width="100%" border="0" cellspacing="1">
<tr>
<td><h1> {:$i->title} => {:if $i->p[0] eq "mod"}修改{:elseif $i->p[0] eq "add"}
添加{:/if} </h1></td>
</tr>
</table>
</div>
<div class="content shadow">
<form>
<table width="100%" border="0" cellspacing="1">
<tr>
<th width="20%">用户名:</th>
<td width="80%"><input name="username" type="text" class="posted" /></td>
</tr>
<tr>
<th>密 码:</th>
<td><input name="password" type="password" size="20" class="posted" /></td>
</tr>
<tr>
<th>所属组:</th>
<td><select name="groupId" class="posted">
{:foreach item=item from=$i->groups}
<option value="{:$item->id}">{:$item->name}</option>
{:/foreach}
</select></td>
</tr>
<tr>
<th> </th>
<td><input type="submit" value=" 提 交 " />
<input type="reset" onclick="history.go(-1);" value=" 返 回 " /></td>
</tr>
</table>
</form>
</div>
</div>
<link href="{:$smarty.const.PUBLIC_DIR}/common/style/ui.all.css" rel="stylesheet" type="text/css" />
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/jquery.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.core.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.draggable.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.dialog.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/jquery.post.js"></script>
<script language="javascript" type="text/javascript">
$(document).ready(function(){
$("form").post({
sendUrl:'{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/{:if $i->p[0] eq "mod"}update/{:$i->p[1]}{:elseif $i->p[0] eq "add"}insert{:/if}',
goUrl:'{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/lists'
});
});
</script>
</body>
</html>
| 01cms | 01cms/branches/v1.0/01cms/view/Admin/userAdd.tpl | Smarty | asf20 | 2,821 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>{:$i->title}</title>
<link href="{:$smarty.const.PUBLIC_DIR}/common/style/admin.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
th { text-align:right; }
td { text-align:left; }
-->
</style>
</head>
<body>
<div class="wrapper">
<div class="title shadow titleBg">
<table width="100%" border="0" cellspacing="1">
<tr>
<td><h1> {:$i->title} => {:if $i->p[0] eq "mod"}修改{:elseif $i->p[0] eq "add"}
添加{:/if} </h1></td>
</tr>
</table>
</div>
<div class="content shadow">
<form>
<table width="100%" border="0" cellspacing="1">
<tr>
<th width="20%">排 序:</th>
<td width="80%"><input name="ordering" type="text" id="ordering" value="0" size="5" class="posted" /></td>
</tr>
<tr>
<th>默认状态:</th>
<td><select name="hidden" class="posted">
<option value="1">收起菜单</option>
<option value="0">展开菜单</option>
</select></td>
</tr>
<tr>
<th>模块名称:</th>
<td><input name="title" type="text" size="30" maxlength="20" id="title" class="posted" /></td>
</tr>
<tr>
<th>菜单内容:</th>
<td><textarea name="items" cols="60" rows="5" id="items" class="posted"></textarea></td>
</tr>
<tr>
<th> </th>
<td><input type="submit" id="submit" value=" 提 交 " />
<input type="reset" onclick="history.go(-1);" value=" 返 回 " /></td>
</tr>
</table>
</form>
</div>
</div>
<link href="{:$smarty.const.PUBLIC_DIR}/common/style/ui.all.css" rel="stylesheet" type="text/css" />
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/jquery.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.core.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.draggable.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.dialog.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/jquery.post.js"></script>
<script language="javascript" type="text/javascript">
$(document).ready(function(){
$("form").post({
sendUrl:'{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/{:if $i->p[0] eq "mod"}update/{:$i->p[1]}{:elseif $i->p[0] eq "add"}insert{:/if}',
goUrl:'{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/reload'
});
});
</script>
</body>
</html>
| 01cms | 01cms/branches/v1.0/01cms/view/Admin/menuAdd.tpl | Smarty | asf20 | 2,991 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>网站内容管理系统</title>
</head>
<frameset rows="44,*" cols="*">
<frame src="{:$smarty.const.BOOT_URL}/admin/top" name="top" scrolling="no" frameborder="0" noresize="noresize" />
<frameset cols="170,*">
<frame src="{:$smarty.const.BOOT_URL}/admin/menu" name="menu" scrolling="auto" frameborder="0" noresize="noresize" />
<frame src="{:$smarty.const.BOOT_URL}/admin/body" name="main" scrolling="yes" frameborder="0" noresize="noresize" />
</frameset>
</frameset>
<noframes></noframes>
</html> | 01cms | 01cms/branches/v1.0/01cms/view/Admin/index.tpl | Smarty | asf20 | 773 |
<link href="{:$smarty.const.PUBLIC_DIR}/common/style/admin.css" rel="stylesheet" type="text/css" />
<link href="{:$smarty.const.PUBLIC_DIR}/common/style/common/tooltip.css" rel="stylesheet" type="text/css" />
<link href="{:$smarty.const.PUBLIC_DIR}/common/style/common/boxy.css" rel="stylesheet" type="text/css" />
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/jquery.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/jquery.tooltip.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/jquery.boxy.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/common.js"></script>
| 01cms | 01cms/branches/v1.0/01cms/view/Admin/head.tpl | Smarty | asf20 | 803 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>{:$i->title}</title>
<link href="{:$smarty.const.PUBLIC_DIR}/common/style/admin.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div class="wrapper">
<div class="title shadow titleBg">
<table width="100%" border="0" cellspacing="1">
<tr>
<td><h1> {:$i->title} <span>[<a href="{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/add">添加</a>]</span></h1></td>
</tr>
</table>
</div>
<div class="content shadow">
<table width="100%" border="0" cellspacing="1">
<tr class="titleBg">
<th scope="col">选择</th>
<th scope="col">排序</th>
<th scope="col">分隔线</th>
<th scope="col">权限名称</th>
<th scope="col">权限内容</th>
<th scope="col">操作</th>
</tr>
{:foreach item=item from=$i->lists}<tr>
<td><input name="selected[]" title="ID:{:$item->id}" type="checkbox" value="{:$item->id}" class="noBorder" /></td>
<td>{:$item->ordering}</td>
<td>{:if $item->line}有{:else}无{:/if}</td>
<td>{:$item->name}</td>
<td title="{:$item->auth}" class="helpTip">权限内容</td>
<td><a href="{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/mod/{:$item->id}">修改</a> | <a onclick="return del({:$item->id});" href="#@">删除</a></td>
</tr>{:/foreach}
<tr>
<td colspan="7" class="lightGreyBg textL"> <a href="#@" onclick="return selAll('selected[]');">全选</a> | <a href="#@" onclick="return selAnti('selected[]');">反选</a> | <a href="#@" onclick="return dels('selected[]');">删除</a> | {:$i->pagesCode}</td>
</tr>
</table>
</div>
</div>
<link href="{:$smarty.const.PUBLIC_DIR}/common/style/tooltip.css" rel="stylesheet" type="text/css" />
<link href="{:$smarty.const.PUBLIC_DIR}/common/style/ui.all.css" rel="stylesheet" type="text/css" />
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/jquery.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.core.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.draggable.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.resizable.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.dialog.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/jquery.tooltip.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/common.js"></script>
<script language="javascript" type="text/javascript">
function dels(name)
{
var ids='';
$("input:checked[name='"+name+"']").each(function(i){
ids+=this.value+',';
});
if(ids.length==0)
{
alert('您还没有选中要删除的记录');
return false;
}
ids = ids.substr(0,ids.length-1)
if(confirm('确定要删除ID为'+ids+'的记录吗?'))
{
getDialog('{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/del/'+ids, '{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/lists');
}
return false;
}
function del(id)
{
if(confirm('确定要删除?'))
{
getDialog('{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/del/'+id, '{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/lists');
}
return false;
}
$(document).ready(function() {
$(".helpTip").tooltip({cssClass:"tooltip", xOffset:30, opacity:5});
});
</script>
</body>
</html>
| 01cms | 01cms/branches/v1.0/01cms/view/Admin/auth.tpl | Smarty | asf20 | 3,843 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>{:$i->title}</title>
<link href="{:$smarty.const.PUBLIC_DIR}/common/style/admin.css" rel="stylesheet" type="text/css" />
<style type="text/css">
th {text-align:right;}
td {text-align:left;}
</style>
</head>
<body>
<div class="wrapper">
<div class="title shadow titleBg">
<table width="100%" border="0" cellspacing="1">
<tr>
<td><h1> {:$i->title} => {:if $i->p[0] eq "mod"}修改{:elseif $i->p[0] eq "add"}
添加{:/if} </h1></td>
</tr>
</table>
</div>
<div class="content shadow">
<form>
<table width="100%" border="0" cellspacing="1">
<tr>
<th width="20%">排 序:</th>
<td width="80%"><input name="ordering" type="text" id="ordering" value="0" size="5" class="posted" /></td>
</tr>
<tr>
<th>权限名称:</th>
<td><input name="name" type="text" id="name" value="" size="20" maxlength="20" class="posted" /></td>
</tr>
<tr>
<th>分隔线条:</th>
<td><select name="line" class="posted">
<option value="1">有</option>
<option value="0">无</option>
</select></td>
</tr>
<tr>
<th>权限内容:</th>
<td><input name="auth" type="text" size="60" value="" class="posted" /></td>
</tr>
<tr>
<th> </th>
<td><input type="submit" value=" 提 交 " />
<input type="reset" onclick="history.go(-1);" value=" 返 回 " /> </td>
</tr>
</table>
</form>
</div>
</div>
<link href="{:$smarty.const.PUBLIC_DIR}/common/style/ui.all.css" rel="stylesheet" type="text/css" />
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/jquery.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.core.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.draggable.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.dialog.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/jquery.post.js"></script>
<script language="javascript" type="text/javascript">
$(document).ready(function(){
$("form").post({
sendUrl:'{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/{:if $i->p[0] eq "mod"}update/{:$i->p[1]}{:elseif $i->p[0] eq "add"}insert{:/if}',
goUrl:'{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/lists'
});
});
</script>
</body>
</html>
| 01cms | 01cms/branches/v1.0/01cms/view/Admin/authAdd.tpl | Smarty | asf20 | 2,953 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>登陆 - 01CMS网站内容管理系统</title>
<style type="text/css">
body { margin:0; font-size:14px; background:#fff; padding:0; margin:0; }
input { border:1px solid #ccc; }
img { border:none; }
.header { border-bottom:1px solid #333; background:#eee; }
.logo { padding:9px 15px 7px; }
.login { padding:20px; }
.input { border:none; border-bottom:1px solid #ccc; }
.hidden { display:none; }
#validateImage { cursor:pointer; }
</style>
</head>
<body>
<div class="wrapper">
<div class="header">
<div class="logo"> <a href="http://www.01cms.com" target="_blank"><img src="{:$smarty.const.PUBLIC_DIR}/common/image/logo.gif" alt="01CMS" /></a> </div>
</div>
<!--/header-->
<div class="login">
<form>
用户名:
<input name="username" type="text" size="12" maxlength="20" class="input posted" />
密码:
<input name="password" type="password" size="12" maxlength="20" class="input posted" />
验证码:
<input name="validateCode" type="text" size="6" maxlength="6" class="input posted" />
<img name="" align="absmiddle" id="validateImage" src="{:$smarty.const.BOOT_URL}/common/validateCode" alt="点击重新获取验证码!" onclick="setValidateCode();" />
<input type="submit" class="submit" value=" 登 陆 " />
</form>
</div>
</div>
<link href="{:$smarty.const.PUBLIC_DIR}/common/style/ui.all.css" rel="stylesheet" type="text/css" />
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/jquery.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.core.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.draggable.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.dialog.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/jquery.post.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/common.js"></script>
<script language="javascript" type="text/javascript">
$(document).ready(function(){
$("form").post({
sendUrl:"{:$smarty.const.BOOT_URL}/admin/login/check",
trueJs:"redirect('{:$i->url}');",
falseJs:"setValidateCode();"
});
});
function setValidateCode()
{
$("#validateImage").attr('src','{:$smarty.const.BOOT_URL}/common/validateCode/'+Math.ceil(Math.random()*1000));
}
</script>
</body>
</html>
| 01cms | 01cms/branches/v1.0/01cms/view/Admin/login.tpl | Smarty | asf20 | 2,834 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>{:$i->title}</title>
<link href="{:$smarty.const.PUBLIC_DIR}/common/style/admin.css" rel="stylesheet" type="text/css" />
<style type="text/css">
th {text-align:right;}
td {text-align:left;}
</style>
</head>
<body>
<div class="wrapper">
<div class="title shadow titleBg">
<table width="100%" border="0" cellspacing="1">
<tr>
<td><h1> {:$i->title} => {:if $i->p[0] eq "mod"}修改{:elseif $i->p[0] eq "add"}
添加{:/if} </h1></td>
</tr>
</table>
</div>
<div class="content shadow">
<form>
<table width="100%" border="0" cellspacing="1">
<tr>
<th width="20%">排 序:</th>
<td width="80%"><input name="ordering" type="text" id="ordering" value="{:$i->data->ordering}" size="5" class="posted" /></td>
</tr>
<tr>
<th>权限名称:</th>
<td><input name="name" type="text" id="name" value="{:$i->data->name}" size="20" maxlength="20" class="posted" /></td>
</tr>
<tr>
<th>分隔线条:</th>
<td><select name="line" class="posted">
<option value="1" {:if $i->data->line}selected="selected"{:/if}>有</option>
<option value="0" {:if ! $i->data->line}selected="selected"{:/if}>无</option>
</select></td>
</tr>
<tr>
<th>权限内容:</th>
<td><input name="auth" type="text" size="60" value="{:$i->data->auth}" class="posted" /></td>
</tr>
<tr>
<th> </th>
<td><input type="submit" value=" 提 交 " />
<input type="reset" onclick="history.go(-1);" value=" 返 回 " /> </td>
</tr>
</table>
</form>
</div>
</div>
<link href="{:$smarty.const.PUBLIC_DIR}/common/style/ui.all.css" rel="stylesheet" type="text/css" />
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/jquery.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.core.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.draggable.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.dialog.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/jquery.post.js"></script>
<script language="javascript" type="text/javascript">
$(document).ready(function(){
$("form").post({
sendUrl:'{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/{:if $i->p[0] eq "mod"}update/{:$i->p[1]}{:elseif $i->p[0] eq "add"}insert{:/if}',
goUrl:'{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/lists'
});
});
</script>
</body>
</html> | 01cms | 01cms/branches/v1.0/01cms/view/Admin/authMod.tpl | Smarty | asf20 | 3,099 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style type="text/css">
body{font-size:12px;color:#000;font-family:Verdana;margin:0;}
a:link,a:visited{text-decoration:none;color:#000;}
a:hover,a:active{text-decoration:underline;color:#000;}
.wrapper{border-bottom:1px solid #333;background:#eee url({:$smarty.const.PUBLIC_DIR}/common/image/ui-bg_glass_75_e6e6e6_1x400.png) 50% 56%;}
.clear{clear:both;}
.logo{float:left;padding:9px 15px 7px;}
.menu{float:right;}
.menu div{margin:0;padding:15px 13px 0 0;}
.menu li{list-style:none;display:inline;margin:0;padding:2px; }
</style>
</head>
<body>
<div class="wrapper">
<div class="menu">
<div>
<li>{:$i->User->username},欢迎登陆!</li>
<li><a href="{:$smarty.const.BOOT_URL}/admin/logout" onclick="return confirm('确定要退出系统?');" target="_top">退出系统</a></li>
<li><a href="{:$smarty.const.BOOT_URL}/admin/body" target="main">系统主页</a></li>
<li><a href="{:$smarty.const.ROOT_DIR}" target="_blank">网站首页</a></li>
<li><a href="http://www.01cms.com/help.html" target="_blank">帮助文档</a></li>
</div>
</div>
<div class="logo"><img src="{:$smarty.const.PUBLIC_DIR}/common/image/logo.gif" alt="01CMS" /></div>
<div class="clear"></div>
</div>
</body>
</html>
| 01cms | 01cms/branches/v1.0/01cms/view/Admin/top.tpl | Smarty | asf20 | 1,505 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>{:$i->title}</title>
<link href="{:$smarty.const.PUBLIC_DIR}/common/style/admin.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div class="wrapper">
<div class="title shadow titleBg">
<table width="100%" border="0" cellspacing="1">
<tr>
<td><h1> {:$i->title} <span>[<a href="{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/add">添加</a>]</span></h1></td>
</tr>
</table>
</div>
<div class="content shadow">
<table width="100%" border="0" cellspacing="1">
<tr class="titleBg">
<th scope="col">选择</th>
<th scope="col">用户名</th>
<th scope="col">所属组</th>
<th scope="col">操作</th>
</tr>
{:foreach item=item from=$i->lists}<tr>
<td><input name="selected[]" title="ID:{:$item->id}" type="checkbox" value="{:$item->id}" class="noBorder" /></td>
<td>{:$item->username}</td>
<td>{:$item->groupId|translateId:'groups'}</td>
<td><a href="{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/mod/{:$item->id}">修改</a> | <a onclick="return del({:$item->id});" href="#@">删除</a></td>
</tr>{:/foreach}
<tr>
<td colspan="5" class="lightGreyBg textL"> <a href="#@" onclick="return selAll('selected[]');">全选</a> | <a href="#@" onclick="return selAnti('selected[]');">反选</a> | <a href="#@" onclick="return dels('selected[]');">删除</a> | {:$i->pagesCode}</td>
</tr>
</table>
</div>
</div>
<link href="{:$smarty.const.PUBLIC_DIR}/common/style/ui.all.css" rel="stylesheet" type="text/css" />
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/jquery.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.core.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.draggable.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.resizable.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.dialog.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/common.js"></script>
<script language="javascript" type="text/javascript">
function dels(name)
{
var ids='';
$("input:checked[name='"+name+"']").each(function(i){
ids+=this.value+',';
});
if(ids.length==0)
{
alert('您还没有选中要删除的记录');
return false;
}
ids = ids.substr(0,ids.length-1)
if(confirm('确定要删除ID为'+ids+'的记录吗?'))
{
getDialog('{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/del/'+ids, '{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/lists');
}
return false;
}
function del(id)
{
if(confirm('确定要删除?'))
{
getDialog('{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/del/'+id, '{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/lists');
}
return false;
}
</script>
</body>
</html>
| 01cms | 01cms/branches/v1.0/01cms/view/Admin/user.tpl | Smarty | asf20 | 3,319 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>{:$i->title}</title>
<link href="{:$smarty.const.PUBLIC_DIR}/common/style/admin.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div class="wrapper">
<div class="title shadow titleBg">
<table width="100%" border="0" cellspacing="1">
<tr>
<td><h1> {:$i->title} <span>【<a href="{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/add">添加</a>】[<a href="#" class="helpTip" title="可以拖动〖左栏菜单〗或菜单名称进行排序">?</a>]</span></h1></td>
</tr>
</table>
</div>
<div class="content shadow">
<table width="100%" border="0" cellspacing="1">
<tr class="titleBg">
<th scope="col">选择</th>
<th scope="col">默认状态</th>
<th scope="col">模块名称</th>
<th scope="col">菜单内容</th>
<th scope="col">操作</th>
</tr>
<tbody class="main">
{:foreach item=item from=$i->lists}<tr>
<td title="ID:{:$item->id}"><input name="selected[]" type="checkbox" value="{:$item->id}" class="noBorder" /></td>
<td>{:if $item->hidden}收起{:else}展开{:/if}</td>
<td>{:$item->title}</td>
<td><a href="#@" title="{:$item->items|nl2br}" class="helpTip">点击查看</a></td>
<td><a href="{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/mod/{:$item->id}">修改</a> | <a onclick="return del({:$item->id});" href="#@">删除</a></td>
</tr>{:/foreach}
</tbody>
<tr>
<td colspan="5" class="lightGreyBg textL"> <a href="#@" onclick="return selAll('selected[]');">全选</a> | <a href="#@" onclick="return selAnti('selected[]');">反选</a> | <a href="#@" onclick="return dels('selected[]');">删除</a> | {:$i->pagesCode}</td>
</tr>
</table>
</div>
</div>
<link href="{:$smarty.const.PUBLIC_DIR}/common/style/tooltip.css" rel="stylesheet" type="text/css" />
<link href="{:$smarty.const.PUBLIC_DIR}/common/style/ui.all.css" rel="stylesheet" type="text/css" />
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/jquery.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.core.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.draggable.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.resizable.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.dialog.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.sortable.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/jquery.tooltip.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/common.js"></script>
<script language="javascript" type="text/javascript">
function dels(name)
{
var ids='';
$("input:checked[name='"+name+"']").each(function(i){
ids+=this.value+',';
});
if(ids.length==0)
{
alert('您还没有选中要删除的记录');
return false;
}
ids = ids.substr(0,ids.length-1)
if(confirm('确定要删除ID为'+ids+'的记录?'))
{
getDialog('{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/del/'+ids, '{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/reload');
}
return false;
}
function del(id)
{
if(confirm('确定要删除ID为'+id+'的记录?'))
{
getDialog('{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/del/'+id, '{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/reload');
}
return false;
}
function order()
{
var ids = '';
$(":input").each(function(){
if(ids == '')
{
ids=this.value;
}
else
{
ids+=','+this.value;
}
});
if(confirm('是否要保存排序结果?'))
{
$.get('{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/order/'+ids);
}
return false;
}
$(document).ready(function() {
$(".helpTip").tooltip({cssClass:"tooltip", xOffset:30, opacity:5});
});
$(function() {
$(".main")
.sortable({
connectWith: '.main',
update: function(event, ui) { order(); },
axis: 'y',
cursor: 'move' ,
delay: 100,
opacity: 0.9
});
});
</script>
</body>
</html> | 01cms | 01cms/branches/v1.0/01cms/view/Admin/menu.tpl | Smarty | asf20 | 4,593 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>{:$i->title}</title>
<link href="{:$smarty.const.PUBLIC_DIR}/common/style/admin.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
th { text-align:right; }
td { text-align:left; }
-->
</style>
</head><body>
<div class="wrapper">
<div class="title shadow titleBg">
<table width="100%" border="0" cellspacing="1">
<tr>
<td><h1> {:$i->title} => {:if $i->p[0] eq "mod"}修改{:elseif $i->p[0] eq "add"}
添加{:/if} </h1></td>
</tr>
</table>
</div>
<div class="content shadow">
<form>
<table width="100%" border="0" cellspacing="1">
<tr>
<th width="20%">排 序:</th>
<td width="80%"><input name="ordering" type="text" size="5" id="ordering" value="{:$i->data->ordering}" class="posted" /></td>
</tr>
<tr>
<th>默认状态:</th>
<td><select name="hidden" class="posted">
<option value="1" {:if $i->data->hidden}selected="selected"{:/if}>收起菜单</option>
<option value="0" {:if !$i->data->hidden}selected="selected"{:/if}>展开菜单</option>
</select></td>
</tr>
<tr>
<th>模块名称:</th>
<td><input name="title" type="text" size="30" maxlength="20" id="title" value="{:$i->data->title}" class="posted" /></td>
</tr>
<tr>
<th>菜单内容:</th>
<td><textarea name="items" cols="60" rows="5" id="items" class="posted">{:$i->data->items}</textarea></td>
</tr>
<tr>
<th> </th>
<td><input type="submit" id="submit" value=" 提 交 " />
<input type="reset" onclick="history.go(-1);" value=" 返 回 " /></td>
</tr>
</table>
</form>
</div>
</div>
<link href="{:$smarty.const.PUBLIC_DIR}/common/style/ui.all.css" rel="stylesheet" type="text/css" />
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/jquery.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.core.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.draggable.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.dialog.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/jquery.post.js"></script>
<script language="javascript" type="text/javascript">
$(document).ready(function(){
$("form").post({
sendUrl:'{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/{:if $i->p[0] eq "mod"}update/{:$i->p[1]}{:elseif $i->p[0] eq "add"}insert{:/if}',
goUrl:'{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/reload'
});
});
</script>
</body>
</html> | 01cms | 01cms/branches/v1.0/01cms/view/Admin/menuMod.tpl | Smarty | asf20 | 3,148 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>{:$i->title}</title>
<link href="{:$smarty.const.PUBLIC_DIR}/common/style/admin.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
th { text-align:right; }
td { text-align:left; }
-->
</style>
</head>
<body>
<div class="wrapper">
<div class="title shadow titleBg">
<table width="100%" border="0" cellspacing="1">
<tr>
<td><h1> {:$i->title} => {:if $i->p[0] eq "mod"}修改{:elseif $i->p[0] eq "add"}
添加{:/if} </h1></td>
</tr>
</table>
</div>
<div class="content shadow">
<form>
<table width="100%" border="0" cellspacing="1">
<tr>
<th width="20%">用户名:</th>
<td width="80%"><input name="username" type="text" value="{:$i->data->username}" class="posted" /></td>
</tr>
<tr>
<th>密 码:</th>
<td><input name="password" type="password" size="20" class="posted" /></td>
</tr>
<tr>
<th>所属组:</th>
<td><select name="groupId" class="posted">
{:foreach item=item from=$i->groups}
<option value="{:$item->id}" {:if $i->data->groupId == $item->id}selected="selected"{:/if}>{:$item->name}</option>
{:/foreach}
</select></td>
</tr>
<tr>
<th> </th>
<td><input type="submit" value=" 提 交 " />
<input type="reset" onclick="history.go(-1);" value=" 返 回 " /></td>
</tr>
</table>
</form>
</div>
</div>
<link href="{:$smarty.const.PUBLIC_DIR}/common/style/ui.all.css" rel="stylesheet" type="text/css" />
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/jquery.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.core.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.draggable.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.dialog.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/jquery.post.js"></script>
<script language="javascript" type="text/javascript">
$(document).ready(function(){
$("form").post({
sendUrl:'{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/{:if $i->p[0] eq "mod"}update/{:$i->p[1]}{:elseif $i->p[0] eq "add"}insert{:/if}',
goUrl:'{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/lists'
});
});
</script>
</body>
</html>
| 01cms | 01cms/branches/v1.0/01cms/view/Admin/userMod.tpl | Smarty | asf20 | 2,929 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/jquery.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.core.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.sortable.js"></script>
<style type="text/css">
<!--
html{
scrollbar-face-color:#eee;
scrollbar-highlight-color:#fff;
scrollbar-shadow-color:#fff;
scrollbar-arrow-color:#fff;
scrollbar-base-color:#eee;
scrollbar-3dlight-color :#ccc;
scrollbar-darkshadow-color:#ccc;
scrollbar-track-color: #f9f9f9;
}
body{background:#666;color:#000;font-size:12px;padding:8px 10px;margin:0; font-family:宋体;}
a:link,a:visited{text-decoration:none;color:#000;}
a:hover,a:active{text-decoration:underline;color:#000;}
ul{padding:0;margin:0;}
li{list-style:none; display:block;}
.leftMenu .title{padding:2px 8px;margin:3px 0 1px;cursor:pointer;height:18px;line-height:18px;}
.leftMenu .mainTitle{padding:2px 8px;margin:3px 0 1px;background:#eee;text-align:center; }
.leftMenu .item{margin:0;background:#fff;padding:3px 8px;}
.leftMenu .items{margin:0;background:#fff;padding:3px 0;}
.hidden{display:none; }
.move{ cursor:move; background:#eee url({:$smarty.const.PUBLIC_DIR}/common/image/ui-bg_glass_75_dadada_1x400.png) 50% 50%; }
.hand{ background:#eee url({:$smarty.const.PUBLIC_DIR}/common/image/ui-bg_glass_75_e6e6e6_1x400.png) 50% 50%; }
.ui-sortable-placeholder { border: 1px dotted #eee; margin:3px 0; visibility: visible !important; height: 50px !important; }
.ui-sortable-placeholder * { visibility: hidden; }
-->
</style>
<script language="javascript" type="text/javascript">
function show(key){
$('.item'+key).toggle('fast',function(){
var $str = $('.title'+key).html();
if($str=='+') $('.title'+key).html('- ');
else $('.title'+key).html('+');
});
}
$(function() {
$(".leftMenu")
.sortable({
connectWith: '.leftMenu',
update: function(event, ui) { order(); },
axis: 'y',
cursor: 'move' ,
delay: 100,
handle: '.title',
opacity: 0.7
});
$(".title")
.mousedown(function(){$(this).removeClass("hand");$(this).addClass("move");})
.mouseup(function(){$(this).removeClass("move");$(this).addClass("hand");});
});
function order()
{
var ids = '';
$("li").each(function(i){
if(ids == '')
{
ids=this.id;
}
else
{
ids+=','+this.id;
}
});
if(confirm('是否要保存排序结果?'))
{
$.get('{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/order/'+ids);
}
return false;
}
</script>
</head>
<body>
<ul class="leftMenu">
{:foreach key=key item=items from=$i->menu}
<li id="{:$items.id}">
<div class="title titleBg hand" onclick="show('{:$key}');"><span class="title{:$key}">{:if $items.hidden}+{:else}- {:/if}</span> {:$items.title}</div >
<div class="items item{:$key} {:$items.hidden}">
{:foreach item=item from=$items.items}
<div class="item"><span>·</span> <a href="{:$item[1]}" target="main">{:$item[0]}</a>{:if $item[2] != '' } | <a href="{:$item[3]}" target="main">{:$item[2]}</a>{:/if}</div>
{:/foreach}</div>
</li>
{:/foreach}
</ul>
</body>
</html>
| 01cms | 01cms/branches/v1.0/01cms/view/Admin/menuList.tpl | Smarty | asf20 | 3,515 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>{:$i->title}</title>
<link href="{:$smarty.const.PUBLIC_DIR}/common/style/admin.css" rel="stylesheet" type="text/css" />
<style type="text/css">
ul{padding:2px 0;}
li{color:#333;padding:3px 0;}
li span{font-weight:bold;color:#666; width:200px; }
</style>
</head>
<body>
<div class="wrapper">
<div class="title shadow titleBg">
<table width="100%" border="0" cellspacing="1">
<tr>
<td><h1> 01CMS 网站内容管理系统</h1></td>
</tr>
</table>
</div>
<div class="content shadow textL">
<table width="100%" border="0" cellspacing="1">
<tr class="titleBg">
<th class="textL">
快捷操作
</th>
</tr>
<tr>
<td class="textL">
<ul>
<li><span>添加文档:</span>{:foreach item=item key=key from= $i->channel}【<a href="{:$smarty.const.BOOT_URL}/Archive/archive/add/0/0/{:$key}">{:$item.name}</a>】{:/foreach}</li>
</ul>
</td>
</tr>
</table>
</div>
<div class="content shadow textL">
<table width="100%" border="0" cellspacing="1">
<tr class="titleBg">
<th class="textL">
系统约定
</th>
</tr>
<tr>
<td class="textL">
<ul>
<li><span>1 、</span>提示、说明、帮助等,都以 <a href="#">[?]</a> 出现,鼠标移上去时显示内容。</li>
<li><span>2 、</span>路径、目录、URL等,后面不带斜杠。</li>
</ul>
</td>
</tr>
</table>
</div>
<div class="content shadow textL">
<table width="100%" border="0" cellspacing="1">
<tr class="titleBg">
<th class="textL" width="100">系统常量</th>
<th class="textL">常量值</th>
</tr>
<tr>
<th class="textL">ROOT_DIR</th>
<td class="textL">{:$smarty.const.ROOT_DIR}</td>
</tr>
<tr>
<th class="textL">ROOT_PATH</th>
<td class="textL">{:$smarty.const.ROOT_PATH}</td>
</tr>
<tr>
<th class="textL">SYS_PATH</th>
<td class="textL">{:$smarty.const.SYS_PATH}</td>
</tr>
<tr>
<th class="textL">PUBLIC_DIR</th>
<td class="textL">{:$smarty.const.PUBLIC_DIR}</td>
</tr>
<tr>
<th class="textL">PUBLIC_PATH</th>
<td class="textL">{:$smarty.const.PUBLIC_PATH}</td>
</tr>
<tr>
<th class="textL">BOOT_DIR</th>
<td class="textL">{:$smarty.const.BOOT_DIR}</td>
</tr>
<tr>
<th class="textL">BOOT_URL</th>
<td class="textL">{:$smarty.const.BOOT_URL}</td>
</tr>
<tr>
<th class="textL">APP_PATH</th>
<td class="textL">{:$smarty.const.APP_PATH}</td>
</tr>
</table>
</div>
</div>
</body>
</html> | 01cms | 01cms/branches/v1.0/01cms/view/Admin/body.tpl | Smarty | asf20 | 3,090 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="{:$smarty.const.PUBLIC_DIR}/common/style/admin.css" rel="stylesheet" type="text/css" />
<script language="javascript" type="text/javascript">
window.parent.frames.menu.location.reload();
window.setTimeout(function(){window.location.href='{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/lists';},1000);
</script>
</head>
<body>
<div class="wrapper">
</div>
</body>
</html>
| 01cms | 01cms/branches/v1.0/01cms/view/Admin/menuReload.tpl | Smarty | asf20 | 628 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>{:$i->title}</title>
<link href="{:$smarty.const.PUBLIC_DIR}/common/style/admin.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div class="wrapper">
<div class="title shadow titleBg">
<table width="100%" border="0" cellspacing="1">
<tr>
<td><h1> {:$i->title} <span>[<a href="{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/add">添加</a>]</span></h1></td>
</tr>
</table>
</div>
<div class="content shadow">
<table width="100%" border="0" cellspacing="1">
<tr class="titleBg">
<th width="12%" scope="col">选择</th>
<th width="12%" scope="col">组别名称</th>
<th width="58%" scope="col">拥有权限</th>
<th width="18%" class="center" scope="col">操作</th>
</tr>
{:foreach item=item from=$i->lists}<tr>
<td><input name="selected[]" title="ID:{:$item->id}" type="checkbox" value="{:$item->id}" class="noBorder" /></td>
<td>{:$item->name}</td>
<td><a href="{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/mod/{:$item->id}">点击查看/修改拥有的权限</a></td>
<td class="center"><a onclick="return del({:$item->id});" href="#@">删除</a></td>
</tr>{:/foreach}
<tr>
<td colspan="5" class="lightGreyBg textL"> <a href="#@" onclick="return selAll('selected[]');">全选</a> | <a href="#@" onclick="return selAnti('selected[]');">反选</a> | <a href="#@" onclick="return dels('selected[]');">删除</a> | {:$i->pagesCode}</td>
</tr>
</table>
</div>
</div>
<link href="{:$smarty.const.PUBLIC_DIR}/common/style/ui.all.css" rel="stylesheet" type="text/css" />
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/jquery.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.core.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.draggable.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.resizable.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.dialog.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/common.js"></script>
<script language="javascript" type="text/javascript">
function dels(name)
{
var ids='';
$("input:checked[name='"+name+"']").each(function(i){
ids+=this.value+',';
});
if(ids.length==0)
{
alert('您还没有选中要删除的记录');
return false;
}
ids = ids.substr(0,ids.length-1)
if(confirm('确定要删除ID为'+ids+'的记录吗?'))
{
getDialog('{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/del/'+ids, '{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/lists');
}
return false;
}
function del(id)
{
if(confirm('确定要删除?'))
{
getDialog('{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/del/'+id, '{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/lists');
}
return false;
}
</script>
</body>
</html>
| 01cms | 01cms/branches/v1.0/01cms/view/Admin/group.tpl | Smarty | asf20 | 3,387 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>{:$i->title}</title>
<link href="{:$smarty.const.PUBLIC_DIR}/common/style/admin.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
.listAuth{line-height:22px;}
.listAuth input{border:0;}
.listAuth hr{height:1px; color:#ccc;}
th{text-align:left;}
td{text-align:left;}
-->
</style>
</head>
<body>
<div class="wrapper">
<div class="title shadow titleBg">
<table width="100%" border="0" cellspacing="1">
<tr>
<td><h1> {:$i->title} => {:if $i->p[0] eq "mod"}修改{:elseif $i->p[0] eq "add"}
添加{:/if} </h1></td>
</tr>
</table>
</div>
<div class="content shadow">
<form>
<table width="100%" border="0" cellspacing="1">
<tr>
<th>组别名称:</th>
<td><input name="name" type="text" size="20" maxlength="20" class="posted" /></td>
</tr>
<tr>
<th>拥有权限:<br /></th>
<td class="listAuth">
{:foreach item=item from=$i->auth}
<input id="label{:$item->id}" name="auth[]" class="{:if $item->auth == '**'}all{:else}other{:/if} posted" type="checkbox" value="{:$item->auth}" />
<label for="label{:$item->id}">
{:$item->name}
</label>
{:if $item->line == 1}<hr />{:/if}
{:/foreach}
</td>
</tr>
<tr>
<th> </th>
<td><input type="submit" value=" 提 交 " /> <input type="reset" onclick="history.go(-1);" value=" 返 回 " /> </td>
</tr>
</table>
</form>
</div>
</div>
<link href="{:$smarty.const.PUBLIC_DIR}/common/style/ui.all.css" rel="stylesheet" type="text/css" />
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/jquery.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.core.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.draggable.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.dialog.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/jquery.post.js"></script>
<script language="javascript" type="text/javascript">
$(".all").click(
function () {
if(this.checked){
$("input[class='other posted']").each(function(i){
this.checked=false;
});
}
}
);
$(".other").click(
function () {
if(this.checked){
$("input[class='all posted']").each(function(i){
this.checked=false;
});
}
}
);
$(document).ready(function(){
$("form").post({
sendUrl:'{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/{:if $i->p[0] eq "mod"}update/{:$i->p[1]}{:elseif $i->p[0] eq "add"}insert{:/if}',
goUrl:'{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/lists'
});
});
</script>
</body>
</html>
| 01cms | 01cms/branches/v1.0/01cms/view/Admin/groupAdd.tpl | Smarty | asf20 | 3,091 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>{:$i->title}</title>
<link href="{:$smarty.const.PUBLIC_DIR}/common/style/admin.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
.listAuth{line-height:22px;}
.listAuth input{border:0;}
.listAuth hr{height:1px; color:#ccc;}
th{text-align:right;}
td{text-align:left;}
-->
</style>
</head>
<body>
<div class="wrapper">
<div class="title shadow titleBg">
<table width="100%" border="0" cellspacing="1">
<tr>
<td><h1> {:$i->title} => {:if $i->p[0] eq "mod"}修改{:elseif $i->p[0] eq "add"}
添加{:/if} </h1></td>
</tr>
</table>
</div>
<div class="content shadow">
<form>
<table width="100%" border="0" cellspacing="1">
<tr>
<th>组别名称:</th>
<td><input name="name" type="text" size="20" maxlength="20" value="{:$i->group->name}" class="posted" /></td>
</tr>
<tr>
<th>拥有权限:<br /></th>
<td class="listAuth">
{:foreach item=item from=$i->auth}
<input id="label{:$item->id}" name="auth[]" type="checkbox" value="{:$item->auth}" {:$item->checked} class="{:if $item->auth == '**'}all{:else}other{:/if} posted" />
<label for="label{:$item->id}">
{:$item->name}
</label>
{:if $item->line == 1}<hr />{:/if}
{:/foreach}
</td>
</tr>
<tr>
<th> </th>
<td><input type="submit" value=" 提 交 " /> <input type="reset" onclick="history.go(-1);" value=" 返 回 " /> </td>
</tr>
</table>
</form>
</div>
</div>
<link href="{:$smarty.const.PUBLIC_DIR}/common/style/ui.all.css" rel="stylesheet" type="text/css" />
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/jquery.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.core.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.draggable.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.dialog.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/jquery.post.js"></script>
<script language="javascript" type="text/javascript">
$(".all").click(
function () {
if(this.checked){
$("input[class='other posted']").each(function(i){
this.checked=false;
});
}
}
);
$(".other").click(
function () {
if(this.checked){
$("input[class='all posted']").each(function(i){
this.checked=false;
});
}
}
);
$(document).ready(function(){
$("form").post({
sendUrl:'{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/{:if $i->p[0] eq "mod"}update/{:$i->p[1]}{:elseif $i->p[0] eq "add"}insert{:/if}',
goUrl:'{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/lists'
});
});
</script>
</body>
</html>
| 01cms | 01cms/branches/v1.0/01cms/view/Admin/groupMod.tpl | Smarty | asf20 | 3,137 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>{:$i->title}</title>
<link href="{:$smarty.const.PUBLIC_DIR}/style/admin.css" rel="stylesheet" type="text/css" />
<link href="{:$smarty.const.PUBLIC_DIR}/style/uploadify.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
th { text-align:right; }
td { text-align:left; }
.template { border:none; border-bottom:1px #999 solid; }
.color { color:{:$i->data->color}; cursor:pointer;}
#title {color:{:$i->data->color};{:if $i->data->flag|@strpos:"b" !== false}font-weight:bold;{:/if} }
{:if $i->data->flag && $i->data->flag|@strpos:"j" !== false}.notJ{:else}.j{:/if}{display:none;}
-->
</style>
</head>
<body>
<div class="wrapper">
<div class="title shadow titleBg">
<table width="100%" border="0" cellspacing="1">
<tr>
<td><h1> {:$i->title} => {:if $i->p[0] eq "mod"}修改{:elseif $i->p[0] eq "add"}
添加{:/if} </h1></td>
</tr>
</table>
</div>
<div class="content shadow">
<form id="form1" method="post" action="{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/{:if $i->p[0] eq "mod"}update/{:$i->p[1]}{:elseif $i->p[0] eq "add"}insert/0{:/if}/{:$i->p[2]}/{:$i->p[3]}" target="autoFrame">
<table width="100%" border="0" cellspacing="1">
<tr>
<th width="20%">标 题:</th>
<td width="80%"><input class="inputtitle showcolor" name="title" type="text" size="60" id="title" value="{:$i->data->title|htmlspecialchars}" />
<input name="color" type="text" size="7" id="color" value="{:$i->data->color}" class="color" /></td>
</tr>
<tr>
<th width="20%">属 性:</th>
<td width="80%"><input name='flag[]' type='checkbox' class='noBorder' id='flagsh' value='h' {:php}echo (strpos($this->_tpl_var['i']->data->flag,'h')!==false ? 'checked="checked"' : '');{:/php}>
<label for="flagsh"> 头条[h]</label>
<input class='noBorder' type='checkbox' name='flag[]' id='flagsc' value='c'{:if $i->data->flag|@strpos:"c" !== false} checked="checked"{:/if}>
<label for="flagsc"> 推荐[c]</label>
<input class='noBorder' type='checkbox' name='flag[]' id='flagsp' value='p'{:if $i->data->flag|@strpos:"p" !== false} checked="checked"{:/if}>
<label for="flagsp"> 图文[p]</label>
<input class='noBorder' type='checkbox' name='flag[]' id='flagsf' value='f'{:if $i->data->flag|@strpos:"f" !== false} checked="checked"{:/if}>
<label for="flagsf"> 幻灯[f]</label>
<input class='noBorder' type='checkbox' name='flag[]' id='flagss' value='s'{:if $i->data->flag|@strpos:"s" !== false} checked="checked"{:/if}>
<label for="flagss"> 滚动[s]</label>
<input class='noBorder' type='checkbox' name='flag[]' id='flagsj' value='j'{:if $i->data->flag|@strpos:"j" !== false} checked="checked"{:/if}>
<label for="flagsj"> 跳转[a]</label>
<input class='noBorder' type='checkbox' name='flag[]' id='flagsb' value='b'{:if $i->data->flag|@strpos:"b" !== false} checked="checked"{:/if}>
<label for="flagsb"> 加粗[b]</label></td>
</tr>
<tr class="j">
<th width="20%">跳转地址:</th>
<td width="80%"><input name="redirectUrl" type="text" size="60" id="redirectUrl" value="{:$i->data->redirectUrl}" />
*</td>
</tr>
<tr class="notJ">
<th width="20%">副标题:</th>
<td width="80%"><input name="viceTitle" type="text" size="60" id="viceTitle" value="{:$i->data->viceTitle}" /></td>
</tr>
<tr>
<th>图 片:</th>
<td><input title="点击查看图片" name="thumb" type="text" size="50" id="thumb" value="{:$i->data->thumb}" />
<a href='#' title="上传图片" class="buttonBox hidden" id="preView">预览</a>
<input type="file" name="uploadify" id="uploadify" size="2" />
<div id="fileQueue"></div></td>
</tr>
<tr>
<th>栏 目:</th>
<td><select name="categoryId" id="categoryId">
{:foreach item=item from=$i->category}
<option {:if $item->channelId != $i->channelId}style="background:#ccc;" value="-1"{:else}value="{:$item->id}"{:/if} {:if $item->id == $i->categoryId}selected="selected"{:/if}>{:$item->name}</option>
{:/foreach}
</select>
* (不能选灰色背景的栏目)</td>
</tr>
{:field fields=$i->addFields data=$i->addData}
<tr class="notJ">
<th width="20%">{:$name}:</th>
<td width="80%"> {:$code} </td>
</tr>
{:/field}
<tr class="notJ">
<th width="20%">公司简介:</th>
<td width="80%"><textarea name="desc" cols="58" rows="6" id="desc">{:$i->data->desc}</textarea></td>
</tr>
<tr class="notJ" id="advShow">
<th width="20%"> </th>
<td width="80%">【<a href="#@" onclick="$('#advItems').show();$('#advHide').show();$('#advShow').hide();">显示高级选项</a>】</td>
</tr>
<tr class="notJ hidden" id="advHide">
<th width="20%"> </th>
<td width="80%">【<a href="#@" onclick="$('#advShow').show();$('#advHide').hide();$('#advItems').hide();">隐藏高级选项</a>】</td>
</tr>
<tbody class="notJ hidden" id="advItems">
<tr class="notJ">
<th width="20%">关键词:</th>
<td width="80%"><input name="keywords" type="text" size="50" id="keywords" value="{:$i->data->keywords}" />
(多个时用空格隔开)</td>
</tr>
<tr>
<th>文档排序:</th>
<td><select name="ordering" id="ordering">
<option value="0" {:if ($i->data->ordering - $i->data->pubTime) / 86400 == 0}selected="selected"{:/if}>默认排序</option>
<option value="7" {:if ($i->data->ordering - $i->data->pubTime) / 86400 == 7}selected="selected"{:/if}>置顶一周</option>
<option value="15" {:if ($i->data->ordering - $i->data->pubTime) / 86400 == 15}selected="selected"{:/if}>置顶半个月</option>
<option value="30" {:if ($i->data->ordering - $i->data->pubTime) / 86400 == 30}selected="selected"{:/if}>置顶一个月</option>
<option value="90" {:if ($i->data->ordering - $i->data->pubTime) / 86400 == 90}selected="selected"{:/if}>置顶三个月</option>
<option value="180" {:if ($i->data->ordering - $i->data->pubTime) / 86400 == 180}selected="selected"{:/if}>置顶半年</option>
<option value="360" {:if ($i->data->ordering - $i->data->pubTime) / 86400 == 360}selected="selected"{:/if}>置顶半年</option>
</select></td>
</tr>
<tr class="notJ">
<th>列表显示:</th>
<td><label>
<input class="noBorder" name="listed" type="radio" value="1" {:if $i->data->listed == '1'}checked="checked"{:/if} />是</label>
<label>
<input name="listed" class="noBorder" type="radio" value="0" {:if $i->data->listed == '0'}checked="checked"{:/if} />否</label>
(如果选否则不会在首页和列表页中出现)</td>
</tr>
<tr class="notJ">
<th>访问控制:</th>
<td><select name="visit" id="visit">
<option value="1" {:if $i->data->visit == '1'}selected="selected"{:/if}>访问允许</option>
<option value="0" {:if $i->data->visit == '0'}selected="selected"{:/if}>禁止访问</option>
</select></td>
</tr>
<tr class="notJ">
<th width="20%">发布日期:</th>
<td width="80%"><input name="pubTime" type="text" size="20" id="pubTime" value="{:$i->data->pubTime|date_format:"%Y-%m-%d %H:%M:%S"}
" /></td>
</tr>
<tr class="notJ">
<th width="20%">文档模板:</th>
<td width="80%">{:$smarty.const.ROOT_PATH}{:$i->Load->var.templatePath}/<input name="templateName" type="text" size="30" value="" id="templateName" class="inputLine" /></td>
</tr>
<tr class="notJ">
<th width="20%" nowrap="nowrap">生成文档:</th>
<td width="80%">{:$smarty.const.ROOT_PATH}<input name="fileName" type="text" size="30" value="" id="fileName" class="inputLine" /></td>
</tr>
</tbody>
<tr>
<th> </th>
<td><input type="submit" id="submit" value=" 提 交 " />
<input type="reset" onclick="history.go(-1);" value=" 返 回 " /></td>
</tr>
</table>
</form>
</div>
</div>
<link href="{:$smarty.const.PUBLIC_DIR}/common/style/tooltip.css" rel="stylesheet" type="text/css" />
<link href="{:$smarty.const.PUBLIC_DIR}/common/style/ui.all.css" rel="stylesheet" type="text/css" />
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/jquery.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.core.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.draggable.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.resizable.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.dialog.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/common.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/jquery.tooltip.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/jquery.upload.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/jquery.colorpicker.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/swfobject.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/jquery.uploadify.v2.1.0.min.js"></script>
<script language="javascript" type="text/javascript">
function upload(url)
{
$("#thumb").val(url);
$("#preView").show();
}
function uploaded(e,queueId,fileObj,response,data)
{
var error = $(response).find("#error").html();
if(error != '')
{
alert(error);
}
else
{
$("#preView").show();
var file = $(response).find("#file").html();
$("#thumb").val(file);
}
}
$(document).ready(function(){
$("#uploadify").uploadify({
'uploader' : '{:$smarty.const.PUBLIC_DIR}/common/image/uploadify.swf',
'script' : '{:$smarty.const.BOOT_URL}/file/upload',
'cancelImg' : '{:$smarty.const.PUBLIC_DIR}/common/image/cancel.png',
'queueID' : 'fileQueue',
'auto' : true,
'multi' : false,
'onComplete' : function(e,queueId,fileObj,response,data){uploaded(e,queueId,fileObj,response,data);},
'buttonImg' : '{:$smarty.const.PUBLIC_DIR}/common/image/uploadButton.gif',
'width' : 90,
'height' : 13
});
if($("#thumb").val() != "")
{
$("#preView").show();
}
$("#categoryId").change(function(){
if(this.value == -1)
{
alert('不能选择灰色背景的栏目');
this.value = 0;
return false;
}
});
$("#preView").click(function(){
if($('.ui-dialog').length > 0)
{
$('.ui-dialog').remove();
}
if($('.ui-dialog-message').length > 0)
{
$('.ui-dialog-message').remove();
}
var thumbValue = $("#thumb").val();
if(thumbValue != "")
{
$('<div class="ui-dialog-message"><img src="' + thumbValue + '" onload="if(this.width > 350)this.width = 350;" /></div>').dialog({
title:'图片预览',
resizable : false,
width : 380
});
}
});
$('form').submit(function(){
postDialog();
});
$("#flagsj").click(
function () {
if(this.checked){
$(".j").show();
$(".notJ").hide();
}else{
$(".j").hide();
$(".notJ").show();
}
}
);
$("#color").colorpicker();
$("#flagsb").click(
function () {
if(this.checked){
$("#title").css("font-weight","bold");
}else{
$("#title").css("font-weight","normal");
}
}
);
});
</script>
</body>
</html> | 01cms | 01cms/branches/v1.0/01cms/view/Archive/archiveModCompany.tpl | Smarty | asf20 | 12,898 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>{:$i->title}</title>
<link href="{:$smarty.const.PUBLIC_DIR}/common/style/admin.css" rel="stylesheet" type="text/css" />
<link href="{:$smarty.const.PUBLIC_DIR}/common/style/common/tooltip.css" rel="stylesheet" type="text/css" />
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/jquery.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/jquery.tooltip.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/jquery.boxy.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/common.js"></script>
<link href="{:$smarty.const.PUBLIC_DIR}/common/style/common/boxy.css" rel="stylesheet" type="text/css" />
<script language="javascript" type="text/javascript">
function selAll(name)
{
$("input[name='"+name+"']").attr("checked", true);
}
function selAnti(name)
{
$("input[name='"+name+"']").each(function(i){
this.checked=!this.checked;
});
}
function selectIds(name){
var ids='';
$("input:checked[name='"+name+"']").each(function(i){
ids+=this.value+',';
});
if(ids.length==0)
{
alert('您还没有选中要添加的记录!');
return false;
}
window.parent.{:$i->p[6]}(ids);
return false;
}
</script>
<style type="text/css">
<!--
body{font-size:12px;color:#000;font-family:Verdana;margin:0;padding:0; background:#fff; width:600px;}
-->
</style>
</head>
<body>
<div class="content shadow">
<table width="100%" border="0" cellspacing="1">
<tr class="titleBg">
<th scope="col">#ID</th>
<th scope="col">选择</th>
<th class="textL" scope="col">标题</th>
</tr>
{:foreach item=item from=$i->lists}<tr>
<td>{:$item->id}</td>
<td><input name="selected[]" type="checkbox" value="{:$item->id}" class="noBorder" /></td>
<td class="textL"><a title="{:$item->categoryName} {:$item->pubTime|date_format:"%Y-%m-%d %H:%M"}" href="{:$item->link}" target="_blank">{:$item->title}</a></td>
</tr>{:/foreach}
<tr>
<td colspan="3" class="lightGreyBg textL"><a href="#@" class="buttonBox" onclick="selAll('selected[]');">全选</a> <a href="#@" class="buttonBox" onclick="selAnti('selected[]');">反选</a> <a href="#@" onclick="selectIds('selected[]');return false;" style="background:#e1e1e1;" class="buttonBox" id="addArchive">插入选中的文档</a> {:$i->pagesCode}</td>
</tr>
</table>
</div>
</body>
</html>
| 01cms | 01cms/branches/v1.0/01cms/view/Archive/archiveSelect.tpl | Smarty | asf20 | 2,841 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>{:$i->title}</title>
<link href="{:$smarty.const.PUBLIC_DIR}/common/style/admin.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
th { text-align:right; }
td { text-align:left; }
-->
</style>
</head>
<body>
<div class="wrapper">
<div class="title shadow titleBg">
<table width="100%" border="0" cellspacing="1">
<tr>
<td><h1> {:$i->title} => {:if $i->p[0] eq "mod"}修改{:elseif $i->p[0] eq "add"}
添加{:/if} <span>[<a href="{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/lists/0/{:$i->p[2]}">字段管理</a>]</h1></td>
</tr>
</table>
</div>
<div class="content shadow">
<form>
<table width="100%" border="0" cellspacing="1">
<tr>
<th width="20%">排 序:</th>
<td width="80%"><input name="ordering" type="text" size="4" id="ordering" value="{:$i->data->ordering}" class="posted" /></td>
</tr>
<tr>
<th width="20%">字段提示:</th>
<td width="80%"><input name="name" type="text" size="20" id="name" value="{:$i->data->name}" class="posted" /></td>
</tr>
<tr>
<th width="20%">空值提示:</th>
<td width="80%"><input name="emptyTip" type="text" size="40" id="emptyTip" value="{:$i->data->emptyTip}" class="posted" />
(允许字段空值则留空) </td>
</tr>
<tr>
<th width="20%">字段名称:</th>
<td width="80%"><input name="oldField" type="hidden" size="20" id="oldField" value="{:$i->data->field}" class="posted" />
<input name="field" type="text" size="20" id="field" value="{:$i->data->field}" class="posted" /></td>
</tr>
<tr>
<th>字段类型:</th>
<td><select id="selectCode" >
<option value='{:$i->data->code|printHtml}'>常用类型参考</option>
<option value="text">单行文本</option>
<option value="textarea">多行文本域</option>
<option value="FCKeditor">编辑器文本域</option>
<option value="checkbox">复选框</option>
<option value="radio">单选按钮组</option>
<option value="select">下拉列表</option>
<option value="hidden">隐藏域</option>
</select>
<input name="type" type="text" id="type" value="{:$i->data->type}" size="40" title="不能带有双引号,请根据需要适当修改参考代码" class="posted" />
<select id="selectType" >
<option value="{:$i->data->type}">更多参考...</option>
<option value="int(11) NOT NULL DEFAULT 0">int(11)</option>
<option value="tinyint(1) NOT NULL DEFAULT 0">tinyint(1)</option>
<option value="smallint(6) NOT NULL DEFAULT 0">smallint(6)</option>
<option value="mediumint(8) NOT NULL DEFAULT 0">mediumint(8)</option>
<option value="varchar(255) NOT NULL">varchar(255)</option>
<option value="char(5) NOT NULL">char(5)</option>
<option value="set('a','c','c')">set('a','c','c')</option>
<option value="enum('a','c','c')">enum('a','c','c')</option>
<option value="tinytext">tinytext</option>
<option value="text">text</option>
<option value="mediumtext">mediumtext</option>
<option value="longtext">longtext</option>
</select></td>
</tr>
<tr>
<th>表单代码:</th>
<td><textarea title="不能带有单引号,请根据需要适当修改参考代码" name="code" cols="60" rows="10" id="code" class="posted">{:$i->data->code|printHtml}</textarea></td>
</tr>
<tr>
<th> </th>
<td><input type="submit" value=" 提 交 " />
<input type="reset" onclick="history.go(-1);" value=" 返 回 " /></td>
</tr>
</table>
</form>
</div>
</div>
<link href="{:$smarty.const.PUBLIC_DIR}/common/style/ui.all.css" rel="stylesheet" type="text/css" />
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/jquery.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.core.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.draggable.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.dialog.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/jquery.post.js"></script>
<script language="javascript" type="text/javascript">
$(document).ready(function(){
$("form").post({
sendUrl:'{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/{:if $i->p[0] eq "mod"}update/{:$i->p[1]}{:elseif $i->p[0] eq "add"}insert/0{:/if}/{:$i->p[2]}',
goUrl:'{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/lists/-1/{:$i->p[2]}'
});
});
$("#selectType").change( function() {
$("#type").get(0).value = this.value;
});
$("#selectCode").change( function() {
var code,field;
field=$("#field").get(0).value;
if(this.value=='text'){
$("#type").get(0).value = "varchar(64) NOT NULL";
code='<!--config{type=text}-->\n<input name="'+field+'" id="'+field+'" size="30" type="text" value="$value" />';
}else if(this.value=='hidden'){
$("#type").get(0).value = "varchar(64) NOT NULL";
code='<!--config{type=hidden}-->\n<input name="'+field+'" id="'+field+'" type="hidden" value="$value" />';
}else if(this.value=='textarea'){
$("#type").get(0).value = "text";
code='<!--config{type=textarea}-->\n<textarea name="'+field+'" id="'+field+'" cols="60" rows="8">$value</textarea>';
}else if(this.value=='FCKeditor'){
$("#type").get(0).value = "text";
code='<!--config{type=FCKeditor}-->\nFCKeditor|Width=100%;Height=500';
}else if(this.value=='checkbox'){
$("#type").get(0).value = "varchar(24) NOT NULL";
code='<!--config{type=checkbox}-->\n<input name="'+field+'" id="'+field+'" type="checkbox" value="1" />';
}else if(this.value=='radio'){
$("#type").get(0).value = "tinyint(1) NOT NULL DEFAULT 0";
code='<!--config{type=radio}-->\n<label><input name="'+field+'" type="radio" value="1" checked="checked" />是</label> \n<label><input name="'+field+'" type="radio" value="0" />否</label>';
}else if(this.value=='select'){
$("#type").get(0).value = "varchar(32) NOT NULL";
code='<!--config{type=select}-->\n<select name="'+field+'">\n <option value="1" selected="selected">1</option>\n <option value="2">2</option>\n</select>';
}else{
code=this.value;
}
$("#code").get(0).value = code;
});
</script>
</body>
</html> | 01cms | 01cms/branches/v1.0/01cms/view/Archive/fieldMod.tpl | Smarty | asf20 | 7,108 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>{:$i->title}</title>
<link href="{:$smarty.const.PUBLIC_DIR}/common/style/admin.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div class="wrapper">
<div class="title shadow titleBg">
<table width="100%" border="0" cellspacing="1">
<tr>
<td><h1> {:$i->title} <span>[<a href="{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/add">添加</a>]</span></h1></td>
</tr>
</table>
</div>
<div class="content shadow">
<table width="100%" border="0" cellspacing="1">
<tr class="titleBg">
<th scope="col">#ID</th>
<th scope="col">模型名称</th>
<th scope="col">表名</th>
<th scope="col">操作</th>
</tr>
{:foreach item=item from=$i->lists}<tr>
<td>{:$item->id}</td>
<td>{:$item->name}</td>
<td>{:$i->Load->config.mysql.prefix}archive_channel_{:$item->tableId}</td>
<td><a href="{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/mod/{:$item->id}">修改</a> | <a onclick="del({:$item->id});return false;" href="#@">删除</a> | <a href="{:$smarty.const.BOOT_URL}/{:$i->c}/field/lists/0/{:$item->id}">字段管理</a> | <a href="{:$smarty.const.BOOT_URL}/archive/field/add/0/{:$item->id}">添加字段</a></td>
</tr>{:/foreach}
<tr>
<td colspan="6" class="lightGreyBg textL"> {:$i->pagesCode}</td>
</tr>
</table>
</div>
</div>
<link href="{:$smarty.const.PUBLIC_DIR}/common/style/tooltip.css" rel="stylesheet" type="text/css" />
<link href="{:$smarty.const.PUBLIC_DIR}/common/style/ui.all.css" rel="stylesheet" type="text/css" />
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/jquery.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.core.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.draggable.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.resizable.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.dialog.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/jquery.tooltip.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/common.js"></script>
<script language="javascript" type="text/javascript">
function del(id)
{
if(confirm('删除模型会同时删除相关的栏目和文档,确定要删除?'))
{
getDialog('{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/del/'+id+'/', '{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/lists');
}
return false;
}
</script>
</body>
</html>
| 01cms | 01cms/branches/v1.0/01cms/view/Archive/channel.tpl | Smarty | asf20 | 3,052 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>{:$i->title}</title>
<link href="{:$smarty.const.PUBLIC_DIR}/common/style/admin.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
th {text-align:right;}
td {text-align:left;}
-->
</style>
</head>
<body>
<div class="wrapper">
<div class="title shadow titleBg">
<table width="100%" border="0" cellspacing="1">
<tr>
<td><h1> {:$i->title} => {:if $i->p[0] eq "mod"}修改{:elseif $i->p[0] eq "add"}
添加{:/if} </h1></td>
</tr>
</table>
</div>
<div class="content shadow">
<form id="form1" method="post">
<table width="100%" border="0" cellspacing="1">
<tr>
<th width="20%">上级栏目:</th>
<td width="80%"><label>
<select name="parentId" id="parentId" class="posted">
<option value="0" {:if $i->data->parentId == 0}selected="selected"{:/if}>无(作为顶级栏目)</option>
{:foreach item=item from=$i->categories}
<option value="{:if $item->id == $i->data->id}-1{:else}{:$item->id}{:/if}" {:if $item->id == $i->data->parentId}selected="selected"{:/if}>{:$item->name}</option>
{:/foreach}
</select>
</label></td>
</tr>
<tr>
<th width="20%">栏目类型:</th>
<td width="80%">
<label>
<input class="noBorder posted" name="type" type="radio" id="radio1" value="1" {:if 1 == $i->data->type}checked="checked"{:/if} />
栏目列表 </label>
<label><input class="noBorder posted" name="type" type="radio" id="radio2" value="2" {:if 2 == $i->data->type}checked="checked"{:/if} />
栏目封面 </label>
<label>
<input class="noBorder posted" type="radio" name="type" id="radio0" value="0" {:if 0 == $i->data->type}checked="checked"{:/if} />
任意链接 </label></td>
</tr>
<tr>
<th>栏目名称:</th>
<td>
<input name="name" type="text" size="20" id="name" value="{:$i->data->name}" class="posted check" /> *
</td>
</tr>
<tr class="in">
<th>栏目别名:</th>
<td><input name="alias" type="text" size="30" maxlength="30" id="alias" value="{:$i->data->alias}" class="posted" />
<input name="pinyin" id="pinyin1" type="radio" value="1" class="posted noBorder" /><label for="pinyin1">拼音</label>
<input name="pinyin" id="pinyin2" type="radio" value="2" class="posted noBorder" /><label for="pinyin2">拼音首字母</label>
<input name="pinyin" id="pinyin3" type="radio" value="3" class="posted noBorder" checked="checked" /><label for="pinyin3">自定义</label>
[<a href="#@" class="helpTip" title="允许字符:A-Z a-z 0-9 - _<br />别名主要用于URL中显示<br />默认为拼音">?</a>]
</td>
</tr>
<tr class="in" id="channelIdTr">
<th>绑定模型:</th>
<td><label>
<select name="channelId" id="channelId" class="posted check">
{:foreach item=item key=key from=$i->channels}
<option value="{:$key}" {:if $key == $i->data->channelId}selected="selected"{:/if}>{:$item.name}</option>
{:/foreach}
</select>
</label> *</td>
</tr>
<tr class="in" id="categoryTemplateNameTr">
<th>栏目模板:</th>
<td>/template/{:$i->Load->var.style}/<input name="categoryTemplateName" type="text" id="categoryTemplateName" class="inputLine posted check" value="{:$i->data->categoryTemplateName}" size="30" />
</td>
</tr>
<tr class="in" id="archiveTemplateNameTr">
<th>默认文档模板:</th>
<td>/template/{:$i->Load->var.style}/<input name="archiveTemplateName" type="text" id="archiveTemplateName" class="inputLine posted check" value="{:$i->data->archiveTemplateName}" size="30" />
</td>
</tr>
<tr class="in" id="archiveUrlTr">
<th>默认文档URL:</th>
<td><input name="archiveUrl" type="text" id="archiveUrl" class="inputLine posted check" value="{:$i->data->archiveUrl}" size="40" />
<label>
<select name="regulation" id="regulation" onchange="$('#archiveUrl').val(this.value);">
<option value="" selected="selected">URL参考规则</option>
<option value="{:$i->Load->var.htmlSaveDir}/[alias]/%Y/%m%d/[id].html">栏目别名/年/月日</option>
<option value="{:$i->Load->var.htmlSaveDir}/[alias]/%Y/%m/%d/[id].html">栏目别名/年/月/日</option>
<option value="{:$i->Load->var.htmlSaveDir}/%Y/%m%d/[id].html">年/月日</option>
<option value="{:$i->Load->var.htmlSaveDir}/%Y/%m/%d/[id].html">年/月/日</option>
</select>
</label> [<a href="#@" class="helpTip" title="[alias]表示当前的栏目别名<br />[id]表示文档ID<br />%Y%m%d用于格式化文档添加日期<br />%Y表示年,%m表示月,%d表示日">?</a>]
</td>
</tr>
<tr class="in">
<th><strong>列表访问:</strong></th>
<td><input name="visit" id="visit1" type="radio" value="1" class="posted noBorder" {:if 1 == $i->data->visit}checked="checked"{:/if} /><label for="visit1">静态</label>
<input name="visit" id="visit2" type="radio" value="2" class="posted noBorder" {:if 2 == $i->data->visit}checked="checked"{:/if} /><label for="visit2">动态</label>
<input name="visit" id="visit0" type="radio" value="0" class="posted noBorder" {:if '0' == $i->data->visit}checked="checked"{:/if} /><label for="visit0">自动</label>
</td>
</tr>
<tr class="in">
<th><strong>列表大小:</strong></th>
<td><input name="pageSize" type="text" size="10" id="pageSize" value="{:$i->data->pageSize}" class="posted check" /> [<a href="#@" class="helpTip" title="栏目列表每页多少条记录">?</a>]</td>
</tr>
<tr>
<th>导航显示:</th>
<td>
<label>
<input class="noBorder posted" type="radio" name="isHidden" value="0" {:if 0 == $i->data->isHidden}checked="checked"{:/if} />
显示 </label> <label>
<input class="noBorder posted" type="radio" name="isHidden" value="1" {:if 1 == $i->data->isHidden}checked="checked"{:/if} />
隐藏 </label> [<a href="#@" class="helpTip" title="是否在导航中显示">?</a>]
</td>
</tr>
<tr class="in">
<th><strong>关键词:</strong></th>
<td><input name="keywords" type="text" size="50" id="keywords" value="{:$i->data->keywords}" class="posted" /></td>
</tr>
<tr class="in">
<th><strong>描 述</strong>:</th>
<td><textarea name="desc" rows="3" id="desc" class="posted">{:$i->data->desc}</textarea></td>
</tr>
<tr class="out">
<th>链接地址:</th>
<td><input name="link" type="text" size="60" id="link" value="{:$i->data->link}" class="posted check" /></td>
</tr>
<tr>
<th> </th>
<td><input type="submit" value=" 提 交 " />
<input type="reset" onclick="history.go(-1);" value=" 返 回 " /> </td>
</tr>
</table>
</form>
</div>
</div>
<link href="{:$smarty.const.PUBLIC_DIR}/common/style/tooltip.css" rel="stylesheet" type="text/css" />
<link href="{:$smarty.const.PUBLIC_DIR}/common/style/ui.all.css" rel="stylesheet" type="text/css" />
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/jquery.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.core.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.draggable.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.dialog.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/jquery.post.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/jquery.tooltip.js"></script>
<script language="javascript" type="text/javascript">
var typeId = $("input:checked[name='type']").val();
switch(typeId)
{
case '1':$("#archiveTemplateNameTr,#pageSizeTr,#archiveUrlTr,#channelIdTr").show();$(".out").hide();break;
case '2':$("#archiveTemplateNameTr,#pageSizeTr,#archiveUrlTr,#channelIdTr,.out").hide();break;
case '0':$(".in").hide();$(".out").show();break;
}
var channel = new Array();
{:foreach item=item key=key from=$i->channels}
channel[{:$key}] = "{:$item.tableId}";
{:/foreach}
$(document).ready(function(){
$("form").post({
sendUrl:'{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/{:if $i->p[0] eq "mod"}update/{:$i->p[1]}{:elseif $i->p[0] eq "add"}insert{:/if}',
goUrl:'{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/lists/-1'
});
$("#parentId").change(function(){
if(this.value == -1)
{
alert('不能选择自身ID');
this.value = 0;
return false;
}
});
$("input[name='pinyin']").click(function(){
if(this.value == 3)
{
$("#alias").show();
}
else
{
$("#alias").hide();
}
});
$("input[name='type']").click(function(){
var channelId = $("#channelId").val();
if(this.value == 1)
{
var categoryTemplate = (channelId > 0) ? channel[channelId]+'List' : 'list';
var archiveTemplate = (channelId > 0) ? channel[channelId]+'Show' : 'show';
$(".in").show();
$(".out").hide();
if($("#categoryTemplateName").val() == '') $("#categoryTemplateName").val(categoryTemplate+'.tpl');
if($("#archiveTemplateName").val() == '') $("#archiveTemplateName").val(archiveTemplate+'.tpl');
$("#archiveTemplateNameTr,#archiveUrlTr,#channelIdTr").show();
}
else if(this.value == 2)
{
$(".in").show();
$(".out").hide();
$("#archiveTemplateNameTr,#archiveUrlTr,#channelIdTr").hide();
}
else if(this.value == 0)
{
$(".in").hide();
$(".out").show();
}
});
$("#channelId").change(function(){
var typeId = $("input:checked[name='type']").val();
if(confirm('是否自动更新栏目模板和文档默认模板?'))
{
if(typeId == 1)
{
var categoryTemplate = (this.value > 0) ? channel[this.value]+'List' : 'list';
var archiveTemplate = (this.value > 0) ? channel[this.value]+'Show' : 'show';
$("#categoryTemplateName").val(categoryTemplate+'.tpl');
$("#archiveTemplateName").val(archiveTemplate+'.tpl');
$("#archiveTemplateNameTr,#pageSizeTr,#archiveUrlTr,#channelIdTr").show();
}
else if(typeId == 2)
{
var value = (this.value > 0) ? channel[this.value]+'Index' : 'index';
$("#categoryTemplateName").val(value+'.tpl');
$("#archiveTemplateNameTr,#pageSizeTr,#archiveUrlTr,#channelIdTr").hide();
}
}
});
$(".helpTip").tooltip({cssClass:"tooltip", xOffset:30, opacity:5});
});
</script>
</body>
</html> | 01cms | 01cms/branches/v1.0/01cms/view/Archive/categoryMod.tpl | Smarty | asf20 | 11,680 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>{:$i->title}</title>
<link href="{:$smarty.const.PUBLIC_DIR}/common/style/admin.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div class="wrapper">
<div class="title shadow titleBg">
<table width="100%" border="0" cellspacing="1">
<tr>
<td><h1> {:$i->title} <span>[<a href="{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/add/0/{:$i->categoryId}/{:$i->channelId}">添加</a>]</span></h1></td>
</tr>
</table>
</div>
<div class="title shadow">
<table width="100%" border="0" cellspacing="1">
<tr>
<td><form action="{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/lists/" method="get">
ID:<input class="keyWord" name="id" type="text" value="{:$i->keyWord.id}" size="8" />
标题:<input class="keyWord" name="title" type="text" value="{:$i->keyWord.title}" size="20" />
审核:<select class="keyWord" name="pass">
<option value="">-不限-</option>
<option value="0" {: if $i->keyWord.pass == '0'}selected="selected"{:/if}>待审核</option>
<option value="1" {: if $i->keyWord.pass == '1'}selected="selected"{:/if}>已通过</option>
<option value="2" {: if $i->keyWord.pass == '2'}selected="selected"{:/if}>未通过</option>
</select>
<input name="" value="搜 索" type="submit" />
<input name="" type="reset" value="清 除" onclick="$('.keyWord').each(function(){this.value = '';});return false;" />
<input name="" type="reset" value="全 部" onclick="window.location.href='{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/lists/';return false;" />
</form></td>
</tr>
</table>
</div>
<div class="content shadow">
<table width="100%" border="0" cellspacing="1">
<tr class="titleBg">
<th scope="col">#ID</th>
<th scope="col">选择</th>
<th class="textL" scope="col">标题</th>
<th scope="col">所属栏目</th>
<th scope="col">发布时间</th>
<th scope="col" class="textL">审核状态 => 操作</th>
<th scope="col">操作</th>
</tr>
{:foreach item=item from=$i->lists}<tr>
<td>{:$item->id}</td>
<td><input name="selected[]" type="checkbox" value="{:$item->id}" class="noBorder" /></td>
<td class="textL"><a href="{:$smarty.const.ROOT_DIR}/index.php/data/archive/{:$item->id}" target="_blank">{:$item->title}</a></td>
<td>{:$item->categoryName}</td>
<td>{:$item->pubTime|date_format:"%Y-%m-%d %H:%M"}</td>
<td class="textL" id="set{:$item->id}"><span class="deepGrey">【{:if $item->pass == 0}待审核{:elseif $item->pass == 1}已通过{:elseif $item->pass == 2}未通过{:/if}】 =></span>
{:if $item->pass == 0}
【<a onclick="return getDialog('{:$smarty.const.BOOT_URL}/{:$i->c}/setPass/{:$item->id}/1');" href="#">通过</a>】【<a onclick="return getDialog('{:$smarty.const.BOOT_URL}/{:$i->c}/setPass/{:$item->id}/2');" href="#">不通过</a>】
{:elseif $item->pass == 1}
【<a onclick="return getDialog('{:$smarty.const.BOOT_URL}/{:$i->c}/setPass/{:$item->id}/2');" href="#">不通过</a>】{:elseif $item->pass == 2}
【<a onclick="return getDialog('{:$smarty.const.BOOT_URL}/{:$i->c}/setPass/{:$item->id}/1');" href="#">通过</a>】
{:/if}</td>
<td class="textL" id="set{:$item->id}"><a href="{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/mod/{:$item->id}/{:$i->p[2]}">修改</a> | <a onclick="del({:$item->id});return false;" href="#@">删除</a></td>
</tr>{:/foreach}
<tr>
<td colspan="7" class="lightGreyBg textL"> <a href="#@" onclick="selAll('selected[]');">全选</a> | <a href="#@" onclick="selAnti('selected[]');">反选</a> | <a href="#@" onclick="del(0,'selected[]');">删除</a> | <a href="#@" onclick="batPass(1);">通过审核</a> | <a href="#@" onclick="batPass(2);">不通过审核</a> | {:$i->pagesCode}</td>
</tr>
</table>
</div>
</div>
<link href="{:$smarty.const.PUBLIC_DIR}/common/style/tooltip.css" rel="stylesheet" type="text/css" />
<link href="{:$smarty.const.PUBLIC_DIR}/common/style/ui.all.css" rel="stylesheet" type="text/css" />
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/jquery.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.core.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.draggable.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.resizable.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.dialog.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/jquery.tooltip.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/common.js"></script>
<script language="javascript" type="text/javascript">
function batPass(status)
{
var ids = '';
$("input[name='selected[]']").each(function(i){
if(this.checked)
{
if(ids == '')
{
ids=this.value;
}
else
{
ids+=','+this.value;
}
}
});
if(ids.length==0)
{
alert('您还没有选中要进行处理的记录');
return false;
}
if(confirm('确定要批量审核ID为'+ids+'的记录?'))
{
getDialog('{:$smarty.const.BOOT_URL}/{:$i->c}/setPass/'+ids+'/'+status, '{:$i->curUrl}');
}
}
function setPass(id,status)
{
if(status == 1)
{
$("#set"+id).html('<span class="deepGrey">【已通过】 =></span> 【<a onclick="return getDialog(\'{:$smarty.const.BOOT_URL}/{:$i->c}/setPass/'+id+'/2\');" href="#">不通过</a>】');
}
else if(status == 2)
{
$("#set"+id).html('<span class="deepGrey">【未通过】 =></span> 【<a onclick="return getDialog(\'{:$smarty.const.BOOT_URL}/{:$i->c}/setPass/'+id+'/1\');" href="#">通过</a>】');
}
}
function del(id, name)
{
var ids='';
if(name != undefined)
{
$("input:checked[name='"+name+"']").each(function(i){
ids+=this.value+',';
});
ids = ids.substr(0,ids.length-1);
}
else if(id > 0)
{
ids = id;
}
if(ids.length==0)
{
alert('您还没有选中要删除的记录');
return false;
}
if(confirm('确定要删除ID为'+ids+'的记录?'))
{
getDialog('{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/del/'+ids, '{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/lists/0/{:$i->p[2]}/{:$i->p[3]}');
}
return false;
}
</script>
</body>
</html>
| 01cms | 01cms/branches/v1.0/01cms/view/Archive/archive.tpl | Smarty | asf20 | 6,962 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>{:$i->title}</title>
<link href="{:$smarty.const.PUBLIC_DIR}/common/style/admin.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
th { text-align:right; }
td { text-align:left; }
.out { display:none; }
-->
</style>
</head>
<body>
<div class="wrapper">
<div class="title shadow titleBg">
<table width="100%" border="0" cellspacing="1">
<tr>
<td><h1> {:$i->title} => {:if $i->p[0] eq "mod"}修改{:elseif $i->p[0] eq "add"}
添加{:/if} </h1></td>
</tr>
</table>
</div>
<div class="content shadow">
<form id="form1" method="post">
<table width="100%" border="0" cellspacing="1">
<tr>
<th width="20%">上级栏目:</th>
<td width="80%"><label>
<select name="parentId" id="parentId" class="posted">
<option value="0" selected="selected">无(作为顶级栏目)</option>
{:foreach item=item from=$i->categories}
<option value="{:$item->id}" {:if $item->id == $i->data->id}selected="selected"{:/if}>{:$item->name}</option>
{:/foreach}
</select>
</label></td>
</tr>
<tr>
<th width="20%">栏目类型:</th>
<td width="80%"><label>
<input class="noBorder posted" name="type" type="radio" id="radio1" value="1" checked="checked" />
栏目列表 </label>
<label><input class="noBorder posted" name="type" type="radio" id="radio2" value="2" />
栏目封面 </label>
<label>
<input class="noBorder posted" type="radio" name="type" id="radio0" value="0" />
任意链接 </label></td>
</tr>
<tr>
<th>栏目名称:</th>
<td><input name="name" type="text" id="name" value="" size="30" maxlength="30" class="posted check" /> *</td>
</tr>
<tr class="in">
<th>栏目别名:</th>
<td><input name="alias" type="text" size="30" maxlength="30" id="alias" value="" class="posted hidden" />
<input name="pinyin" id="pinyin1" type="radio" value="1" checked="checked" class="posted noBorder" /><label for="pinyin1">拼音</label>
<input name="pinyin" id="pinyin2" type="radio" value="2" class="posted noBorder" /><label for="pinyin2">拼音首字母</label>
<input name="pinyin" id="pinyin3" type="radio" value="3" class="posted noBorder" /><label for="pinyin3">自定义</label>
[<a href="#@" class="helpTip" title="允许字符:A-Z a-z 0-9 - _<br />别名主要用于URL中显示<br />默认为拼音">?</a>]</td>
</tr>
<tr class="in" id="channelIdTr">
<th>绑定模型:</th>
<td><label>
<select name="channelId" id="channelId" class="posted check">
<option value="">请选择模型</option>
{:foreach item=item key=key from=$i->channels}
<option value="{:$key}">{:$item.name}</option>
{:/foreach}
</select>
</label> *</td>
</tr>
<tr class="in" id="categoryTemplateNameTr">
<th>栏目模板:</th>
<td>/template/{:$i->Load->var.style}/<input name="categoryTemplateName" type="text" id="categoryTemplateName" class="inputLine posted check" value="" size="30" />
</td>
</tr>
<tr class="in" id="archiveTemplateNameTr">
<th>默认文档模板:</th>
<td>/template/{:$i->Load->var.style}/<input name="archiveTemplateName" type="text" id="archiveTemplateName" class="inputLine posted check" value="" size="30" />
</td>
</tr>
<tr class="in" id="archiveUrlTr">
<th>默认文档URL:</th>
<td><input name="archiveUrl" type="text" id="archiveUrl" class="inputLine posted check" value="{:$i->Load->var.htmlSaveDir}/[alias]/%Y/%m%d/[id].html" size="40" />
<label>
<select name="regulation" id="regulation" onchange="$('#archiveUrl').val(this.value);">
<option value="{:$i->Load->var.htmlSaveDir}/[alias]/%Y/%m%d/[id].html" selected="selected">栏目别名/年/月日</option>
<option value="{:$i->Load->var.htmlSaveDir}/[alias]/%Y/%m/%d/[id].html">栏目别名/年/月/日</option>
<option value="{:$i->Load->var.htmlSaveDir}/%Y/%m%d/[id].html">年/月日</option>
<option value="{:$i->Load->var.htmlSaveDir}/%Y/%m/%d/[id].html">年/月/日</option>
</select>
</label> [<a href="#@" class="helpTip" title="[alias]表示当前的栏目别名<br />[id]表示文档ID<br />%Y%m%d用于格式化文档添加日期<br />%Y表示年,%m表示月,%d表示日">?</a>]
</td>
</tr>
<tr class="in">
<th><strong>列表访问:</strong></th>
<td><input name="visit" id="visit1" type="radio" value="1" class="posted noBorder" /><label for="visit1">静态</label>
<input name="visit" id="visit2" type="radio" value="2" class="posted noBorder" /><label for="visit2">动态</label>
<input name="visit" id="visit0" type="radio" value="0" class="posted noBorder" checked="checked" /><label for="visit0">自动</label>
</td>
</tr>
<tr class="in">
<th><strong>列表大小:</strong></th>
<td><input name="pageSize" type="text" size="10" id="pageSize" value="20" class="posted check" /> [<a href="#@" class="helpTip" title="栏目列表每页多少条记录">?</a>]</td>
</tr>
<tr>
<th>导航显示:</th>
<td>
<label>
<input name="isHidden" type="radio" class="noBorder posted" value="0" checked="checked" />显示 </label> <label>
<input class="noBorder posted" type="radio" name="isHidden" value="1" />隐藏 </label> [<a href="#@" class="helpTip" title="是否在导航中显示">?</a>]
</td>
</tr>
<tr class="in">
<th><strong>关键词:</strong></th>
<td><input name="keywords" type="text" size="50" id="keywords" value="" class="posted" /></td>
</tr>
<tr class="in">
<th><strong>描 述</strong>:</th>
<td><textarea name="desc" rows="3" id="desc" class="posted"></textarea></td>
</tr>
<tr class="out">
<th>链接地址:</th>
<td><input name="link" type="text" size="60" id="link" value="" class="posted check" /> *</td>
</tr>
<tr>
<th> </th>
<td><input type="submit" value=" 提 交 " />
<input type="reset" onclick="history.go(-1);" value=" 返 回 " /></td>
</tr>
</table>
</form>
</div>
</div>
<link href="{:$smarty.const.PUBLIC_DIR}/common/style/tooltip.css" rel="stylesheet" type="text/css" />
<link href="{:$smarty.const.PUBLIC_DIR}/common/style/ui.all.css" rel="stylesheet" type="text/css" />
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/jquery.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.core.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.draggable.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.dialog.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/jquery.post.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/jquery.tooltip.js"></script>
<script language="javascript" type="text/javascript">
var channel = new Array();
{:foreach item=item key=key from=$i->channels}
channel[{:$key}] = "{:$item.tableId}";
{:/foreach}
$(document).ready(function(){
$("form").post({
sendUrl:'{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/{:if $i->p[0] eq "mod"}update/{:$i->p[1]}{:elseif $i->p[0] eq "add"}insert{:/if}',
goUrl:'{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/lists/-1'
});
$("input[name='pinyin']").click(function(){
if(this.value == 3)
{
$("#alias").show();
}
else
{
$("#alias").hide();
}
});
$("input[name='type']").click(function(){
var channelId = $("#channelId").val();
if(this.value == 1)
{
var categoryTemplate = (channelId > 0) ? channel[channelId]+'List' : 'list';
var archiveTemplate = (channelId > 0) ? channel[channelId]+'Show' : 'show';
$(".in").show();
$(".out").hide();
$("#categoryTemplateName").val(categoryTemplate+'.tpl');
$("#archiveTemplateName").val(archiveTemplate+'.tpl');
$("#archiveTemplateNameTr,#pageSizeTr,#archiveUrlTr,#channelIdTr").show();
}
else if(this.value == 2)
{
$(".in").show();
$(".out").hide();
$("#categoryTemplateName").val('categoryIndex.tpl');
$("#archiveTemplateNameTr,#pageSizeTr,#archiveUrlTr,#channelIdTr").hide();
}
else if(this.value == 0)
{
$(".in").hide();
$(".out").show();
}
});
$("#channelId").change(function(){
var typeId = $("input:checked[name='type']").val();
if(typeId == 1)
{
var categoryTemplate = (this.value > 0) ? channel[this.value]+'List' : 'list';
var archiveTemplate = (this.value > 0) ? channel[this.value]+'Show' : 'show';
$("#categoryTemplateName").val(categoryTemplate+'.tpl');
$("#archiveTemplateName").val(archiveTemplate+'.tpl');
$("#archiveTemplateNameTr,#pageSizeTr,#archiveUrlTr,#channelIdTr").show();
}
else if(typeId == 2)
{
var value = (this.value > 0) ? channel[this.value]+'Index' : 'index';
$("#categoryTemplateName").val(value+'.tpl');
$("#archiveTemplateNameTr,#pageSizeTr,#archiveUrlTr,#channelIdTr").hide();
}
});
$(".helpTip").tooltip({cssClass:"tooltip", xOffset:30, opacity:5});
});
</script>
</body>
</html> | 01cms | 01cms/branches/v1.0/01cms/view/Archive/categoryAdd.tpl | Smarty | asf20 | 10,511 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>{:$i->title}</title>
<link href="{:$smarty.const.PUBLIC_DIR}/common/style/admin.css" rel="stylesheet" type="text/css" />
<link href="{:$smarty.const.PUBLIC_DIR}/common/style/uploadify.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
th { text-align:right; }
td { text-align:left; }
.template { border:none; border-bottom:1px #999 solid; }
.color { color:#000000; cursor:pointer;}
-->
</style>
</head>
<body>
<div class="wrapper">
<div class="title shadow titleBg">
<table width="100%" border="0" cellspacing="1">
<tr>
<td><h1> {:$i->title} => {:if $i->p[0] eq "mod"}修改{:elseif $i->p[0] eq "add"}
添加{:/if} </h1></td>
</tr>
</table>
</div>
<div class="content shadow">
<form id="form1" method="post" action="{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/insert/0/{:$i->p[2]}/{:$i->p[3]}" target="autoFrame">
<table width="100%" border="0" cellspacing="1">
<tr>
<th width="20%">公司名称:</th>
<td width="80%"><input class="inputtitle showcolor" name="title" type="text" size="60" id="title" value="" />
<input name="color" type="text" size="7" id="color" value="" class="color" />
</td>
</tr>
<tr>
<th width="20%">属 性:</th>
<td width="80%"><input class='noBorder' type='checkbox' name='flag[]' id='flagsh' value='h'>
<label for="flagsh"> 头条[h]</label>
<input class='noBorder' type='checkbox' name='flag[]' id='flagsc' value='c'>
<label for="flagsc"> 推荐[c]</label>
<input class='noBorder' type='checkbox' name='flag[]' id='flagsp' value='p'>
<label for="flagsp"> 图文[p]</label>
<input class='noBorder' type='checkbox' name='flag[]' id='flagsf' value='f'>
<label for="flagsf"> 幻灯[f]</label>
<input class='noBorder' type='checkbox' name='flag[]' id='flagss' value='s'>
<label for="flagss"> 滚动[s]</label>
<input class='noBorder' type='checkbox' name='flag[]' id='flagsj' value='j'>
<label for="flagsj"> 跳转[a]</label>
<input class='noBorder' type='checkbox' name='flag[]' id='flagsb' value='b'>
<label for="flagsb"> 加粗[b]</label></td>
</tr>
<tr class="j hidden">
<th width="20%">跳转地址:</th>
<td width="80%"><input name="redirectUrl" type="text" size="60" id="redirectUrl" value="" />
*</td>
</tr>
<tr>
<th>图 片:</th>
<td><input title="点击查看图片" name="thumb" type="text" size="50" id="thumb" value="" />
<a href='#' title="上传图片" class="buttonBox hidden" id="preView">预览</a>
<input type="file" name="uploadify" id="uploadify" size="2" />
<div id="fileQueue"></div></td>
</tr>
<tr>
<th>栏 目:</th>
<td><select name="categoryId" id="categoryId" onchange="if(!this.value){alert('请选择白色背景的栏目');this.value = 0;return false;}">
<option value="0">--请选择栏目--</option>
{:foreach item=item from=$i->category}
<option {:if $item->channelId != $i->channelId}style="background:#ccc;" value="-1"{:else}value="{:$item->id}"{:/if} {:if $item->id == $i->categoryId}selected="selected"{:/if}>{:$item->name}</option>
{:/foreach}
</select>
*</td>
</tr>
{:field fields=$i->addFields}
<tr class="notJ">
<th width="20%">{:$name}:</th>
<td width="80%"> {:$code} </td>
</tr>
{:/field}
<tr class="notJ">
<th width="20%">公司简介:</th>
<td width="80%"><textarea name="desc" cols="58" rows="8" id="desc"></textarea></td>
</tr>
<tr class="notJ" id="advShow">
<th width="20%"> </th>
<td width="80%">【<a href="#" onclick="$('#advItems').show();$('#advHide').show();$('#advShow').hide();return false;">显示高级选项</a>】</td>
</tr>
<tr class="notJ hidden" id="advHide">
<th width="20%"> </th>
<td width="80%">【<a href="#" onclick="$('#advShow').show();$('#advHide').hide();$('#advItems').hide();return false;">隐藏高级选项</a>】</td>
</tr>
<tbody class="notJ hidden" id="advItems">
<tr>
<th width="20%">关键词:</th>
<td width="80%"><input name="keywords" type="text" size="50" id="keywords" value="" />
(多个时用空格隔开)</td>
</tr>
<tr>
<th>文档排序:</th>
<td><select name="ordering" id="ordering">
<option value="0" selected="selected">默认排序</option>
<option value="7">置顶一周</option>
<option value="15">置顶半个月</option>
<option value="30">置顶一个月</option>
<option value="90">置顶三个月</option>
<option value="180">置顶半年</option>
<option value="360">置顶一年</option>
</select></td>
</tr>
<tr>
<th>列表显示:</th>
<td><label>
<input class="noBorder" name="listed" type="radio" value="1" checked="checked" />
是</label>
<label>
<input name="listed" class="noBorder" type="radio" value="0" />
否</label>
(如果选否则不会在首页和列表页中出现)</td>
</tr>
<tr>
<th>访问控制:</th>
<td>
<select name="visit" id="visit">
<option value="0" selected="selected">允许访问</option>
<option value="1">禁止访问</option>
</select>
</td>
</tr>
<tr>
<th width="20%">发布日期:</th>
<td width="80%"><input name="pubTime" type="text" size="20" id="pubTime" value="{:$smarty.now|date_format:"%Y-%m-%d %H:%M:%S"}
" /></td>
</tr>
<tr>
<th width="20%">文档模板:</th>
<td width="80%">{:$smarty.const.ROOT_PATH}{:$i->Load->var.templatePath}/
<input name="templateName" type="text" size="30" value="" id="templateName" class="inputLine" /></td>
</tr>
<tr>
<th width="20%" nowrap="nowrap">生成文档:</th>
<td width="80%">{:$smarty.const.ROOT_PATH}
<input name="fileName" type="text" size="30" value="" id="fileName" class="inputLine" />
</td>
</tr>
</tbody>
<tr>
<th> </th>
<td><input type="submit" id="submit" value=" 提 交 " />
<input type="reset" onclick="history.go(-1);" value=" 返 回 " /></td>
</tr>
</table>
</form>
</div>
</div>
<link href="{:$smarty.const.PUBLIC_DIR}/common/style/tooltip.css" rel="stylesheet" type="text/css" />
<link href="{:$smarty.const.PUBLIC_DIR}/common/style/ui.all.css" rel="stylesheet" type="text/css" />
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/jquery.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.core.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.draggable.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.resizable.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.dialog.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/common.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/jquery.tooltip.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/jquery.upload.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/jquery.colorpicker.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/swfobject.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/jquery.uploadify.v2.1.0.min.js"></script>
<script language="javascript" type="text/javascript">
function upload(url)
{
$("#thumb").val(url);
$("#preView").show();
}
function uploaded(e,queueId,fileObj,response,data)
{
var error = $(response).find("#error").html();
if(error != '')
{
alert(error);
}
else
{
$("#preView").show();
var file = $(response).find("#file").html();
$("#thumb").val(file);
}
}
$(document).ready(function(){
$("#uploadify").uploadify({
'uploader' : '{:$smarty.const.PUBLIC_DIR}/common/image/uploadify.swf',
'script' : '{:$smarty.const.BOOT_URL}/file/upload',
'cancelImg' : '{:$smarty.const.PUBLIC_DIR}/common/image/cancel.png',
'queueID' : 'fileQueue',
'auto' : true,
'multi' : false,
'onComplete' : function(e,queueId,fileObj,response,data){uploaded(e,queueId,fileObj,response,data);},
'buttonImg' : '{:$smarty.const.PUBLIC_DIR}/common/image/uploadButton.gif',
'width' : 90,
'height' : 13
});
if($("#thumb").val() != "")
{
$("#preView").show();
}
$("#categoryId").change(function(){
if(this.value == -1)
{
alert('不能选择灰色背景的栏目');
this.value = 0;
return false;
}
});
$("#preView").click(function(){
if($('.ui-dialog').length > 0)
{
$('.ui-dialog').remove();
}
if($('.ui-dialog-message').length > 0)
{
$('.ui-dialog-message').remove();
}
var thumbValue = $("#thumb").val();
if(thumbValue != "")
{
$('<div class="ui-dialog-message"><img src="' + thumbValue + '" onload="if(this.width > 350)this.width = 350;" /></div>').dialog({
title:'图片预览',
resizable : false,
width : 380
});
}
});
$('form').submit(function(){
postDialog();
});
$("#flagsj").click(
function () {
if(this.checked){
$(".j").show();
$(".notJ").hide();
}else{
$(".j").hide();
$(".notJ").show();
}
}
);
$("#color").colorpicker();
$("#flagsb").click(
function () {
if(this.checked){
$("#title").css("font-weight","bold");
}else{
$("#title").css("font-weight","normal");
}
}
);
});
</script>
</body>
</html> | 01cms | 01cms/branches/v1.0/01cms/view/Archive/archiveAddCompany.tpl | Smarty | asf20 | 11,274 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>{:$i->title}</title>
<link href="{:$smarty.const.PUBLIC_DIR}/common/style/admin.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div class="wrapper">
<div class="title shadow titleBg">
<table width="100%" border="0" cellspacing="1">
<tr>
<td><h1> 文档系统 => 添加文档</h1></td>
</tr>
</table>
</div>
<div class="content shadow">
<table width="100%" border="0" cellspacing="1">
<tr class="titleBg">
<th scope="col" class="textL">请先选择您要添加的内容类型:</th>
</tr>
<tr>
<td class="textL font14" style="padding:16px;">
{:foreach item=item key=key from=$i->Load->data("archiveChannel")}
【<a href="{:$smarty.const.BOOT_URL}/Archive/archive/add/0/0/{:$key}">{:$item.name}</a>】
{:/foreach}
</td>
</tr>
</table>
</div>
</div>
</body>
</html>
| 01cms | 01cms/branches/v1.0/01cms/view/Archive/channelSelect.tpl | Smarty | asf20 | 1,140 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>{:$i->title}</title>
</head>
<body>
<div class="wrapper">
<div class="title shadow titleBg">
<table width="100%" border="0" cellspacing="1">
<tr>
<td><h1> {:$i->title} => {:if $i->p[0] eq "mod"}修改{:elseif $i->p[0] eq "add"}添加{:/if} </h1></td>
</tr>
</table>
</div>
<div class="content shadow">
<form>
<table width="100%" border="0" cellspacing="1">
<tr>
<th nowrap="nowrap">标 题:</th>
<td><input name="title" type="text" id="title" value="" size="60" class="posted" /></td>
</tr>
<tr>
<th nowrap="nowrap">关键词:</th>
<td><input name="keywords" type="text" id="keywords" value="" size="60" class="posted" /></td>
</tr>
<tr>
<th nowrap="nowrap">描 述:</th>
<td><textarea name="description" rows="3" id="description" class="posted"></textarea></td>
</tr>
<tr>
<th nowrap="nowrap">文件名:</th>
<td><input name="fileName" type="text" id="fileName" value="{:$i->Load->var.htmlSaveDir}/single/{:$smarty.now|date_format:'%Y%m%d%H%M%S'}.html" size="40" class="posted check" /> [<a href="#@" class="helpTip" title="相对于安装目录的完整路径">?</a>]</td>
</tr>
<tr>
<th nowrap="nowrap">模板名:</th>
<td>/template/{:$i->Load->var.style}/<input name="template" type="text" id="template" value="single.tpl" size="20" class="posted check inputLine" /></td>
</tr>
<tr>
<th nowrap="nowrap">内 容:</th>
<td><textarea name="content" rows="10" id="content" class="posted check"></textarea></td>
</tr>
<tr>
<th nowrap="nowrap"> </th>
<td><input type="submit" value=" 提 交 " />
<input type="reset" onclick="history.go(-1);" value=" 返 回 " /> </td>
</tr>
</table>
</form>
</div>
</div>
<link href="{:$smarty.const.PUBLIC_DIR}/common/style/admin.css" rel="stylesheet" type="text/css" />
<style type="text/css">
th {text-align:right; width:65px;}
td {text-align:left;}
</style>
<link href="{:$smarty.const.PUBLIC_DIR}/common/style/ui.all.css" rel="stylesheet" type="text/css" />
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/jquery-1.4.2.min.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/jquery.tools.min.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.core.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.draggable.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.dialog.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/jquery.post.js"></script>
<script language="javascript" type="text/javascript">
$(document).ready(function(){
$(".helpTip").tooltip().dynamic();
$("form").post({
sendUrl:'{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/{:if $i->p[0] eq "mod"}update/{:$i->p[1]}{:elseif $i->p[0] eq "add"}insert{:/if}',
goUrl:'{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/lists'
});
});
</script>
</body>
</html>
| 01cms | 01cms/branches/v1.0/01cms/view/Archive/singleAdd.tpl | Smarty | asf20 | 3,696 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>{:$i->title}</title>
<link href="{:$smarty.const.PUBLIC_DIR}/common/style/admin.css" rel="stylesheet" type="text/css" />
<link href="{:$smarty.const.PUBLIC_DIR}/common/style/common/tooltip.css" rel="stylesheet" type="text/css" />
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/jquery.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/jquery.tooltip.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/jquery.boxy.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/common.js"></script>
<link href="{:$smarty.const.PUBLIC_DIR}/common/style/common/boxy.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
th {
text-align:right;
}
td {
text-align:left;
}
.template { border:none; border-bottom:1px #999 solid; }
-->
</style>
</head>
<body>
<div class="wrapper">
<div class="title shadow titleBg">
<table width="100%" border="0" cellspacing="1">
<tr>
<td><h1> {:$i->title} => {:if $i->p[0] eq "mod"}修改{:elseif $i->p[0] eq "add"}
添加{:/if} </h1></td>
</tr>
</table>
</div>
<div class="content shadow">
<form id="form1" method="post" action="{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/{:if $i->p[0] eq "mod"}update/{:$i->p[1]}{:elseif $i->p[0] eq "add"}insert/0{:/if}/{:$i->p[2]}/{:$i->p[3]}" target="actionFrame" onsubmit="javascript:return actionFrame();">
<table width="100%" border="0" cellspacing="1">
<tr>
<th width="20%">完整标题:</th>
<td width="80%"><input class="inputtitle" name="title" type="text" size="60" id="title" value="" />
*</td>
</tr>
<tr>
<th width="20%">简短标题:</th>
<td width="80%"><input class="inputtitle" name="briefTitle" type="text" size="40" id="briefTitle" value="" title="可不填,默认和完整标题相同" />
<select name="color" id="color">
<option value="">颜色</option>
<option value="#000" style="background-color:#000"></option>
<option value="#fff" style="background-color:#fff"></option>
<option value="green" style="background-color:green"></option>
<option value="maroon" style="background-color:maroon"></option>
<option value="olive" style="background-color:olive"></option>
<option value="navy" style="background-color:navy"></option>
<option value="purple" style="background-color:purple"></option>
<option value="gray" style="background-color:gray"></option>
<option value="#ff0" style="background-color:#ff0"></option>
<option value="#0f0" style="background-color:#0f0"></option>
<option value="#0ff" style="background-color:#0ff"></option>
<option value="#f0f" style="background-color:#f0f"></option>
<option value="red" style="background-color:red"></option>
<option value="#00f" style="background-color:#00f"></option>
<option value="teal" style="background-color:teal"></option>
</select>
(在列表中显示)</td>
</tr>
<tr>
<th width="20%">属 性:</th>
<td width="80%"><input class='noBorder' type='checkbox' name='flag[]' id='flagsh' value='h'><label for="flagsh">
头条[h]</label>
<input class='noBorder' type='checkbox' name='flag[]' id='flagsc' value='c'><label for="flagsc">
推荐[c]</label>
<input class='noBorder' type='checkbox' name='flag[]' id='flagsp' value='p'><label for="flagsp">
图文[p]</label>
<input class='noBorder' type='checkbox' name='flag[]' id='flagsf' value='f'><label for="flagsf">
幻灯[f]</label>
<input class='noBorder' type='checkbox' name='flag[]' id='flagss' value='s'><label for="flagss">
滚动[s]</label>
<input class='noBorder' type='checkbox' name='flag[]' id='flagsj' value='j'><label for="flagsj">
跳转[a]</label>
<input class='noBorder' type='checkbox' name='flag[]' id='flagsb' value='b'><label for="flagsb">
加粗[b]</label></td>
</tr>
<tr class="j hidden">
<th width="20%">跳转地址:</th>
<td width="80%"><input name="redirectUrl" type="text" size="60" id="redirectUrl" value="" />
*</td>
</tr>
<tr class="notJ">
<th width="20%">副标题:</th>
<td width="80%"><input name="viceTitle" type="text" size="60" id="viceTitle" value="" /></td>
</tr>
<tr>
<th>缩略图:</th>
<td><input title="点击查看图片" name="thumb" type="text" size="50" id="thumb" value="{:$i->data->thumb}" /> 【<a href='#' title="上传图片" id="upload">上传图片</a>】</td>
</tr>
<tr class="notJ">
<th>栏 目:</th>
<td><select name="categoryId" id="categoryId">
<option value="">--请选择栏目--</option>
{:foreach item=item from=$i->category}
<option {:$item->style} value="{:$item->id}" {:if $item->id == $i->categoryId}selected="selected"{:/if}>{:$item->name}</option>
{:/foreach}
</select>
* (不能选灰色背景的栏目)</td>
</tr>
{:field fields=$i->addFields}
<tr class="notJ">
<th width="20%">{:$name}:</th>
<td width="80%"> {:$code} </td>
</tr>
{:/field}
<tr class="notJ">
<th>作 者:</th>
<td><input name="author" type="text" size="30" id="author" value="" /></td>
</tr>
<tr class="notJ">
<th>来 源:</th>
<td><input name="source" type="text" size="30" id="source" value="" /></td>
</tr>
<tr class="notJ">
<th width="20%">关键词:</th>
<td width="80%"><input name="keywords" type="text" size="50" id="keywords" value="" />
(多个时用空格隔开)</td>
</tr>
<tr class="notJ">
<th width="20%">摘 要:</th>
<td width="80%"><textarea name="desc" cols="58" rows="4" id="desc"></textarea></td>
</tr>
<tr>
<th>文档排序:</th>
<td>
<select name="ordering" id="ordering">
<option value="0" selected="selected">默认排序</option>
<option value="7">置顶一周</option>
<option value="15">置顶半个月</option>
<option value="30">置顶一个月</option>
<option value="90">置顶三个月</option>
<option value="180">置顶半年</option>
<option value="360">置顶一年</option>
</select></td>
</tr>
<tr class="notJ">
<th>列表显示:</th>
<td>
<label><input class="noBorder" name="listed" type="radio" value="1" checked="checked" />是</label> <label><input name="listed" class="noBorder" type="radio" value="0" />否</label>
(如果选否则不会在首页和列表页中出现)</td>
</tr>
<tr class="notJ">
<th>访问权限:</th>
<td><select name="visit" id="visit">
<option value="0" selected="selected">无任何访问限制</option>
<option value="1">VIP1及以上等级</option>
<option value="2">VIP2及以上等级</option>
<option value="3">VIP3及以上等级</option>
<option value="4">VIP4及以上等级</option>
<option value="5">VIP5及以上等级</option>
<option value="6">VIP6及以上等级</option>
<option value="-1">禁止任何人访问</option>
</select></td>
</tr>
<tr class="notJ">
<th width="20%">发布日期:</th>
<td width="80%"><input name="pubTime" type="text" size="20" id="pubTime" value="{:$smarty.now|date_format:"%Y-%m-%d %H:%M:%S"}
" /></td>
</tr>
<tr>
<th> </th>
<td><input type="submit" id="submit" value=" 提 交 " />
<input type="reset" onclick="history.go(-1);" value=" 返 回 " /></td>
</tr>
</table>
</form>
</div>
</div>
<script language="javascript" type="text/javascript">
$("#flagsj").click(
function () {
if(this.checked){
$(".j").show();
$(".notJ").hide();
}else{
$(".j").hide();
$(".notJ").show();
}
}
);
$("#upload").click(
function () {
if($("#uploadFrame").tpl()===null)
{
$("select").hide();
new Boxy('<iframe id="uploadFrame" src="{:$smarty.const.BOOT_URL}/file/upload/show" width="400" height="100" frameborder="0" scrolling="no"></iframe>', {title:'上传图片', afterHide:function() {remove();}});
return false;
}
}
);
$("#thumb").focus(
function () {
if($.trim($("#thumb").get(0).value)!='')
{
new Boxy('<img src="'+$("#thumb").get(0).value+'">', {title:'缩略图'});
}
}
);
$("#thumb").blur(
function () {
$(".boxy-wrapper").hide("fast");
}
);
function hide(){
$(".boxy-wrapper").remove();
Boxy.DEFAULTS.title = '上传成功';
new Boxy('<img src="'+$("#thumb").get(0).value+'">');
window.setTimeout("doHide();",2000);
}
function actionFrame() {
$("#submit").get(0).disabled=true;
new Boxy('<iframe frameborder="0" scrolling="auto" width="330" height="120" id="actionFrame" name="actionFrame"></iframe>', {title:'提示信息',closeable:false});
return true;
}
function hideAlertTrue(){
$(".boxy-wrapper").remove();
window.location.href='{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/lists';
return true;
}
function hideAlertFalse(){
$(".boxy-wrapper").remove();
$("#submit").get(0).disabled=false;
return false;
}
function doAgain(){
$(".boxy-wrapper").remove();
window.location.href='{:$smarty.const.BOOT_URL}/{:$i->Uri->getPathInfo()}';
return true;
}
function listMore(){
$(".boxy-wrapper").remove();
window.location.href='{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/lists';
return true;
}
function doHide(){
$(".boxy-wrapper").hide("slow");
remove();
}
function upload(url){
$('#thumb').val(url);
}
$("#addNode").click(
function () {
$("select").hide();
if($('#newNodeName').tpl()===null)
{
new Boxy('<form action="" method="get">节点名称:<input type="text" name="newNodeName" id="newNodeName" value="" /> [<a href="#@" onclick="newNode();return false;">确定</a>]</form>', {title:'增加节点', afterHide:function() {remove();}});
}
return false;
}
);
$("#addArchive").click(
function () {
if($("#addArchiveFrame").tpl()===null)
{
$("select").hide();
new Boxy('<iframe id="addArchiveFrame" src="{:$smarty.const.BOOT_URL}/Archive/archive/lists/0/0/0/0/select/insertSpecIds" width="620" height="400" frameborder="0" scrolling="auto"></iframe>', {title:'选择文档', afterHide:function() {remove();}});
return false;
}
}
);
$("#addRelative").click(
function () {
if($("#addRelativeFrame").tpl()===null)
{
$("select").hide();
new Boxy('<iframe id="addRelativeFrame" src="{:$smarty.const.BOOT_URL}/Archive/archive/lists/0/0/0/0/select/insertRelativeIds" width="620" height="400" frameborder="0" scrolling="auto"></iframe>', {title:'选择文档', afterHide:function() {remove();}});
return false;
}
}
);
function remove()
{
$(".boxy-wrapper").remove();
$("select").show();
}
function newNode(){
var startBr="\n";
if($("#newNodeName").val()=='')
{
alert('节点名称不能为空');
return false;
}
if($("#specCode").val()==''){
startBr="";
}
$("#specCode").val($("#specCode").val()+startBr+$("#newNodeName").val()+":");
remove();
return false;
}
var textObj;
function insertSpecIds(ids){
if(typeof(textObj) == 'object' && textObj.caretPos)
{
textObj.caretPos.text+=ids;
}
else
{
var specValue = $("#specCode").val() +ids;
$("#specCode").val(specValue);
}
remove();
return false;
}
function insertRelativeIds(ids){
$("#relative").val($("#relative").val() +ids);
remove();
return false;
}
function setCaret(o){
textObj = o;
if(textObj.createTextRange){
textObj.caretPos=document.selection.createRange().duplicate();
}
}
</script>
</body>
</html> | 01cms | 01cms/branches/v1.0/01cms/view/Archive/archiveAddSpec.tpl | Smarty | asf20 | 13,067 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>{:$i->title}</title>
<link href="{:$smarty.const.PUBLIC_DIR}/common/style/admin.css" rel="stylesheet" type="text/css" />
<link href="{:$smarty.const.PUBLIC_DIR}/common/style/uploadify.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
th { text-align:right; }
td { text-align:left; }
.template { border:none; border-bottom:1px #999 solid; }
.color { color:{:$i->data->color}; cursor:pointer;}
#title {color:{:$i->data->color};{:if $i->data->flag|@strpos:"b" !== false}font-weight:bold;{:/if} }
{:if $i->data->flag && $i->data->flag|@strpos:"j" !== false}.notJ{:else}.j{:/if}{display:none;}
-->
</style>
</head>
<body>
<div class="wrapper">
<div class="title shadow titleBg">
<table width="100%" border="0" cellspacing="1">
<tr>
<td><h1> {:$i->title} => {:if $i->p[0] eq "mod"}修改{:elseif $i->p[0] eq "add"}
添加{:/if} </h1></td>
</tr>
</table>
</div>
<div class="content shadow">
<form id="form1" method="post" action="{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/{:if $i->p[0] eq "mod"}update/{:$i->p[1]}{:elseif $i->p[0] eq "add"}insert/0{:/if}/{:$i->p[2]}/{:$i->p[3]}" target="autoFrame">
<table width="100%" border="0" cellspacing="1">
<tr>
<th width="20%">标 题:</th>
<td width="80%"><input class="inputtitle showcolor" name="title" type="text" size="60" id="title" value="{:$i->data->title|htmlspecialchars}" />
<input name="color" type="text" size="7" id="color" value="{:$i->data->color}" class="color" /></td>
</tr>
<tr>
<th width="20%">属 性:</th>
<td width="80%"><input name='flag[]' type='checkbox' class='noBorder' id='flagsh' value='h' {:php}echo (strpos($this->_tpl_var['i']->data->flag,'h')!==false ? 'checked="checked"' : '');{:/php}>
<label for="flagsh"> 头条[h]</label>
<input class='noBorder' type='checkbox' name='flag[]' id='flagsc' value='c'{:if $i->data->flag|@strpos:"c" !== false} checked="checked"{:/if}>
<label for="flagsc"> 推荐[c]</label>
<input class='noBorder' type='checkbox' name='flag[]' id='flagsp' value='p'{:if $i->data->flag|@strpos:"p" !== false} checked="checked"{:/if}>
<label for="flagsp"> 图文[p]</label>
<input class='noBorder' type='checkbox' name='flag[]' id='flagsf' value='f'{:if $i->data->flag|@strpos:"f" !== false} checked="checked"{:/if}>
<label for="flagsf"> 幻灯[f]</label>
<input class='noBorder' type='checkbox' name='flag[]' id='flagss' value='s'{:if $i->data->flag|@strpos:"s" !== false} checked="checked"{:/if}>
<label for="flagss"> 滚动[s]</label>
<input class='noBorder' type='checkbox' name='flag[]' id='flagsj' value='j'{:if $i->data->flag|@strpos:"j" !== false} checked="checked"{:/if}>
<label for="flagsj"> 跳转[a]</label>
<input class='noBorder' type='checkbox' name='flag[]' id='flagsb' value='b'{:if $i->data->flag|@strpos:"b" !== false} checked="checked"{:/if}>
<label for="flagsb"> 加粗[b]</label></td>
</tr>
<tr class="j">
<th width="20%">跳转地址:</th>
<td width="80%"><input name="redirectUrl" type="text" size="60" id="redirectUrl" value="{:$i->data->redirectUrl}" />
*</td>
</tr>
<tr class="notJ">
<th width="20%">副标题:</th>
<td width="80%"><input name="viceTitle" type="text" size="60" id="viceTitle" value="{:$i->data->viceTitle}" /></td>
</tr>
<tr>
<th>缩略图:</th>
<td><input title="点击查看图片" name="thumb" type="text" size="50" id="thumb" value="{:$i->data->thumb}" />
<a href='#' title="上传图片" class="buttonBox hidden" id="preView">预览</a>
<input type="file" name="uploadify" id="uploadify" size="2" />
<div id="fileQueue"></div></td>
</tr>
<tr>
<th>栏 目:</th>
<td><select name="categoryId" id="categoryId">
{:foreach item=item from=$i->category}
<option {:if $item->channelId != $i->channelId}style="background:#ccc;" value="-1"{:else}value="{:$item->id}"{:/if} {:if $item->id == $i->categoryId}selected="selected"{:/if}>{:$item->name}</option>
{:/foreach}
</select>
* (不能选灰色背景的栏目)</td>
</tr>
<tr class="notJ">
<th>作 者:</th>
<td><input name="author" type="text" size="30" id="author" value="{:$i->data->author}" /></td>
</tr>
<tr class="notJ">
<th>来 源:</th>
<td><input name="source" type="text" size="30" id="source" value="{:$i->data->source}" /></td>
</tr>
{:field fields=$i->addFields data=$i->addData}
<tr class="notJ">
<th width="20%">{:$name}:</th>
<td width="80%"> {:$code} </td>
</tr>
{:/field}
<tr class="notJ" id="advShow">
<th width="20%"> </th>
<td width="80%">【<a href="#@" onclick="$('#advItems').show();$('#advHide').show();$('#advShow').hide();">显示高级选项</a>】</td>
</tr>
<tr class="notJ hidden" id="advHide">
<th width="20%"> </th>
<td width="80%">【<a href="#@" onclick="$('#advShow').show();$('#advHide').hide();$('#advItems').hide();">隐藏高级选项</a>】</td>
</tr>
<tbody class="notJ hidden" id="advItems">
<tr class="notJ">
<th width="20%">关键词:</th>
<td width="80%"><input name="keywords" type="text" size="50" id="keywords" value="{:$i->data->keywords}" />
(多个时用空格隔开)</td>
</tr>
<tr class="notJ">
<th width="20%">摘 要:</th>
<td width="80%"><textarea name="desc" cols="58" rows="4" id="desc">{:$i->data->desc}</textarea></td>
</tr>
<tr>
<th>文档排序:</th>
<td><select name="ordering" id="ordering">
<option value="0" {:if ($i->data->ordering - $i->data->pubTime) / 86400 == 0}selected="selected"{:/if}>默认排序</option>
<option value="7" {:if ($i->data->ordering - $i->data->pubTime) / 86400 == 7}selected="selected"{:/if}>置顶一周</option>
<option value="15" {:if ($i->data->ordering - $i->data->pubTime) / 86400 == 15}selected="selected"{:/if}>置顶半个月</option>
<option value="30" {:if ($i->data->ordering - $i->data->pubTime) / 86400 == 30}selected="selected"{:/if}>置顶一个月</option>
<option value="90" {:if ($i->data->ordering - $i->data->pubTime) / 86400 == 90}selected="selected"{:/if}>置顶三个月</option>
<option value="180" {:if ($i->data->ordering - $i->data->pubTime) / 86400 == 180}selected="selected"{:/if}>置顶半年</option>
<option value="360" {:if ($i->data->ordering - $i->data->pubTime) / 86400 == 360}selected="selected"{:/if}>置顶半年</option>
</select></td>
</tr>
<tr class="notJ">
<th>列表显示:</th>
<td><label>
<input class="noBorder" name="listed" type="radio" value="1" {:if $i->data->listed == '1'}checked="checked"{:/if} />是</label>
<label>
<input name="listed" class="noBorder" type="radio" value="0" {:if $i->data->listed == '0'}checked="checked"{:/if} />否</label>
(如果选否则不会在首页和列表页中出现)</td>
</tr>
<tr class="notJ">
<th>访问控制:</th>
<td><select name="visit" id="visit">
<option value="1" {:if $i->data->visit == '1'}selected="selected"{:/if}>访问允许</option>
<option value="0" {:if $i->data->visit == '0'}selected="selected"{:/if}>禁止访问</option>
</select></td>
</tr>
<tr class="notJ">
<th width="20%">发布日期:</th>
<td width="80%"><input name="pubTime" type="text" size="20" id="pubTime" value="{:$i->data->pubTime|date_format:"%Y-%m-%d %H:%M:%S"}
" /></td>
</tr>
<tr class="notJ">
<th width="20%">文档模板:</th>
<td width="80%">/template/{:$i->Load->var.style}/<input name="templateName" type="text" size="30" value="" id="templateName" class="inputLine" /></td>
</tr>
<tr class="notJ">
<th width="20%" nowrap="nowrap">生成文档:</th>
<td width="80%">{:$smarty.const.ROOT_PATH}<input name="fileName" type="text" size="30" value="" id="fileName" class="inputLine" /></td>
</tr>
</tbody>
<tr>
<th> </th>
<td><input type="submit" id="submit" value=" 提 交 " />
<input type="reset" onclick="history.go(-1);" value=" 返 回 " /></td>
</tr>
</table>
</form>
</div>
</div>
<link href="{:$smarty.const.PUBLIC_DIR}/common/style/tooltip.css" rel="stylesheet" type="text/css" />
<link href="{:$smarty.const.PUBLIC_DIR}/common/style/ui.all.css" rel="stylesheet" type="text/css" />
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/jquery.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.core.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.draggable.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.resizable.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.dialog.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/common.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/jquery.tooltip.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/jquery.upload.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/jquery.colorpicker.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/swfobject.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/jquery.uploadify.v2.1.0.min.js"></script>
<script language="javascript" type="text/javascript">
function upload(url)
{
$("#thumb").val(url);
$("#preView").show();
}
function uploaded(e,queueId,fileObj,response,data)
{
var error = $(response).find("#error").html();
if(error != '')
{
alert(error);
}
else
{
$("#preView").show();
var file = $(response).find("#file").html();
$("#thumb").val(file);
}
}
$(document).ready(function(){
$("#uploadify").uploadify({
'uploader' : '{:$smarty.const.PUBLIC_DIR}/common/image/uploadify.swf',
'script' : '{:$smarty.const.BOOT_URL}/file/upload',
'cancelImg' : '{:$smarty.const.PUBLIC_DIR}/common/image/cancel.png',
'queueID' : 'fileQueue',
'auto' : true,
'multi' : false,
'onComplete' : function(e,queueId,fileObj,response,data){uploaded(e,queueId,fileObj,response,data);},
'buttonImg' : '{:$smarty.const.PUBLIC_DIR}/common/image/uploadButton.gif',
'width' : 90,
'height' : 13
});
$('form').submit(function(){
postDialog();
});
$("#flagsj").click(
function () {
if(this.checked){
$(".j").show();
$(".notJ").hide();
}else{
$(".j").hide();
$(".notJ").show();
}
}
);
if($("#thumb").val() != "")
{
$("#preView").show();
}
$("#categoryId").change(function(){
if(this.value == -1)
{
alert('不能选择灰色背景的栏目');
this.value = 0;
return false;
}
});
$("#preView").click(function(){
if($('.ui-dialog').length > 0)
{
$('.ui-dialog').remove();
}
if($('.ui-dialog-message').length > 0)
{
$('.ui-dialog-message').remove();
}
var thumbValue = $("#thumb").val();
if(thumbValue != "")
{
$('<div class="ui-dialog-message"><img src="' + thumbValue + '" onload="if(this.width > 350)this.width = 350;" /></div>').dialog({
title:'图片预览',
resizable : false,
width : 380
});
}
});
$("#color").colorpicker();
$("#flagsb").click(
function () {
if(this.checked){
$("#title").css("font-weight","bold");
}else{
$("#title").css("font-weight","normal");
}
}
);
});
</script>
</body>
</html> | 01cms | 01cms/branches/v1.0/01cms/view/Archive/archiveMod.tpl | Smarty | asf20 | 13,237 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>{:$i->title}</title>
<link href="{:$smarty.const.PUBLIC_DIR}/common/style/admin.css" rel="stylesheet" type="text/css" />
<link href="{:$smarty.const.PUBLIC_DIR}/common/style/common/tooltip.css" rel="stylesheet" type="text/css" />
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/jquery.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/jquery.tooltip.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/jquery.boxy.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/common.js"></script>
<link href="{:$smarty.const.PUBLIC_DIR}/common/style/common/boxy.css" rel="stylesheet" type="text/css" />
<script language="javascript" type="text/javascript">
$(document).ready(function() {
$(".helpTip").tooltip({cssClass:"tooltip", xOffset:30, opacity:5, duration:1000});
});
function selAll(name)
{
$("input[name='"+name+"']").attr("checked", true);
}
function selAnti(name)
{
$("input[name='"+name+"']").each(function(i){
this.checked=!this.checked;
});
}
function del(name){
var ids='';
$("input:checked[name='"+name+"']").each(function(i){
ids+=this.value+',';
});
if(ids.length==0)
{
alert('您还没有选中要删除的记录!');
return false;
}
ids = ids.substr(0,ids.length-1)
if(confirm('确定要删除ID为'+ids+'的记录吗?'))
{
getDialog('{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/del/'+ids, '{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/lists', 3, 'width:250px;text-align:center;');
}
}
</script>
</head>
<body>
<div class="wrapper">
<div class="title shadow titleBg">
<table width="100%" border="0" cellspacing="1">
<tr>
<td><h1> {:$i->title} <span>[<a href="{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/add">添加</a>]</span></h1></td>
</tr>
</table>
</div>
<div class="content shadow">
<table width="100%" border="0" cellspacing="1">
<tr class="titleBg">
<th scope="col">#ID</th>
<th scope="col">选择</th>
<th scope="col">昵称</th>
<th scope="col">IP</th>
<th scope="col">评论时间</th>
<th scope="col">评论内容</th>
<th scope="col">操作</th>
</tr>
{:foreach item=item from=$i->lists}<tr>
<td>{:$item->id}</td>
<td><input name="selected[]" type="checkbox" value="{:$item->id}" class="noBorder" /></td>
<td>{:$item->uname|default:'匿名网友'}</td>
<td>{:$item->ip}</td>
<td>{:$item->time|date_format:"%Y-%m-%d %H:%M:%S"}</td>
<td title="{:$item->message}" class="helpTip">点击查看</td>
<td><a href="{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/mod/{:$item->id}">修改</a> | <a onclick="if(confirm('确定要删除?')){getDialog('{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/del/{:$item->id}', '{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/lists', 3, 'width:250px;text-align:center;');}return false;" href="#@">删除</a></td>
</tr>{:/foreach}
<tr>
<td colspan="7" class="lightGreyBg textL"> <a href="#@" onclick="selAll('selected[]');">全选</a> | <a href="#@" onclick="selAnti('selected[]');">反选</a> | <a href="#@" onclick="dels('selected[]');">删除</a> | {:$i->pagesCode}</td>
</tr>
</table>
</div>
</div>
</body>
</html>
| 01cms | 01cms/branches/v1.0/01cms/view/Archive/comment.tpl | Smarty | asf20 | 3,746 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>{:$i->title}</title>
<link href="{:$smarty.const.PUBLIC_DIR}/common/style/admin.css" rel="stylesheet" type="text/css" />
<link href="{:$smarty.const.PUBLIC_DIR}/common/style/common/ui.all.css" rel="stylesheet" type="text/css" />
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/jquery.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/jquery.mydialog.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/common.js"></script>
</head>
<body>
<div class="wrapper">
<div class="title shadow titleBg">
<table width="100%" border="0" cellspacing="1">
<tr>
<td><h1> {:$i->title} <span>[<a href="{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/add/0/{:$i->p[2]}">添加字段</a>]</span></h1></td>
</tr>
</table>
</div>
<div class="content shadow">
<table width="100%" border="0" cellspacing="1">
<tr class="titleBg">
<th scope="col">排序</th>
<th scope="col">字段提示</th>
<th scope="col">字段名</th>
<th scope="col">类型</th>
<th scope="col">操作</th>
</tr>
{:foreach item=item from=$i->lists}<tr>
<td>{:$item->ordering}</td>
<td>{:$item->name}</td>
<td>{:$item->field}</td>
<td>{:$item->type}</td>
<td><a href="{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/mod/{:$item->id}/{:$i->p[2]}">修改</a> | <a onclick="if(confirm('确定要删除?'))del({:$item->id},'{:$item->field}');return false;" href="#@">删除</a></td>
</tr>{:/foreach}
<tr>
<td colspan="6" class="lightGreyBg textL"> {:$i->pagesCode}</td>
</tr>
</table>
</div>
</div>
<link href="{:$smarty.const.PUBLIC_DIR}/common/style/tooltip.css" rel="stylesheet" type="text/css" />
<link href="{:$smarty.const.PUBLIC_DIR}/common/style/ui.all.css" rel="stylesheet" type="text/css" />
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/jquery.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.core.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.draggable.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.resizable.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.dialog.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/jquery.tooltip.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/common.js"></script>
<script language="javascript" type="text/javascript">
function del(id,field)
{
getDialog('{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/del/'+id+'/{:$i->p[2]}/'+field, '{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/lists/0/{:$i->p[2]}');
return false;
}
</script>
</body>
</html>
| 01cms | 01cms/branches/v1.0/01cms/view/Archive/field.tpl | Smarty | asf20 | 3,407 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>{:$i->title}</title>
<link href="{:$smarty.const.PUBLIC_DIR}/common/style/admin.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--config[
th {text-align:right;}
td {text-align:left;}
-->
</style>
</head>
<body>
<div class="wrapper">
<div class="title shadow titleBg">
<table width="100%" border="0" cellspacing="1">
<tr>
<td><h1> {:$i->title} => {:if $i->p[0] eq "mod"}修改{:elseif $i->p[0] eq "add"}
添加{:/if} <span>[<a href="{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/lists/0/{:$i->p[2]}">字段管理</a>]</h1></td>
</tr>
</table>
</div>
<div class="content shadow">
<form>
<table width="100%" border="0" cellspacing="1">
<tr>
<th width="20%">排 序:</th>
<td width="80%"><input name="ordering" type="text" size="4" id="ordering" value="0" class="posted" /></td>
</tr>
<tr>
<th width="20%">字段提示:</th>
<td width="80%"><input name="name" type="text" size="20" id="name" value="" class="posted" /></td>
</tr>
<tr>
<th width="20%">空值提示:</th>
<td width="80%"><input name="emptyTip" type="text" size="40" id="emptyTip" value="" class="posted" /> (允许字段空值则留空)</td>
</tr>
<tr>
<th width="20%">字段名称:</th>
<td width="80%"><input name="field" type="text" size="20" id="field" value="" class="posted" /></td>
</tr>
<tr>
<th>字段类型:</th>
<td><select id="selectCode" >
<option value=''>常用类型参考</option>
<option value="text">单行文本</option>
<option value="textarea">多行文本域</option>
<option value="FCKeditor">编辑器文本域</option>
<option value="checkbox">复选框</option>
<option value="radio">单选按钮组</option>
<option value="select">下拉列表</option>
<option value="hidden">隐藏域</option>
</select>
<input name="type" type="text" id="type" value="" size="40" title="不能带有双引号,请根据需要适当修改参考代码" class="posted" />
<select id="selectType" >
<option value="">更多参考...</option>
<option value="int(11) NOT NULL DEFAULT 0">int(11)</option>
<option value="tinyint(1) NOT NULL DEFAULT 0">tinyint(1)</option>
<option value="smallint(6) NOT NULL DEFAULT 0">smallint(6)</option>
<option value="mediumint(8) NOT NULL DEFAULT 0">mediumint(8)</option>
<option value="varchar(255) NOT NULL">varchar(255)</option>
<option value="char(5) NOT NULL">char(5)</option>
<option value="set('a','c','c')">set('a','c','c')</option>
<option value="enum('a','c','c')">enum('a','c','c')</option>
<option value="tinytext">tinytext</option>
<option value="text">text</option>
<option value="mediumtext">mediumtext</option>
<option value="longtext">longtext</option>
</select></td>
</tr>
<tr>
<th>表单代码:</th>
<td><textarea title="不能带有双引号,请根据需要适当修改参考代码" name="code" cols="60" rows="10" id="code" class="posted"></textarea></td>
</tr>
<tr>
<th> </th>
<td><input type="submit" value=" 提 交 " />
<input type="reset" onclick="history.go(-1);" value=" 返 回 " /></td>
</tr>
</table>
</form>
</div>
</div>
<link href="{:$smarty.const.PUBLIC_DIR}/common/style/ui.all.css" rel="stylesheet" type="text/css" />
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/jquery.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.core.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.draggable.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.dialog.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/jquery.post.js"></script>
<script language="javascript" type="text/javascript">
$(document).ready(function(){
$("form").post({
sendUrl:'{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/{:if $i->p[0] eq "mod"}update/{:$i->p[1]}{:elseif $i->p[0] eq "add"}insert/0{:/if}/{:$i->p[2]}',
goUrl:'{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/lists/-1/{:$i->p[2]}'
});
});
$("#selectType").change( function() {
$("#type").get(0).value = this.value;
});
$("#selectCode").change( function() {
var code,field;
field=$("#field").get(0).value;
if(this.value=='text'){
$("#type").get(0).value = "varchar(64) NOT NULL";
code='<!--config{type=text}-->\n<input name="'+field+'" id="'+field+'" size="30" type="text" value="$value" />';
}else if(this.value=='hidden'){
$("#type").get(0).value = "varchar(64) NOT NULL";
code='<!--config{type=hidden}-->\n<input name="'+field+'" id="'+field+'" type="hidden" value="$value" />';
}else if(this.value=='textarea'){
$("#type").get(0).value = "text";
code='<!--config{type=textarea}-->\n<textarea name="'+field+'" id="'+field+'" cols="60" rows="8">$value</textarea>';
}else if(this.value=='FCKeditor'){
$("#type").get(0).value = "text";
code='<!--config{type=FCKeditor}-->\nFCKeditor|Width=100%;Height=500';
}else if(this.value=='checkbox'){
$("#type").get(0).value = "varchar(24) NOT NULL";
code='<!--config{type=checkbox}-->\n<input name="'+field+'" id="'+field+'" type="checkbox" value="1" />';
}else if(this.value=='radio'){
$("#type").get(0).value = "tinyint(1) NOT NULL DEFAULT 0";
code='<!--config{type=radio}-->\n<label><input name="'+field+'" type="radio" value="1" checked="checked" />是</label> \n<label><input name="'+field+'" type="radio" value="0" />否</label>';
}else if(this.value=='select'){
$("#type").get(0).value = "varchar(32) NOT NULL";
code='<!--config{type=select}-->\n<select name="'+field+'">\n <option value="1" selected="selected">1</option>\n <option value="2">2</option>\n</select>';
}else{
code=this.value;
}
$("#code").get(0).value = code;
});
</script>
</body>
</html> | 01cms | 01cms/branches/v1.0/01cms/view/Archive/fieldAdd.tpl | Smarty | asf20 | 6,808 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>{:$i->title}</title>
<link href="{:$smarty.const.PUBLIC_DIR}/common/style/admin.css" rel="stylesheet" type="text/css" />
<link href="{:$smarty.const.PUBLIC_DIR}/common/style/uploadify.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
th { text-align:right; }
td { text-align:left; }
.template { border:none; border-bottom:1px #999 solid; }
.color { color:#000000; cursor:pointer;}
-->
</style>
</head>
<body>
<div class="wrapper">
<div class="title shadow titleBg">
<table width="100%" border="0" cellspacing="1">
<tr>
<td><h1> {:$i->title} => {:if $i->p[0] eq "mod"}修改{:elseif $i->p[0] eq "add"}
添加{:/if} </h1></td>
</tr>
</table>
</div>
<div class="content shadow">
<form id="form1" method="post" action="{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/insert/0/{:$i->p[2]}/{:$i->p[3]}" target="autoFrame">
<table width="100%" border="0" cellspacing="1">
<tr>
<th width="20%">标 题:</th>
<td width="80%"><input class="inputtitle showcolor" name="title" type="text" size="60" id="title" value="" />
<input name="color" type="text" size="7" id="color" value="#000000" class="color" />
</td>
</tr>
<tr>
<th width="20%">属 性:</th>
<td width="80%"><input class='noBorder' type='checkbox' name='flag[]' id='flagsh' value='h'>
<label for="flagsh"> 头条[h]</label>
<input class='noBorder' type='checkbox' name='flag[]' id='flagsc' value='c'>
<label for="flagsc"> 推荐[c]</label>
<input class='noBorder' type='checkbox' name='flag[]' id='flagsp' value='p'>
<label for="flagsp"> 图文[p]</label>
<input class='noBorder' type='checkbox' name='flag[]' id='flagsf' value='f'>
<label for="flagsf"> 幻灯[f]</label>
<input class='noBorder' type='checkbox' name='flag[]' id='flagss' value='s'>
<label for="flagss"> 滚动[s]</label>
<input class='noBorder' type='checkbox' name='flag[]' id='flagsj' value='j'>
<label for="flagsj"> 跳转[a]</label>
<input class='noBorder' type='checkbox' name='flag[]' id='flagsb' value='b'>
<label for="flagsb"> 加粗[b]</label></td>
</tr>
<tr class="j hidden">
<th width="20%">跳转地址:</th>
<td width="80%"><input name="redirectUrl" type="text" size="60" id="redirectUrl" value="" />
*</td>
</tr>
<tr class="notJ">
<th width="20%">副标题:</th>
<td width="80%"><input name="viceTitle" type="text" size="60" id="viceTitle" value="" /></td>
</tr>
<tr>
<th>缩略图:</th>
<td><input title="点击查看图片" name="thumb" type="text" size="50" id="thumb" value="" />
<a href='#' title="预览图片" class="buttonBox hidden" id="preView">预览</a>
<input type="file" name="uploadify" id="uploadify" size="2" />
<div id="fileQueue"></div></td>
</tr>
<tr>
<th>栏 目:</th>
<td><select name="categoryId" id="categoryId" onchange="if(!this.value){alert('请选择白色背景的栏目');this.value = 0;return false;}">
<option value="0">--请选择栏目--</option>
{:foreach item=item from=$i->category}
<option {:if $item->channelId != $i->channelId}style="background:#ccc;" value="-1"{:else}value="{:$item->id}"{:/if} {:if $item->id == $i->categoryId}selected="selected"{:/if}>{:$item->name}</option>
{:/foreach}
</select>
*</td>
</tr>
<tr class="notJ">
<th>作 者:</th>
<td><input name="author" type="text" size="30" id="author" value="" /></td>
</tr>
<tr class="notJ">
<th>来 源:</th>
<td><input name="source" type="text" size="30" id="source" value="" /></td>
</tr>
{:field fields=$i->addFields}
<tr class="notJ">
<th width="20%">{:$name}:</th>
<td width="80%"> {:$code} </td>
</tr>
{:/field}
<tr class="notJ" id="advShow">
<th width="20%"> </th>
<td width="80%">【<a href="#" onclick="$('#advItems').show();$('#advHide').show();$('#advShow').hide();return false;">显示高级选项</a>】</td>
</tr>
<tr class="notJ hidden" id="advHide">
<th width="20%"> </th>
<td width="80%">【<a href="#" onclick="$('#advShow').show();$('#advHide').hide();$('#advItems').hide();return false;">隐藏高级选项</a>】</td>
</tr>
<tbody class="notJ hidden" id="advItems">
<tr>
<th width="20%">关键词:</th>
<td width="80%"><input name="keywords" type="text" size="50" id="keywords" value="" />
(多个时用空格隔开)</td>
</tr>
<tr class="notJ">
<th width="20%">摘 要:</th>
<td width="80%"><textarea name="desc" cols="58" rows="4" id="desc"></textarea></td>
</tr>
<tr>
<th>文档排序:</th>
<td><select name="ordering" id="ordering">
<option value="0" selected="selected">默认排序</option>
<option value="7">置顶一周</option>
<option value="15">置顶半个月</option>
<option value="30">置顶一个月</option>
<option value="90">置顶三个月</option>
<option value="180">置顶半年</option>
<option value="360">置顶一年</option>
</select></td>
</tr>
<tr>
<th>列表显示:</th>
<td><label>
<input class="noBorder" name="listed" type="radio" value="1" checked="checked" />
是</label>
<label>
<input name="listed" class="noBorder" type="radio" value="0" />
否</label>
(如果选否则不会在首页和列表页中出现)</td>
</tr>
<tr>
<th>访问控制:</th>
<td>
<select name="visit" id="visit">
<option value="0" selected="selected">允许访问</option>
<option value="1">禁止访问</option>
</select>
</td>
</tr>
<tr>
<th width="20%">发布日期:</th>
<td width="80%"><input name="pubTime" type="text" size="20" id="pubTime" value="{:$smarty.now|date_format:"%Y-%m-%d %H:%M:%S"}
" /></td>
</tr>
<tr>
<th width="20%">文档模板:</th>
<td width="80%">/template/{:$i->Load->var.style}/
<input name="templateName" type="text" size="30" value="" id="templateName" class="inputLine" /></td>
</tr>
<tr>
<th width="20%" nowrap="nowrap">生成文档:</th>
<td width="80%">{:$smarty.const.ROOT_PATH}
<input name="fileName" type="text" size="30" value="" id="fileName" class="inputLine" />
</td>
</tr>
</tbody>
<tr>
<th> </th>
<td><input type="submit" id="submit" value=" 提 交 " />
<input type="reset" onclick="history.go(-1);" value=" 返 回 " /></td>
</tr>
</table>
</form>
</div>
</div>
<link href="{:$smarty.const.PUBLIC_DIR}/common/style/tooltip.css" rel="stylesheet" type="text/css" />
<link href="{:$smarty.const.PUBLIC_DIR}/common/style/ui.all.css" rel="stylesheet" type="text/css" />
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/jquery.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.core.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.draggable.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.resizable.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.dialog.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/common.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/jquery.tooltip.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/jquery.upload.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/jquery.colorpicker.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/swfobject.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/jquery.uploadify.v2.1.0.min.js"></script>
<script language="javascript" type="text/javascript">
function upload(url)
{
$("#thumb").val(url);
$("#preView").show();
}
function uploaded(e,queueId,fileObj,response,data)
{
var error = $(response).find("#error").html();
if(error != '')
{
alert(error);
}
else
{
$("#preView").show();
var file = $(response).find("#file").html();
$("#thumb").val(file);
}
}
$(document).ready(function(){
$("#uploadify").uploadify({
'uploader' : '{:$smarty.const.PUBLIC_DIR}/common/image/uploadify.swf',
'script' : '{:$smarty.const.BOOT_URL}/file/upload',
'cancelImg' : '{:$smarty.const.PUBLIC_DIR}/common/image/cancel.png',
'queueID' : 'fileQueue',
'auto' : true,
'multi' : false,
'onComplete' : function(e,queueId,fileObj,response,data){uploaded(e,queueId,fileObj,response,data);},
'buttonImg' : '{:$smarty.const.PUBLIC_DIR}/common/image/uploadButton.gif',
'width' : 90,
'height' : 13
});
if($("#thumb").val() != "")
{
$("#preView").show();
}
$("#categoryId").change(function(){
if(this.value == -1)
{
alert('不能选择灰色背景的栏目');
this.value = 0;
return false;
}
});
$("#preView").click(function(){
if($('.ui-dialog').length > 0)
{
$('.ui-dialog').remove();
}
if($('.ui-dialog-message').length > 0)
{
$('.ui-dialog-message').remove();
}
var thumbValue = $("#thumb").val();
if(thumbValue != "")
{
$('<div class="ui-dialog-message"><img src="' + thumbValue + '" onload="if(this.width > 350)this.width = 350;" /></div>').dialog({
title:'图片预览',
resizable : false,
width : 380
});
}
});
$('form').submit(function(){
postDialog();
});
$("#flagsj").click(
function () {
if(this.checked){
$(".j").show();
$(".notJ").hide();
}else{
$(".j").hide();
$(".notJ").show();
}
}
);
$("#color").colorpicker();
$("#flagsb").click(
function () {
if(this.checked){
$("#title").css("font-weight","bold");
}else{
$("#title").css("font-weight","normal");
}
}
);
});
</script>
</body>
</html> | 01cms | 01cms/branches/v1.0/01cms/view/Archive/archiveAdd.tpl | Smarty | asf20 | 11,768 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>{:$i->title}</title>
<link href="{:$smarty.const.PUBLIC_DIR}/common/style/admin.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div class="wrapper">
<div class="title shadow titleBg">
<table width="100%" border="0" cellspacing="1">
<tr>
<td><h1> {:$i->title} <span>[<a href="{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/add">添加栏目</a>] [<a href="#" class="helpTip" title="可以上下拖动栏目名称进行排序">?</a>]</span></h1></td>
</tr>
</table>
</div>
<div class="content shadow">
<table width="100%" border="0" cellspacing="1">
<tr class="titleBg">
<th scope="col">#ID</th>
<th scope="col">选择</th>
<th class="textL" scope="col">栏目名称</th>
<th scope="col">类型</th>
<th scope="col">访问</th>
<th scope="col">隐藏</th>
<th scope="col">操作</th>
</tr>
<tbody class="main">
{:foreach item=item from=$i->lists}<tr>
<td>{:$item->id}</td>
<td><input name="selected[]" type="checkbox" value="{:$item->id}" class="noBorder" /></td>
<td class="textL">
{:$item->name}
{:if $item->alias != '' && $item->type != '0'}
({:$item->alias})
{:/if}</td>
<td>
{:if $item->type == 1}
{:$item->channelName}列表
{:elseif $item->type == 2}
栏目封面
{:else}
任意链接
{:/if}</td>
<td>
{:if $item->type == '0'}
跳转
{:elseif $item->visit == 1}
静态
{:elseif $item->visit == 2}
动态
{:else}
自动
{:/if}
</td>
<td>
{:if $item->isHidden}
是
{:else}
否
{:/if}</td>
<td>
{:if $item->type == 1}
<a href="{:$smarty.const.BOOT_URL}/{:$i->c}/archive/lists/0/{:$item->id}">管理文档</a> |
<a target="_blank" href="{:$smarty.const.ROOT_DIR}/boot.php/data/category/{:$item->id}">预览</a> |
{:elseif $item->type == 2}
<a href="{:$smarty.const.BOOT_URL}/{:$i->c}/archive/lists/0/{:$item->id}">管理文档</a> |
<a target="_blank" href="{:$smarty.const.ROOT_DIR}/boot.php/data/category/{:$item->id}">预览</a> |
{:else}
<a target="_blank" href="{:$item->link}">预览</a> |
{:/if}
<a href="{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/mod/{:$item->id}">修改</a> | <a onclick="del({:$item->id});" href="#@">删除</a></td>
</tr>{:/foreach}
</tbody>
<tr>
<td colspan="7" class="lightGreyBg textL"> <a href="#@" onclick="selAll('selected[]');">全选</a> | <a href="#@" onclick="selAnti('selected[]');">反选</a> | <a href="#@" onclick="del(0);">删除</a></td>
</tr>
</table>
</div>
</div>
<link href="{:$smarty.const.PUBLIC_DIR}/common/style/tooltip.css" rel="stylesheet" type="text/css" />
<link href="{:$smarty.const.PUBLIC_DIR}/common/style/ui.all.css" rel="stylesheet" type="text/css" />
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/jquery.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.core.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.draggable.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.resizable.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.dialog.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.sortable.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/jquery.tooltip.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/common.js"></script>
<script language="javascript" type="text/javascript">
$(document).ready(function() {
$(".helpTip").tooltip({cssClass:"tooltip", xOffset:30, opacity:5});
});
function del(id)
{
var ids='';
if(id == 0)
{
$("input:checked[name='selected[]']").each(function(i){
ids+=this.value+',';
});
ids = ids.substr(0,ids.length-1);
}
else if(id > 0)
{
ids = id;
}
if(ids.length==0)
{
alert('您还没有选中要删除的记录');
return false;
}
if(confirm('删除栏目会同时删除相关的子栏目及相关栏目下的全部文档,确定要删除ID为'+ids+'的栏目?'))
{
getDialog('{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/del/'+ids, '{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/lists/-1');
}
return false;
}
function order()
{
var ids = '';
$("input[name='selected[]']").each(function(){
if(ids == '')
{
ids=this.value;
}
else
{
ids+=','+this.value;
}
});
getDialog('{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/ordering/'+ids);
return false;
}
$(function() {
$(".main")
.sortable({
connectWith: '.main',
update: function(event, ui) { order(); },
axis: 'y',
cursor: 'move' ,
delay: 100,
opacity: 0.9
});
});
</script>
</body>
</html>
| 01cms | 01cms/branches/v1.0/01cms/view/Archive/category.tpl | Smarty | asf20 | 5,618 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>{:$i->title}</title>
<link href="{:$smarty.const.PUBLIC_DIR}/common/style/admin.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
th {text-align:right;}
td {text-align:left;}
-->
</style>
</head>
<body>
<div class="wrapper">
<div class="title shadow titleBg">
<table width="100%" border="0" cellspacing="1">
<tr>
<td><h1> {:$i->title} => {:if $i->p[0] eq "mod"}修改{:elseif $i->p[0] eq "add"}
添加{:/if} </h1></td>
</tr>
</table>
</div>
<div class="content shadow">
<form>
<table width="100%" border="0" cellspacing="1">
<tr>
<th width="20%">模型名称:</th>
<td width="80%"><input name="name" type="text" size="20" id="name" value="{:$i->data->name}" class="posted" /></td>
</tr>
<tr>
<th>数据表名:</th>
<td>{:$i->Config->config.mysql.prefix}archive_channel_<input name="tableId" type="text" id="tableId" value="{:$i->data->tableId}" size="10" maxlength="20" class="posted" />
<input name="oldTableId" type="hidden" id="oldTableId" value="{:$i->data->tableId}" size="10" maxlength="30" class="posted inputLine" /></td>
</tr>
<tr>
<th> </th>
<td><input type="submit" value=" 提 交 " />
<input type="reset" onclick="history.go(-1);" value=" 返 回 " /> </td>
</tr>
</table>
</form>
</div>
</div>
<link href="{:$smarty.const.PUBLIC_DIR}/common/style/ui.all.css" rel="stylesheet" type="text/css" />
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/jquery.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.core.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.draggable.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.dialog.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/jquery.post.js"></script>
<script language="javascript" type="text/javascript">
$(document).ready(function(){
$("form").post({
sendUrl:'{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/update/{:$i->p[1]}',
goUrl:'{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/lists/-1'
});
});
</script>
</body>
</html> | 01cms | 01cms/branches/v1.0/01cms/view/Archive/channelMod.tpl | Smarty | asf20 | 2,736 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>{:$i->title}</title>
<link href="{:$smarty.const.PUBLIC_DIR}/common/style/admin.css" rel="stylesheet" type="text/css" />
<link href="{:$smarty.const.PUBLIC_DIR}/common/style/uploadify.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
th { text-align:right; }
td { text-align:left; }
object{ padding-top:-8px; margin:0;}
.template { border:none; border-bottom:1px #999 solid; }
.color { color:{:$i->data->color}; cursor:pointer;}
#title {color:{:$i->data->color};{:if $i->data->flag|@strpos:"b" !== false}font-weight:bold;{:/if} }
{:if $i->data->flag && $i->data->flag|@strpos:"j" !== false}.notJ{:else}.j{:/if}{display:none;}
.pictureData{ border:solid 1px #ccc; margin:0 5px 5px 0; float:left; padding:5px; text-align:center;}
.pictureData input{ border:none; border-bottom:1px #999 dashed;}
.pictureData img{padding:2px;cursor:move;}
.pictureDesc{}
.uploadButtonArea{ padding:5px 0;}
.manualData{border:solid 1px #ccc; margin:0 5px 5px 0; padding:5px; background:#eee;}
-->
</style>
</head>
<body>
<div class="wrapper">
<div class="title shadow titleBg">
<table width="100%" border="0" cellspacing="1">
<tr>
<td><h1> {:$i->title} => {:if $i->p[0] eq "mod"}修改{:elseif $i->p[0] eq "add"}
添加{:/if} </h1></td>
</tr>
</table>
</div>
<div class="content shadow">
<form id="form1" method="post" action="{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/update/{:$i->p[1]}/{:$i->p[2]}/{:$i->p[3]}" target="autoFrame">
<table width="100%" border="0" cellspacing="1">
<tr>
<th width="20%">标 题:</th>
<td width="80%"><input class="inputtitle showcolor" name="title" type="text" size="60" id="title" value="{:$i->data->title|htmlspecialchars}" />
<input name="color" type="text" size="7" id="color" value="{:$i->data->color}" class="color" /></td>
</tr>
<tr>
<th width="20%">属 性:</th>
<td width="80%"><input name='flag[]' type='checkbox' class='noBorder' id='flagsh' value='h' {:php}echo (strpos($this->_tpl_var['i']->data->flag,'h')!==false ? 'checked="checked"' : '');{:/php}>
<label for="flagsh"> 头条[h]</label>
<input class='noBorder' type='checkbox' name='flag[]' id='flagsc' value='c'{:if $i->data->flag|@strpos:"c" !== false} checked="checked"{:/if}>
<label for="flagsc"> 推荐[c]</label>
<input class='noBorder' type='checkbox' name='flag[]' id='flagsp' value='p'{:if $i->data->flag|@strpos:"p" !== false} checked="checked"{:/if}>
<label for="flagsp"> 图文[p]</label>
<input class='noBorder' type='checkbox' name='flag[]' id='flagsf' value='f'{:if $i->data->flag|@strpos:"f" !== false} checked="checked"{:/if}>
<label for="flagsf"> 幻灯[f]</label>
<input class='noBorder' type='checkbox' name='flag[]' id='flagss' value='s'{:if $i->data->flag|@strpos:"s" !== false} checked="checked"{:/if}>
<label for="flagss"> 滚动[s]</label>
<input class='noBorder' type='checkbox' name='flag[]' id='flagsj' value='j'{:if $i->data->flag|@strpos:"j" !== false} checked="checked"{:/if}>
<label for="flagsj"> 跳转[a]</label>
<input class='noBorder' type='checkbox' name='flag[]' id='flagsb' value='b'{:if $i->data->flag|@strpos:"b" !== false} checked="checked"{:/if}>
<label for="flagsb"> 加粗[b]</label></td>
</tr>
<tr class="j">
<th width="20%">跳转地址:</th>
<td width="80%"><input name="redirectUrl" type="text" size="60" id="redirectUrl" value="{:$i->data->redirectUrl}" />
*</td>
</tr>
<tr class="notJ">
<th width="20%">副标题:</th>
<td width="80%"><input name="viceTitle" type="text" size="60" id="viceTitle" value="{:$i->data->viceTitle}" /></td>
</tr>
<tr>
<th>缩略图:</th>
<td><input title="点击查看图片" name="thumb" type="text" size="50" id="thumb" value="{:$i->data->thumb}" />
<a href='#' title="上传图片" class="buttonBox hidden" id="preView">预览</a>
<input type="file" name="uploadify" id="uploadify" size="2" />
<div id="fileQueue"></div></td>
</tr>
<tr>
<th>栏 目:</th>
<td><select name="categoryId" id="categoryId">
{:foreach item=item from=$i->category}
<option {:if $item->channelId != $i->channelId || $item->type != 1}style="background:#ccc;" value="-1"{:else}value="{:$item->id}"{:/if} {:if $item->id == $i->categoryId}selected="selected"{:/if}>{:$item->name}</option>
{:/foreach}
</select>
* </td>
</tr>
<tr class="notJ">
<th>作 者:</th>
<td><input name="author" type="text" size="30" id="author" value="{:$i->data->author}" /></td>
</tr>
<tr class="notJ">
<th>来 源:</th>
<td><input name="source" type="text" size="30" id="source" value="{:$i->data->source}" /></td>
</tr>
<tr class="notJ">
<th width="20%">图片内容:</th>
<td width="80%">
<input name="content" type="hidden" size="30" id="content" value="" />
<div id="pictureList"></div>
<div class="clear"></div>
<div id="manualList"></div>
<div id="fileQueuePicture"></div>
<div class="uploadButtonArea"><input type="file" name="uploadifyPicture" id="uploadifyPicture" size="2" />【<a href="#@" id="addButton">增加网址输入框</a>】</div>
</td>
</tr>
<tr class="notJ" id="advShow">
<th width="20%"> </th>
<td width="80%">【<a href="#@" onclick="$('#advItems').show();$('#advHide').show();$('#advShow').hide();">显示高级选项</a>】</td>
</tr>
<tr class="notJ hidden" id="advHide">
<th width="20%"> </th>
<td width="80%">【<a href="#@" onclick="$('#advShow').show();$('#advHide').hide();$('#advItems').hide();">隐藏高级选项</a>】</td>
</tr>
<tbody class="notJ hidden" id="advItems">
<tr class="notJ">
<th width="20%">关键词:</th>
<td width="80%"><input name="keywords" type="text" size="50" id="keywords" value="{:$i->data->keywords}" />
(多个时用空格隔开)</td>
</tr>
<tr class="notJ">
<th width="20%">摘 要:</th>
<td width="80%"><textarea name="desc" cols="58" rows="4" id="desc">{:$i->data->desc}</textarea></td>
</tr>
<tr>
<th>文档排序:</th>
<td><select name="ordering" id="ordering">
<option value="0" {:if ($i->data->ordering - $i->data->pubTime) / 86400 == 0}selected="selected"{:/if}>默认排序</option>
<option value="7" {:if ($i->data->ordering - $i->data->pubTime) / 86400 == 7}selected="selected"{:/if}>置顶一周</option>
<option value="15" {:if ($i->data->ordering - $i->data->pubTime) / 86400 == 15}selected="selected"{:/if}>置顶半个月</option>
<option value="30" {:if ($i->data->ordering - $i->data->pubTime) / 86400 == 30}selected="selected"{:/if}>置顶一个月</option>
<option value="90" {:if ($i->data->ordering - $i->data->pubTime) / 86400 == 90}selected="selected"{:/if}>置顶三个月</option>
<option value="180" {:if ($i->data->ordering - $i->data->pubTime) / 86400 == 180}selected="selected"{:/if}>置顶半年</option>
<option value="360" {:if ($i->data->ordering - $i->data->pubTime) / 86400 == 360}selected="selected"{:/if}>置顶半年</option>
</select></td>
</tr>
<tr class="notJ">
<th>列表显示:</th>
<td><label>
<input class="noBorder" name="listed" type="radio" value="1" {:if $i->data->listed == '1'}checked="checked"{:/if} />是</label>
<label>
<input name="listed" class="noBorder" type="radio" value="0" {:if $i->data->listed == '0'}checked="checked"{:/if} />否</label>
(如果选否则不会在首页和列表页中出现)</td>
</tr>
<tr class="notJ">
<th>访问控制:</th>
<td><select name="visit" id="visit">
<option value="1" {:if $i->data->visit == '1'}selected="selected"{:/if}>访问允许</option>
<option value="0" {:if $i->data->visit == '0'}selected="selected"{:/if}>禁止访问</option>
</select></td>
</tr>
<tr class="notJ">
<th width="20%">发布日期:</th>
<td width="80%"><input name="pubTime" type="text" size="20" id="pubTime" value="{:$i->data->pubTime|date_format:"%Y-%m-%d %H:%M:%S"}
" /></td>
</tr>
<tr class="notJ">
<th width="20%">文档模板:</th>
<td width="80%">/template/{:$i->Load->var.style}/<input name="templateName" type="text" size="30" value="" id="templateName" class="inputLine" /></td>
</tr>
<tr class="notJ">
<th width="20%" nowrap="nowrap">生成文档:</th>
<td width="80%">{:$smarty.const.ROOT_PATH}<input name="fileName" type="text" size="30" value="" id="fileName" class="inputLine" /></td>
</tr>
</tbody>
<tr>
<th> </th>
<td><input type="submit" id="submit" value=" 提 交 " />
<input type="reset" onclick="history.go(-1);" value=" 返 回 " /></td>
</tr>
</table>
</form>
</div>
</div>
<link href="{:$smarty.const.PUBLIC_DIR}/common/style/tooltip.css" rel="stylesheet" type="text/css" />
<link href="{:$smarty.const.PUBLIC_DIR}/common/style/ui.all.css" rel="stylesheet" type="text/css" />
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/jquery.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.core.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.draggable.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.resizable.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.sortable.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.dialog.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/common.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/jquery.tooltip.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/jquery.upload.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/jquery.colorpicker.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/swfobject.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/jquery.uploadify.v2.1.0.min.js"></script>
<script language="javascript" type="text/javascript">
var countManualUrl = 1;
var countPicturnData = 1;
var content = "{:$i->addData->content}";
var pictures = content.split("{!}");
for(var i=0; i<pictures.length; i++)
{
var pictureData = pictures[i].split("{#}");
var file = pictureData[0];
var thumb = (pictureData[1].length > 0) ? pictureData[1] : file;
var desc = pictureData[2];
addPicture(file,thumb,desc);
}
function removeHtml(id)
{
$('#'+id).fadeOut("slow",function(){$('#'+id).remove();});
}
function showImg(id) {
if($('.ui-dialog').length > 0)
{
$('.ui-dialog').remove();
}
if($('.ui-dialog-message').length > 0)
{
$('.ui-dialog-message').remove();
}
var v = $("#"+id).val();
if(v != "")
{
$('<div class="ui-dialog-message"><img src="' + v + '" onload="if(this.width > 350)this.width = 350;" /></div>').dialog({
title:'图片预览',
resizable : false,
width : 380
});
}
}
function setContent()
{
var v='', s='';
$(".pictureData").each(function(i){
var url = $(this).find('.pictureUrl').val();
var thumb = $(this).find('.pictureThumbUrl').attr('src');
var desc = $(this).find('.pictureDesc').val();
if(url!='')
{
if(v=='')
{
s='';
}
else
{
s="{!}";
}
v += s+url+'{#}'+thumb+'{#}'+desc;
}
});
$("#content").val(v);
}
function upload(url)
{
$("#thumb").val(url);
$("#preView").show();
}
function uploaded(e,queueId,fileObj,response,data)
{
var error = $(response).find("#error").html();
if(error != '')
{
alert(error);
}
else
{
$("#preView").show();
var file = $(response).find("#file").html();
$("#thumb").val(file);
}
}
function uploadedPicture(e,queueId,fileObj,response,data)
{
var error = $(response).find("#error").html();
if(error != '')
{
alert(error);
}
else
{
var file = $(response).find("#file").html();
var thumb = $(response).find("#thumb").html();
addPicture(file,thumb,'');
}
}
function addManualPicture(manualDataId,fileId,descId)
{
var file = $('#'+fileId).val();
var desc = $('#'+descId).val();
addPicture(file,'',desc);
$('#'+manualDataId).hide('slow',function(){$('#'+manualDataId).remove();});
}
function addPicture(file,thumb,desc)
{
if(!file) return false;
if($('#pictureData0').length > 0)
{
$('#pictureData0').remove();
}
thumb = thumb ? thumb : file;
$("#pictureList").append('<div class="pictureData" id="pictureData'+countPicturnData+'"><img alt="拖动图片进行排序" class="pictureThumbUrl" width="{:$i->uploadSetting.thumbWidth}" height="{:$i->uploadSetting.thumbHeight}" src="'+thumb+'" /><br />【<a href="javascript:removeHtml(\'pictureData'+countPicturnData+'\');">删除</a>】描述:<input type="text" size="20" class="pictureDesc" name="pictureDesc" value="'+desc+'" /><input type="hidden" class="pictureUrl" name="pictureUrl" value="'+file+'" /></div>');
countPicturnData++;
}
$(document).ready(function(){
$("#pictureList").sortable({
connectWith: '#pictureList',
cursor: 'move',
handle: 'img',
delay: 0,
opacity: 0.6
});
$("#uploadifyPicture").uploadify({
'uploader' : '{:$smarty.const.PUBLIC_DIR}/common/image/uploadify.swf',
'script' : '{:$smarty.const.BOOT_URL}/file/upload',
'cancelImg' : '{:$smarty.const.PUBLIC_DIR}/common/image/cancel.png',
'queueID' : 'fileQueuePicture',
'auto' : true,
'multi' : true,
'onComplete' : function(e,queueId,fileObj,response,data){uploadedPicture(e,queueId,fileObj,response,data);},
'buttonImg' : '{:$smarty.const.PUBLIC_DIR}/common/image/uploadBatButton.gif',
'width' : 120,
'height' : 13,
'fileDesc' : '*.jpg;*.gif;*.png',
'fileExt' : '*.jpg;*.gif;*.png'
});
$("#uploadify").uploadify({
'uploader' : '{:$smarty.const.PUBLIC_DIR}/common/image/uploadify.swf',
'script' : '{:$smarty.const.BOOT_URL}/file/upload',
'cancelImg' : '{:$smarty.const.PUBLIC_DIR}/common/image/cancel.png',
'queueID' : 'fileQueue',
'auto' : true,
'multi' : false,
'onComplete' : function(e,queueId,fileObj,response,data){uploaded(e,queueId,fileObj,response,data);},
'buttonImg' : '{:$smarty.const.PUBLIC_DIR}/common/image/uploadButton.gif',
'width' : 90,
'height' : 13,
'fileDesc' : '*.jpg;*.gif;*.png',
'fileExt' : '*.jpg;*.gif;*.png'
});
$("#addButton").click(
function () {
var id = countManualUrl;
$("#manualList").append('<div class="manualData" id="manualData'+id+'">地址'+id+':<input type="text" size="60" class="manualUrl" id="manualUrl'+id+'" value="" />【<a href="javascript:showImg(\'manualUrl'+id+'\');">预览</a>】<br />描述'+id+':<input type="text" size="60" class="manualDesc" id="manualDesc'+id+'" value="" />【<a href="javascript:addManualPicture(\'manualData'+id+'\',\'manualUrl'+id+'\',\'manualDesc'+id+'\');">确定</a>】</div>');
countManualUrl++;
return false;
}
);
if($("#thumb").val() != "")
{
$("#preView").show();
}
$("#categoryId").change(function(){
if(this.value == -1)
{
alert('不能选择灰色背景的栏目');
this.value = 0;
return false;
}
});
$("#preView").click(function(){
if($('.ui-dialog').length > 0)
{
$('.ui-dialog').remove();
}
if($('.ui-dialog-message').length > 0)
{
$('.ui-dialog-message').remove();
}
var thumbValue = $("#thumb").val();
if(thumbValue != "")
{
$('<div class="ui-dialog-message"><img src="' + thumbValue + '" onload="if(this.width > 350)this.width = 350;" /></div>').dialog({
title:'图片预览',
resizable : false,
width : 380
});
}
});
$('form').submit(function(){
setContent();
postDialog();
});
$("#flagsj").click(
function () {
if(this.checked){
$(".j").show();
$(".notJ").hide();
}else{
$(".j").hide();
$(".notJ").show();
}
}
);
$("#color").colorpicker();
$("#flagsb").click(
function () {
if(this.checked){
$("#title").css("font-weight","bold");
}else{
$("#title").css("font-weight","normal");
}
}
);
});
</script>
</body>
</html> | 01cms | 01cms/branches/v1.0/01cms/view/Archive/archiveModPicture.tpl | Smarty | asf20 | 18,172 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>{:$i->title}</title>
<link href="{:$smarty.const.PUBLIC_DIR}/common/style/admin.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div class="wrapper">
<div class="title shadow titleBg">
<table width="100%" border="0" cellspacing="1">
<tr>
<td><h1> {:$i->title} <span>[<a href="{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/add/0/{:$i->categoryId}/{:$i->channelId}">添加</a>] [<a href="#@" onclick="updateHtml(0);">全部更新</a>]</span></h1></td>
</tr>
</table>
</div>
<div class="title shadow">
<table width="100%" border="0" cellspacing="1">
<tr>
<td><form action="{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/lists/" method="get">
ID:<input class="keyWord" name="id" type="text" value="{:$i->keyWord.id}" size="8" />
标题:<input class="keyWord" name="title" type="text" value="{:$i->keyWord.title}" size="20" />
<input name="" value="搜 索" type="submit" />
<input name="" type="reset" value="清 除" onclick="$('.keyWord').each(function(){this.value = '';});return false;" />
<input name="" type="reset" value="全 部" onclick="window.location.href='{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/lists/';return false;" />
</form></td>
</tr>
</table>
</div>
<div class="content shadow">
<table width="100%" border="0" cellspacing="1">
<tr class="titleBg">
<th scope="col">#ID</th>
<th scope="col" width="40">选择</th>
<th class="textL" scope="col">页面标题</th>
<th scope="col">修改时间</th>
<th scope="col">操作</th>
</tr>
{:foreach item=item from=$i->lists}<tr>
<td>{:$item->id}</td>
<td><input name="sel[]" type="checkbox" value="{:$item->id}" class="noBorder" /></td>
<td class="textL"><a href="{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/mod/{:$item->id}">{:$item->title}</a></td>
<td>{:$item->updateTime|date_format:"%Y-%m-%d %H:%M"}</td>
<td>
<a href="{:$smarty.const.ROOT_DIR}/io.php/data/single/{:$item->id}" target="_blank">动态访问</a> | <a href="{:$smarty.const.ROOT_DIR}{:$item->fileName}" target="_blank">静态访问</a> | <a href="#@" onclick="updateHtml({:$item->id});">更新</a>
| <a href="{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/mod/{:$item->id}">修改</a>
| <a onclick="del({:$item->id});return false;" href="#@">删除</a></td>
</tr>{:/foreach}
<tr>
<td colspan="5" class="lightGreyBg textL"> <a href="#@" onclick="selAll('sel[]');">全选</a> | <a href="#@" onclick="selAnti('sel[]');">反选</a> | <a href="#@" onclick="del(0,'sel[]');">删除</a> | <a href="#@" onclick="updateHtml(-1);">更新</a> | {:$i->pagesCode}</td>
</tr>
</table>
</div>
</div>
<link href="{:$smarty.const.PUBLIC_DIR}/common/style/tooltip.css" rel="stylesheet" type="text/css" />
<link href="{:$smarty.const.PUBLIC_DIR}/common/style/ui.all.css" rel="stylesheet" type="text/css" />
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/jquery.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.core.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.draggable.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.resizable.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.dialog.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/jquery.tooltip.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/common.js"></script>
<script language="javascript" type="text/javascript">
function batPass(status)
{
var ids = '';
$("input[name='sel[]']").each(function(i){
if(this.checked)
{
if(ids == '')
{
ids=this.value;
}
else
{
ids+=','+this.value;
}
}
});
if(ids.length==0)
{
alert('您还没有选中要进行处理的记录');
return false;
}
if(confirm('确定要批量审核ID为'+ids+'的记录?'))
{
getDialog('{:$smarty.const.BOOT_URL}/{:$i->c}/setPass/'+ids+'/'+status, '{:$i->curUrl}');
}
}
function updateHtml(id)
{
if(id == -1)
{
id = getSel('sel[]');
if(id == '')
{
alert('您还没有选中要更新的记录');
return false;
}
}
getDialog('{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/updateHtml/'+id);
}
function setPass(id,status)
{
if(status == 1)
{
$("#set"+id).html('<span class="deepGrey">【已通过】 =></span> 【<a onclick="return getDialog(\'{:$smarty.const.BOOT_URL}/{:$i->c}/setPass/'+id+'/2\');" href="#">不通过</a>】');
}
else if(status == 2)
{
$("#set"+id).html('<span class="deepGrey">【未通过】 =></span> 【<a onclick="return getDialog(\'{:$smarty.const.BOOT_URL}/{:$i->c}/setPass/'+id+'/1\');" href="#">通过</a>】');
}
}
function del(id, name)
{
var ids='';
if(name != undefined)
{
$("input:checked[name='"+name+"']").each(function(i){
ids+=this.value+',';
});
ids = ids.substr(0,ids.length-1);
}
else if(id > 0)
{
ids = id;
}
if(ids.length==0)
{
alert('您还没有选中要删除的记录');
return false;
}
if(confirm('确定要删除ID为'+ids+'的记录?'))
{
getDialog('{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/del/'+ids, '{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/lists/0/{:$i->p[2]}/{:$i->p[3]}');
}
return false;
}
</script>
</body>
</html>
| 01cms | 01cms/branches/v1.0/01cms/view/Archive/single.tpl | Smarty | asf20 | 6,031 |