[pLog-svn] r6064 - in plog/trunk: class/action/admin class/view/admin js/ui js/ui/pages templates/admin
mark at devel.lifetype.net
mark at devel.lifetype.net
Wed Nov 21 04:33:01 EST 2007
Author: mark
Date: 2007-11-21 04:33:00 -0500 (Wed, 21 Nov 2007)
New Revision: 6064
Added:
plog/trunk/js/ui/pages/resourcealbums.js
plog/trunk/templates/admin/editresourcealbum_form.template
plog/trunk/templates/admin/newresourcealbum_form.template
plog/trunk/templates/admin/resources_table.template
Removed:
plog/trunk/js/ui/pages/newresourcealbum.js
Modified:
plog/trunk/class/action/admin/adminaddresourcealbumaction.class.php
plog/trunk/class/action/admin/admineditresourcealbumaction.class.php
plog/trunk/class/action/admin/adminnewresourcealbumaction.class.php
plog/trunk/class/action/admin/adminresourcesaction.class.php
plog/trunk/class/action/admin/adminupdateresourcealbumaction.class.php
plog/trunk/class/view/admin/admineditresourcealbumview.class.php
plog/trunk/class/view/admin/adminnewalbumview.class.php
plog/trunk/class/view/admin/adminresourceslistview.class.php
plog/trunk/js/ui/forms.js
plog/trunk/js/ui/pages/resources.js
plog/trunk/templates/admin/editposts_table.template
plog/trunk/templates/admin/editresourcealbum.template
plog/trunk/templates/admin/newresourcealbum.template
plog/trunk/templates/admin/resources.template
Log:
Fixed the resourcealbums admin panel.
Modified: plog/trunk/class/action/admin/adminaddresourcealbumaction.class.php
===================================================================
--- plog/trunk/class/action/admin/adminaddresourcealbumaction.class.php 2007-11-20 04:33:57 UTC (rev 6063)
+++ plog/trunk/class/action/admin/adminaddresourcealbumaction.class.php 2007-11-21 09:33:00 UTC (rev 6064)
@@ -1,15 +1,4 @@
<?php
-
-
-
-
-
-
-
-
-
-
-
/**
* \ingroup Action
* @private
@@ -30,7 +19,7 @@
function AdminAddResourceAlbumAction( $actionInfo, $request )
{
$this->AdminAction( $actionInfo, $request );
-
+
// validation stuff
$this->registerFieldValidator( "albumName", new StringValidator(), false, $this->_locale->tr("error_empty_name"));
$this->registerFieldValidator( "parentId", new IntegerValidator(), false, $this->_locale->tr("error_incorrect_value"));
@@ -38,7 +27,7 @@
$view = new AdminNewAlbumView( $this->_blogInfo );
$view->setErrorMessage( $this->_locale->tr("error_adding_album" ));
$this->setValidationErrorView( $view );
-
+
$this->requirePermission( "add_album" );
}
@@ -47,32 +36,32 @@
// fetch our data
$this->_albumName = $this->_request->getFilteredValue( "albumName", new HtmlFilter());
$this->_albumDescription = $this->_request->getFilteredValue( "albumDescription", new HtmlFilter());
- $this->_parentId = $this->_request->getValue( "parentId" );
+ $this->_parentId = $this->_request->getValue( "parentId" );
$showAlbum = $this->_request->getValue("showAlbum") ? 1 : 0;
-
+
// create the album
$albums = new GalleryAlbums();
$t = new Timestamp();
- $album = new GalleryAlbum( $this->_blogInfo->getId(), $this->_albumName,
- $this->_albumDescription,
+ $album = new GalleryAlbum( $this->_blogInfo->getId(), $this->_albumName,
+ $this->_albumDescription,
GalleryConstants::GALLERY_RESOURCE_PREVIEW_AVAILABLE,
- $this->_parentId,
+ $this->_parentId,
$t->getTimestamp(),
Array(),
$showAlbum);
-
+
$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 ));
+
+ $this->notifyEvent( EVENT_POST_ALBUM_ADD, Array( "album" => &$album ));
// clear the cache if everything went fine
CacheControl::resetBlogCache( $this->_blogInfo->getId(), false );
-
- return( $album );
+
+ return( $album );
}
/**
@@ -81,12 +70,12 @@
function perform()
{
$album = $this->addAlbum();
-
+
if( $this->userHasPermission( "view_resources" ))
$this->_view = new AdminResourcesListView( $this->_blogInfo, Array( "albumId" => $this->_parentId, "gotoLastPage" => true ));
else
$this->_view = new AdminNewAlbumView( $this->_blogInfo );
-
+
if( $album )
$this->_view->setSuccessMessage( $this->_locale->pr( "album_added_ok", $album->getName()));
else
@@ -100,18 +89,18 @@
function performAjax()
{
-
+
$this->_view = new AdminAjaxView( $this->_blogInfo );
-
+
$album = $this->addAlbum();
if( $album ) {
$this->_view->setSuccessMessage($this->_locale->pr( "album_added_ok", $album->getName()));
$this->_view->setResult( $album );
}
else {
- $this->_view->setErrorMessage( $this->_locale->tr("error_adding_album" ));
+ $this->_view->setErrorMessage( $this->_locale->tr("error_adding_album" ));
}
-
+
return( true );
}
}
Modified: plog/trunk/class/action/admin/admineditresourcealbumaction.class.php
===================================================================
--- plog/trunk/class/action/admin/admineditresourcealbumaction.class.php 2007-11-20 04:33:57 UTC (rev 6063)
+++ plog/trunk/class/action/admin/admineditresourcealbumaction.class.php 2007-11-21 09:33:00 UTC (rev 6064)
@@ -1,11 +1,4 @@
<?php
-
-
-
-
-
-
-
/**
* \ingroup Action
* @private
@@ -24,12 +17,12 @@
function AdminEditResourceAlbumAction( $actionInfo, $request )
{
$this->AdminAction( $actionInfo, $request );
-
+
$this->registerFieldValidator( "albumId", new IntegerValidator());
$view = new AdminResourcesListView( $this->_blogInfo );
$view->setErrorMessage( $this->_locale->tr("error_incorrect_album_id"));
$this->setValidationErrorView( $view );
-
+
$this->requirePermission( "update_album" );
}
@@ -62,5 +55,10 @@
// better to return true if everything fine
return true;
}
+
+ function performAjax()
+ {
+ return( $this->perform() );
+ }
}
?>
Modified: plog/trunk/class/action/admin/adminnewresourcealbumaction.class.php
===================================================================
--- plog/trunk/class/action/admin/adminnewresourcealbumaction.class.php 2007-11-20 04:33:57 UTC (rev 6063)
+++ plog/trunk/class/action/admin/adminnewresourcealbumaction.class.php 2007-11-21 09:33:00 UTC (rev 6064)
@@ -6,7 +6,7 @@
*
* Adds a new album
*/
- class AdminNewResourceAlbumAction extends AdminAction
+ class AdminNewResourceAlbumAction extends AdminAction
{
/**
@@ -16,7 +16,7 @@
function AdminNewResourceAlbumAction( $actionInfo, $request )
{
$this->AdminAction( $actionInfo, $request );
-
+
$this->requirePermission( "add_album" );
}
@@ -29,7 +29,7 @@
$v = new IntegerValidator();
if( !$v->validate( $parentId ))
$parentId = 0;
-
+
$this->_view = new AdminNewAlbumView( $this->_blogInfo, $parentId );
$this->setCommonData();
return true;
@@ -39,6 +39,5 @@
{
return( $this->perform());
}
-
}
?>
Modified: plog/trunk/class/action/admin/adminresourcesaction.class.php
===================================================================
--- plog/trunk/class/action/admin/adminresourcesaction.class.php 2007-11-20 04:33:57 UTC (rev 6063)
+++ plog/trunk/class/action/admin/adminresourcesaction.class.php 2007-11-21 09:33:00 UTC (rev 6064)
@@ -1,11 +1,4 @@
<?php
-
-
-
-
-
-
-
/**
* \ingroup Action
* @private
@@ -25,13 +18,13 @@
function AdminResourcesAction( $actionInfo, $request )
{
$this->AdminAction( $actionInfo, $request );
-
+
// data validation
$this->registerFieldValidator( "albumId", new IntegerValidator(), true );
$view = new AdminResourcesListView( $this->_blogInfo, Array( "albumId" => 0 ));
$view->setErrorMessage( $this->_locale->tr("error_incorrect_album_id"));
$this->setValidationErrorView( $view );
-
+
$this->requirePermission( "view_resources" );
}
@@ -45,7 +38,7 @@
$message = "";
// check if the storage folder exists and it is readable
- if( !GalleryResourceStorage::checkBaseStorageFolder() ||
+ if( !GalleryResourceStorage::checkBaseStorageFolder() ||
!GalleryResourceStorage::checkUserStorageFolder( $this->_blogInfo->getId()) ||
!GalleryResourceStorage::checkPreviewsStorageFolder( $this->_blogInfo->getId()) ||
!GalleryResourceStorage::checkMediumSizePreviewsStorageFolder( $this->_blogInfo->getId())) {
@@ -80,5 +73,10 @@
return true;
}
+
+ function performAjax()
+ {
+ return( $this->perform() );
+ }
}
?>
\ No newline at end of file
Modified: plog/trunk/class/action/admin/adminupdateresourcealbumaction.class.php
===================================================================
--- plog/trunk/class/action/admin/adminupdateresourcealbumaction.class.php 2007-11-20 04:33:57 UTC (rev 6063)
+++ plog/trunk/class/action/admin/adminupdateresourcealbumaction.class.php 2007-11-21 09:33:00 UTC (rev 6064)
@@ -1,12 +1,4 @@
<?php
-
-
-
-
-
-
-
-
/**
* \ingroup Action
* @private
@@ -29,77 +21,102 @@
function AdminUpdateResourceAlbumAction( $actionInfo, $request )
{
$this->AdminAction( $actionInfo, $request );
-
+
// data validation
- $this->registerFieldValidator( "albumId", new IntegerValidator());
- $this->registerFieldValidator( "albumName", new StringValidator());
- $this->registerFieldValidator( "parentId", new IntegerValidator());
+ $this->registerFieldValidator( "albumId", new IntegerValidator() );
+ $this->registerFieldValidator( "albumName", new StringValidator(), false, $this->_locale->tr("error_empty_name") );
+ $this->registerFieldValidator( "parentId", new IntegerValidator() );
$this->registerField( "albumDescription" );
$this->registerField( "showAlbum" );
$view = new AdminEditResourceAlbumView( $this->_blogInfo );
$view->setErrorMessage( $this->_locale->tr("error_updating_album" ));
$this->setValidationErrorView( $view );
-
+
$this->requirePermission( "update_album" );
}
- /**
- * Carries out the specified action
- */
- function perform()
+ function updateAlbum()
{
$this->_albumId = $this->_request->getValue( "albumId" );
$this->_parentId = $this->_request->getValue( "parentId" );
- $this->_albumName = Textfilter::filterAllHTML($this->_request->getValue( "albumName" ));
+ $this->_albumName = Textfilter::filterAllHTML($this->_request->getValue( "albumName" ));
$this->_albumDescription = Textfilter::filterAllHTML($this->_request->getValue( "albumDescription" ));
$this->_showAlbum = $this->_request->getValue( "showAlbum" );
if( $this->_showAlbum == "" )
- $this->_showAlbum = 0;
-
+ $this->_showAlbum = 0;
+
// fetch the albums for this blog
$albums = new GalleryAlbums();
$album = $albums->getAlbum( $this->_albumId, $this->_blogInfo->getId());
-
- if( $this->userHasPermission( "view_resources" ))
- $this->_view = new AdminResourcesListView( $this->_blogInfo );
- else {
- $this->_view = new AdminEditResourceAlbumView( $this->_blogInfo );
- $this->_view->setValue( "albumName", $this->_albumName );
- $this->_view->setValue( "albumDescription", $this->_albumDescription );
- $this->_view->setValue( "showAlbum", $this->_showAlbum );
- $this->_view->setValue( "parentId", $this->_parentId );
- $this->_view->setValue( "albumId", $this->_albumId );
- }
-
+
if( !$album ) {
- $this->_view->setErrorMessage( $this->_locale->tr("error_updating_album" ) );
- $this->setCommonData();
return false;
}
-
+
// update the fields in the object
$album->setName( $this->_albumName );
$album->setDescription( $this->_albumDescription );
$album->setParentId( $this->_parentId );
- $album->setShowAlbum( $this->_showAlbum );
-
+ $album->setShowAlbum( $this->_showAlbum );
+
$this->notifyEvent( EVENT_PRE_ALBUM_UPDATE, Array( "album" => &$album ));
+
// and update the data in the database
if( !$albums->updateAlbum( $album )) {
- $this->_view->setErrorMessage( $this->_locale->tr("error_updating_album" ) );
- $this->setCommonData();
return false;
}
- $this->_view->setSuccessMessage( $this->_locale->pr("album_updated_ok", $album->getName()));
- $this->notifyEvent( EVENT_POST_ALBUM_UPDATE, Array( "album" => &$album ));
+ $this->notifyEvent( EVENT_POST_ALBUM_UPDATE, Array( "album" => &$album ));
+
+ return $album;
+ }
+
+ /**
+ * Carries out the specified action
+ */
+ function perform()
+ {
+ $album = $this->updateAlbum();
+
+ if( $this->userHasPermission( "view_resources" ))
+ $this->_view = new AdminResourcesListView( $this->_blogInfo );
+ else {
+ $this->_view = new AdminEditResourceAlbumView( $this->_blogInfo );
+ $this->_view->setValue( "albumName", $this->_albumName );
+ $this->_view->setValue( "albumDescription", $this->_albumDescription );
+ $this->_view->setValue( "showAlbum", $this->_showAlbum );
+ $this->_view->setValue( "parentId", $this->_parentId );
+ $this->_view->setValue( "albumId", $this->_albumId );
+ }
+
+ if( $album )
+ $this->_view->setSuccessMessage( $this->_locale->pr("album_updated_ok", $album->getName()) );
+ else
+ $this->_view->setErrorMessage( $this->_locale->tr("error_updating_album" ) );
+
$this->setCommonData();
-
+
// clear the cache
CacheControl::resetBlogCache( $this->_blogInfo->getId(), false );
// better to return true if everything fine
return true;
}
+
+ function performAjax()
+ {
+ $this->_view = new AdminAjaxView( $this->_blogInfo );
+
+ $album = $this->updateAlbum();
+ if( $album ) {
+ $this->_view->setSuccessMessage($this->_locale->pr( "album_updated_ok", $album->getName()));
+ $this->_view->setResult( $album );
+ }
+ else {
+ $this->_view->setErrorMessage( $this->_locale->tr("error_updating_album" ));
+ }
+
+ return( true );
+ }
}
?>
Modified: plog/trunk/class/view/admin/admineditresourcealbumview.class.php
===================================================================
--- plog/trunk/class/view/admin/admineditresourcealbumview.class.php 2007-11-20 04:33:57 UTC (rev 6063)
+++ plog/trunk/class/view/admin/admineditresourcealbumview.class.php 2007-11-21 09:33:00 UTC (rev 6064)
@@ -1,30 +1,29 @@
<?php
-
-
-
-
/**
* \ingroup View
* @private
- *
+ *
* shows the view that allows to edit an album
*/
class AdminEditResourceAlbumView extends AdminTemplatedView
{
-
+
function AdminEditResourceAlbumView( $blogInfo )
{
- $this->AdminTemplatedView( $blogInfo, "editresourcealbum" );
+ if( Request::isXHR() )
+ $this->AdminTemplatedView( $blogInfo, "editresourcealbum_form" );
+ else
+ $this->AdminTemplatedView( $blogInfo, "editresourcealbum" );
}
-
+
function render()
{
// load the nested list of albums
$albums = new GalleryAlbums();
- $userAlbums = $albums->getNestedAlbumList( $this->_blogInfo->getId());
- $this->notifyEvent( EVENT_ALBUMS_LOADED, Array( "albums" => &$userAlbums ));
+ $userAlbums = $albums->getNestedAlbumList( $this->_blogInfo->getId());
+ $this->notifyEvent( EVENT_ALBUMS_LOADED, Array( "albums" => &$userAlbums ));
$this->setValue( "albums", $userAlbums );
-
+
// let the parent view do its work
parent::render();
}
Modified: plog/trunk/class/view/admin/adminnewalbumview.class.php
===================================================================
--- plog/trunk/class/view/admin/adminnewalbumview.class.php 2007-11-20 04:33:57 UTC (rev 6063)
+++ plog/trunk/class/view/admin/adminnewalbumview.class.php 2007-11-21 09:33:00 UTC (rev 6064)
@@ -1,23 +1,22 @@
<?php
-
-
-
-
/**
* \ingroup View
* @private
- */
+ */
class AdminNewAlbumView extends AdminTemplatedView
{
var $_parentId;
-
+
function AdminNewAlbumView( $blogInfo, $parentId = 0 )
{
- $this->AdminTemplatedView( $blogInfo, "newresourcealbum" );
-
+ if( Request::isXHR() )
+ $this->AdminTemplatedView( $blogInfo, "newresourcealbum_form" );
+ else
+ $this->AdminTemplatedView( $blogInfo, "newresourcealbum" );
+
$this->_parentId = $parentId;
}
-
+
function render()
{
// get all the albums
@@ -25,8 +24,8 @@
$userAlbums = $albums->getNestedAlbumList( $this->_blogInfo->getId());
$this->notifyEvent( EVENT_ALBUMS_LOADED, Array( "albums" => &$userAlbums ));
$this->setValue( "albums", $userAlbums );
- $this->setValue( "parentId", $this->_parentId );
-
+ $this->setValue( "parentId", $this->_parentId );
+
// transfer control to the parent class
parent::render();
}
Modified: plog/trunk/class/view/admin/adminresourceslistview.class.php
===================================================================
--- plog/trunk/class/view/admin/adminresourceslistview.class.php 2007-11-20 04:33:57 UTC (rev 6063)
+++ plog/trunk/class/view/admin/adminresourceslistview.class.php 2007-11-21 09:33:00 UTC (rev 6064)
@@ -1,20 +1,20 @@
<?php
-
-
-
-
-
-
-
+
+
+
+
+
+
+
define( "ROOT_ALBUM_ID", 0 );
-
+
define( "DEFAULT_RESOURCES_PER_PAGE", 30 );
-
+
/**
* \ingroup View
* @private
- *
+ *
* lists the resources
*/
class AdminResourcesListView extends AdminTemplatedView
@@ -24,36 +24,39 @@
var $_resourceType;
var $_viewParams;
var $_locationId;
-
+
function AdminResourcesListView( $blogInfo, $params = Array())
{
- $this->AdminTemplatedView( $blogInfo, "resources" );
-
+ if( Request::isXHR())
+ $this->AdminTemplatedView( $blogInfo, "resources_table" );
+ else
+ $this->AdminTemplatedView( $blogInfo, "resources" );
+
$this->_viewParams = $params;
}
-
+
function render()
{
-
+
// fetch and save the albumId parameter in the request, if not available as a
// constructor parameter
isset( $this->_viewParams["albumId"] ) ? $this->_albumId = $this->_viewParams["albumId"] : $this->_albumId = null;
-
+
// location id parameter
- isset( $this->_viewParams["locationId"] ) ? $this->_locationId = $this->_viewParams["locationId"] : $this->_locationId = null;
-
+ isset( $this->_viewParams["locationId"] ) ? $this->_locationId = $this->_viewParams["locationId"] : $this->_locationId = null;
+
if( $this->_albumId == null )
$this->_albumId = $this->getSessionValue( "albumId", ROOT_ALBUM_ID );
// in case we didn't get any album id at all!
if( $this->_albumId == "" )
$this->_albumId = ROOT_ALBUM_ID;
-
+
// search terms
$this->_searchTerms = "";
if( isset( $this->_viewParams['searchTerms'] ))
$this->_searchTerms = $this->_viewParams['searchTerms'];
-
+
$this->setSessionValue( "albumId", $this->_albumId );
$this->_resourceType = GalleryConstants::GALLERY_RESOURCE_ANY;
@@ -62,11 +65,11 @@
// such as AdminSimpleResourcesListView
if ( !isset( $this->_pagerUrl ) )
$this->_pagerUrl = "?op=resources&albumId=".$this->_albumId."&showLocation=".$this->_locationId."&page=";
-
-
+
+
// get the page from the request
$this->_page = $this->getCurrentPageFromRequest();
-
+
$albums = Array();
// and the current album
@@ -74,26 +77,26 @@
$galleryResources = new GalleryResources();
$numResources = 0;
- if( $this->_albumId > ROOT_ALBUM_ID && $this->_page > 0 ) {
+ if( $this->_albumId > ROOT_ALBUM_ID && $this->_page > 0 ) {
$album = $galleryAlbums->getAlbum( $this->_albumId, $this->_blogInfo->getId());
if( !$album || empty($album) ) {
$this->_albumId = ROOT_ALBUM_ID;
}
- else {
+ else {
// total number of resources in this album, used by the pager
$numResources = $galleryResources->getNumUserResources( $this->_blogInfo->getId(),
$this->_albumId,
$this->_resourceType,
$this->_searchTerms,
- $this->_locationId );
-
+ $this->_locationId );
+
// create and export the pager
$pager = new Pager( $this->_pagerUrl, $this->_page, $numResources, DEFAULT_ITEMS_PER_PAGE );
if( isset( $this->_viewParams["gotoLastPage"] )) {
$pager->setCurPage( $pager->getEndPage());
$this->_page = $pager->getEndPage();
}
-
+
// resources for this page
$resources = $galleryResources->getUserResources( $this->_blogInfo->getId(),
$this->_albumId,
@@ -113,15 +116,15 @@
GalleryConstants::GALLERY_NO_ALBUM,
$this->_resourceType,
$this->_searchTerms,
- $this->_locationId );
-
+ $this->_locationId );
+
// load the resources matching the given string from *all* albums
$resources = $galleryResources->getUserResources( $this->_blogInfo->getId(),
GalleryConstants::GALLERY_NO_ALBUM,
$this->_resourceType,
$this->_searchTerms,
$this->_locationId,
- $this->_page,
+ $this->_page,
DEFAULT_RESOURCES_PER_PAGE );
}
else {
@@ -129,15 +132,15 @@
$resources = Array();
}
// create and export the pager
- $pager = new Pager( $this->_pagerUrl, $this->_page, $numResources, DEFAULT_ITEMS_PER_PAGE );
+ $pager = new Pager( $this->_pagerUrl, $this->_page, $numResources, DEFAULT_ITEMS_PER_PAGE );
}
-
+
// get a list with the nested albums
$userAlbums = $galleryAlbums->getNestedAlbumList( $this->_blogInfo->getId());
-
+
// event about the albums we just loaded
$this->notifyEvent( EVENT_ALBUMS_LOADED, Array( "albums" => &$userAlbums ));
-
+
$this->setValue( "albumsList", $userAlbums );
// fetch some statistics and continue
@@ -146,7 +149,7 @@
$this->setValue( "quotausage", $quotaUsage );
$this->setValue( "totalresources", $totalResources );
- // and now export info about the albums and so on but only
+ // and now export info about the albums and so on but only
// if we're browsing the first page only (albums do not appear anymore after the first page)
$this->setValue( "album", $album );
if( $this->_albumId > ROOT_ALBUM_ID && $this->_page < 2 ) {
@@ -155,19 +158,19 @@
else {
$this->setValue( "albums", $albums );
}
-
+
// load the list of locations
$locations = new Locations();
$this->setValue( "locations", $locations->getBlogLocations( $this->_blogInfo->getId()));
$this->setValue( "currentlocation", $this->_locationId );
-
+
// event about the resources
$this->notifyEvent( EVENT_RESOURCES_LOADED, Array ( "resources" => &$resources ));
$this->setValue( "resources", $resources );
- $this->setValue( "pager", $pager );
+ $this->setValue( "pager", $pager );
$this->setValue( "searchTerms", $this->_searchTerms );
-
+
parent::render();
}
}
Modified: plog/trunk/js/ui/forms.js
===================================================================
--- plog/trunk/js/ui/forms.js 2007-11-20 04:33:57 UTC (rev 6063)
+++ plog/trunk/js/ui/forms.js 2007-11-21 09:33:00 UTC (rev 6064)
@@ -228,13 +228,14 @@
YAHOO.util.Connect.setForm(formObject);
if( options )
+ {
options.formElement = formObject;
+ if ( options.formInfo ) formInfoId = options.formInfo; else formInfoId = 'FormInfo';
+ if ( options.formInfoMessage ) formInfoMessageId = options.formInfoMessage; else formInfoMessageId = 'FormInfoMessage';
+ if ( options.formError ) formErrorId = options.formError; else formErrorId = 'FormError';
+ if ( options.formErrorMessage ) formErrorMessageId = options.formErrorMessage; else formErrorMessageId = 'FormErrorMessage';
+ }
- if ( options.formInfo ) formInfoId = options.formInfo; else formInfoId = 'FormInfo';
- if ( options.formInfoMessage ) formInfoMessageId = options.formInfoMessage; else formInfoMessageId = 'FormInfoMessage';
- if ( options.formError ) formErrorId = options.formError; else formErrorId = 'FormError';
- if ( options.formErrorMessage ) formErrorMessageId = options.formErrorMessage; else formErrorMessageId = 'FormErrorMessage';
-
var cObj = YAHOO.util.Connect.asyncRequest('POST', postUrl,
callback = {
argument: options,
Deleted: plog/trunk/js/ui/pages/newresourcealbum.js
===================================================================
--- plog/trunk/js/ui/pages/newresourcealbum.js 2007-11-20 04:33:57 UTC (rev 6063)
+++ plog/trunk/js/ui/pages/newresourcealbum.js 2007-11-21 09:33:00 UTC (rev 6064)
@@ -1,7 +0,0 @@
-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
Added: plog/trunk/js/ui/pages/resourcealbums.js
===================================================================
--- plog/trunk/js/ui/pages/resourcealbums.js (rev 0)
+++ plog/trunk/js/ui/pages/resourcealbums.js 2007-11-21 09:33:00 UTC (rev 6064)
@@ -0,0 +1,21 @@
+Lifetype.UI.Pages.ResourceAlbums = function() {}
+
+Lifetype.UI.Pages.ResourceAlbums.addSubmitHook = function( form )
+{
+ Lifetype.Forms.AjaxFormProcessor(form.id,'?op=addResourceAlbum&output=json', {resetAfterSuccess:true});
+}
+
+Lifetype.UI.Pages.ResourceAlbums.updateSubmitHook = function( form )
+{
+ Lifetype.Forms.AjaxFormProcessor(form.id,'?op=addResourceAlbum&output=json', {} );
+}
+
+YAHOO.util.Event.addListener( window, "load", function() {
+ var t = new Lifetype.Effects.Table( "list" );
+ t.stripe();
+ t.highlightRows();
+
+ // reload the list when successfully deleting an item and processing one of the forms
+ Lifetype.Forms.Events.performRequestSuccessEvent.subscribe( Lifetype.UI.AjaxPager.reload );
+ Lifetype.Forms.Events.formProcessorSuccessEvent.subscribe( Lifetype.UI.AjaxPager.reload );
+});
\ No newline at end of file
Modified: plog/trunk/js/ui/pages/resources.js
===================================================================
--- plog/trunk/js/ui/pages/resources.js 2007-11-20 04:33:57 UTC (rev 6063)
+++ plog/trunk/js/ui/pages/resources.js 2007-11-21 09:33:00 UTC (rev 6064)
@@ -62,7 +62,7 @@
f = Lifetype.UI.Pages.Resources.select;
}
else {
- selectAllToggle.selected = false;
+ selectAllToggle.selected = false;
f = Lifetype.UI.Pages.Resources.unselect;
}
@@ -76,7 +76,7 @@
for( i = 0; i < elems.length; i++ ) {
if( elems[i].id != "root_album" )
f( elems[i] );
- }
+ }
}
Lifetype.UI.Pages.EditResources = function() {}
Modified: plog/trunk/templates/admin/editposts_table.template
===================================================================
--- plog/trunk/templates/admin/editposts_table.template 2007-11-20 04:33:57 UTC (rev 6063)
+++ plog/trunk/templates/admin/editposts_table.template 2007-11-21 09:33:00 UTC (rev 6064)
@@ -97,4 +97,4 @@
{/foreach}
</tbody>
</table>
-{adminpagerajax style="list"}
+{adminpagerajax style="list"}
\ No newline at end of file
Modified: plog/trunk/templates/admin/editresourcealbum.template
===================================================================
--- plog/trunk/templates/admin/editresourcealbum.template 2007-11-20 04:33:57 UTC (rev 6063)
+++ plog/trunk/templates/admin/editresourcealbum.template 2007-11-21 09:33:00 UTC (rev 6064)
@@ -1,48 +1,7 @@
{include file="$admintemplatepath/header.template"}
{include file="$admintemplatepath/navigation.template" showOpt=resources title=$locale->tr("editResourceAlbum")}
-<form name="updateResourceAlbum" method="post" action="admin.php">
- <fieldset class="inputField">
- <legend>{$locale->tr("editResourceAlbum")}</legend>
- {include file="$admintemplatepath/formvalidate.template"}
- <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")}
- </div>
- <div class="field">
- <label for="parentId">{$locale->tr("parent")}</label>
- <div class="formHelp">{$locale->tr("parent_album_help")}</div>
- <select name="parentId" id="parentId">
- <option value="0">({$locale->tr("no_parent")})</option>
- {foreach from=$albums item=albumItem}
- <option value="{$albumItem->getId()}" {if $albumItem->getId()==$parentId}selected="selected"{/if}>
- {assign var=indentLevel value=$albumItem->getValue("level")}
- {textformat indent=$indentLevel indent_char=" "}{$albumItem->getName()}{/textformat}
- </option>
- {/foreach}
- </select>
- </div>
- <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>
- </div>
- <div class="field">
- <label for="showAlbum">{$locale->tr("show")}</label>
- <div class="formHelp">
- <input class="checkbox" type="checkbox" id="showAlbum" name="showAlbum" value="1" {if $showAlbum == 1} checked="checked"{/if} />
- {$locale->tr("show_album_help")}
- </div>
- </div>
- </fieldset>
- <div class="buttons">
- <input type="hidden" name="op" value="updateResourceAlbum" />
- <input type="hidden" name="albumId" value="{$albumId}" />
- <input type="reset" name="resetButton" value="{$locale->tr("reset")}" />
- <input type="submit" name="Update" value="{$locale->tr("update")}" />
- </div>
-</form>
+
+{include file="$admintemplatepath/editresourcealbum_form.template"}
+
{include file="$admintemplatepath/footernavigation.template"}
{include file="$admintemplatepath/footer.template"}
\ No newline at end of file
Added: plog/trunk/templates/admin/editresourcealbum_form.template
===================================================================
--- plog/trunk/templates/admin/editresourcealbum_form.template (rev 0)
+++ plog/trunk/templates/admin/editresourcealbum_form.template 2007-11-21 09:33:00 UTC (rev 6064)
@@ -0,0 +1,44 @@
+<form id="updateResourceAlbum" name="updateResourceAlbum" method="post" action="admin.php" onSubmit="Lifetype.UI.Pages.ResourceAlbums.updateSubmitHook(this);return(false);">
+ <fieldset class="inputField">
+ {include file="$admintemplatepath/formvalidateajax.template"}
+ <legend>{$locale->tr("editResourceAlbum")}</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/validateajax.template" field=albumName}
+ </div>
+ <div class="field">
+ <label for="parentId">{$locale->tr("parent")}</label>
+ <div class="formHelp">{$locale->tr("parent_album_help")}</div>
+ <select name="parentId" id="parentId">
+ <option value="0">({$locale->tr("no_parent")})</option>
+ {foreach from=$albums item=albumItem}
+ <option value="{$albumItem->getId()}" {if $albumItem->getId()==$parentId}selected="selected"{/if}>
+ {assign var=indentLevel value=$albumItem->getValue("level")}
+ {textformat indent=$indentLevel indent_char=" "}{$albumItem->getName()}{/textformat}
+ </option>
+ {/foreach}
+ </select>
+ </div>
+ <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="5" cols="60">{$albumDescription}</textarea>
+ </div>
+ <div class="field">
+ <label for="showAlbum">{$locale->tr("show")}</label>
+ <div class="formHelp">
+ <input class="checkbox" type="checkbox" id="showAlbum" name="showAlbum" value="1" {if $showAlbum == 1} checked="checked"{/if} />
+ {$locale->tr("show_album_help")}
+ </div>
+ </div>
+ </fieldset>
+ <div class="buttons">
+ <input type="hidden" name="op" value="updateResourceAlbum" />
+ <input type="hidden" name="albumId" value="{$albumId}" />
+ <input type="reset" name="resetButton" value="{$locale->tr("reset")}" />
+ <input type="submit" name="Update" value="{$locale->tr("update")}" />
+ </div>
+</form>
\ No newline at end of file
Modified: plog/trunk/templates/admin/newresourcealbum.template
===================================================================
--- plog/trunk/templates/admin/newresourcealbum.template 2007-11-20 04:33:57 UTC (rev 6063)
+++ plog/trunk/templates/admin/newresourcealbum.template 2007-11-21 09:33:00 UTC (rev 6064)
@@ -1,43 +1,7 @@
-<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/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/validateajax.template" field=albumName}
- </div>
- <div class="field">
- <label for="parentId">{$locale->tr("parent")}</label>
- <div class="formHelp">{$locale->tr("parent_album_help")}</div>
- <select name="parentId" id="parentId">
- <option value="0">({$locale->tr("no_parent")})</option>
- {foreach from=$albums item=album}
- <option value="{$album->getId()}" {if $album->getId()==$parentId}selected="selected"{/if}>
- {assign var=indentLevel value=$album->getValue("level")}
- {textformat indent=$indentLevel indent_char=" "}{$album->getName()}{/textformat}
- </option>
- {/foreach}
- </select>
- </div>
- <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="5" cols="60">{$albumDescription}</textarea>
- </div>
- <div class="field">
- <label for="showAlbum">{$locale->tr("show")}</label>
- <div class="formHelp">
- <input class="checkbox" type="checkbox" id="showAlbum" name="showAlbum" value="1"
- checked="checked" />
- {$locale->tr("show_album_help")}
- </div>
- </div> </fieldset>
- <div class="buttons">
- <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>
\ No newline at end of file
+{include file="$admintemplatepath/header.template"}
+{include file="$admintemplatepath/navigation.template" showOpt=resources title=$locale->tr("editResourceAlbum")}
+
+{include file="$admintemplatepath/newresourcealbum_form.template"}
+
+{include file="$admintemplatepath/footernavigation.template"}
+{include file="$admintemplatepath/footer.template"}
\ No newline at end of file
Added: plog/trunk/templates/admin/newresourcealbum_form.template
===================================================================
--- plog/trunk/templates/admin/newresourcealbum_form.template (rev 0)
+++ plog/trunk/templates/admin/newresourcealbum_form.template 2007-11-21 09:33:00 UTC (rev 6064)
@@ -0,0 +1,43 @@
+<form id="addResourceAlbum" name="addResourceAlbum" method="post" action="admin.php" onSubmit="Lifetype.UI.Pages.ResourceAlbums.addSubmitHook(this);return(false);">
+ <fieldset class="inputField">
+ {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/validateajax.template" field=albumName}
+ </div>
+ <div class="field">
+ <label for="parentId">{$locale->tr("parent")}</label>
+ <div class="formHelp">{$locale->tr("parent_album_help")}</div>
+ <select name="parentId" id="parentId">
+ <option value="0">({$locale->tr("no_parent")})</option>
+ {foreach from=$albums item=album}
+ <option value="{$album->getId()}" {if $album->getId()==$parentId}selected="selected"{/if}>
+ {assign var=indentLevel value=$album->getValue("level")}
+ {textformat indent=$indentLevel indent_char=" "}{$album->getName()}{/textformat}
+ </option>
+ {/foreach}
+ </select>
+ </div>
+ <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="5" cols="60">{$albumDescription}</textarea>
+ </div>
+ <div class="field">
+ <label for="showAlbum">{$locale->tr("show")}</label>
+ <div class="formHelp">
+ <input class="checkbox" type="checkbox" id="showAlbum" name="showAlbum" value="1" checked="checked" />
+ {$locale->tr("show_album_help")}
+ </div>
+ </div>
+ </fieldset>
+ <div class="buttons">
+ <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>
\ No newline at end of file
Modified: plog/trunk/templates/admin/resources.template
===================================================================
--- plog/trunk/templates/admin/resources.template 2007-11-20 04:33:57 UTC (rev 6063)
+++ plog/trunk/templates/admin/resources.template 2007-11-21 09:33:00 UTC (rev 6064)
@@ -3,7 +3,7 @@
{js src="js/yui/imageloader/imageloader-experimental-min.js"}
{js src="js/ui/pages/global.js"}
{js src="js/ui/pages/resources.js"}
-{js src="js/ui/pages/newresourcealbum.js"}
+{js src="js/ui/pages/resourcealbums.js"}
<div id="list_nav_bar">
<div id="list_nav_select">
<form id="viewResources" action="admin.php" method="post">
@@ -17,11 +17,11 @@
{foreach from=$albumsList item=albumItem}
{assign var=indentLevel value=$albumItem->getValue("level")}
<option value="{$albumItem->getId()}" {if $album}{if $album->getName()==$albumItem->getName()}selected="selected"{/if}{/if}>
- {textformat indent=$indentLevel indent_char=" "}{$albumItem->getName()}{/textformat}
+ {textformat indent=$indentLevel indent_char=" "}{$albumItem->getName()}{/textformat}
</option>
{/foreach}
</select>
- </div>
+ </div>
{if $location_data_enabled}
<div class="list_nav_option">
@@ -35,7 +35,7 @@
<label for="search">{$locale->tr("search_terms")}</label>
<br />
<input type="text" name="searchTerms" value="{$searchTerms}" size="15" id="search" />
- </div>
+ </div>
<div class="list_nav_option">
<br />
<input type="hidden" name="op" value="resources" />
@@ -48,13 +48,13 @@
<img style="border:0px" src="imgs/admin/icon_link-16.png" alt="{$locale->tr("bookmark_this_filter")}" />
</a>
</div>
- </fieldset>
- </form>
+ </fieldset>
+ </form>
</div>
<br style="clear:both" />
</div>
-<div class="extraFunctions">
+<div class="extraFunctions">
<div class="left">
<a {if $album}href="?op=newResourceAlbum&parentId={$album->getId()}"{else}href="?op=newResourceAlbum"{/if} id="addAlbumButton" rel="overlay">{$locale->tr("newResourceAlbum")}</a> |
<a {if $album}href="?op=newResource&albumId={$album->getId()}"{else}href="?op=newResource"{/if} id="addResourceButton" rel="overlay">{$locale->tr("newResource")}</a>
@@ -66,96 +66,28 @@
</div>
<form id="Resources" method="post" action="admin.php">
-<div id="list">
- {include file="$admintemplatepath/successmessage.template"}
- {include file="$admintemplatepath/errormessage.template"}
+ {include file="$admintemplatepath/viewvalidateajax.template"}
+ <div id="list">
+ {include file="$admintemplatepath/resources_table.template"}
-<div id="album">
-
- <div class="clearer"> </div>
-
- {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>
- </div>
- {/if}
-
- {if $pager->getCurrentPage() == 1}
- {assign var="counter" value=1}
- {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><br/>
- {$childalbum->getName()} ({$childalbum->getNumResources()})
- </div>
- {/foreach}
- {/if}
-
-<!-- show the resources here -->
-
- {foreach from=$resources item=resource}
- <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">
- <a href="?op=resourceInfo&resourceId={$resource->getId()}">
- <img alt="{$resource->getDescription()}" id="resource_img_{$resource->getId()}" />
- </a>
- </div>
- </div>
- {$resource->getFileName()}<br/>
- {else}
- <a href="{$url->resourceLink($resource)}"><br/>
- {if $resource->isSound()}
- <img alt="Sound" src="{$url->getTemplateFile("imgs/sound.gif")}" /></a><br/>
- {elseif $resource->isVideo()}
- <img alt="Video" src="{$url->getTemplateFile("imgs/video.gif")}" /></a><br/>
- {elseif $resource->isZip()}
- <img alt="Zip" src="{$url->getTemplateFile("imgs/compressed.gif")}" /></a><br/>
- {else}
- <img alt="File" src="{$url->getTemplateFile("imgs/file.gif")}" /></a><br/>
- {/if}
- {$resource->getFileName()}
- {/if}
- {assign var=metadata value=$resource->getMetadataReader()}
- {$metadata->getRoundedSize()}<br/>
- {if $resource->isImage()}
- {$metadata->getWidth()} x {$metadata->getHeight()}<br/>
- {elseif $resource->isSound()}
- {$metadata->getFormat()|upper} {$metadata->getSampleRate()} bps<br/>
- {elseif $resource->isVideo()}
- {$metadata->getFormat()|upper} {$metadata->getWidth()} x {$metadata->getHeight()}, {$metadata->getLengthString()}<br/>
- {elseif $resource->isZip()}
- {$metadata->getTotalFiles()} {$locale->tr("files")}<br/>
- {/if}
- </div>
-{/foreach}
-<div class="clearer"> </div>
</div>
-
-</div>
<a name="bulkEdit"></a>
<div id="list_action_bar">
{assign var=quota value=$blog->getResourcesQuota()}
- {adminpager style=list}
{$locale->tr("num_resources")}: <strong>{$totalresources}</strong>, {$locale->tr("total_size")}: <strong>{$quotausage|round:$locale}</strong>
{if $quota > 0 }, {$locale->tr("quota")}: <strong>{$quota|round:$locale}</strong>{/if}
<input type="submit" name="delete" value="{$locale->tr("delete")}" class="submit" />
<input type="hidden" name="op" value="deleteResourceItems" />
<div id="massiveChangeOption" style="display: none;">
<fieldset>
- <legend>{$locale->tr("massive_change_option")}</legend>
+ <legend>{$locale->tr("massive_change_option")}</legend>
<label for="galleryAlbumId">{$locale->tr("album")}</label>
<select name="galleryAlbumId" id="galleryAlbumId">
<option value="0">{$locale->tr("root_album")}</option>
{foreach from=$albumsList item=albumItem}
{assign var=indentLevel value=$albumItem->getValue("level")}
<option value="{$albumItem->getId()}">
- {textformat indent=$indentLevel indent_char=" "}{$albumItem->getName()}{/textformat}
+ {textformat indent=$indentLevel indent_char=" "}{$albumItem->getName()}{/textformat}
</option>
{/foreach}
</select>
@@ -174,16 +106,16 @@
<img src="imgs/admin/icon_map-16.png" alt="View" style="border:0px" />
</a>
<input type="button" name="changeResourcesLocation" value="{$locale->tr("change_location")}" class="submit" onClick="Lifetype.UI.Pages.Resources.submitGalleryItemsList('changeGalleryItemsLocation');" />
- {/if}
+ {/if}
</fieldset>
- </div>
+ </div>
</div>
</form>
<script type="text/javascript">
var foldGroup = new YAHOO.util.ImageLoader.group(window, 'scroll');
{foreach from=$resources item=resource}
{if $resource->hasPreview()}
- foldGroup.registerSrcImage( 'resource_img_{$resource->getId()}', '{$url->resourcePreviewLink($resource)}');
+ foldGroup.registerSrcImage( 'resource_img_{$resource->getId()}', '{$url->resourcePreviewLink($resource)}');
{/if}
{/foreach}
foldGroup.foldConditional = true;
Added: plog/trunk/templates/admin/resources_table.template
===================================================================
--- plog/trunk/templates/admin/resources_table.template (rev 0)
+++ plog/trunk/templates/admin/resources_table.template 2007-11-21 09:33:00 UTC (rev 6064)
@@ -0,0 +1,83 @@
+<div id="album">
+
+ <div class="clearer"> </div>
+
+ {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>
+ </div>
+ {/if}
+
+ {if $pager->getCurrentPage() == 1}
+ {assign var="counter" value=1}
+ {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><br/>
+ {$childalbum->getName()} ({$childalbum->getNumResources()})
+ <span class="list_action_button">
+ <a rel="overlay" href="?op=editResourceAlbum&albumId={$childalbum->getId()}" title="{$locale->tr("edit")}">
+ <img src="imgs/admin/icon_edit-16.png" alt="{$locale->tr("edit")}" />
+ </a>
+ {*<a href="?op=deleteResourceAlbum&albumId={$childalbum->getId()}" title="{$locale->tr("delete")}" onClick="Lifetype.Forms.performRequest(this);return(false)">
+ <img src="imgs/admin/icon_delete-16.png" alt="{$locale->tr("delete")}" />
+ </a>*}
+ </span>
+ </div>
+ {/foreach}
+ {/if}
+
+<!-- show the resources here -->
+
+ {foreach from=$resources item=resource}
+ <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">
+ <a href="?op=resourceInfo&resourceId={$resource->getId()}">
+ <img alt="{$resource->getDescription()}" id="resource_img_{$resource->getId()}" />
+ </a>
+ </div>
+ </div>
+ {$resource->getFileName()}<br/>
+ {else}
+ <a href="{$url->resourceLink($resource)}"><br/>
+ {if $resource->isSound()}
+ <img alt="Sound" src="{$url->getTemplateFile("imgs/sound.gif")}" /></a><br/>
+ {elseif $resource->isVideo()}
+ <img alt="Video" src="{$url->getTemplateFile("imgs/video.gif")}" /></a><br/>
+ {elseif $resource->isZip()}
+ <img alt="Zip" src="{$url->getTemplateFile("imgs/compressed.gif")}" /></a><br/>
+ {else}
+ <img alt="File" src="{$url->getTemplateFile("imgs/file.gif")}" /></a><br/>
+ {/if}
+ {$resource->getFileName()}
+ {/if}
+ {assign var=metadata value=$resource->getMetadataReader()}
+ {$metadata->getRoundedSize()}<br/>
+ {if $resource->isImage()}
+ {$metadata->getWidth()} x {$metadata->getHeight()}<br/>
+ {elseif $resource->isSound()}
+ {$metadata->getFormat()|upper} {$metadata->getSampleRate()} bps<br/>
+ {elseif $resource->isVideo()}
+ {$metadata->getFormat()|upper} {$metadata->getWidth()} x {$metadata->getHeight()}, {$metadata->getLengthString()}<br/>
+ {elseif $resource->isZip()}
+ {$metadata->getTotalFiles()} {$locale->tr("files")}<br/>
+ {/if}
+ <span class="list_action_button">
+ <a rel="overlay" href="?op=resourceInfo&resourceId={$resource->getId()}" title="{$locale->tr("edit")}">
+ <img src="imgs/admin/icon_edit-16.png" alt="{$locale->tr("edit")}" />
+ </a>
+ {*<a href="?op=deleteResource&resourceId={$resource->getId()}" title="{$locale->tr("delete")}" onClick="Lifetype.Forms.performRequest(this);return(false)">
+ <img src="imgs/admin/icon_delete-16.png" alt="{$locale->tr("delete")}" />
+ </a>*}
+ </span>
+ </div>
+{/foreach}
+<div class="clearer"> </div>
+</div>
+{adminpagerajax style="list"}
\ No newline at end of file
More information about the pLog-svn
mailing list