Skip to content

Commit c7426f0

Browse files
embARC website
1 parent ce5c283 commit c7426f0

28 files changed

Lines changed: 689 additions & 0 deletions

app/AppKernel.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ public function registerBundles()
5050
new MediaBinBundle\MediaBinBundle(),
5151
new MediaConchOnlineBundle\MediaConchOnlineBundle(),
5252
new LeaveSDBundle\LeaveSDBundle(),
53+
new embARCBundle\embARCBundle(),
5354
];
5455

5556
if (in_array($this->getEnvironment(), ['dev', 'test'], true)) {

app/Resources/translations/messages.en.xlf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,10 @@
138138
<source><![CDATA[menu.projects.leavesd]]></source>
139139
<target><![CDATA[LeaveSD]]></target>
140140
</trans-unit>
141+
<trans-unit id="menu.projects.embarc" approved="yes">
142+
<source><![CDATA[menu.projects.embarc]]></source>
143+
<target><![CDATA[embARC]]></target>
144+
</trans-unit>
141145
<trans-unit id="menu.supportUs" approved="yes">
142146
<source><![CDATA[menu.supportUs]]></source>
143147
<target><![CDATA[Support Us!]]></target>

app/config/config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ imports:
2323
- { resource: "@RAWcookedBundle/Resources/config/services.yml" }
2424
- { resource: "@DVRescueBundle/Resources/config/services.yml" }
2525
- { resource: "@LeaveSDBundle/Resources/config/services.yml" }
26+
- { resource: "@embARCBundle/Resources/config/services.yml" }
2627

2728
# Put parameters here that don't need to change on each machine where the app is deployed
2829
# https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration

app/config/routing.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,10 @@ leavesd:
7373
resource: "@LeaveSDBundle/Controller/"
7474
type: annotation
7575

76+
embarc:
77+
resource: "@embARCBundle/Controller/"
78+
type: annotation
79+
7680
support_us:
7781
resource: "@SupportUsBundle/Controller/"
7882
type: annotation

app/config/services.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ services:
4949
- { name: knp_menu.menu_builder, method: createRAWcookedMenu, alias: rc }
5050
- { name: knp_menu.menu_builder, method: createDVRescueMenu, alias: dvr }
5151
- { name: knp_menu.menu_builder, method: createLeaveSDMenu, alias: lsd }
52+
- { name: knp_menu.menu_builder, method: createembARCMenu, alias: embarc }
5253
- { name: knp_menu.menu_builder, method: createMediaConchMenu, alias: mc }
5354
- { name: knp_menu.menu_builder, method: createMediaConchOnlineMenu, alias: mco }
5455
public: true

src/AppBundle/Menu/MenuBuilder.php

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,26 @@ public function createLeaveSDMenu(array $options)
340340
return $menu;
341341
}
342342

343+
/**
344+
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
345+
*/
346+
public function createembARCMenu(array $options)
347+
{
348+
$menu = $this->factory->createItem('root');
349+
$menu->setChildrenAttribute('class', 'nav navbar-nav main-menu');
350+
351+
$menu = $this->mediaAreaMenu($menu);
352+
353+
$menu->addChild('menu.embarc', ['route' => 'embarc_home'])->setExtras(['dropdown' => true])->setCurrent(true);
354+
$menu['menu.embarc']->addChild('menu.embarc.about', ['route' => 'embarc_home']);
355+
$menu['menu.embarc']->addChild('menu.embarc.download', ['route' => 'embarc_download']);
356+
357+
$menu = $this->projectsMenu($menu);
358+
$menu = $this->supportUsMenu($menu);
359+
360+
return $menu;
361+
}
362+
343363
/**
344364
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
345365
*/
@@ -482,6 +502,7 @@ private function projectsMenu(ItemInterface $menu)
482502
$menu['menu.projects']->addChild('menu.projects.rawcooked', ['route' => 'rawcooked_home'])->setCurrent(false);
483503
$menu['menu.projects']->addChild('menu.projects.dvrescue', ['route' => 'dvrescue_home'])->setCurrent(false);
484504
$menu['menu.projects']->addChild('menu.projects.leavesd', ['route' => 'leavesd_home'])->setCurrent(false);
505+
$menu['menu.projects']->addChild('menu.projects.embarc', ['route' => 'embarc_home'])->setCurrent(false);
485506

486507
return $menu;
487508
}

