@@ -76,18 +76,18 @@ |
||
76 | 76 | public function __call($name, $arguments) |
77 | 77 | { |
78 | 78 | // We delegate all undefined methods to the $item object. |
79 | - if(isset($this->item)){ |
|
79 | + if (isset($this->item)) { |
|
80 | 80 | $returnedValue = call_user_func_array(array( |
81 | 81 | $this->item, |
82 | 82 | $name |
83 | 83 | ), $arguments); |
84 | - if($returnedValue === $this->item){ |
|
84 | + if ($returnedValue === $this->item) { |
|
85 | 85 | $returnedValue = $this; |
86 | 86 | } |
87 | 87 | return $returnedValue; |
88 | 88 | } |
89 | - else{ |
|
90 | - trigger_error('the method ' . $name . ' does not exists on ' . get_class($this) . ' and there is no widget defined with the setInheritedItem method'); |
|
89 | + else { |
|
90 | + trigger_error('the method '.$name.' does not exists on '.get_class($this).' and there is no widget defined with the setInheritedItem method'); |
|
91 | 91 | } |
92 | 92 | } |
93 | 93 |
@@ -85,8 +85,7 @@ |
||
85 | 85 | $returnedValue = $this; |
86 | 86 | } |
87 | 87 | return $returnedValue; |
88 | - } |
|
89 | - else{ |
|
88 | + } else{ |
|
90 | 89 | trigger_error('the method ' . $name . ' does not exists on ' . get_class($this) . ' and there is no widget defined with the setInheritedItem method'); |
91 | 90 | } |
92 | 91 | } |
@@ -50,14 +50,14 @@ discard block |
||
50 | 50 | |
51 | 51 | $this->setHiddenValue('tg', $App->controllerTg); |
52 | 52 | |
53 | - if(isset($customfield)){ |
|
53 | + if (isset($customfield)) { |
|
54 | 54 | $this->setHiddenValue('customfield[id]', $customfield->id); |
55 | 55 | $values = $customfield->getValues(); |
56 | 56 | |
57 | - if(! empty($this->customfield->enumvalues)){ |
|
57 | + if (!empty($this->customfield->enumvalues)) { |
|
58 | 58 | $values['enumvalues'] = unserialize($this->customfield->enumvalues); |
59 | 59 | } |
60 | - else{ |
|
60 | + else { |
|
61 | 61 | $values['enumvalues'] = array( |
62 | 62 | '0' => '' |
63 | 63 | ); |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | $this->addItem($this->searchable()); |
83 | 83 | $this->addItem($this->visible()); |
84 | 84 | $this->addItem($this->importable()); |
85 | - if($App->onlineShop){ |
|
85 | + if ($App->onlineShop) { |
|
86 | 86 | $this->addItem($this->visible_in_shop()); |
87 | 87 | } |
88 | 88 | } |
@@ -175,16 +175,16 @@ discard block |
||
175 | 175 | $fieldValuesItem->addItem($W->Label($App->translate('List of available values'))); |
176 | 176 | $values = array(); |
177 | 177 | |
178 | - if(isset($this->customfield) && ! empty($this->customfield->enumvalues)){ |
|
178 | + if (isset($this->customfield) && !empty($this->customfield->enumvalues)) { |
|
179 | 179 | $values = unserialize($this->customfield->enumvalues); |
180 | 180 | |
181 | - foreach ($values as $name => $text){ |
|
181 | + foreach ($values as $name => $text) { |
|
182 | 182 | $fieldValuesItem->addItem($W->LineEdit() |
183 | 183 | ->setName((string) $name)); |
184 | 184 | } |
185 | 185 | } |
186 | 186 | |
187 | - if(empty($values)){ |
|
187 | + if (empty($values)) { |
|
188 | 188 | $fieldValuesItem->addItem($W->LineEdit() |
189 | 189 | ->setName('1')); |
190 | 190 | } |
@@ -56,8 +56,7 @@ |
||
56 | 56 | |
57 | 57 | if(! empty($this->customfield->enumvalues)){ |
58 | 58 | $values['enumvalues'] = unserialize($this->customfield->enumvalues); |
59 | - } |
|
60 | - else{ |
|
59 | + } else{ |
|
61 | 60 | $values['enumvalues'] = array( |
62 | 61 | '0' => '' |
63 | 62 | ); |
@@ -28,7 +28,7 @@ |
||
28 | 28 | |
29 | 29 | protected function getShapeHtml() |
30 | 30 | { |
31 | - $path = "M{$this->size} {$this->size} " . number_format($this->size / 2, 1) . ' ' . number_format($this->size / 6, 1) . " L0 {$this->size} Z"; |
|
31 | + $path = "M{$this->size} {$this->size} ".number_format($this->size / 2, 1).' '.number_format($this->size / 6, 1)." L0 {$this->size} Z"; |
|
32 | 32 | return "<svg height='{$this->size}' width='{$this->size}'> |
33 | 33 | <path d='{$path}' fill='{$this->color}'/> |
34 | 34 | </svg>"; |
@@ -137,8 +137,7 @@ discard block |
||
137 | 137 | } |
138 | 138 | if(isset($title)){ |
139 | 139 | $this->context->addItem($W->Section($title, $item, 4), $position); |
140 | - } |
|
141 | - else{ |
|
140 | + } else{ |
|
142 | 141 | $this->context->addItem($item, $position); |
143 | 142 | } |
144 | 143 | return $this; |
@@ -169,8 +168,7 @@ discard block |
||
169 | 168 | $mainPanel = $W->Frame(null, $this->mainPanel); |
170 | 169 | if(bab_isAjaxRequest()){ |
171 | 170 | $mainPanel->addClass('app_main_panel'); |
172 | - } |
|
173 | - else{ |
|
171 | + } else{ |
|
174 | 172 | $mainPanel->setId('app_main_panel'); |
175 | 173 | } |
176 | 174 |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | * @var FuncIcons $I |
66 | 66 | */ |
67 | 67 | $I = BabFunctionality::get('Icons'); |
68 | - if($I){ |
|
68 | + if ($I) { |
|
69 | 69 | $I->includeCss(); |
70 | 70 | } |
71 | 71 | |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | */ |
113 | 113 | public function addItem(WidgetDisplayableInterface $item = null, $order = null) |
114 | 114 | { |
115 | - if(! isset($this->mainPanel)){ |
|
115 | + if (!isset($this->mainPanel)) { |
|
116 | 116 | $W = bab_widgets(); |
117 | 117 | $this->mainPanel = $W->VBoxLayout(); |
118 | 118 | } |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | { |
134 | 134 | $W = bab_widgets(); |
135 | 135 | |
136 | - if(null === $this->context){ |
|
136 | + if (null === $this->context) { |
|
137 | 137 | |
138 | 138 | $isAjaxRequest = (isset($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest'); |
139 | 139 | $contextPanelId = $isAjaxRequest ? null : 'app_context_panel'; |
@@ -141,10 +141,10 @@ discard block |
||
141 | 141 | $this->context = $W->Frame($contextPanelId, $W->VBoxLayout() |
142 | 142 | ->setVerticalSpacing(2, 'em')); |
143 | 143 | } |
144 | - if(isset($title)){ |
|
144 | + if (isset($title)) { |
|
145 | 145 | $this->context->addItem($W->Section($title, $item, 4), $position); |
146 | 146 | } |
147 | - else{ |
|
147 | + else { |
|
148 | 148 | $this->context->addItem($item, $position); |
149 | 149 | } |
150 | 150 | return $this; |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | { |
161 | 161 | $W = bab_Widgets(); |
162 | 162 | |
163 | - if(null === $this->toolbars){ |
|
163 | + if (null === $this->toolbars) { |
|
164 | 164 | $this->toolbars = $W->Frame(null, $W->VBoxItems()); |
165 | 165 | } |
166 | 166 | $this->toolbars->addItem($item); |
@@ -173,10 +173,10 @@ discard block |
||
173 | 173 | $W = bab_widgets(); |
174 | 174 | |
175 | 175 | $mainPanel = $W->Frame(null, $this->mainPanel); |
176 | - if(bab_isAjaxRequest()){ |
|
176 | + if (bab_isAjaxRequest()) { |
|
177 | 177 | $mainPanel->addClass('app_main_panel'); |
178 | 178 | } |
179 | - else{ |
|
179 | + else { |
|
180 | 180 | $mainPanel->setId('app_main_panel'); |
181 | 181 | } |
182 | 182 | |
@@ -193,7 +193,7 @@ discard block |
||
193 | 193 | { |
194 | 194 | $mainPanel = $this->getMainPanel(); |
195 | 195 | |
196 | - if($this->context){ |
|
196 | + if ($this->context) { |
|
197 | 197 | |
198 | 198 | $W = bab_widgets(); |
199 | 199 | |
@@ -210,7 +210,7 @@ discard block |
||
210 | 210 | |
211 | 211 | protected function addToolbars(WidgetItem $mainPanel) |
212 | 212 | { |
213 | - if($this->toolbars){ |
|
213 | + if ($this->toolbars) { |
|
214 | 214 | |
215 | 215 | $W = bab_widgets(); |
216 | 216 | $this->toolbars->setSizePolicy('app-toolbars'); |
@@ -250,12 +250,12 @@ discard block |
||
250 | 250 | */ |
251 | 251 | public function addMessageInfo() |
252 | 252 | { |
253 | - if(isset($_SESSION['app_msginfo'])){ |
|
253 | + if (isset($_SESSION['app_msginfo'])) { |
|
254 | 254 | |
255 | 255 | // all widget have static id to not change id of others widgets in page |
256 | 256 | |
257 | 257 | $infoMessages = $_SESSION['app_msginfo']; |
258 | - foreach ($infoMessages as $infoLine){ |
|
258 | + foreach ($infoMessages as $infoLine) { |
|
259 | 259 | $this->App() |
260 | 260 | ->Controller() |
261 | 261 | ->addMessage($infoLine); |
@@ -69,8 +69,7 @@ |
||
69 | 69 | case 'visible_in_shop': |
70 | 70 | if(self::getRecordFieldValue($record, $fieldPath)){ |
71 | 71 | return $W->Label($App->translate('Yes')); |
72 | - } |
|
73 | - else{ |
|
72 | + } else{ |
|
74 | 73 | return $W->Label($App->translate('No')); |
75 | 74 | } |
76 | 75 | break; |
@@ -55,14 +55,14 @@ discard block |
||
55 | 55 | |
56 | 56 | case '_actions_': |
57 | 57 | $box = $W->FlowItems(); |
58 | - if($record->isUpdatable()){ |
|
58 | + if ($record->isUpdatable()) { |
|
59 | 59 | $box->addItem($W->Link('', $App->Controller() |
60 | 60 | ->CustomField() |
61 | 61 | ->edit($record->id)) |
62 | 62 | ->addClass('icon', \FuncIcons::ACTIONS_DOCUMENT_EDIT) |
63 | 63 | ->setOpenMode(WidgetLink::OPEN_DIALOG_AND_RELOAD)); |
64 | 64 | } |
65 | - if($record->isDeletable()){ |
|
65 | + if ($record->isDeletable()) { |
|
66 | 66 | $box->addItem($W->Link('', $App->Controller() |
67 | 67 | ->CustomField() |
68 | 68 | ->confirmDelete($record->id)) |
@@ -74,10 +74,10 @@ discard block |
||
74 | 74 | |
75 | 75 | case 'mandatory': |
76 | 76 | case 'visible_in_shop': |
77 | - if(self::getRecordFieldValue($record, $fieldPath)){ |
|
77 | + if (self::getRecordFieldValue($record, $fieldPath)) { |
|
78 | 78 | return $W->Label($App->translate('Yes')); |
79 | 79 | } |
80 | - else{ |
|
80 | + else { |
|
81 | 81 | return $W->Label($App->translate('No')); |
82 | 82 | } |
83 | 83 | break; |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | $this->addColumn(Widget_TableModelViewColumn($recordSet->visible, $App->translate('Visible in list'))->addClass('widget-10em')); |
106 | 106 | $this->addColumn(Widget_TableModelViewColumn('_actions_', '')->setSortable(false) |
107 | 107 | ->addClass('widget-column-thin', 'widget-nowrap', FuncIcons::ICON_LEFT_SYMBOLIC)); |
108 | - if($App->onlineShop){ |
|
108 | + if ($App->onlineShop) { |
|
109 | 109 | $this->addColumn(Widget_TableModelViewColumn($recordSet->visible_in_shop, $App->translate('Visible in online shop'))); |
110 | 110 | } |
111 | 111 |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | public function display() |
36 | 36 | { |
37 | 37 | $App = $this->App(); |
38 | - if(!bab_isUserAdministrator()) { |
|
38 | + if (!bab_isUserAdministrator()) { |
|
39 | 39 | throw new AppAccessException($App->translate('You do not have access to this page')); |
40 | 40 | } |
41 | 41 | |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | public function configureSSE() |
75 | 75 | { |
76 | 76 | $App = $this->App(); |
77 | - if(!bab_isUserAdministrator()) { |
|
77 | + if (!bab_isUserAdministrator()) { |
|
78 | 78 | throw new AppAccessException($App->translate('You do not have access to this page')); |
79 | 79 | } |
80 | 80 |
@@ -131,8 +131,7 @@ discard block |
||
131 | 131 | |
132 | 132 | if(empty($customfield['id'])){ |
133 | 133 | $record = $set->newRecord(); |
134 | - } |
|
135 | - else{ |
|
134 | + } else{ |
|
136 | 135 | $record = $set->get($customfield['id']); |
137 | 136 | } |
138 | 137 | |
@@ -142,8 +141,7 @@ discard block |
||
142 | 141 | $enumvalues[$enumkey] = $set->enumvalues->input($enumvalue); |
143 | 142 | } |
144 | 143 | $record->enumvalues = serialize($enumvalues); |
145 | - } |
|
146 | - else{ |
|
144 | + } else{ |
|
147 | 145 | $record->enumvalues = ''; |
148 | 146 | } |
149 | 147 |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | * {@inheritdoc} |
62 | 62 | * @see AppCtrlRecord::display() |
63 | 63 | */ |
64 | - public function display($id = null,$view = "",$itemId =null) |
|
64 | + public function display($id = null, $view = "", $itemId = null) |
|
65 | 65 | { |
66 | 66 | } |
67 | 67 | |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | $page->addClass('app-page-editor'); |
106 | 106 | $page->setTitle($App->translate('Edit custom field')); |
107 | 107 | |
108 | - if(null !== $customfield){ |
|
108 | + if (null !== $customfield) { |
|
109 | 109 | $set = $App->CustomFieldSet(); |
110 | 110 | $customfield = $set->request($customfield); |
111 | 111 | } |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | |
115 | 115 | $page->addItem($form); |
116 | 116 | |
117 | - if($customfield instanceof AppCustomField){ |
|
117 | + if ($customfield instanceof AppCustomField) { |
|
118 | 118 | $actionsFrame = $page->ActionsFrame(); |
119 | 119 | $page->addContextItem($actionsFrame); |
120 | 120 | |
@@ -134,21 +134,21 @@ discard block |
||
134 | 134 | |
135 | 135 | $set = $App->CustomFieldSet(); |
136 | 136 | |
137 | - if(empty($customfield['id'])){ |
|
137 | + if (empty($customfield['id'])) { |
|
138 | 138 | $record = $set->newRecord(); |
139 | 139 | } |
140 | - else{ |
|
140 | + else { |
|
141 | 141 | $record = $set->get($customfield['id']); |
142 | 142 | } |
143 | 143 | |
144 | - if('Enum' === $customfield['fieldtype'] || 'Set' === $customfield['fieldtype']){ |
|
144 | + if ('Enum' === $customfield['fieldtype'] || 'Set' === $customfield['fieldtype']) { |
|
145 | 145 | $enumvalues = array(); |
146 | - foreach ($customfield['enumvalues'] as $enumkey => $enumvalue){ |
|
146 | + foreach ($customfield['enumvalues'] as $enumkey => $enumvalue) { |
|
147 | 147 | $enumvalues[$enumkey] = $set->enumvalues->input($enumvalue); |
148 | 148 | } |
149 | 149 | $record->enumvalues = serialize($enumvalues); |
150 | 150 | } |
151 | - else{ |
|
151 | + else { |
|
152 | 152 | $record->enumvalues = ''; |
153 | 153 | } |
154 | 154 | |
@@ -159,11 +159,11 @@ discard block |
||
159 | 159 | |
160 | 160 | // refresh target table structure |
161 | 161 | |
162 | - $object = $record->object . 'Set'; |
|
162 | + $object = $record->object.'Set'; |
|
163 | 163 | $mysqlbackend = new ORMMySqlBackend($GLOBALS['babDB']); |
164 | 164 | |
165 | 165 | $recordSet = $App->$object(); |
166 | - if(method_exists($recordSet, 'useLang')){ |
|
166 | + if (method_exists($recordSet, 'useLang')) { |
|
167 | 167 | // This is necessary if the recordSet constructor uses a setLang(). |
168 | 168 | // We need to revert to multilang fields before synchronizing. |
169 | 169 | $recordSet->useLang(false); |
@@ -185,17 +185,17 @@ discard block |
||
185 | 185 | { |
186 | 186 | $App = $this->App(); |
187 | 187 | |
188 | - if(! $customfield){ |
|
188 | + if (!$customfield) { |
|
189 | 189 | throw new AppAccessException($App->translate('Access denied')); |
190 | 190 | } |
191 | 191 | |
192 | 192 | $set = $App->CustomFieldSet(); |
193 | 193 | $record = $set->request($customfield); |
194 | - $object = $record->object . 'Set'; |
|
194 | + $object = $record->object.'Set'; |
|
195 | 195 | $set->delete($set->id->is($customfield)); |
196 | 196 | |
197 | 197 | $recordSet = $App->$object(); |
198 | - if(method_exists($recordSet, 'useLang')){ |
|
198 | + if (method_exists($recordSet, 'useLang')) { |
|
199 | 199 | // This is necessary if the recordSet constructor uses a setLang(). |
200 | 200 | // We need to revert to multilang fields before synchronizing. |
201 | 201 | $recordSet->useLang(false); |
@@ -168,8 +168,7 @@ |
||
168 | 168 | ->addClass('notificationElementShowMore')); |
169 | 169 | |
170 | 170 | $box->addItem($notificationBox); |
171 | - } |
|
172 | - else{ |
|
171 | + } else{ |
|
173 | 172 | $notifIcon .= 'webapp-bell-o'; |
174 | 173 | } |
175 | 174 |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | ->popup($notifBox->getId())); |
65 | 65 | $page->addClass(AppNotification::NOTIFICATION_PORTLET_CLASS); |
66 | 66 | |
67 | - foreach ($notifications as $notification){ |
|
67 | + foreach ($notifications as $notification) { |
|
68 | 68 | $notifBox->addItem($W->Link($notification->title, $this->proxy() |
69 | 69 | ->display($notification->id)) |
70 | 70 | ->setOpenMode(WidgetLink::OPEN_DIALOG)); |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | { |
78 | 78 | $set = $this->getRecordSet(); |
79 | 79 | $record = $set->get($id); |
80 | - if(! $record){ |
|
80 | + if (!$record) { |
|
81 | 81 | return true; |
82 | 82 | } |
83 | 83 | |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | $notifSet = $App->NotificationSet(); |
121 | 121 | |
122 | 122 | $box = $W->FlowItems()->setIconFormat(24, 'center'); |
123 | - if(isset($itemId)){ |
|
123 | + if (isset($itemId)) { |
|
124 | 124 | $box->setId($itemId); |
125 | 125 | } |
126 | 126 | $notifs = $notifSet->selectUserNotifications(); |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | |
132 | 132 | $box->addItem($btnWidget = $W->FlexItems()) |
133 | 133 | ->setIcon(16, 'left'); |
134 | - if($nbNotif > 0){ |
|
134 | + if ($nbNotif > 0) { |
|
135 | 135 | $btnWidget->addItem($W->Label($nbNotif) |
136 | 136 | ->addClass('notificationNumber')); |
137 | 137 | $btnWidget->addClass('notificationDisplayButton'); |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | ->addClass('notificationBoxElements') |
155 | 155 | ->setDirection(WidgetFlexLayout::FLEX_DIRECTION_COL)); |
156 | 156 | |
157 | - foreach ($notifs as $notif){ |
|
157 | + foreach ($notifs as $notif) { |
|
158 | 158 | $notificationBoxElements->addItem($W->Link($el = $W->FlexItems($W->Label($notif->title) |
159 | 159 | ->addClass('notificationElementTitle'), $W->Label(date('d/m/Y H:i', strtotime($notif->createdOn))) |
160 | 160 | ->addClass('notificationElementDate')) |
@@ -162,10 +162,10 @@ discard block |
||
162 | 162 | ->display($notif->id)) |
163 | 163 | ->addClass('notificationBoxElement') |
164 | 164 | ->setOpenMode(WidgetLink::OPEN_DIALOG)); |
165 | - if(! empty($notif->description)){ |
|
165 | + if (!empty($notif->description)) { |
|
166 | 166 | $desc = $notif->description; |
167 | - if(strlen($desc) > 40){ |
|
168 | - $desc = trim(substr($desc, 0, 40)) . '...'; |
|
167 | + if (strlen($desc) > 40) { |
|
168 | + $desc = trim(substr($desc, 0, 40)).'...'; |
|
169 | 169 | } |
170 | 170 | $el->addItem($W->Label($desc) |
171 | 171 | ->addClass('notificationElementDescription'), 1); |
@@ -177,7 +177,7 @@ discard block |
||
177 | 177 | |
178 | 178 | $box->addItem($notificationBox); |
179 | 179 | } |
180 | - else{ |
|
180 | + else { |
|
181 | 181 | $notifIcon .= 'webapp-bell-o'; |
182 | 182 | } |
183 | 183 | |
@@ -219,7 +219,7 @@ discard block |
||
219 | 219 | |
220 | 220 | $notifSet = $App->NotificationSet(); |
221 | 221 | $notifs = $notifSet->selectUserNotifications(); |
222 | - foreach ($notifs as $notif){ |
|
222 | + foreach ($notifs as $notif) { |
|
223 | 223 | $notif->markAsSeen(); |
224 | 224 | } |
225 | 225 |
@@ -27,7 +27,7 @@ |
||
27 | 27 | { |
28 | 28 | public function __construct($action, $code = 0) |
29 | 29 | { |
30 | - $message = 'Unknown method "' . $action->getController() . '::' . $action->getMethod() . '"'; |
|
30 | + $message = 'Unknown method "'.$action->getController().'::'.$action->getMethod().'"'; |
|
31 | 31 | parent::__construct($message, $code); |
32 | 32 | } |
33 | 33 | } |
34 | 34 | \ No newline at end of file |