Location: PHPKode > projects > iF.SVNAdmin > svnadmin/actions/update.php
<?php
/**
 * iF.SVNAdmin
 * Copyright (c) 2010 by Manuel Freiholz
 * http://www.insanefactory.com/
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; version 2
 * of the License.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.
 */
if( !defined('ACTION_HANDLING') ) {
  die("HaHa!");
}

// Check module.
$appEngine->forwardInvalidModule( !$appEngine->isViewUpdateable() );

// Iterate all view providers and update them.
$doneList = array();
$failedList = array();

// User view.
if( $appEngine->isUserViewActive() ){
  if( $appEngine->getUserViewProvider()->isUpdateable() ){
    if( $appEngine->getUserViewProvider()->update() ){
      array_push( $doneList, "User-View" );
    }
    else{
      array_push( $failedList, "User-View" );
    }
  }
}

// Group view.
if( $appEngine->isGroupViewActive() ){
  if( $appEngine->getGroupViewProvider()->isUpdateable() ){
    if( $appEngine->getGroupViewProvider()->update() ){
      array_push( $doneList, "Group-View" );
    }
    else{
      array_push( $failedList, "Group-View" );
    }
  }
}

// AccessPath view.
if( $appEngine->isAccessPathViewActive() ){
  if( $appEngine->getAccessPathViewProvider()->isUpdateable() ){
    if( $appEngine->getAccessPathViewProvider()->update() ){
      array_push( $doneList, "Permission-View" );
    }
    else{
      array_push( $failedList, "Permission-View" );
    }
  }
}

// The result of the update.
if( count($doneList) > 0 )
{
  $appTemplate->addDefine("UPDATE_DONE_LIST");
  $appTemplate->addReplacement("doneList", $doneList);
}

if( count($failedList) > 0 )
{
  $appTemplate->addDefine("UPDATE_FAILED_LIST");
  $appTemplate->addReplacement("failedList", $failedList);
}
?>
Return current item: iF.SVNAdmin