|
@@ -210,20 +210,49 @@ class CoreController extends Controller
|
210
|
210
|
else
|
211
|
211
|
{
|
212
|
212
|
|
213
|
|
- $search_object = $this->getElementSearcher();
|
214
|
|
- $search_form = $this->getSearchForm($search_object);
|
215
|
|
- $add_form = $this->getAddForm();
|
216
|
|
-
|
217
|
|
- return $this->render('MuzichHomeBundle:Home:index.html.twig', array(
|
218
|
|
- 'search_tags_id' => $search_object->getTags(),
|
219
|
|
- 'user' => $this->getUser(),
|
220
|
|
- 'add_form' => $add_form->createView(),
|
221
|
|
- 'add_form_name' => $add_form->getName(),
|
222
|
|
- 'search_form' => $search_form->createView(),
|
223
|
|
- 'search_form_name' => $search_form->getName(),
|
224
|
|
- 'elements' => $search_object->getElements($this->getDoctrine(), $this->getUserId()),
|
225
|
|
- 'more_count' => $this->container->getParameter('search_default_count')*2
|
226
|
|
- ));
|
|
213
|
+ if (!$group_slug)
|
|
214
|
+ {
|
|
215
|
+ $search_object = $this->getElementSearcher();
|
|
216
|
+ $search_form = $this->getSearchForm($search_object);
|
|
217
|
+ $add_form = $form;
|
|
218
|
+
|
|
219
|
+ return $this->render('MuzichHomeBundle:Home:index.html.twig', array(
|
|
220
|
+ 'search_tags_id' => $search_object->getTags(),
|
|
221
|
+ 'user' => $this->getUser(),
|
|
222
|
+ 'add_form' => $add_form->createView(),
|
|
223
|
+ 'add_form_name' => $add_form->getName(),
|
|
224
|
+ 'search_form' => $search_form->createView(),
|
|
225
|
+ 'search_form_name' => $search_form->getName(),
|
|
226
|
+ 'elements' => $search_object->getElements($this->getDoctrine(), $this->getUserId()),
|
|
227
|
+ 'more_count' => $this->container->getParameter('search_default_count')*2
|
|
228
|
+ ));
|
|
229
|
+ }
|
|
230
|
+ else
|
|
231
|
+ {
|
|
232
|
+ $group = $this->findGroupWithSlug($group_slug);
|
|
233
|
+
|
|
234
|
+ $search_object = $this->createSearchObject(array(
|
|
235
|
+ 'group_id' => $group->getId()
|
|
236
|
+ ));
|
|
237
|
+
|
|
238
|
+ ($group->getOwner()->getId() == $this->getUserId()) ? $his = true : $his = false;
|
|
239
|
+ if ($his || $group->getOpen())
|
|
240
|
+ {
|
|
241
|
+ $add_form = $form;
|
|
242
|
+ }
|
|
243
|
+
|
|
244
|
+ return $this->render('MuzichHomeBundle:Show:showGroup.html.twig', array(
|
|
245
|
+ 'group' => $group,
|
|
246
|
+ 'his_group' => ($group->getOwner()->getId() == $this->getUserId()) ? true : false,
|
|
247
|
+ 'elements' => $search_object->getElements($this->getDoctrine(), $this->getUserId()),
|
|
248
|
+ 'following' => $this->getUser()->isFollowingGroupByQuery($this->getDoctrine(), $group->getId()),
|
|
249
|
+ 'user' => $this->getUser(),
|
|
250
|
+ 'add_form' => (isset($add_form)) ? $add_form->createView() : null,
|
|
251
|
+ 'add_form_name' => (isset($add_form)) ? $add_form->getName() : null,
|
|
252
|
+ 'more_count' => null,
|
|
253
|
+ 'more_route' => 'show_group_more'
|
|
254
|
+ ));
|
|
255
|
+ }
|
227
|
256
|
|
228
|
257
|
}
|
229
|
258
|
|