src/AppBundle/Resources/views/footer.html.twig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
<li><a href="{{ path('rawcooked_home') }}">RAWcooked</a></li>
3434
<li><a href="{{ path('dvrescue_home') }}">DVRescue</a></li>
3535
<li><a href="{{ path('leavesd_home') }}">LeaveSD</a></li>
36+
<li><a href="{{ path('embarc_home') }}">embARC</a></li>
3637
</ul>
3738
</div>
3839
<div class="col-sm-12 col-md-4">
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
<?php
2+
3+
namespace embARCBundle\Controller;
4+
5+
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
6+
use Symfony\Component\HttpFoundation\Request;
7+
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
8+
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
9+
10+
class DefaultController extends Controller
11+
{
12+
/**
13+
* @Route("/embARC", name="embarc_home")
14+
* @Template()
15+
*/
16+
public function indexAction(Request $request)
17+
{
18+
// Download infos
19+
$downloadInfo = $this->get('embarc.download_info');
20+
$downloadInfo->setUserAgent($request->headers->get('User-Agent'));
21+
$downloadInfo->parse();
22+
23+
return array(
24+
'downloadInfo' => $downloadInfo,
25+
);
26+
}
27+
28+
/**
29+
* @Route("/embARC/License", name="embarc_license")
30+
* @Template()
31+
*/
32+
public function licenseAction()
33+
{
34+
return array();
35+
}
36+
37+
/**
38+
* @Route("/embARC/man", name="embarc_man")
39+
* @Template()
40+
*/
41+
public function manAction()
42+
{
43+
return array();
44+
}
45+
}
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
<?php
2+
3+
namespace embARCBundle\Controller;
4+
5+
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
6+
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
7+
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
8+
9+
/**
10+
* @SuppressWarnings(PHPMD.TooManyPublicMethods)
11+
*/
12+
class DownloadController extends Controller
13+
{
14+
/**
15+
* @Route("/embARC/Download", name="embarc_download")
16+
* @Template()
17+
*/
18+
public function indexAction()
19+
{
20+
return array();
21+
}
22+
23+
/**
24+
* @Route(
25+
* "/embARC/Download/Windows",
26+
* name="embarc_download_windows"
27+
* )
28+
* @Template()
29+
*/
30+
public function windowsAction()
31+
{
32+
return array();
33+
}
34+
35+
/**
36+
* @Route(
37+
* "/{_locale}/MediaInfo/Download/macOS",
38+
* name="embarc_download_mac",
39+
* requirements={"_locale": "%app.locales%"
40+
* }
41+
* )
42+
* @Template()
43+
*/
44+
public function macAction()
45+
{
46+
return array();
47+
}
48+
49+
/**
50+
* @Route(
51+
* "/{_locale}/MediaInfo/Download/Linux",
52+
* name="embarc_download_linux",
53+
* requirements={"_locale": "%app.locales%"
54+
* }
55+
* )
56+
* @Template()
57+
*/
58+
public function linuxAction()
59+
{
60+
return array();
61+
}
62+
63+
/**
64+
* @Route(
65+
* "/embARC/Download/Source",
66+
* name="embarc_download_source"
67+
* )
68+
* @Template()
69+
*/
70+
public function sourceAction()
71+
{
72+
return array();
73+
}
74+
}
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<?php
2+
3+
namespace embARCBundle\Lib\DownloadInfo;
4+
5+
use AppBundle\Lib\DownloadInfo\AbstractDownloadInfo;
6+
use DeviceDetector\Parser\OperatingSystem as OSParser;
7+
8+
class embARCDownloadInfo extends AbstractDownloadInfo
9+
{
10+
protected $supportedOS = array(
11+
'Windows' => array('name' => 'Windows', 'route' => 'embarc_download_windows', 'installer' => true),
12+
'Mac' => array('name' => 'macOS', 'route' => 'embarc_download_mac', 'installer' => true),
13+
'Linux' => array('name' => 'Linux', 'route' => 'embarc_download_linux', 'installer' => false),
14+
);
15+
protected $userAgent;
16+
protected $downloadInfo;
17+
18+
protected function detectOS()
19+
{
20+
$osParser = new OSParser();
21+
$osParser->setUserAgent($this->userAgent);
22+
$detectedOS = $osParser->parse();
23+
24+
if ($detectedOS && array_key_exists($detectedOS['name'], $this->supportedOS)) {
25+
return $this->supportedOS[$detectedOS['name']];
26+
}
27+
28+
return array('name' => false, 'route' => 'embarc_download');
29+
}
30+
31+
public function parse()
32+
{
33+
$this->downloadInfo = $this->detectOS();
34+
$this->downloadInfo['version'] = '1.4.20251129';
35+
$this->downloadInfo['date'] = '2025-11-29';
36+
$this->downloadInfo['versionPath'] = '20251129';
37+
}
38+
39+
public function getVersionPath()
40+
{
41+
return $this->downloadInfo['versionPath'];
42+
}
43+
}

0 commit comments

Comments
 (0)