[ Index ]
 

Code source de eZ Publish 3.9.0

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

title

Body

[fermer]

/kernel/classes/ -> ezcollaborationviewhandler.php (source)

   1  <?php
   2  //
   3  // Definition of eZCollaborationViewHandler class
   4  //
   5  // Created on: <23-Jan-2003 11:59:34 amos>
   6  //
   7  // SOFTWARE NAME: eZ publish
   8  // SOFTWARE RELEASE: 3.9.0
   9  // BUILD VERSION: 17785
  10  // COPYRIGHT NOTICE: Copyright (C) 1999-2006 eZ systems AS
  11  // SOFTWARE LICENSE: GNU General Public License v2.0
  12  // NOTICE: >
  13  //   This program is free software; you can redistribute it and/or
  14  //   modify it under the terms of version 2.0  of the GNU General
  15  //   Public License as published by the Free Software Foundation.
  16  //
  17  //   This program is distributed in the hope that it will be useful,
  18  //   but WITHOUT ANY WARRANTY; without even the implied warranty of
  19  //   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  20  //   GNU General Public License for more details.
  21  //
  22  //   You should have received a copy of version 2.0 of the GNU General
  23  //   Public License along with this program; if not, write to the Free
  24  //   Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
  25  //   MA 02110-1301, USA.
  26  //
  27  //
  28  
  29  /*! \file ezcollaborationviewhandler.php
  30  */
  31  
  32  /*!
  33    \class eZCollaborationViewHandler ezcollaborationviewhandler.php
  34    \brief The class eZCollaborationViewHandler does
  35  
  36  */
  37  
  38  define( 'EZ_COLLABORATION_VIEW_TYPE_STANDARD', 1 );
  39  define( 'EZ_COLLABORATION_VIEW_TYPE_GROUP', 2 );
  40  
  41  class eZCollaborationViewHandler
  42  {
  43      /*!
  44       Initializes the view mode.
  45      */
  46      function eZCollaborationViewHandler( $viewMode, $viewType )
  47      {
  48          $this->ViewMode = $viewMode;
  49          $this->ViewType = $viewType;
  50          $this->TemplateName = $viewMode;
  51          $ini =& $this->ini();
  52          if ( $viewType == EZ_COLLABORATION_VIEW_TYPE_STANDARD )
  53          {
  54              $this->TemplatePrefix = "design:collaboration/view/";
  55              $viewGroup = $viewMode . "View";
  56          }
  57          else if ( $viewType == EZ_COLLABORATION_VIEW_TYPE_GROUP )
  58          {
  59              $this->TemplatePrefix = "design:collaboration/group/view/";
  60              $viewGroup = $viewMode . "GroupView";
  61          }
  62          if ( $ini->hasGroup( $viewGroup ) )
  63          {
  64              if ( $ini->hasVariable( $viewGroup, 'TemplateName' ) )
  65                  $this->TemplateName = $ini->variable( $viewGroup, 'TemplateName' );
  66          }
  67      }
  68  
  69      /*!
  70       \return the template which is used for viewing the collaborations.
  71      */
  72      function template()
  73      {
  74          return $this->TemplatePrefix . $this->TemplateName . ".tpl";
  75      }
  76  
  77      /*!
  78       \static
  79       \return the ini object for collaboration.ini
  80      */
  81      function &ini()
  82      {
  83          $iniInstance =& eZINI::instance( 'collaboration.ini' );
  84          return $iniInstance;
  85      }
  86  
  87      /*!
  88       \static
  89       \return true if the viewmode \a $viewMode exists with the current configuration
  90      */
  91      function exists( $viewMode )
  92      {
  93          $list = eZCollaborationViewHandler::fetchList();
  94          return in_array( $viewMode, $list );
  95      }
  96  
  97      /*!
  98       \static
  99       \return true if the viewmode \a $viewMode exists for groups with the current configuration
 100      */
 101      function groupExists( $viewMode )
 102      {
 103          $list = eZCollaborationViewHandler::fetchGroupList();
 104          return in_array( $viewMode, $list );
 105      }
 106  
 107      /*!
 108       \static
 109       \return a list of active viewmodes.
 110      */
 111      function fetchList()
 112      {
 113          $ini =& eZCollaborationViewHandler::ini();
 114          return $ini->variable( 'ViewSettings', 'ViewList' );
 115      }
 116  
 117      /*!
 118       \static
 119       \return a list of active viewmodes for groups.
 120      */
 121      function fetchGroupList()
 122      {
 123          $ini =& eZCollaborationViewHandler::ini();
 124          return $ini->variable( 'ViewSettings', 'GroupViewList' );
 125      }
 126  
 127      /*!
 128       \static
 129       \return the single instance of the viewmode \a $viewMode.
 130      */
 131      function &instance( $viewMode, $type = EZ_COLLABORATION_VIEW_TYPE_STANDARD )
 132      {
 133          if ( $type == EZ_COLLABORATION_VIEW_TYPE_STANDARD )
 134              $instance =& $GLOBALS["eZCollaborationView"][$viewMode];
 135          else if ( $type == EZ_COLLABORATION_VIEW_TYPE_GROUP )
 136              $instance =& $GLOBALS["eZCollaborationGroupView"][$viewMode];
 137          else
 138          {
 139              $instance = null;
 140              return $instance;
 141          }
 142          if ( !isset( $instance ) )
 143          {
 144              $instance = new eZCollaborationViewHandler( $viewMode, $type );
 145          }
 146          return $instance;
 147      }
 148  
 149      /// \privatesection
 150      /// The viewmode
 151      var $ViewMode;
 152      var $ViewType;
 153      var $TemplateName;
 154      var $TemplatePrefix;
 155  }
 156  
 157  ?>


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