00001 <?php 00002 // 00003 // Definition of eZNavigationPart class 00004 // 00005 // Created on: <18-Feb-2003 11:38:57 bf> 00006 // 00007 // ## BEGIN COPYRIGHT, LICENSE AND WARRANTY NOTICE ## 00008 // SOFTWARE NAME: eZ publish 00009 // SOFTWARE RELEASE: 3.9.x 00010 // COPYRIGHT NOTICE: Copyright (C) 1999-2006 eZ systems AS 00011 // SOFTWARE LICENSE: GNU General Public License v2.0 00012 // NOTICE: > 00013 // This program is free software; you can redistribute it and/or 00014 // modify it under the terms of version 2.0 of the GNU General 00015 // Public License as published by the Free Software Foundation. 00016 // 00017 // This program is distributed in the hope that it will be useful, 00018 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00019 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00020 // GNU General Public License for more details. 00021 // 00022 // You should have received a copy of version 2.0 of the GNU General 00023 // Public License along with this program; if not, write to the Free 00024 // Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 00025 // MA 02110-1301, USA. 00026 // 00027 // 00028 // ## END COPYRIGHT, LICENSE AND WARRANTY NOTICE ## 00029 // 00030 00031 /*! 00032 \class eZNavigationPart eznavigationpart.php 00033 \brief eZNavigationPart handles grouping of functions across modules 00034 \ingroup eZKernel 00035 00036 A navigation part is a group of functions which belongs together. Every view can 00037 return the navigation part it should use. It is up to the view to return the 00038 proper navigation part. Views can internally check which navigation part to use, 00039 in the case of content/view the view will check the navigation part set in 00040 the section setup and use this. 00041 00042 If the view does not return any navigation part it will default to the Content part. 00043 00044 The navigation parts are controlled by the \c menu.ini file, look for the 00045 \c NavigationPart group. 00046 You can easily add new entries in override files or in extensions by adding 00047 to the \c Part list. 00048 00049 */ 00050 00051 class eZNavigationPart 00052 { 00053 function eZNavigationPart() 00054 { 00055 } 00056 00057 /*! 00058 \static 00059 Will return the navigation part array if the identifier is valid, 00060 the default will be returned if the identifier is not valid. 00061 00062 The navigation parts are defined in the INI file \c menu.ini 00063 under the \c NavigationPart group. 00064 */ 00065 function fetchPartByIdentifier( $identifier ) 00066 { 00067 $parts = eZNavigationPart::fetchList(); 00068 00069 if ( isset( $parts[$identifier] ) ) 00070 return $parts[$identifier]; 00071 00072 // Return the first part which is the default 00073 if ( isset( $parts[0] ) ) 00074 return $parts[0]; 00075 00076 return false; 00077 } 00078 00079 /*! 00080 \static 00081 \return The current list of navigation part identifiers 00082 00083 \note The list is cached in the global variable \c eZNavigationPartList. 00084 */ 00085 function fetchList() 00086 { 00087 $list =& $GLOBALS['eZNavigationPartList']; 00088 if ( isset( $list ) ) 00089 return $list; 00090 00091 $ini =& eZINI::instance( 'menu.ini' ); 00092 $parts = $ini->variable( 'NavigationPart', 'Part' ); 00093 $list = array(); 00094 foreach ( $parts as $identifier => $name ) 00095 { 00096 $list[$identifier] = array( 'name' => ezi18n( 'kernel/navigationpart', $name, 'Navigation part' ), 00097 'identifier' => $identifier ); 00098 } 00099 return $list; 00100 } 00101 00102 /*! 00103 \private 00104 \note This funtion only exists for the i18n entries to be picked up by ezlupdate. 00105 */ 00106 function i18nDummy() 00107 { 00108 ezi18n( 'kernel/navigationpart', 'Content structure', 'Navigation part' ); 00109 ezi18n( 'kernel/navigationpart', 'Media library', 'Navigation part' ); 00110 ezi18n( 'kernel/navigationpart', 'User accounts', 'Navigation part' ); 00111 ezi18n( 'kernel/navigationpart', 'Webshop', 'Navigation part' ); 00112 ezi18n( 'kernel/navigationpart', 'Design', 'Navigation part' ); 00113 ezi18n( 'kernel/navigationpart', 'Setup', 'Navigation part' ); 00114 ezi18n( 'kernel/navigationpart', 'My account', 'Navigation part' ); 00115 } 00116 00117 } 00118 00119 ?>
1.6.3