[ Index ]
 

Code source de eZ Publish 3.9.0

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/kernel/setup/ -> settingstoolbar.php (source)

   1  <?php
   2  //
   3  // Created on: <01-Mar-2005 15:47:23 ks>
   4  //
   5  // SOFTWARE NAME: eZ publish
   6  // SOFTWARE RELEASE: 3.9.0
   7  // BUILD VERSION: 17785
   8  // COPYRIGHT NOTICE: Copyright (C) 1999-2006 eZ systems AS
   9  // SOFTWARE LICENSE: GNU General Public License v2.0
  10  // NOTICE: >
  11  //   This program is free software; you can redistribute it and/or
  12  //   modify it under the terms of version 2.0  of the GNU General
  13  //   Public License as published by the Free Software Foundation.
  14  //
  15  //   This program is distributed in the hope that it will be useful,
  16  //   but WITHOUT ANY WARRANTY; without even the implied warranty of
  17  //   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  18  //   GNU General Public License for more details.
  19  //
  20  //   You should have received a copy of version 2.0 of the GNU General
  21  //   Public License along with this program; if not, write to the Free
  22  //   Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
  23  //   MA 02110-1301, USA.
  24  //
  25  //
  26  
  27  $http =& eZHTTPTool::instance();
  28  $module =& $Params["Module"];
  29  
  30  include_once ( 'lib/ezutils/classes/ezini.php' );
  31  include_once ( 'lib/ezutils/classes/ezhttptool.php' );
  32  include_once ( 'kernel/classes/ezpreferences.php' );
  33  
  34  $allSettingsList = $module->actionParameter( 'AllSettingsList' );
  35  
  36  if ( $module->hasActionParameter( 'SelectedList' ) )
  37      $selectedList = $module->actionParameter( 'SelectedList' );
  38  else
  39      $selectedList=array();
  40  
  41  $siteAccess = $module->actionParameter( 'SiteAccess' );
  42  if ( !$siteAccess )
  43      $siteAccess = 'global_override';
  44  
  45  eZPreferences::setValue( 'admin_quicksettings_siteaccess', $siteAccess );
  46  
  47  $iniFiles = array();
  48  
  49  foreach( $allSettingsList as $index => $setting )
  50  {
  51      $settingArray = explode( ';', $setting );
  52  
  53      if ( !array_key_exists( $settingArray[2], $iniFiles ) )
  54          $iniFiles[$settingArray[2]] = array();
  55  
  56      $iniFiles[$settingArray[2]][] = array ( $settingArray[0], $settingArray[1], in_array( $index, $selectedList ) );
  57  }
  58  unset( $setting );
  59  
  60  $iniPath = ( $siteAccess == "global_override" ) ? "settings/override" : "settings/siteaccess/$siteAccess";
  61  
  62  foreach( $iniFiles as $fileName => $settings )
  63  {
  64      $ini =& eZINI::instance( $fileName . '.append', $iniPath, null, null, null, true, true );
  65      $baseIni =& eZINI::instance( $fileName );
  66  
  67      foreach( $settings as $setting )
  68      {
  69          if ( $ini->hasVariable( $setting[0], $setting[1] ) )
  70              $value = $ini->variable( $setting[0], $setting[1] );
  71          else
  72              $value = $baseIni->variable( $setting[0], $setting[1] );
  73  
  74          if ( $value == 'true' || $value == 'false' )
  75              $ini->setVariable( $setting[0], $setting[1], $setting[2] ? 'true' : 'false' );
  76          else
  77              $ini->setVariable( $setting[0], $setting[1], $setting[2] ? 'enabled' : 'disabled' );
  78      }
  79  
  80      if ( !$ini->save() )
  81          eZDebug::writeError( "Can't save ini file: $iniPath/$fileName.append" );
  82  
  83      unset( $baseIni );
  84      unset( $ini );
  85  
  86      // Remove variable from the global override
  87      if ( $siteAccess != "global_override" )
  88      {
  89          $ini =& eZINI::instance( $fileName . '.append', "settings/override", null, null, null, true, true );
  90          foreach( $settings as $setting )
  91          {
  92              if ( $ini->hasVariable( $setting[0], $setting[1] ) )
  93                  $ini->removeSetting( $setting[0], $setting[1] );
  94          }
  95          if ( !$ini->save() )
  96              eZDebug::writeError( "Can't save ini file: $iniPath/$fileName.append" );
  97  
  98          unset($ini);
  99      }
 100  }
 101  
 102  $uri = $http->sessionVariable( "LastAccessedModifyingURI" );
 103  $module->redirectTo( $uri );
 104      
 105  ?>


Généré le : Sat Feb 24 10:30:04 2007 par Balluche grâce à PHPXref 0.7