Account Suspended
Account Suspended
This Account has been suspended.
Contact your hosting provider for more information.
 All Data Structures Functions Variables Pages
ActionBarForUserEditAndDetailsView.php
1 <?php
2  /*********************************************************************************
3  * Zurmo is a customer relationship management program developed by
4  * Zurmo, Inc. Copyright (C) 2017 Zurmo Inc.
5  *
6  * Zurmo is free software; you can redistribute it and/or modify it under
7  * the terms of the GNU Affero General Public License version 3 as published by the
8  * Free Software Foundation with the addition of the following permission added
9  * to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
10  * IN WHICH THE COPYRIGHT IS OWNED BY ZURMO, ZURMO DISCLAIMS THE WARRANTY
11  * OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
12  *
13  * Zurmo is distributed in the hope that it will be useful, but WITHOUT
14  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
15  * FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
16  * details.
17  *
18  * You should have received a copy of the GNU Affero General Public License along with
19  * this program; if not, see http://www.gnu.org/licenses or write to the Free
20  * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
21  * 02110-1301 USA.
22  *
23  * You can contact Zurmo, Inc. with a mailing address at 27 North Wacker Drive
24  * Suite 370 Chicago, IL 60606. or at email address contact@zurmo.com.
25  *
26  * The interactive user interfaces in original and modified versions
27  * of this program must display Appropriate Legal Notices, as required under
28  * Section 5 of the GNU Affero General Public License version 3.
29  *
30  * In accordance with Section 7(b) of the GNU Affero General Public License version 3,
31  * these Appropriate Legal Notices must retain the display of the Zurmo
32  * logo and Zurmo copyright notice. If the display of the logo is not reasonably
33  * feasible for technical reasons, the Appropriate Legal Notices must display the words
34  * "Copyright Zurmo Inc. 2017. All rights reserved".
35  ********************************************************************************/
36 
41  {
42  protected $controllerId;
43 
44  protected $moduleId;
45 
46  protected $model;
47 
48  protected $activeActionElementType;
49 
56  public function __construct($controllerId, $moduleId, User $model, $activeActionElementType)
57  {
58  assert('is_string($controllerId)');
59  assert('is_string($moduleId)');
60  assert('is_string($activeActionElementType)');
61  $this->controllerId = $controllerId;
62  $this->moduleId = $moduleId;
63  $this->modelId = $model->id;
64  $this->model = $model;
65  $this->activeActionElementType = $activeActionElementType;
66  }
67 
68  protected function renderContent()
69  {
70  $content = '<div class="view-toolbar-container clearfix"><nav class="pillbox clearfix">';
71  $content .= $this->renderActionElementBar(false);
72  $content .= '</nav></div>';
73  return $content;
74  }
75 
76  public function isUniqueToAPage()
77  {
78  return true;
79  }
80 
81  public static function getDefaultMetadata()
82  {
83  $metadata = array(
84  'global' => array(
85  'toolbar' => array(
86  'elements' => array(
87  array('type' => 'UserDetailsMenu',
88  'iconClass' => 'icon-user-details',
89  'label' => "eval:Zurmo::t('UsersModule', 'Profile')",
90  ),
91  array('type' => 'UserEditMenu',
92  'iconClass' => 'icon-edit',
93  ),
94  array('type' => 'AuditEventsModalListLink',
95  'iconClass' => 'icon-audit',
96  ),
97  array('type' => 'ChangePasswordMenu',
98  'iconClass' => 'icon-password',
99  ),
100  array('type' => 'UserConfigurationMenu',
101  'id' => 'UserViewAccountConfiguration',
102  'iconClass' => 'icon-user-config',
103  'itemOptions' => array('class' => 'icon-user-config_', 'id' => 'UserViewAccountConfiguration'),
104  ),
105  array('type' => 'GameDashboardLink',
106  'iconClass' => 'icon-gamification',
107  ),
108  ),
109  ),
110  ),
111  );
112  return $metadata;
113  }
114 
115  protected function resolveActionElementInformationDuringRender(& $elementInformation)
116  {
117  parent::resolveActionElementInformationDuringRender($elementInformation);
118  if ($elementInformation['type'] == $this->activeActionElementType)
119  {
120  if (isset($elementInformation['htmlOptions']))
121  {
122  $elementInformation['htmlOptions']['class'] .= ' active';
123  }
124  else
125  {
126  $elementInformation['htmlOptions']['class'] = 'active';
127  }
128  }
129  }
130 
131  protected function shouldRenderToolBarElement($element, $elementInformation)
132  {
133  if (!parent::shouldRenderToolBarElement($element, $elementInformation))
134  {
135  return false;
136  }
137  if (in_array($elementInformation['type'],
138  array('UserEditMenu', 'AuditEventsModalListLink', 'ChangePasswordMenu', 'UserConfigurationMenu')) &&
140  {
141  return false;
142  }
143  return true;
144  }
145  }
146 ?>
Definition: User.php:37
static canCurrentUserViewALinkRequiringAccessAndManageRights(User $user)
__construct($controllerId, $moduleId, User $model, $activeActionElementType)
renderActionElementBar($renderedInForm)
Generated on Thu Oct 22 2020 07:10:33
Account Suspended
Account Suspended
This Account has been suspended.
Contact your hosting provider for more information.