diff --git a/controller/Controller.class.php b/controller/Controller.class.php
index b91296e3..c763d3ac 100644
--- a/controller/Controller.class.php
+++ b/controller/Controller.class.php
@@ -11,7 +11,9 @@ class Controller
{
try
{
- list($viewTemplate, $viewParameters) = static::execute($uri);
+ $viewAndParams = static::execute($uri);
+ $viewTemplate = $viewAndParams[0];
+ $viewParameters = isset($viewAndParams[1]) ? $viewAndParams[1] : [];
if ($viewTemplate === null)
{
@@ -42,7 +44,12 @@ class Controller
case '/fund':
return CreditActions::executeFund();
case '/get':
- return ContentActions::executeGet();
+ case '/windows':
+ case '/ios':
+ case '/android':
+ case '/linux':
+ case '/osx':
+ return DownloadActions::executeGet();
case '/postcommit':
return OpsActions::executePostCommit();
case '/log-upload':
diff --git a/controller/action/ContentActions.class.php b/controller/action/ContentActions.class.php
index 424f0da6..d80cdd0e 100644
--- a/controller/action/ContentActions.class.php
+++ b/controller/action/ContentActions.class.php
@@ -14,52 +14,4 @@ class ContentActions extends Actions
'totalPeople' => CreditApi::getTotalPeople()
]];
}
-
- public static function executeGet()
- {
- $hasEmail = isset($_GET['email']) && $_GET['email'];
- if ($hasEmail && Session::get(Session::KEY_LIST_SUB_ERROR))
- {
- Controller::redirect('/get');
- }
- return ['page/get', [
- 'isSubscribed' => $hasEmail || in_array(Mailchimp::LIST_GENERAL_ID, Session::get(Session::KEY_MAILCHIMP_LIST_IDS, []))
- ]];
- }
-//
-// protected static function validateDownloadAccess()
-// {
-// $seshionKey = 'has-download-access';
-// if (Session::get($seshionKey))
-// {
-// return true;
-// }
-//
-// if ($_SERVER['REQUEST_METHOD'] === 'POST')
-// {
-// $accessCodes = include ROOT_DIR . '/data/secret/access_list.php';
-// $today = date('Y-m-d H:i:s');
-// foreach($accessCodes as $code => $date)
-// {
-// if ($_POST['invite'] == $code && $today <= $date)
-// {
-// Session::set($seshionKey, true);
-// Controller::redirect('/get', 302);
-// }
-// }
-//
-// if ($_POST['invite'])
-// {
-// Session::set('invite_error', 'Please provide a valid invite code.');
-// }
-// else
-// {
-// Session::set('invite_error', 'Please provide an invite code.');
-// }
-//
-// Controller::redirect('/get', 401);
-// }
-//
-// return false;
-// }
}
diff --git a/controller/action/CreditActions.class.php b/controller/action/CreditActions.class.php
index 94692977..b9aed065 100644
--- a/controller/action/CreditActions.class.php
+++ b/controller/action/CreditActions.class.php
@@ -11,7 +11,7 @@ class CreditActions extends Actions
{
$fundStartTime = strtotime('2015-11-15');
$daysActive = floor((time() - $fundStartTime) / (60*60*24));
- return ['page/fund', [
+ return ['fund/fund', [
'creditsPerDollar' => CreditApi::getCreditsPerDollar($daysActive),
'creditsPerDollarTomorrow' => CreditApi::getCreditsPerDollar($daysActive + 1),
]];
diff --git a/controller/action/DownloadActions.class.php b/controller/action/DownloadActions.class.php
new file mode 100644
index 00000000..2cc2432f
--- /dev/null
+++ b/controller/action/DownloadActions.class.php
@@ -0,0 +1,107 @@
+ ['/linux', 'Linux', 'icon-linux', '_linux'],
+ static::OS_ANDROID => ['/android', 'Android', 'icon-android', '_android'],
+ static::OS_OSX => ['/osx', 'OS X', 'icon-apple', '_osx'],
+ static::OS_WINDOWS => ['/windows', 'Windows', 'icon-windows', '_windows'],
+ static::OS_IOS => ['/ios', 'iOS', 'icon-ios', '_ios']
+ ];
+ }
+
+ public static function executeGet()
+ {
+ $osChoices = static::getOses();
+ $os = static::guessOs();
+ if (isset($osChoices[$os]))
+ {
+ list($uri, $osTitle, $osIcon, $partial) = $osChoices[$os];
+ return ['download/get2', [
+ 'os' => $os,
+ 'osTitle' => $osTitle,
+ 'osIcon' => $osIcon,
+ 'downloadHtml' => View::exists('download/' . $partial) ?
+ View::render('download/' . $partial) :
+ false
+ ]];
+ }
+ return ['download/get', [
+ 'isSubscribed' => in_array(Mailchimp::LIST_GENERAL_ID, Session::get(Session::KEY_MAILCHIMP_LIST_IDS, []))
+ ]];
+ }
+
+ public static function prepareListPartial(array $vars)
+ {
+ return $vars + ['osChoices' => isset($vars['excludeOs']) ?
+ array_diff_key(static::getOses(), [$vars['excludeOs'] => null]) :
+ static::getOses()
+ ];
+ }
+
+ //implement me!
+ protected static function guessOs()
+ {
+ $uri = strtok($_SERVER['REQUEST_URI'], '?');
+ foreach(static::getOses() as $os => $osChoice)
+ {
+ if ($osChoice[0] == $uri)
+ {
+ return $os;
+ }
+ }
+// $oses = ['linux', 'windows', 'osx', 'ios', 'android'];
+ $oses = ['linux', 'windows', 'osx'];
+ return $oses[rand(0, count($oses) - 1)];
+ }
+
+// protected static function validateDownloadAccess()
+// {
+// $seshionKey = 'has-get-access';
+// if (Session::get($seshionKey))
+// {
+// return true;
+// }
+//
+// if ($_SERVER['REQUEST_METHOD'] === 'POST')
+// {
+// $accessCodes = include ROOT_DIR . '/data/secret/access_list.php';
+// $today = date('Y-m-d H:i:s');
+// foreach($accessCodes as $code => $date)
+// {
+// if ($_POST['invite'] == $code && $today <= $date)
+// {
+// Session::set($seshionKey, true);
+// Controller::redirect('/get', 302);
+// }
+// }
+//
+// if ($_POST['invite'])
+// {
+// Session::set('invite_error', 'Please provide a valid invite code.');
+// }
+// else
+// {
+// Session::set('invite_error', 'Please provide an invite code.');
+// }
+//
+// Controller::redirect('/get', 401);
+// }
+//
+// return false;
+// }
+}
diff --git a/controller/action/MailActions.class.php b/controller/action/MailActions.class.php
index a56e0415..9fb72235 100644
--- a/controller/action/MailActions.class.php
+++ b/controller/action/MailActions.class.php
@@ -21,11 +21,11 @@ class MailActions extends Actions
$email = $_POST['email'];
if (!$email|| !filter_var($email, FILTER_VALIDATE_EMAIL))
{
- Session::set('list_error', $email ? __('Please provide a valid email address.') : __('Please provide an email address.'));
+ Session::set(Session::KEY_LIST_SUB_ERROR, $email ? __('Please provide a valid email address.') : __('Please provide an email address.'));
}
elseif (!$_POST['listId'])
{
- Session::set('list_error', __('List not provided.'));
+ Session::set(Session::KEY_LIST_SUB_ERROR, __('List not provided.'));
}
else
{
@@ -42,7 +42,7 @@ class MailActions extends Actions
else
{
$error = $mcApi->errorMessage ?: __('Something went wrong adding you to the list.');
- Session::set('list_error', $error);
+ Session::set(Session::KEY_LIST_SUB_ERROR, $error);
}
}
@@ -56,8 +56,8 @@ class MailActions extends Actions
if (Session::get(Session::KEY_LIST_SUB_SIGNATURE) == $vars['listSig'])
{
- $vars['error'] = Session::get('list_error');
- Session::unsetKey('list_error');
+ $vars['error'] = Session::get(Session::KEY_LIST_SUB_ERROR);
+ Session::unsetKey(Session::KEY_LIST_SUB_ERROR);
$vars['success'] = Session::get(Session::KEY_LIST_SUB_SUCCESS) ? __('Great success! Welcome to LBRY.') : false;
$vars['fbEvent'] = Session::get(Session::KEY_LIST_SUB_FB_EVENT) ?: 'Lead';
@@ -72,5 +72,4 @@ class MailActions extends Actions
return $vars;
}
-
}
\ No newline at end of file
diff --git a/lib/exception/ErrorException.class.php b/lib/exception/ErrorException.class.php
deleted file mode 100644
index 81e2d9d1..00000000
--- a/lib/exception/ErrorException.class.php
+++ /dev/null
@@ -1,11 +0,0 @@
-
+ This is a pre-release, beta version of LBRY.
+ Something something something.
+
\ No newline at end of file
diff --git a/view/template/download/_developers.php b/view/template/download/_developers.php
new file mode 100644
index 00000000..cf52ac03
--- /dev/null
+++ b/view/template/download/_developers.php
@@ -0,0 +1,3 @@
+
+
Developers
+
\ No newline at end of file
diff --git a/view/template/download/_linux.php b/view/template/download/_linux.php
new file mode 100644
index 00000000..1b2eb359
--- /dev/null
+++ b/view/template/download/_linux.php
@@ -0,0 +1,17 @@
+
\ No newline at end of file
diff --git a/view/template/download/_osx.php b/view/template/download/_osx.php
new file mode 100644
index 00000000..dcb5ae57
--- /dev/null
+++ b/view/template/download/_osx.php
@@ -0,0 +1,6 @@
+
*/ ?>
\ No newline at end of file
diff --git a/view/template/download/_unavailable.php b/view/template/download/_unavailable.php
new file mode 100644
index 00000000..96b2c861
--- /dev/null
+++ b/view/template/download/_unavailable.php
@@ -0,0 +1 @@
+not avail
\ No newline at end of file
diff --git a/view/template/get/feedback-prompt.php b/view/template/download/feedback-prompt.php
similarity index 100%
rename from view/template/get/feedback-prompt.php
rename to view/template/download/feedback-prompt.php
diff --git a/view/template/page/get.php b/view/template/download/get.php
similarity index 100%
rename from view/template/page/get.php
rename to view/template/download/get.php
diff --git a/view/template/download/get2.php b/view/template/download/get2.php
new file mode 100644
index 00000000..aea522b0
--- /dev/null
+++ b/view/template/download/get2.php
@@ -0,0 +1,28 @@
+ $osTitle])) ?>
+
+ false]) ?>
+
+
+
+
+
LBRY for
+
+
+
+
+
+
+
+
+
+
+
+
+ $os
+ ]) ?>
+
+
+
+
+
diff --git a/view/template/page/fund.php b/view/template/fund/fund.php
similarity index 100%
rename from view/template/page/fund.php
rename to view/template/fund/fund.php
diff --git a/view/template/get/alphaNotice.php b/view/template/get/alphaNotice.php
deleted file mode 100644
index 7cbe6b82..00000000
--- a/view/template/get/alphaNotice.php
+++ /dev/null
@@ -1,4 +0,0 @@
-
- This is a pre-release, alpha version of LBRY. It is only designed to show what LBRY makes possible.
- Future releases will involve a full network reboot.
-
\ No newline at end of file
diff --git a/view/template/get/getSharedApp.php b/view/template/get/getSharedApp.php
deleted file mode 100644
index 1d93b323..00000000
--- a/view/template/get/getSharedApp.php
+++ /dev/null
@@ -1,31 +0,0 @@
-
- false]) ?>
-
-
-
-
-
-
-
-
-
-
-
Test and Earn
-
-
Test Your Install
-
-
Double click the app (LBRY will open in your browser)
-
Search and stream wonderfullife
-
Continue to play as you desire
-
-
Feedback
-
- In addition to , your feedback will be personally read by the developers and help signal
- interest in LBRY to investors.
-