Exponential 6.0.13 Exponential Enterprise Open Source CMS - PHP Class Reference

ezcollaborationviewhandler.php
Go to the documentation of this file.
1 <?php
17 class eZCollaborationViewHandler
18 {
19 const TYPE_STANDARD = 1;
20 const TYPE_GROUP = 2;
21
28 public function __construct( $viewMode, $viewType )
29 {
30 $this->ViewMode = $viewMode;
31 $this->ViewType = $viewType;
32 $this->TemplateName = $viewMode;
33 $ini = $this->ini();
34 if ( $viewType == self::TYPE_STANDARD )
35 {
36 $this->TemplatePrefix = "design:collaboration/view/";
37 $viewGroup = $viewMode . "View";
38 }
39 else if ( $viewType == self::TYPE_GROUP )
40 {
41 $this->TemplatePrefix = "design:collaboration/group/view/";
42 $viewGroup = $viewMode . "GroupView";
43 }
44 if ( $ini->hasGroup( $viewGroup ) )
45 {
46 if ( $ini->hasVariable( $viewGroup, 'TemplateName' ) )
47 $this->TemplateName = $ini->variable( $viewGroup, 'TemplateName' );
48 }
49 }
50
54 function template()
55 {
56 return $this->TemplatePrefix . $this->TemplateName . ".tpl";
57 }
58
63 static function ini()
64 {
65 return eZINI::instance( 'collaboration.ini' );
66 }
67
72 static function exists( $viewMode )
73 {
74 $list = eZCollaborationViewHandler::fetchList();
75 return in_array( $viewMode, $list );
76 }
77
82 static function groupExists( $viewMode )
83 {
84 $list = eZCollaborationViewHandler::fetchGroupList();
85 return in_array( $viewMode, $list );
86 }
87
92 static function fetchList()
93 {
94 return eZCollaborationViewHandler::ini()->variable( 'ViewSettings', 'ViewList' );
95 }
96
101 static function fetchGroupList()
102 {
103 return eZCollaborationViewHandler::ini()->variable( 'ViewSettings', 'GroupViewList' );
104 }
105
115 static function instance( $viewMode, $type = self::TYPE_STANDARD )
116 {
117 if ( $type == self::TYPE_STANDARD )
118 $instance =& $GLOBALS["eZCollaborationView"][$viewMode];
119 else if ( $type == self::TYPE_GROUP )
120 $instance =& $GLOBALS["eZCollaborationGroupView"][$viewMode];
121 else
122 {
123 return null;
124 }
125 if ( !isset( $instance ) )
126 {
127 $instance = new eZCollaborationViewHandler( $viewMode, $type );
128 }
129 return $instance;
130 }
131
134 public $ViewMode;
135 public $ViewType;
136 public $TemplateName;
137 public $TemplatePrefix;
138 }
139
140 ?>
eZCollaborationViewHandler
The class eZCollaborationViewHandler does.
Definition: ezcollaborationviewhandler.php:18
eZCollaborationViewHandler\exists
static exists( $viewMode)
Definition: ezcollaborationviewhandler.php:72
eZCollaborationViewHandler\$TemplateName
$TemplateName
Definition: ezcollaborationviewhandler.php:136
eZCollaborationViewHandler\$TemplatePrefix
$TemplatePrefix
Definition: ezcollaborationviewhandler.php:137
eZCollaborationViewHandler\TYPE_STANDARD
const TYPE_STANDARD
Definition: ezcollaborationviewhandler.php:19
eZCollaborationViewHandler\__construct
__construct( $viewMode, $viewType)
Definition: ezcollaborationviewhandler.php:28
eZCollaborationViewHandler\TYPE_GROUP
const TYPE_GROUP
Definition: ezcollaborationviewhandler.php:20
eZCollaborationViewHandler\$ViewMode
$ViewMode
Definition: ezcollaborationviewhandler.php:134
eZCollaborationViewHandler\groupExists
static groupExists( $viewMode)
Definition: ezcollaborationviewhandler.php:82
eZCollaborationViewHandler\$ViewType
$ViewType
Definition: ezcollaborationviewhandler.php:135
eZCollaborationViewHandler\fetchList
static fetchList()
Definition: ezcollaborationviewhandler.php:92
eZCollaborationViewHandler\instance
static instance( $viewMode, $type=self::TYPE_STANDARD)
Definition: ezcollaborationviewhandler.php:115
eZCollaborationViewHandler\fetchGroupList
static fetchGroupList()
Definition: ezcollaborationviewhandler.php:101
eZCollaborationViewHandler\ini
static ini()
Definition: ezcollaborationviewhandler.php:63
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.