[pLog-svn] r5658 - in plog/branches/lifetype-1.3-ajax: class/action/admin class/gallery/dao class/view/admin js/ui js/ui/pages templates/admin
oscar at devel.lifetype.net
oscar at devel.lifetype.net
Sun Jul 15 10:48:48 EDT 2007
Author: oscar
Date: 2007-07-15 10:48:48 -0400 (Sun, 15 Jul 2007)
New Revision: 5658
Added:
plog/branches/lifetype-1.3-ajax/js/ui/contentoverlay.js
plog/branches/lifetype-1.3-ajax/js/ui/pages/newresourcealbum.js
Modified:
plog/branches/lifetype-1.3-ajax/class/action/admin/adminaddresourcealbumaction.class.php
plog/branches/lifetype-1.3-ajax/class/action/admin/adminnewresourceaction.class.php
plog/branches/lifetype-1.3-ajax/class/action/admin/adminnewresourcealbumaction.class.php
plog/branches/lifetype-1.3-ajax/class/action/admin/adminresourceinfoaction.class.php
plog/branches/lifetype-1.3-ajax/class/gallery/dao/galleryresource.class.php
plog/branches/lifetype-1.3-ajax/class/view/admin/adminnewalbumview.class.php
plog/branches/lifetype-1.3-ajax/class/view/admin/adminnewresourceview.class.php
plog/branches/lifetype-1.3-ajax/js/ui/forms.js
plog/branches/lifetype-1.3-ajax/js/ui/pages/resources.js
plog/branches/lifetype-1.3-ajax/templates/admin/customfields.template
plog/branches/lifetype-1.3-ajax/templates/admin/editarticlecategories.template
plog/branches/lifetype-1.3-ajax/templates/admin/editarticlecategory.template
plog/branches/lifetype-1.3-ajax/templates/admin/editcustomfield.template
plog/branches/lifetype-1.3-ajax/templates/admin/editlink.template
plog/branches/lifetype-1.3-ajax/templates/admin/editlinkcategories.template
plog/branches/lifetype-1.3-ajax/templates/admin/editlinkcategory.template
plog/branches/lifetype-1.3-ajax/templates/admin/editlinks.template
plog/branches/lifetype-1.3-ajax/templates/admin/header.template
plog/branches/lifetype-1.3-ajax/templates/admin/menus.xml
plog/branches/lifetype-1.3-ajax/templates/admin/newcustomfield.template
plog/branches/lifetype-1.3-ajax/templates/admin/newlink.template
plog/branches/lifetype-1.3-ajax/templates/admin/newlinkcategory.template
plog/branches/lifetype-1.3-ajax/templates/admin/newpostcategory.template
plog/branches/lifetype-1.3-ajax/templates/admin/newresource.template
plog/branches/lifetype-1.3-ajax/templates/admin/newresourcealbum.template
plog/branches/lifetype-1.3-ajax/templates/admin/resources.template
Log:
Some more experimental changes.
Modified: plog/branches/lifetype-1.3-ajax/class/action/admin/adminaddresourcealbumaction.class.php
===================================================================
--- plog/branches/lifetype-1.3-ajax/class/action/admin/adminaddresourcealbumaction.class.php 2007-07-15 10:04:22 UTC (rev 5657)
+++ plog/branches/lifetype-1.3-ajax/class/action/admin/adminaddresourcealbumaction.class.php 2007-07-15 14:48:48 UTC (rev 5658)
@@ -5,6 +5,7 @@
lt_include( PLOG_CLASS_PATH."class/view/admin/adminresourceslistview.class.php" );
lt_include( PLOG_CLASS_PATH."class/data/validator/stringvalidator.class.php" );
lt_include( PLOG_CLASS_PATH."class/data/validator/integervalidator.class.php" );
+ lt_include( PLOG_CLASS_PATH."class/data/filter/htmlfilter.class.php" );
lt_include( PLOG_CLASS_PATH."class/gallery/dao/galleryalbums.class.php" );
lt_include( PLOG_CLASS_PATH."class/template/cachecontrol.class.php" );
lt_include( PLOG_CLASS_PATH."class/data/timestamp.class.php" );
@@ -31,22 +32,21 @@
$this->AdminAction( $actionInfo, $request );
// validation stuff
- $this->registerFieldValidator( "albumName", new StringValidator());
- $this->registerFieldValidator( "parentId", new IntegerValidator());
+ $this->registerFieldValidator( "albumName", new StringValidator(), false, $this->_locale->tr("error_empty_name"));
+ $this->registerFieldValidator( "parentId", new IntegerValidator(), false, $this->_locale->tr("error_incorrect_value"));
$this->_form->registerField( "albumDescription" );
- $this->setValidationErrorView( new AdminNewAlbumView( $this->_blogInfo ));
+ $view = new AdminNewAlbumView( $this->_blogInfo );
+ $view->setErrorMessage( $this->_locale->tr("error_adding_album" ));
+ $this->setValidationErrorView( $view );
$this->requirePermission( "add_album" );
}
- /**
- * Carries out the specified action
- */
- function perform()
- {
+ function addAlbum()
+ {
// fetch our data
- $this->_albumName = Textfilter::filterAllHTML($this->_request->getValue( "albumName" ));
- $this->_albumDescription = Textfilter::filterAllHTML($this->_request->getValue( "albumDescription" ));
+ $this->_albumName = $this->_request->getFilteredValue( "albumName", new HtmlFilter());
+ $this->_albumDescription = $this->_request->getFilteredValue( "albumDescription", new HtmlFilter());
$this->_parentId = $this->_request->getValue( "parentId" );
$showAlbum = $this->_request->getValue("showAlbum") ? 1 : 0;
@@ -64,25 +64,55 @@
$this->notifyEvent( EVENT_PRE_ALBUM_ADD, Array( "album" => &$album ));
// and add it to the database
$result = $albums->addAlbum( $album );
-
+
+ if( !$result )
+ return( false );
+
+ $this->notifyEvent( EVENT_POST_ALBUM_ADD, Array( "album" => &$album ));
+ // clear the cache if everything went fine
+ CacheControl::resetBlogCache( $this->_blogInfo->getId(), false );
+
+ return( $album );
+ }
+
+ /**
+ * Carries out the specified action
+ */
+ function perform()
+ {
+ $album = $this->addAlbum();
+
if( $this->userHasPermission( "view_resources" ))
$this->_view = new AdminResourcesListView( $this->_blogInfo, Array( "albumId" => $this->_parentId ));
else
$this->_view = new AdminNewAlbumView( $this->_blogInfo );
- if( $result ) {
+ if( $album )
$this->_view->setSuccessMessage( $this->_locale->pr( "album_added_ok", $album->getName()));
- $this->notifyEvent( EVENT_POST_ALBUM_ADD, Array( "album" => &$album ));
- // clear the cache if everything went fine
- CacheControl::resetBlogCache( $this->_blogInfo->getId(), false );
- }
- else {
- $this->_view->setErrorMessage( $this->_locale->tr("error_adding_album" ) );
- }
+ else
+ $this->_view->setErrorMessage( $this->_locale->tr("error_adding_album" ));
+
$this->setCommonData();
// better to return true if everything fine
return true;
}
+
+ function performAjax()
+ {
+ lt_include( PLOG_CLASS_PATH."class/view/admin/ajax/adminajaxview.class.php" );
+ $this->_view = new AdminAjaxView( $this->_blogInfo );
+
+ $album = $this->addAlbum();
+ if( $album ) {
+ $this->_view->setSuccessMessage($this->_locale->pr( "album_added_ok", $album->getName()));
+ $this->_view->setValue( "album", $album );
+ }
+ else {
+ $this->_view->setErrorMessage( $this->_locale->tr("error_adding_album" ));
+ }
+
+ return( true );
+ }
}
?>
Modified: plog/branches/lifetype-1.3-ajax/class/action/admin/adminnewresourceaction.class.php
===================================================================
--- plog/branches/lifetype-1.3-ajax/class/action/admin/adminnewresourceaction.class.php 2007-07-15 10:04:22 UTC (rev 5657)
+++ plog/branches/lifetype-1.3-ajax/class/action/admin/adminnewresourceaction.class.php 2007-07-15 14:48:48 UTC (rev 5658)
@@ -7,6 +7,8 @@
lt_include( PLOG_CLASS_PATH."class/view/admin/adminresourceslistview.class.php" );
lt_include( PLOG_CLASS_PATH."class/gallery/dao/galleryalbums.class.php" );
lt_include( PLOG_CLASS_PATH."class/gallery/dao/galleryresourcestorage.class.php" );
+ lt_include( PLOG_CLASS_PATH."class/data/filter/htmlfilter.class.php" );
+ lt_include( PLOG_CLASS_PATH."class/data/validator/integervalidator.class.php" );
/**
* \ingroup Action
@@ -67,8 +69,13 @@
return false;
}
+ $albumId = $this->_request->getFilteredValue( "albumId", new HtmlFilter());
+ $v = new IntegerValidator();
+ if( !$v->validate( $albumId ))
+ $albumId = 0;
+
// if all's fine, continue...
- $this->_view = new AdminNewResourceView( $this->_blogInfo );
+ $this->_view = new AdminNewResourceView( $this->_blogInfo, $albumId );
$this->setCommonData();
$this->_view->setValue( "albums", $blogAlbums );
Modified: plog/branches/lifetype-1.3-ajax/class/action/admin/adminnewresourcealbumaction.class.php
===================================================================
--- plog/branches/lifetype-1.3-ajax/class/action/admin/adminnewresourcealbumaction.class.php 2007-07-15 10:04:22 UTC (rev 5657)
+++ plog/branches/lifetype-1.3-ajax/class/action/admin/adminnewresourcealbumaction.class.php 2007-07-15 14:48:48 UTC (rev 5658)
@@ -2,6 +2,8 @@
lt_include( PLOG_CLASS_PATH."class/action/admin/adminaction.class.php" );
lt_include( PLOG_CLASS_PATH."class/view/admin/adminnewalbumview.class.php" );
+ lt_include( PLOG_CLASS_PATH."class/data/filter/htmlfilter.class.php" );
+ lt_include( PLOG_CLASS_PATH."class/data/validator/integervalidator.class.php" );
/**
* \ingroup Action
@@ -28,7 +30,12 @@
*/
function perform()
{
- $this->_view = new AdminNewAlbumView( $this->_blogInfo );
+ $parentId = $this->_request->getFilteredValue( "parentId", new HtmlFilter());
+ $v = new IntegerValidator();
+ if( !$v->validate( $parentId ))
+ $parentId = 0;
+
+ $this->_view = new AdminNewAlbumView( $this->_blogInfo, $parentId );
$this->setCommonData();
return true;
}
Modified: plog/branches/lifetype-1.3-ajax/class/action/admin/adminresourceinfoaction.class.php
===================================================================
--- plog/branches/lifetype-1.3-ajax/class/action/admin/adminresourceinfoaction.class.php 2007-07-15 10:04:22 UTC (rev 5657)
+++ plog/branches/lifetype-1.3-ajax/class/action/admin/adminresourceinfoaction.class.php 2007-07-15 14:48:48 UTC (rev 5658)
@@ -35,16 +35,24 @@
$this->requirePermission( "update_resource" );
}
+ function loadResource()
+ {
+ // load the resource
+ $this->_resourceId = $this->_request->getValue( "resourceId" );
+ $resources = new GalleryResources();
+ $resource = $resources->getResource( $this->_resourceId, $this->_blogInfo->getId());
+ if( $resource )
+ $this->notifyEvent( EVENT_RESOURCE_LOADED, Array( "resource" => &$resource ));
+
+ return( $resource );
+ }
+
/**
* Carries out the specified action
*/
function perform()
{
- // load the resource
- $this->_resourceId = $this->_request->getValue( "resourceId" );
- $resources = new GalleryResources();
- $resource = $resources->getResource( $this->_resourceId, $this->_blogInfo->getId());
-
+ $resource = $this->loadResource();
if( !$resource ) {
$this->_view = new AdminResourcesListView( $this->_blogInfo );
$this->_view->setErrorMessage( $this->_locale->tr("error_fetching_resource"));
@@ -63,5 +71,22 @@
// better to return true if everything fine
return true;
}
+
+ function performAjax()
+ {
+ lt_include( PLOG_CLASS_PATH."class/view/admin/ajax/adminajaxview.class.php" );
+ $this->_view = new AdminAjaxView( $this->_blogInfo );
+ $resource = $this->loadResource();
+ if( !$resource ) {
+ $this->_view->setErrorMessage( $this->_locale->tr("error_fetching_resource"));
+ }
+ else {
+ $this->_view->setValue( "resource", $resource );
+ $this->_view->setSuccess( true );
+ }
+
+ // better to return true if everything fine
+ return true;
+ }
}
?>
Modified: plog/branches/lifetype-1.3-ajax/class/gallery/dao/galleryresource.class.php
===================================================================
--- plog/branches/lifetype-1.3-ajax/class/gallery/dao/galleryresource.class.php 2007-07-15 10:04:22 UTC (rev 5657)
+++ plog/branches/lifetype-1.3-ajax/class/gallery/dao/galleryresource.class.php 2007-07-15 14:48:48 UTC (rev 5658)
@@ -559,5 +559,22 @@
return( $link );
}
+
+ /**
+ * @see DbObject::toJson()
+ *
+ * Add a few more things to the output serialized for Json
+ */
+ function toJson()
+ {
+ $data = parent::toJson();
+ $data["album"] = $this->getAlbum();
+ $data["link"] = $this->getLink();
+ $data["preview_link"] = $this->getPreviewLink();
+ $data["medium_preview_link"] = $this->getMediumPreviewLink();
+ $data["resource_link"] = $this->getResourceLink();
+
+ return( $data );
+ }
}
?>
\ No newline at end of file
Modified: plog/branches/lifetype-1.3-ajax/class/view/admin/adminnewalbumview.class.php
===================================================================
--- plog/branches/lifetype-1.3-ajax/class/view/admin/adminnewalbumview.class.php 2007-07-15 10:04:22 UTC (rev 5657)
+++ plog/branches/lifetype-1.3-ajax/class/view/admin/adminnewalbumview.class.php 2007-07-15 14:48:48 UTC (rev 5658)
@@ -9,10 +9,13 @@
*/
class AdminNewAlbumView extends AdminTemplatedView
{
-
- function AdminNewAlbumView( $blogInfo )
+ var $_parentId;
+
+ function AdminNewAlbumView( $blogInfo, $parentId = 0 )
{
$this->AdminTemplatedView( $blogInfo, "newresourcealbum" );
+
+ $this->_parentId = $parentId;
}
function render()
@@ -22,6 +25,7 @@
$userAlbums = $albums->getNestedAlbumList( $this->_blogInfo->getId());
$this->notifyEvent( EVENT_ALBUMS_LOADED, Array( "albums" => &$userAlbums ));
$this->setValue( "albums", $userAlbums );
+ $this->setValue( "parentId", $this->_parentId );
// transfer control to the parent class
parent::render();
Modified: plog/branches/lifetype-1.3-ajax/class/view/admin/adminnewresourceview.class.php
===================================================================
--- plog/branches/lifetype-1.3-ajax/class/view/admin/adminnewresourceview.class.php 2007-07-15 10:04:22 UTC (rev 5657)
+++ plog/branches/lifetype-1.3-ajax/class/view/admin/adminnewresourceview.class.php 2007-07-15 14:48:48 UTC (rev 5658)
@@ -8,10 +8,13 @@
*/
class AdminNewResourceView extends AdminTemplatedView
{
+ var $_albumId;
- function AdminNewResourceView( $blogInfo )
+ function AdminNewResourceView( $blogInfo, $albumId )
{
$this->AdminTemplatedView( $blogInfo, "newresource" );
+
+ $this->_albumId = $albumId;
}
function render()
@@ -21,6 +24,7 @@
$userAlbums = $albums->getNestedAlbumList( $this->_blogInfo->getId());
$this->notifyEvent( EVENT_ALBUMS_LOADED, Array( "albums" => &$userAlbums ));
$this->setValue( "albums", $userAlbums );
+ $this->setValue( "albumId", $this->_albumId );
// transfer control to the parent class
parent::render();
Added: plog/branches/lifetype-1.3-ajax/js/ui/contentoverlay.js
===================================================================
--- plog/branches/lifetype-1.3-ajax/js/ui/contentoverlay.js (rev 0)
+++ plog/branches/lifetype-1.3-ajax/js/ui/contentoverlay.js 2007-07-15 14:48:48 UTC (rev 5658)
@@ -0,0 +1,121 @@
+Lifetype.UI.ContentOverlay = function( el, url, userConfig )
+{
+ if( arguments.length < 3 ) {
+ userConfig = {
+ fixedcenter:true,
+ constraintoviewport:true,
+ visible:false,
+ width:"660px",
+ close: true,
+ draggable: false,
+ underlay:"shadow",
+ modal:true
+ }
+ }
+ Lifetype.UI.ContentOverlay.superclass.constructor.call( this, el, userConfig );
+ this.setBody( "" );
+ this.url = url;
+}
+YAHOO.extend( Lifetype.UI.ContentOverlay, YAHOO.widget.Panel );
+
+Lifetype.UI.ContentOverlay.prototype.show = function()
+{
+ this.render( document.body );
+
+ c = YAHOO.util.Connect.asyncRequest( 'GET', this.url, { scope:this, success: function(o) {
+ this.setBody( o.responseText )
+ }
+ });
+ Lifetype.UI.ContentOverlay.superclass.show.call( this );
+}
+
+// Overrides the handler for the "modal" property with special animation-related functionality
+Lifetype.UI.ContentOverlay.prototype.configModal = function(type, args, obj)
+{
+ var modal = args[0];
+
+ if (modal) {
+ this.buildMask();
+
+ if (typeof this.maskOpacity == 'undefined') {
+ this.mask.style.visibility = "hidden";
+ this.mask.style.display = "block";
+ this.maskOpacity = YAHOO.util.Dom.getStyle(this.mask,"opacity");
+ this.mask.style.display = "none";
+ this.mask.style.visibility = "visible";
+ }
+
+ if (! YAHOO.util.Config.alreadySubscribed( this.beforeShowEvent, this.showMask, this ) ) {
+ this.beforeShowEvent.subscribe(this.showMask, this, true);
+ }
+ if (! YAHOO.util.Config.alreadySubscribed( this.hideEvent, this.hideMask, this) ) {
+ this.hideEvent.subscribe(this.hideMask, this, true);
+ }
+ if (! YAHOO.util.Config.alreadySubscribed( YAHOO.widget.Overlay.windowResizeEvent, this.sizeMask, this ) ) {
+ YAHOO.widget.Overlay.windowResizeEvent.subscribe(this.sizeMask, this, true);
+ }
+ if (! YAHOO.util.Config.alreadySubscribed( this.destroyEvent, this.removeMask, this) ) {
+ this.destroyEvent.subscribe(this.removeMask, this, true);
+ }
+ this.cfg.refireEvent("zIndex");
+ }
+ else {
+ this.beforeShowEvent.unsubscribe(this.showMask, this);
+ this.beforeHideEvent.unsubscribe(this.hideMask, this);
+ YAHOO.widget.Overlay.windowResizeEvent.unsubscribe(this.sizeMask);
+ }
+};
+
+// Overrides the showMask function to allow for fade-in animation
+Lifetype.UI.ContentOverlay.prototype.showMask = function() {
+ if (this.cfg.getProperty("modal") && this.mask) {
+ YAHOO.util.Dom.addClass(document.body, "masked");
+ this.sizeMask();
+
+ var o = this.maskOpacity;
+
+ if (! this.maskAnimIn) {
+ this.maskAnimIn = new YAHOO.util.Anim(this.mask, {opacity: {to:o}}, 0.25)
+ YAHOO.util.Dom.setStyle(this.mask, "opacity", 0);
+ }
+
+ if (! this.maskAnimOut) {
+ this.maskAnimOut = new YAHOO.util.Anim(this.mask, {opacity: {to:0}}, 0.25)
+ this.maskAnimOut.onComplete.subscribe(function() {
+ this.mask.tabIndex = -1;
+ this.mask.style.display = "none";
+ this.hideMaskEvent.fire();
+ YAHOO.util.Dom.removeClass(document.body, "masked");
+ }, this, true);
+
+ }
+ this.mask.style.display = "block";
+ this.maskAnimIn.animate();
+ this.mask.tabIndex = 0;
+ this.showMaskEvent.fire();
+ }
+};
+
+// Overrides the showMask function to allow for fade-out animation
+Lifetype.UI.ContentOverlay.prototype.hideMask = function() {
+ if (this.cfg.getProperty("modal") && this.mask) {
+ this.maskAnimOut.animate();
+ }
+};
+
+/**
+ * General code that is executed as soon as the page is loaded. It will attach an instance of the ContentOverlay
+ * class to all links whose "rel" attribute is set to "overlay"
+ */
+YAHOO.util.Event.addListener( window, "load", function() {
+ elems = YAHOO.util.Dom.getElementsBy(function(e) {return(e.rel == "overlay")});
+ objs = new Array();
+ for( i = 0; i < elems.length; i++ ) {
+ e = elems[i];
+ // create the object
+ objs[i] = new Lifetype.UI.ContentOverlay( YAHOO.util.Dom.generateId(), e.href );
+ e.href = "#";
+ // and bind it to the onclick event
+ YAHOO.util.Event.addListener( e.id, "click", objs[i].show, objs[i], true );
+ }
+});
\ No newline at end of file
Modified: plog/branches/lifetype-1.3-ajax/js/ui/forms.js
===================================================================
--- plog/branches/lifetype-1.3-ajax/js/ui/forms.js 2007-07-15 10:04:22 UTC (rev 5657)
+++ plog/branches/lifetype-1.3-ajax/js/ui/forms.js 2007-07-15 14:48:48 UTC (rev 5658)
@@ -161,13 +161,22 @@
* Processes responses for forms submitted via Ajax
* @param formId
* @param postUrl
+ * @param options An options object:
+ * resetAfterSuccess:boolean = reset the form after success
+ * formSuccessCallback:function = callback, function to call if the form is successful
+ * formErrorCallback:function = callback, function to call if the form is not successful
*/
-Lifetype.Forms.AjaxFormProcessor = function( formId, postUrl )
+Lifetype.Forms.AjaxFormProcessor = function( formId, postUrl, options )
{
var formObject = document.getElementById( formId );
YAHOO.util.Connect.setForm(formObject);
+
+ if( options )
+ options.formElement = formObject;
+
var cObj = YAHOO.util.Connect.asyncRequest('POST', postUrl,
callback = {
+ argument: options,
success: function( o ) {
// decode the JSon response from the server
response = Lifetype.JSon.decode( o.responseText );
@@ -205,7 +214,7 @@
elem.style.display = 'none';
}
}
- }
+ }
// display the general error message by setting it into its container
if(( elem = YAHOO.util.Dom.get( "FormErrorMessage" ))) {
@@ -215,15 +224,33 @@
elem.style.display = 'block';
}
+ // check the arguments
+ if( o.argument ) {
+ // is there an error callback?
+ if( o.argument.formErrorCallback )
+ o.argument.formErrorCallback( o );
+ }
+
return( true );
}
else {
- // display the general error message by setting it into its container
+ // display the general success message by setting it into its container
// and making the block visible
if(( elem = YAHOO.util.Dom.get( "FormInfoMessage" )))
elem.innerHTML = response.message;
if(( elem = YAHOO.util.Dom.get( "FormInfo" )))
- elem.style.display = 'block';
+ elem.style.display = 'block';
+
+ // check if there's any argument
+ if( o.argument ) {
+ // do we reset the form after success
+ if( o.argument.resetAfterSuccess == true ) {
+ o.argument.formElement.reset();
+ }
+ // is there a success callback?
+ if( o.argument.formSuccessCallback )
+ o.argument.formSuccessCallback( o );
+ }
}
}
}
Added: plog/branches/lifetype-1.3-ajax/js/ui/pages/newresourcealbum.js
===================================================================
--- plog/branches/lifetype-1.3-ajax/js/ui/pages/newresourcealbum.js (rev 0)
+++ plog/branches/lifetype-1.3-ajax/js/ui/pages/newresourcealbum.js 2007-07-15 14:48:48 UTC (rev 5658)
@@ -0,0 +1,7 @@
+Lifetype.UI.Pages.NewResourceAlbum = function() {}
+
+Lifetype.UI.Pages.NewResourceAlbum.submitHook = function( form )
+{
+ Lifetype.Forms.AjaxFormProcessor(form.id,'?op=addResourceAlbum&output=json', {resetAfterSuccess:true});
+ return(false);
+}
\ No newline at end of file
Modified: plog/branches/lifetype-1.3-ajax/js/ui/pages/resources.js
===================================================================
--- plog/branches/lifetype-1.3-ajax/js/ui/pages/resources.js 2007-07-15 10:04:22 UTC (rev 5657)
+++ plog/branches/lifetype-1.3-ajax/js/ui/pages/resources.js 2007-07-15 14:48:48 UTC (rev 5658)
@@ -10,15 +10,15 @@
//elem.style.background = "white";
}
-Lifetype.UI.Pages.Resources.clickHandler = function( elem )
+Lifetype.UI.Pages.Resources.toggle = function( elem )
{
checkbox = Lifetype.Dom.$( "checkbox_" + elem.id );
if( checkbox.checked == false ) {
// toggle the checkbox assigned to this item
checkbox.checked = true;
-
+
// and the background color of the element
- elem.style.background = "blue";
+ elem.style.background = "#f9f8b1";
}
else {
// toggle the checkbox assigned to this item
@@ -27,4 +27,54 @@
// and the background color of the element
elem.style.background = "white";
}
+}
+
+Lifetype.UI.Pages.Resources.clickHandler = function( elem )
+{
+ Lifetype.UI.Pages.Resources.toggle( elem );
+}
+
+Lifetype.UI.Pages.Resources.select = function( elem )
+{
+ checkbox = Lifetype.Dom.$( "checkbox_" + elem.id );
+ // toggle the checkbox assigned to this item
+ checkbox.checked = true;
+
+ // and the background color of the element
+ elem.style.background = "#f9f8b1";
+}
+
+Lifetype.UI.Pages.Resources.unselect = function( elem )
+{
+ checkbox = Lifetype.Dom.$( "checkbox_" + elem.id );
+ // toggle the checkbox assigned to this item
+ checkbox.checked = false;
+
+ // and the background color of the element
+ elem.style.background = "white";
+}
+
+Lifetype.UI.Pages.Resources.selectAll = function()
+{
+ selectAllToggle = Lifetype.Dom.$( "selectAll" );
+ if( !selectAllToggle.selected ) {
+ selectAllToggle.selected = true;
+ f = Lifetype.UI.Pages.Resources.select;
+ }
+ else {
+ selectAllToggle.selected = false;
+ f = Lifetype.UI.Pages.Resources.unselect;
+ }
+
+ // select all files
+ elems = YAHOO.util.Dom.getElementsByClassName( 'file', 'div' );
+ for( i = 0; i < elems.length; i++ ) {
+ f( elems[i] );
+ }
+ // select all albums, if any
+ elems = YAHOO.util.Dom.getElementsByClassName( 'album', 'div' );
+ for( i = 0; i < elems.length; i++ ) {
+ if( elems[i].id != "root_album" )
+ f( elems[i] );
+ }
}
\ No newline at end of file
Modified: plog/branches/lifetype-1.3-ajax/templates/admin/customfields.template
===================================================================
--- plog/branches/lifetype-1.3-ajax/templates/admin/customfields.template 2007-07-15 10:04:22 UTC (rev 5657)
+++ plog/branches/lifetype-1.3-ajax/templates/admin/customfields.template 2007-07-15 14:48:48 UTC (rev 5658)
@@ -1,5 +1,7 @@
{include file="$admintemplatepath/header.template"}
{include file="$admintemplatepath/navigation.template" showOpt=blogCustomFields title=$locale->tr("blogCustomFields")}
+{js src="js/ui/pages/newcustomfield.js"}
+{js src="js/ui/pages/editcustomfield.js"}
<script type="text/javascript">
{literal}
YAHOO.util.Event.addListener( window, "load", function() {
@@ -9,6 +11,11 @@
});
{/literal}
</script>
+
+<div class="optionIcon">
+ <a id="newCustomField" href="?op=newCustomField" rel="overlay">New Custom Field</a>
+</div>
+
<form id="customFields" action="admin.php" method="post">
<div id="list">
{include file="$admintemplatepath/successmessage.template"}
@@ -32,7 +39,7 @@
<input class="checkbox" type="checkbox" name="fieldIds[{$field->getId()}]" id="checks_1" value="{$field->getId()}" />
</td>
<td class="col_highlighted">
- {check_perms perm=update_custom_field}<a href="admin.php?op=editCustomField&fieldId={$field->getId()}">{/check_perms}{$field->getName()}{check_perms perm=update_custom_field}</a>{/check_perms}
+ {check_perms perm=update_custom_field}<a href="admin.php?op=editCustomField&fieldId={$field->getId()}" rel="overlay" id="customfield_{$field->getId()}">{/check_perms}{$field->getName()}{check_perms perm=update_custom_field}</a>{/check_perms}
</td>
<td>
{$field->getDescription()}
Modified: plog/branches/lifetype-1.3-ajax/templates/admin/editarticlecategories.template
===================================================================
--- plog/branches/lifetype-1.3-ajax/templates/admin/editarticlecategories.template 2007-07-15 10:04:22 UTC (rev 5657)
+++ plog/branches/lifetype-1.3-ajax/templates/admin/editarticlecategories.template 2007-07-15 14:48:48 UTC (rev 5658)
@@ -33,6 +33,10 @@
<br style="clear:both" />
</div>
+<div class="optionIcon">
+ <a id="newArticleCategory" href="?op=newArticleCategory" rel="overlay">New Article Category</a>
+</div>
+
<form id="deleteCategories" action="admin.php" method="post">
<div id="list">
{include file="$admintemplatepath/successmessage.template"}
@@ -54,7 +58,7 @@
<input class="checkbox" type="checkbox" name="categoryIds[{counter}]" id="checks_{$category->getId()}" value="{$category->getId()}" />
</td>
<td class="col_highlighted">
- {check_perms perm=update_category}<a href="admin.php?op=editArticleCategory&categoryId={$category->getId()}">{/check_perms}{$category->getName()}{check_perms perm=update_category}</a>{/check_perms}
+ {check_perms perm=update_category}<a id="cat_{$category->getId()}" rel="overlay" href="admin.php?op=editArticleCategory&categoryId={$category->getId()}">{/check_perms}{$category->getName()}{check_perms perm=update_category}</a>{/check_perms}
</td>
{if $category->getNumArticles() > 0}
<td>{check_perms perm=view_articles}<a href="admin.php?op=editPosts&showCategory={$category->getId()}&showStatus=0&showMonth=-1">{/check_perms}({$category->getNumAllArticles()}){check_perms perm=view_articles}</a>{/check_perms}</td>
Modified: plog/branches/lifetype-1.3-ajax/templates/admin/editarticlecategory.template
===================================================================
--- plog/branches/lifetype-1.3-ajax/templates/admin/editarticlecategory.template 2007-07-15 10:04:22 UTC (rev 5657)
+++ plog/branches/lifetype-1.3-ajax/templates/admin/editarticlecategory.template 2007-07-15 14:48:48 UTC (rev 5658)
@@ -1,6 +1,3 @@
-{include file="$admintemplatepath/header.template"}
-{include file="$admintemplatepath/navigation.template" showOpt=editArticleCategories title=$locale->tr("editArticleCategories")}
-
<form name="editArticleCategory" id="editArticleCategory" action="admin.php" method="post" onSubmit="Lifetype.Forms.AjaxFormProcessor(this.id,'?output=json');return(false);">
<fieldset class="inputField">
@@ -39,6 +36,4 @@
<input type="hidden" name="op" value="updateArticleCategory" />
<input type="hidden" name="categoryId" value="{$categoryId}" />
</div>
-</form>
-{include file="$admintemplatepath/footernavigation.template"}
-{include file="$admintemplatepath/footer.template"}
\ No newline at end of file
+</form>
\ No newline at end of file
Modified: plog/branches/lifetype-1.3-ajax/templates/admin/editcustomfield.template
===================================================================
--- plog/branches/lifetype-1.3-ajax/templates/admin/editcustomfield.template 2007-07-15 10:04:22 UTC (rev 5657)
+++ plog/branches/lifetype-1.3-ajax/templates/admin/editcustomfield.template 2007-07-15 14:48:48 UTC (rev 5658)
@@ -1,7 +1,3 @@
-{include file="$admintemplatepath/header.template"}
-{js src="js/ui/pages/newcustomfield.js"}
-{js src="js/ui/pages/editcustomfield.js"}
-{include file="$admintemplatepath/navigation.template" showOpt=blogCustomFields title=$locale->tr("editCustomField")}
<form name="updateCustomField" id="updateCustomField" method="post" action="admin.php" onSubmit="Lifetype.UI.Pages.UpdateCustomField.onSubmitHook();return false">
<fieldset class="inputField">
<legend>{$locale->tr("editCustomField")}</legend>
@@ -66,6 +62,4 @@
<input type="reset" name="Rest" value="{$locale->tr("reset")}" />
<input type="submit" name="{$locale->tr("update")}" value="{$locale->tr("update")}" />
</div>
- </form>
-{include file="$admintemplatepath/footernavigation.template"}
-{include file="$admintemplatepath/footer.template"}
\ No newline at end of file
+ </form>
\ No newline at end of file
Modified: plog/branches/lifetype-1.3-ajax/templates/admin/editlink.template
===================================================================
--- plog/branches/lifetype-1.3-ajax/templates/admin/editlink.template 2007-07-15 10:04:22 UTC (rev 5657)
+++ plog/branches/lifetype-1.3-ajax/templates/admin/editlink.template 2007-07-15 14:48:48 UTC (rev 5658)
@@ -1,5 +1,3 @@
-{include file="$admintemplatepath/header.template"}
-{include file="$admintemplatepath/navigation.template" showOpt=editLinks title=$locale->tr("editLink")}
<form id="newLink" action="admin.php" method="post" onSubmit="Lifetype.Forms.AjaxFormProcessor(this.id,'?output=json');return(false);">
<fieldset class="inputField">
<legend>{$locale->tr("editLink")}</legend>
@@ -55,7 +53,4 @@
<input type="reset" value="{$locale->tr("reset")}" name="reset"/>
<input type="submit" value="{$locale->tr("update")}" name="Update"/>
</div>
-</form>
-
-{include file="$admintemplatepath/footernavigation.template"}
-{include file="$admintemplatepath/footer.template"}
\ No newline at end of file
+</form>
\ No newline at end of file
Modified: plog/branches/lifetype-1.3-ajax/templates/admin/editlinkcategories.template
===================================================================
--- plog/branches/lifetype-1.3-ajax/templates/admin/editlinkcategories.template 2007-07-15 10:04:22 UTC (rev 5657)
+++ plog/branches/lifetype-1.3-ajax/templates/admin/editlinkcategories.template 2007-07-15 14:48:48 UTC (rev 5658)
@@ -33,6 +33,10 @@
<br style="clear:both" />
</div>
+<div class="optionIcon">
+ <a id="newLinkCategory" href="?op=newLinkCategory" rel="overlay">New Link Category</a>
+</div>
+
<form id="linkCategories" action="admin.php" method="post">
<div id="list">
{include file="$admintemplatepath/successmessage.template"}
@@ -51,7 +55,7 @@
<tr>
<td align="center"><input class="checkbox" type="checkbox" name="categoryIds[{counter}]" value="{$category->getId()}"/></td>
<td class="col_highlighted">
- {check_perms perm="update_link_category"}<a href="admin.php?op=editLinkCategory&categoryId={$category->getId()}">{/check_perms}{$category->getName()}{check_perms perm="update_link_category"}</a>{/check_perms}
+ {check_perms perm="update_link_category"}<a href="admin.php?op=editLinkCategory&categoryId={$category->getId()}" rel="overlay" id="linkcategory_{$category->getId()}">{/check_perms}{$category->getName()}{check_perms perm="update_link_category"}</a>{/check_perms}
</td>
<td>
{if $category->getNumLinks() > 0}
Modified: plog/branches/lifetype-1.3-ajax/templates/admin/editlinkcategory.template
===================================================================
--- plog/branches/lifetype-1.3-ajax/templates/admin/editlinkcategory.template 2007-07-15 10:04:22 UTC (rev 5657)
+++ plog/branches/lifetype-1.3-ajax/templates/admin/editlinkcategory.template 2007-07-15 14:48:48 UTC (rev 5658)
@@ -1,5 +1,3 @@
-{include file="$admintemplatepath/header.template"}
-{include file="$admintemplatepath/navigation.template" showOpt=editLinkCategories title=$locale->tr("editLinkCategory")}
<form id="editLinkCategory" method="post" action="admin.php" onSubmit="Lifetype.Forms.AjaxFormProcessor(this.id,'?admin.php?output=json');return(false);">
<fieldset class="inputField">
{include file="$admintemplatepath/formvalidateajax.template"}
@@ -18,6 +16,4 @@
<input type="submit" name="subOp" value="{$locale->tr("update")}" />
<input type="hidden" name="linkCategoryId" value="{$linkCategoryId}" />
</div>
-</form>
-{include file="$admintemplatepath/footernavigation.template"}
-{include file="$admintemplatepath/footer.template"}
\ No newline at end of file
+</form>
\ No newline at end of file
Modified: plog/branches/lifetype-1.3-ajax/templates/admin/editlinks.template
===================================================================
--- plog/branches/lifetype-1.3-ajax/templates/admin/editlinks.template 2007-07-15 10:04:22 UTC (rev 5657)
+++ plog/branches/lifetype-1.3-ajax/templates/admin/editlinks.template 2007-07-15 14:48:48 UTC (rev 5658)
@@ -51,6 +51,7 @@
<form id="links" action="admin.php" method="post">
{check_perms perm="update_link"}
<div class="optionIcon">
+ <a id="newLink" href="?op=newLink" rel="overlay">New Link</a> |
<a id="optionIconLink" href="#bulkEdit" title="{$locale->tr("show_massive_change_option")}" onclick="Lifetype.UI.Pages.Global.switchMassiveOption()">{$locale->tr("show_massive_change_option")}</a>
</div>
{/check_perms}
@@ -73,7 +74,7 @@
<tr>
<td><input class="checkbox" type="checkbox" name="linkIds[{counter}]" value="{$link->getId()}"/></td>
<td class="col_highlighted">
- {check_perms perm="update_link"}<a href="admin.php?op=editLink&linkId={$link->getId()}">{/check_perms}{$link->getName()|utf8_wordwrap:20:"<br/>":false}{check_perms perm="update_link"}</a>{/check_perms}
+ {check_perms perm="update_link"}<a id="link_{$link->getId()}" href="admin.php?op=editLink&linkId={$link->getId()}" rel="overlay">{/check_perms}{$link->getName()|utf8_wordwrap:20:"<br/>":false}{check_perms perm="update_link"}</a>{/check_perms}
</td>
<td><a href="{$link->getUrl()}">{$link->getUrl()|utf8_wordwrap:40:"<br/>":true}</a></td>
{assign var=linkcategory value=$link->getCategoryId()}
Modified: plog/branches/lifetype-1.3-ajax/templates/admin/header.template
===================================================================
--- plog/branches/lifetype-1.3-ajax/templates/admin/header.template 2007-07-15 10:04:22 UTC (rev 5657)
+++ plog/branches/lifetype-1.3-ajax/templates/admin/header.template 2007-07-15 14:48:48 UTC (rev 5658)
@@ -24,7 +24,6 @@
var scriptName = "{$config->getValue("script_name")}";
var plogAdminBaseUrl = "{$url->getBaseUrl(false)}/admin.php";
var plogBlogId = "{$blog->getId()}";
- var GB_ROOT_DIR = "{$url->getBaseUrl(false)}/js/greybox/";
</script>
{js src="js/cookie/cookie.js"}
<!-- Yahoo UI Library -->
@@ -32,6 +31,9 @@
{js src="js/yui/dom/dom-min.js"}
{js src="js/yui/event/event-min.js"}
{js src="js/yui/connection/connection-min.js"}
+{js src="js/yui/container/container-min.js"}
+{js src="js/yui/animation/animation-min.js"}
+<link rel="stylesheet" type="text/css" href="js/yui/container/assets/container.css">
<!-- LifeType UI Library -->
{js src="js/ui/core.js"}
{js src="js/ui/common.js"}
@@ -39,6 +41,7 @@
{js src="js/ui/plogui.js"}
{js src="js/ui/tableeffects.js"}
{js src="js/ui/overlay.js"}
+{js src="js/ui/contentoverlay.js"}
{js src="js/ui/dom.js"}
{js src="js/ui/menu.js"}
{if $location_data_enabled}
@@ -51,12 +54,6 @@
<link rel="stylesheet" href="js/JSCookMenu/ThemeOffice/theme.css" type="text/css" />
{js src="js/JSCookMenu/ThemeOffice/theme.js"}
{/if}
-<!-- Greybox -->
-{js src="js/greybox/AJS.js"}
-{js src="js/greybox/AJS_fx.js"}
-{js src="js/greybox/gb_scripts.js"}
-<link href="js/greybox/gb_styles.css" rel="stylesheet" type="text/css" />
-
</head>
<body>
Modified: plog/branches/lifetype-1.3-ajax/templates/admin/menus.xml
===================================================================
--- plog/branches/lifetype-1.3-ajax/templates/admin/menus.xml 2007-07-15 10:04:22 UTC (rev 5657)
+++ plog/branches/lifetype-1.3-ajax/templates/admin/menus.xml 2007-07-15 14:48:48 UTC (rev 5658)
@@ -1,31 +1,17 @@
<menu url="?op=Dashboard" localeId="dashboard">
- <Manage url="?op=Manage">
+ <Manage url="?op=editPosts">
<managePosts ignoreBreadCrumbs="1" orPerms="add_post,view_posts,add_category,view_categories,view_comments,view_trackbacks">
<newPost url="?op=newPost" andPerms="add_post" />
<editPosts url="?op=editPosts" andPerms="view_posts" />
- <newArticleCategory url="?op=newArticleCategory" andPerms="add_category" />
<editArticleCategories url="?op=editArticleCategories" andPerms="view_categories" />
<editComments url="?op=editComments" andPerms="view_comments" />
<editTrackbacks url="?op=editTrackbacks" andPerms="view_trackbacks" />
+ <editLinks url="?op=editLinks" andPerms="view_links" />
+ <editLinkCategories url="?op=editLinkCategories" andPerms="view_link_categories" />
+ <blogCustomFields url="?op=blogCustomFields" andPerms="view_custom_fields" />
</managePosts>
- <manageLinks ignoreBreadCrumbs="1" orPerms="add_link,view_links,add_link_category,view_link_categories">
- <newLink url="?op=newLink" andPerms="add_link" />
- <editLinks url="?op=editLinks" andPerms="view_links" />
- <newLinkCategory url="?op=newLinkCategory" andPerms="add_link_category" />
- <editLinkCategories url="?op=editLinkCategories" andPerms="view_link_categories" />
- </manageLinks>
- <manageCustomFields ignoreBreadCrumbs="1" orPerms="add_custom_field,view_custom_fields">
- <newCustomField url="?op=newCustomField" andPerms="add_custom_field" />
- <blogCustomFields url="?op=blogCustomFields" andPerms="view_custom_fields" />
- </manageCustomFields>
</Manage>
- <ResourcesGroup url="?op=resourcesGroup" localeId="resourceCenter">
- <resourceCenter ignoreBreadCrumbs="1" orPerms="add_resource,add_album,view_resources">
- <newResource url="?op=newResource" andPerms="add_resource" />
- <newResourceAlbum url="?op=newResourceAlbum" andPerms="add_album" />
- <resources url="?op=resources" andPerms="view_resources" />
- </resourceCenter>
- </ResourcesGroup>
+ <resources url="?op=resources" andPerms="view_resources" />
<friendManagement url="?op=friendManagement">
<manageFriends ignoreBreadCrumbs="1">
<newFriend url="?op=newFriend"/>
Modified: plog/branches/lifetype-1.3-ajax/templates/admin/newcustomfield.template
===================================================================
--- plog/branches/lifetype-1.3-ajax/templates/admin/newcustomfield.template 2007-07-15 10:04:22 UTC (rev 5657)
+++ plog/branches/lifetype-1.3-ajax/templates/admin/newcustomfield.template 2007-07-15 14:48:48 UTC (rev 5658)
@@ -1,6 +1,3 @@
-{include file="$admintemplatepath/header.template"}
-{js src="js/ui/pages/newcustomfield.js"}
-{include file="$admintemplatepath/navigation.template" showOpt=newCustomField title=$locale->tr("newCustomField")}
<form name="newCustomField" id="newCustomField" method="post" action="admin.php" onSubmit="Lifetype.UI.Pages.NewCustomField.onSubmitHook();return false">
<fieldset class="inputField">
<legend>{$locale->tr("newCustomField")}</legend>
@@ -63,6 +60,4 @@
<input type="reset" name="Rest" value="{$locale->tr("reset")}" />
<input type="submit" name="{$locale->tr("add")}" value="{$locale->tr("add")}" />
</div>
- </form>
-{include file="$admintemplatepath/footernavigation.template"}
-{include file="$admintemplatepath/footer.template"}
\ No newline at end of file
+ </form>
\ No newline at end of file
Modified: plog/branches/lifetype-1.3-ajax/templates/admin/newlink.template
===================================================================
--- plog/branches/lifetype-1.3-ajax/templates/admin/newlink.template 2007-07-15 10:04:22 UTC (rev 5657)
+++ plog/branches/lifetype-1.3-ajax/templates/admin/newlink.template 2007-07-15 14:48:48 UTC (rev 5658)
@@ -1,11 +1,3 @@
-{include file="$admintemplatepath/header.template"}
-{include file="$admintemplatepath/navigation.template" showOpt=newLink title=$locale->tr("newLink")}
-{if $smarty.request.linkName}
- {assign var=linkName value=$smarty.request.linkName}
-{/if}
-{if $smarty.request.linkUrl}
- {assign var=linkUrl value=$smarty.request.linkUrl}
-{/if}
<form id="newLink" action="admin.php" method="post" onSubmit="Lifetype.Forms.AjaxFormProcessor(this.id,'?output=json');return(false);">
<fieldset class="inputField">
@@ -55,13 +47,16 @@
{/foreach}
</select>
</div>
+
+
+ <!--
+ <div class="field">
+ <label for="bookmarklet">{$locale->tr("bookmarklet")}</label>
+ <div class="formHelp">{$locale->tr("bookmarklet_help")}</div>
+ <a href="javascript:void(ltbm=window.open('{$url->getAdminUrl()}?op=newLink&linkName='+encodeURIComponent(document.title)+'&linkUrl='+encodeURIComponent(location.href),'ltbm','toolbar=1,status=1,location=1,scrollbars=1,menubar=1,resizable=1'));" onclick="window.alert('{$locale->tr("bookmarklet_help")}');">{$locale->tr("bookmarkit_to_lifetype")}</a>
+ </div>
+ -->
- <div class="field">
- <label for="bookmarklet">{$locale->tr("bookmarklet")}</label>
- <div class="formHelp">{$locale->tr("bookmarklet_help")}</div>
- <a href="javascript:void(ltbm=window.open('{$url->getAdminUrl()}?op=newLink&linkName='+encodeURIComponent(document.title)+'&linkUrl='+encodeURIComponent(location.href),'ltbm','toolbar=1,status=1,location=1,scrollbars=1,menubar=1,resizable=1'));" onclick="window.alert('{$locale->tr("bookmarklet_help")}');">{$locale->tr("bookmarkit_to_lifetype")}</a>
- </div>
-
</fieldset>
<div class="buttons">
<input type="hidden" name="op" value="addLink" />
@@ -69,6 +64,4 @@
<input type="submit" name="Add" value="{$locale->tr("add")}"/>
<input type="hidden" value="addLink" name="op"/>
</div>
-</form>
-{include file="$admintemplatepath/footernavigation.template"}
-{include file="$admintemplatepath/footer.template"}
+</form>
\ No newline at end of file
Modified: plog/branches/lifetype-1.3-ajax/templates/admin/newlinkcategory.template
===================================================================
--- plog/branches/lifetype-1.3-ajax/templates/admin/newlinkcategory.template 2007-07-15 10:04:22 UTC (rev 5657)
+++ plog/branches/lifetype-1.3-ajax/templates/admin/newlinkcategory.template 2007-07-15 14:48:48 UTC (rev 5658)
@@ -1,6 +1,4 @@
-{include file="$admintemplatepath/header.template"}
-{include file="$admintemplatepath/navigation.template" showOpt=newLinkCategory title=$locale->tr("newLinkCategory")}
- <form name="newLinkCategory" action="admin.php" method="post" id="newLinkCategory" onSubmit="Lifetype.Forms.AjaxFormProcessor(this.id,'?output=json');return(false);">
+<form name="newLinkCategory" action="admin.php" method="post" id="newLinkCategory" onSubmit="Lifetype.Forms.AjaxFormProcessor(this.id,'?output=json');return(false);">
<fieldset class="inputField">
<legend>{$locale->tr("newLinkCategory")}</legend>
{include file="$admintemplatepath/formvalidateajax.template"}
@@ -17,6 +15,4 @@
<input type="hidden" name="op" value="addLinkCategory"/>
<input type="submit" name="Add" value="{$locale->tr("add")}"/>
</div>
- </form>
-{include file="$admintemplatepath/footernavigation.template"}
-{include file="$admintemplatepath/footer.template"}
+ </form>
\ No newline at end of file
Modified: plog/branches/lifetype-1.3-ajax/templates/admin/newpostcategory.template
===================================================================
--- plog/branches/lifetype-1.3-ajax/templates/admin/newpostcategory.template 2007-07-15 10:04:22 UTC (rev 5657)
+++ plog/branches/lifetype-1.3-ajax/templates/admin/newpostcategory.template 2007-07-15 14:48:48 UTC (rev 5658)
@@ -1,5 +1,3 @@
-{include file="$admintemplatepath/header.template"}
-{include file="$admintemplatepath/navigation.template" showOpt=newArticleCategory title=$locale->tr("newArticleCategory")}
<form name="addArticleCategory" id="addArticleCategory" method="post" action="admin.php" onSubmit="Lifetype.Forms.AjaxFormProcessor(this.id,'?op=addArticleCategory&output=json');return(false);">
<fieldset class="inputField">
<legend>{$locale->tr("newArticleCategory")}</legend>
@@ -34,6 +32,4 @@
<input type="reset" name="Reset" value="{$locale->tr("reset")}" />
<input type="submit" name="Add" value="{$locale->tr("add")}" />
</div>
- </form>
-{include file="$admintemplatepath/footernavigation.template"}
-{include file="$admintemplatepath/footer.template"}
+</form>
\ No newline at end of file
Modified: plog/branches/lifetype-1.3-ajax/templates/admin/newresource.template
===================================================================
--- plog/branches/lifetype-1.3-ajax/templates/admin/newresource.template 2007-07-15 10:04:22 UTC (rev 5657)
+++ plog/branches/lifetype-1.3-ajax/templates/admin/newresource.template 2007-07-15 14:48:48 UTC (rev 5658)
@@ -1,5 +1,3 @@
-{include file="$admintemplatepath/header.template"}
-{include file="$admintemplatepath/navigation.template" showOpt=newResource title=$locale->tr("newResource")}
<script type="text/javascript" src="js/ui/forms.js"></script>
<script type="text/javascript" src="js/ui/plogui.js"></script>
<form name="addResource" action="admin.php" method="post" enctype="multipart/form-data">
@@ -29,7 +27,7 @@
<select name="albumId" id="albumId">
{foreach from=$albums item=album}
{assign var=indentLevel value=$album->getValue("level")}
- <option value="{$album->getId()}">
+ <option value="{$album->getId()}" {if $albumId == $album->getId()}selected="selected"{/if}>
{textformat indent=$indentLevel indent_char=" "}{$album->getName()}{/textformat}
</option>
{/foreach}
@@ -55,7 +53,4 @@
{$locale->tr("upload_in_progress")}
<img src="imgs/admin/spinner_small.gif" alt="Spinner" />
</div>
- </form>
-
-{include file="$admintemplatepath/footernavigation.template"}
-{include file="$admintemplatepath/footer.template"}
+ </form>
\ No newline at end of file
Modified: plog/branches/lifetype-1.3-ajax/templates/admin/newresourcealbum.template
===================================================================
--- plog/branches/lifetype-1.3-ajax/templates/admin/newresourcealbum.template 2007-07-15 10:04:22 UTC (rev 5657)
+++ plog/branches/lifetype-1.3-ajax/templates/admin/newresourcealbum.template 2007-07-15 14:48:48 UTC (rev 5658)
@@ -1,21 +1,13 @@
-{include file="$admintemplatepath/header.template"}
-{include file="$admintemplatepath/navigation.template" showOpt=newResourceAlbum title=$locale->tr("newResourceAlbum")}
-
- <form name="addResourceAlbum" action="admin.php" method="post">
+<form name="addResourceAlbum" id="addResourceAlbum" action="admin.php" method="post" onSubmit="Lifetype.UI.Pages.NewResourceAlbum.submitHook(this);return(false);">
<fieldset class="inputField">
- {include file="$admintemplatepath/formvalidate.template"}
- {if $viewIsError}
- {if $viewErrorMessage != ""}
- {include file="$admintemplatepath/successmessage.template" message=$viewErrorMessage}
- {/if}
- {/if}
+ {include file="$admintemplatepath/formvalidateajax.template"}
<legend>{$locale->tr("newResourceAlbum")}</legend>
<div class="field">
<label for="albumName">{$locale->tr("name")}</label>
<span class="required">*</span>
<div class="formHelp">{$locale->tr("album_name_help")}</div>
<input type="text" id="albumName" name="albumName" value="{$albumName}" />
- {include file="$admintemplatepath/validate.template" field=albumName message=$locale->tr("error_empty_name")}
+ {include file="$admintemplatepath/validateajax.template" field=albumName}
</div>
<div class="field">
<label for="parentId">{$locale->tr("parent")}</label>
@@ -33,7 +25,7 @@
<div class="field">
<label for="albumDescription">{$locale->tr("description")}</label>
<div class="formHelp">{$locale->tr("album_description_help")}</div>
- <textarea name="albumDescription" id="albumDescription" rows="10" cols="60">{$albumDescription}</textarea>
+ <textarea name="albumDescription" id="albumDescription" rows="5" cols="60">{$albumDescription}</textarea>
</div>
<div class="field">
<label for="showAlbum">{$locale->tr("show")}</label>
@@ -44,10 +36,8 @@
</div>
</div> </fieldset>
<div class="buttons">
- <input type="reset" name="reset" value="{$locale->tr("reset")}" />
+ <input type="reset" name="resetButton" value="{$locale->tr("reset")}" />
<input type="submit" name="addAlbum" value="{$locale->tr("add")}" />
<input type="hidden" name="op" value="addResourceAlbum" />
</div>
- </form>
-{include file="$admintemplatepath/footernavigation.template"}
-{include file="$admintemplatepath/footer.template"}
+ </form>
\ No newline at end of file
Modified: plog/branches/lifetype-1.3-ajax/templates/admin/resources.template
===================================================================
--- plog/branches/lifetype-1.3-ajax/templates/admin/resources.template 2007-07-15 10:04:22 UTC (rev 5657)
+++ plog/branches/lifetype-1.3-ajax/templates/admin/resources.template 2007-07-15 14:48:48 UTC (rev 5658)
@@ -1,67 +1,14 @@
{include file="$admintemplatepath/header.template"}
-{include file="$admintemplatepath/navigation.template" showOpt=resources title=$locale->tr("resources")}
+{include file="$admintemplatepath/navigation.template" showOpt=ResourcesGroup title=$locale->tr("resourceCenter")}
{js src="js/ui/pages/global.js"}
{js src="js/ui/pages/resources.js"}
- <script type="text/javascript" src="js/ui/plogui.js"></script>
+{js src="js/ui/pages/newresourcealbum.js"}
+<script type="text/javascript" src="js/ui/plogui.js"></script>
<script type="text/javascript">
var showMassiveChangeOption = '{$locale->tr("show_massive_change_option")}';
var hideMassiveChangeOption = '{$locale->tr("hide_massive_change_option")}';
var errorLocationMsg = '{$locale->tr("error_post_location")}';
</script>
-{literal}
-<style type="text/css">
-/* ****************** albums *************** */
-
-div.album {
- text-align: center;
- float: left;
- width:150px;
- height:100px;
- margin-bottom:20px;
- margin-right:5px;
-}
-
-div.file {
- text-align: center;
- align:center;
- float: left;
- width:150px;
- height:170px;
- margin-bottom:5px;
- margin-right:5px;
- padding-top:5px;
-}
-
-.clearer {
- clear : both;
- height : 1px;
- font-size : 1px;
-}
-
-a img {border:none;}
-#album a:link {color: #004ca1;}
-#album a:visited {color: #b50394;}
-#album a:hover, #album a:active, #album a:focus {color: #004ca1;background:none;}
-
-/*.pictureFrame {
- border: 1px solid #dfdfdf;
- background-color: #ffffff;
- padding-top:5px;
- padding-left:5px;
- padding-right:5px;
- padding-bottom:15px;
- width:120px;
- text-align:center;
-}
-
-.picture {
- align:center;
- border: 1px solid #dfdfdf;
- width:120px;
-}*/
-</style>
-{/literal}
-
<div id="list_nav_bar">
<div id="list_nav_select">
<form id="viewResources" action="admin.php" method="post">
@@ -115,7 +62,10 @@
</div>
<form id="Resources" method="post" action="admin.php">
-<div class="optionIcon">
+<div class="optionIcon">
+ <a {if $album}href="?op=newResourceAlbum&parentId={$album->getId()}"{else}href="?op=newResourceAlbum"{/if} id="addAlbum" rel="overlay">Add Album</a> |
+ <a {if $album}href="?op=newResource&albumId={$album->getId()}"{else}href="?op=newResource"{/if} id="addResource" rel="overlay">Add Resource</a> |
+ <a href="#" id="selectAll" onClick="Lifetype.UI.Pages.Resources.selectAll('Resources')">{$locale->tr("select_all")}</a> |
<a id="optionIconLink" href="#bulkEdit" title="{$locale->tr("show_massive_change_option")}" onclick="Lifetype.UI.Pages.Global.switchMassiveOption()">{$locale->tr("show_massive_change_option")}</a>
</div>
<div id="list">
@@ -126,8 +76,8 @@
<div class="clearer"> </div>
- {if $pager->getCurrentPage() == 1}
- <div class="album">
+ {if $album && $pager->getCurrentPage() == 1}
+ <div class="album" id="root_album">
<a href="admin.php?op=resources&albumId={$album->getParentId()}&page=1">
<img src="{$url->getTemplateFile("imgs/parentfolder.gif")}" alt="{$locale->tr("parent")}" /></a>
<p>{$locale->tr("parent")}</p>
@@ -136,27 +86,21 @@
{if $pager->getCurrentPage() == 1}
{assign var="counter" value=1}
- {assign var=children value=$album->getChildren()}
- {foreach from=$children item=childalbum}
- <div class="album">
+ {foreach from=$albums item=childalbum}
+ <div id="album_{$childalbum->getId()}" class="album" onClick="Lifetype.UI.Pages.Resources.clickHandler(this)">
+ <input type="checkbox" name="albumIds[{$childalbum->getId()}]" id="checkbox_album_{$childalbum->getId()}" value="{$childalbum->getId()}" style="display:none">
<a href="admin.php?op=resources&albumId={$childalbum->getId()}&page=1">
- <img src="{$url->getTemplateFile("imgs/folder.gif")}" alt="{$childalbum->getName()}" /></a>
- <p>{$childalbum->getName()} ({$childalbum->getNumResources()})</p>
- {assign var="counter" value="`$counter+1`"}
- {if $counter%3 == 0}
- {/if}
+ <img src="{$url->getTemplateFile("imgs/folder.gif")}" alt="{$childalbum->getName()}" /></a><br/>
+ {$childalbum->getName()} ({$childalbum->getNumResources()})
</div>
{/foreach}
{/if}
<!-- show the resources here -->
- {** assign var=resources value=$album->getResources() **}
- {** use the code above if you want to display all the resources at once, or leave it commented **}
- {** if you would like to use the new paged display that was introduced in lifetype 1.1 **}
{foreach from=$resources item=resource}
- <div id="res_{$resource->getId()}" class="file" onMouseOver="Lifetype.UI.Pages.Resources.mouseOver(this)" onMouseOut="Lifetype.UI.Pages.Resources.mouseOut(this)" onClick="Lifetype.UI.Pages.Resources.clickHandler(this)">
- <input type="checkbox" name="res_{$resource->getId()}" id="checkbox_res_{$resource->getId()}" value="{$resource->getId()}" style="display:none">
+ <div id="res_{$resource->getId()}" class="file" onClick="Lifetype.UI.Pages.Resources.clickHandler(this)">
+ <input type="checkbox" name="resourceIds[{$resource->getId()}]" id="checkbox_res_{$resource->getId()}" value="{$resource->getId()}" style="display:none">
{if $resource->hasPreview()}
<div class="pictureFrame">
<div class="picture">
@@ -238,4 +182,4 @@
</div>
</form>
{include file="$admintemplatepath/footernavigation.template"}
-{include file="$admintemplatepath/footer.template"}
+{include file="$admintemplatepath/footer.template"}
\ No newline at end of file
More information about the pLog-svn
mailing list