mirror of
https://github.com/LBRYFoundation/lbry.com.git
synced 2025-08-23 09:37:26 +00:00
updated and fix files using php-cs-fixer
This commit is contained in:
parent
f8b413326c
commit
de10165d5e
34 changed files with 394 additions and 395 deletions
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
class Controller
|
class Controller
|
||||||
{
|
{
|
||||||
const CACHE_CLEAR_PATH = '/clear-cache';
|
public const CACHE_CLEAR_PATH = '/clear-cache';
|
||||||
|
|
||||||
protected static $queuedFunctions = [];
|
protected static $queuedFunctions = [];
|
||||||
|
|
||||||
|
@ -113,7 +113,7 @@ class Controller
|
||||||
$router->get(['/get', 'get'], 'DownloadActions::executeGet');
|
$router->get(['/get', 'get'], 'DownloadActions::executeGet');
|
||||||
|
|
||||||
foreach (array_keys(OS::getAll()) as $os) {
|
foreach (array_keys(OS::getAll()) as $os) {
|
||||||
$router->get(['/' . $os, 'get-' . $os], 'DownloadActions::executeGet');
|
$router->get(['/' . $os, 'get-' . $os], 'DownloadActions::executeGet');
|
||||||
}
|
}
|
||||||
|
|
||||||
$router->get('/roadmap', 'ContentActions::executeRoadmap');
|
$router->get('/roadmap', 'ContentActions::executeRoadmap');
|
||||||
|
|
|
@ -2,10 +2,10 @@
|
||||||
|
|
||||||
class Request
|
class Request
|
||||||
{
|
{
|
||||||
const GET = 'GET';
|
public const GET = 'GET';
|
||||||
const POST = 'POST';
|
public const POST = 'POST';
|
||||||
const HEAD = 'HEAD';
|
public const HEAD = 'HEAD';
|
||||||
const OPTIONS = 'OPTIONS';
|
public const OPTIONS = 'OPTIONS';
|
||||||
|
|
||||||
protected static $method;
|
protected static $method;
|
||||||
|
|
||||||
|
|
|
@ -2,10 +2,10 @@
|
||||||
|
|
||||||
class Session
|
class Session
|
||||||
{
|
{
|
||||||
const KEY_LIST_SUB_ERROR = 'list_error',
|
public const KEY_LIST_SUB_ERROR = 'list_error',
|
||||||
KEY_USER_CULTURE = 'user_culture';
|
KEY_USER_CULTURE = 'user_culture';
|
||||||
|
|
||||||
const NAMESPACE_DEFAULT = 'default',
|
public const NAMESPACE_DEFAULT = 'default',
|
||||||
NAMESPACE_FLASH = 'flash',
|
NAMESPACE_FLASH = 'flash',
|
||||||
NAMESPACE_FLASH_REMOVE = 'flash_remove',
|
NAMESPACE_FLASH_REMOVE = 'flash_remove',
|
||||||
USER_ID = 'user_id',
|
USER_ID = 'user_id',
|
||||||
|
@ -26,7 +26,7 @@ class Session
|
||||||
header_remove('expires');
|
header_remove('expires');
|
||||||
|
|
||||||
if (!static::get('secure_and_httponly_set')) {
|
if (!static::get('secure_and_httponly_set')) {
|
||||||
session_regenerate_id(); // ensure that old cookies get new settings
|
session_regenerate_id(); // ensure that old cookies get new settings
|
||||||
}
|
}
|
||||||
static::set('secure_and_httponly_set', true);
|
static::set('secure_and_httponly_set', true);
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
class AcquisitionActions extends Actions
|
class AcquisitionActions extends Actions
|
||||||
{
|
{
|
||||||
public static function executeYouTube()
|
public static function executeYouTube()
|
||||||
{
|
{
|
||||||
return ['acquisition/youtube'];
|
return ['acquisition/youtube'];
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
class ContentActions extends Actions
|
class ContentActions extends Actions
|
||||||
{
|
{
|
||||||
const
|
public const
|
||||||
SLUG_RSS = 'rss.xml',
|
SLUG_RSS = 'rss.xml',
|
||||||
SLUG_NEWS = 'news',
|
SLUG_NEWS = 'news',
|
||||||
SLUG_FAQ = 'faq',
|
SLUG_FAQ = 'faq',
|
||||||
|
@ -46,11 +46,11 @@ class ContentActions extends Actions
|
||||||
|
|
||||||
if (!$slug || $slug == static::SLUG_RSS) {
|
if (!$slug || $slug == static::SLUG_RSS) {
|
||||||
$posts = array_filter(
|
$posts = array_filter(
|
||||||
Post::find(static::VIEW_FOLDER_NEWS, Post::SORT_DATE_DESC),
|
Post::find(static::VIEW_FOLDER_NEWS, Post::SORT_DATE_DESC),
|
||||||
function (Post $post) {
|
function (Post $post) {
|
||||||
return !$post->getDate() || $post->getDate()->format('U') <= date('U');
|
return !$post->getDate() || $post->getDate()->format('U') <= date('U');
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
if ($slug == static::SLUG_RSS) {
|
if ($slug == static::SLUG_RSS) {
|
||||||
Response::setHeader(Response::HEADER_CONTENT_TYPE, 'text/xml; charset=utf-8');
|
Response::setHeader(Response::HEADER_CONTENT_TYPE, 'text/xml; charset=utf-8');
|
||||||
|
@ -267,11 +267,11 @@ class ContentActions extends Actions
|
||||||
$filter_post = [];
|
$filter_post = [];
|
||||||
|
|
||||||
$posts = array_filter(
|
$posts = array_filter(
|
||||||
Post::find(static::VIEW_FOLDER_NEWS, Post::SORT_DATE_DESC),
|
Post::find(static::VIEW_FOLDER_NEWS, Post::SORT_DATE_DESC),
|
||||||
function (Post $post) use ($category) {
|
function (Post $post) use ($category) {
|
||||||
return (($post->getCategory() === $category) && (!$post->getDate() || $post->getDate()->format('U') <= date('U')));
|
return (($post->getCategory() === $category) && (!$post->getDate() || $post->getDate()->format('U') <= date('U')));
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -287,8 +287,8 @@ class ContentActions extends Actions
|
||||||
{
|
{
|
||||||
$jobs =
|
$jobs =
|
||||||
array_filter(
|
array_filter(
|
||||||
array_map('View::parseMarkdown', glob(static::VIEW_FOLDER_JOBS . '/*')),
|
array_map('View::parseMarkdown', glob(static::VIEW_FOLDER_JOBS . '/*')),
|
||||||
function ($job) {
|
function ($job) {
|
||||||
return $job[0]['status'] !== 'closed';
|
return $job[0]['status'] !== 'closed';
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
|
@ -3,8 +3,8 @@
|
||||||
class DownloadActions extends Actions
|
class DownloadActions extends Actions
|
||||||
{
|
{
|
||||||
//bad, fix me!
|
//bad, fix me!
|
||||||
const ANDROID_STORE_URL = 'https://play.google.com/store/apps/details?id=io.lbry.browser';
|
public const ANDROID_STORE_URL = 'https://play.google.com/store/apps/details?id=io.lbry.browser';
|
||||||
const IOS_STORE_URL = 'https://apps.apple.com/us/app/odysee/id1539444143';
|
public const IOS_STORE_URL = 'https://apps.apple.com/us/app/odysee/id1539444143';
|
||||||
|
|
||||||
public static function executeDownloadPrereleaseAsset(string $repo, string $ext)
|
public static function executeDownloadPrereleaseAsset(string $repo, string $ext)
|
||||||
{
|
{
|
||||||
|
@ -19,14 +19,14 @@ class DownloadActions extends Actions
|
||||||
public static function executeDownloadSnapshot(string $type)
|
public static function executeDownloadSnapshot(string $type)
|
||||||
{
|
{
|
||||||
if (!in_array($type, ['blockchain', 'wallet'])) {
|
if (!in_array($type, ['blockchain', 'wallet'])) {
|
||||||
return ['page/404'];
|
return ['page/404'];
|
||||||
}
|
}
|
||||||
|
|
||||||
$bucketName = "snapshots.lbry.com";
|
$bucketName = "snapshots.lbry.com";
|
||||||
$bucket = S3::getBucket($bucketName, "$type/");
|
$bucket = S3::getBucket($bucketName, "$type/");
|
||||||
|
|
||||||
if (!count($bucket)) {
|
if (!count($bucket)) {
|
||||||
return ['page/404'];
|
return ['page/404'];
|
||||||
}
|
}
|
||||||
|
|
||||||
krsort($bucket);
|
krsort($bucket);
|
||||||
|
@ -38,9 +38,9 @@ class DownloadActions extends Actions
|
||||||
*/
|
*/
|
||||||
public static function getGetTemplateParams($os)
|
public static function getGetTemplateParams($os)
|
||||||
{
|
{
|
||||||
$osChoices = OS::getAll();
|
$osChoices = OS::getAll();
|
||||||
list($uri, $osTitle, $osIcon, $title) = $osChoices[$os];
|
list($uri, $osTitle, $osIcon, $title) = $osChoices[$os];
|
||||||
$params = [
|
$params = [
|
||||||
'preferredExt' => $os === Os::OS_LINUX ? 'AppImage' : '',
|
'preferredExt' => $os === Os::OS_LINUX ? 'AppImage' : '',
|
||||||
'title' => $title,
|
'title' => $title,
|
||||||
'osTitle' => $osTitle,
|
'osTitle' => $osTitle,
|
||||||
|
@ -49,23 +49,18 @@ class DownloadActions extends Actions
|
||||||
'os' => $os
|
'os' => $os
|
||||||
];
|
];
|
||||||
|
|
||||||
if ($os === OS::OS_ANDROID)
|
if ($os === OS::OS_ANDROID) {
|
||||||
{
|
$params['downloadUrl'] = static::ANDROID_STORE_URL;
|
||||||
$params['downloadUrl'] = static::ANDROID_STORE_URL;
|
$params['osScreenshotSrc'] = 'https://spee.ch/@lbry:3f/android-08-homepage.gif';
|
||||||
$params['osScreenshotSrc'] = 'https://spee.ch/@lbry:3f/android-08-homepage.gif';
|
} elseif ($os === OS::OS_IOS) {
|
||||||
}
|
$params['downloadUrl'] = static::IOS_STORE_URL;
|
||||||
else if ($os === OS::OS_IOS)
|
$params['osScreenshotSrc'] = 'https://spee.ch/odyseeiosimage.png';
|
||||||
{
|
} else {
|
||||||
$params['downloadUrl'] = static::IOS_STORE_URL;
|
$asset = Github::getRepoAsset(GitHub::REPO_LBRY_DESKTOP, $os, $params['preferredExt']);
|
||||||
$params['osScreenshotSrc'] = 'https://spee.ch/odyseeiosimage.png';
|
$params['downloadUrl'] = $asset ? $asset['browser_download_url'] : null;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
$asset = Github::getRepoAsset(GitHub::REPO_LBRY_DESKTOP, $os, $params['preferredExt']);
|
|
||||||
$params['downloadUrl'] = $asset ? $asset['browser_download_url'] : null;
|
|
||||||
}
|
|
||||||
|
|
||||||
return $params;
|
return $params;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function executeGet()
|
public static function executeGet()
|
||||||
|
@ -143,19 +138,19 @@ class DownloadActions extends Actions
|
||||||
list($uri, $osTitle, $osIcon, $oldButtonLabel, $analyticsLabel) = $osChoices[$os];
|
list($uri, $osTitle, $osIcon, $oldButtonLabel, $analyticsLabel) = $osChoices[$os];
|
||||||
|
|
||||||
if ($os === OS::OS_ANDROID) {
|
if ($os === OS::OS_ANDROID) {
|
||||||
$asset = ['browser_download_url' => static::ANDROID_STORE_URL];
|
$asset = ['browser_download_url' => static::ANDROID_STORE_URL];
|
||||||
} else if ($os === OS::OS_IOS) {
|
} elseif ($os === OS::OS_IOS) {
|
||||||
$asset = ['browser_download_url' => static::IOS_STORE_URL];
|
$asset = ['browser_download_url' => static::IOS_STORE_URL];
|
||||||
} else {
|
} else {
|
||||||
$asset = Github::getRepoAsset(GitHub::REPO_LBRY_DESKTOP, $os, $vars['preferredExt'] ?? '');
|
$asset = Github::getRepoAsset(GitHub::REPO_LBRY_DESKTOP, $os, $vars['preferredExt'] ?? '');
|
||||||
}
|
}
|
||||||
$buttonLabel = __('Download for %os%', ['%os%' => $osTitle]);
|
$buttonLabel = __('Download for %os%', ['%os%' => $osTitle]);
|
||||||
|
|
||||||
if (isset($vars['preferredExt']) && $vars['preferredExt']) {
|
if (isset($vars['preferredExt']) && $vars['preferredExt']) {
|
||||||
$buttonLabel = __('Download .%ext%', ['%ext%' => $vars['preferredExt']]);
|
$buttonLabel = __('Download .%ext%', ['%ext%' => $vars['preferredExt']]);
|
||||||
}
|
}
|
||||||
|
|
||||||
$vars += [
|
$vars += [
|
||||||
'analyticsLabel' => $analyticsLabel,
|
'analyticsLabel' => $analyticsLabel,
|
||||||
'buttonLabel' => $buttonLabel,
|
'buttonLabel' => $buttonLabel,
|
||||||
'isDownload' => true,
|
'isDownload' => true,
|
||||||
|
@ -169,8 +164,8 @@ class DownloadActions extends Actions
|
||||||
|
|
||||||
|
|
||||||
if ($os === OS::OS_LINUX && !isset($vars['preferredExt'])) {
|
if ($os === OS::OS_LINUX && !isset($vars['preferredExt'])) {
|
||||||
$vars['isDownload'] = false;
|
$vars['isDownload'] = false;
|
||||||
$vars['downloadUrl'] = '/linux';
|
$vars['downloadUrl'] = '/linux';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -178,27 +173,27 @@ class DownloadActions extends Actions
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static function prepareMetaPartial(array $vars)
|
public static function prepareMetaPartial(array $vars)
|
||||||
{
|
{
|
||||||
$osChoices = OS::getAll();
|
$osChoices = OS::getAll();
|
||||||
|
|
||||||
$os = static::guessOS();
|
$os = static::guessOS();
|
||||||
|
|
||||||
if ($os && isset($osChoices[$os])) {
|
if ($os && isset($osChoices[$os])) {
|
||||||
list($uri, $osTitle, $osIcon, $buttonLabel, $analyticsLabel) = $osChoices[$os];
|
list($uri, $osTitle, $osIcon, $buttonLabel, $analyticsLabel) = $osChoices[$os];
|
||||||
|
|
||||||
if ($os === OS::OS_ANDROID) {
|
if ($os === OS::OS_ANDROID) {
|
||||||
$asset = ['browser_download_url' => static::ANDROID_STORE_URL, 'size' => 0];
|
$asset = ['browser_download_url' => static::ANDROID_STORE_URL, 'size' => 0];
|
||||||
$release = [];
|
$release = [];
|
||||||
} else if ($os === OS::OS_IOS) {
|
} elseif ($os === OS::OS_IOS) {
|
||||||
$asset = ['browser_download_url' => static::IOS_STORE_URL, 'size' => 0];
|
$asset = ['browser_download_url' => static::IOS_STORE_URL, 'size' => 0];
|
||||||
$release = [];
|
$release = [];
|
||||||
} else {
|
} else {
|
||||||
$release = Github::getRepoRelease(GitHub::REPO_LBRY_DESKTOP, false);
|
$release = Github::getRepoRelease(GitHub::REPO_LBRY_DESKTOP, false);
|
||||||
$asset = Github::getRepoAsset(GitHub::REPO_LBRY_DESKTOP, $os);
|
$asset = Github::getRepoAsset(GitHub::REPO_LBRY_DESKTOP, $os);
|
||||||
}
|
}
|
||||||
|
|
||||||
$vars += [
|
$vars += [
|
||||||
'os' => $os,
|
'os' => $os,
|
||||||
'osTitle' => $osTitle,
|
'osTitle' => $osTitle,
|
||||||
'osIcon' => $osIcon,
|
'osIcon' => $osIcon,
|
||||||
|
@ -208,8 +203,8 @@ class DownloadActions extends Actions
|
||||||
'version' => $release ? $release['name'] : null,
|
'version' => $release ? $release['name'] : null,
|
||||||
'isAuto' => Request::getParam('auto'),
|
'isAuto' => Request::getParam('auto'),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
return $vars;
|
return $vars;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,9 +16,9 @@ class MailActions extends Actions
|
||||||
$email = Request::getPostParam('email');
|
$email = Request::getPostParam('email');
|
||||||
if (!$email || !filter_var($email, FILTER_VALIDATE_EMAIL)) {
|
if (!$email || !filter_var($email, FILTER_VALIDATE_EMAIL)) {
|
||||||
Session::set(
|
Session::set(
|
||||||
Session::KEY_LIST_SUB_ERROR,
|
Session::KEY_LIST_SUB_ERROR,
|
||||||
$email ? __('Please provide a valid email address.') : __('Please provide an email address.')
|
$email ? __('Please provide a valid email address.') : __('Please provide an email address.')
|
||||||
);
|
);
|
||||||
|
|
||||||
return Controller::redirect(Request::getRelativeUri());
|
return Controller::redirect(Request::getRelativeUri());
|
||||||
}
|
}
|
||||||
|
@ -80,17 +80,17 @@ class MailActions extends Actions
|
||||||
|
|
||||||
public static function prepareSettingsFormPartial(array $vars)
|
public static function prepareSettingsFormPartial(array $vars)
|
||||||
{
|
{
|
||||||
$tags = LBRY::listTags($vars['token']);
|
$tags = LBRY::listTags($vars['token']);
|
||||||
$tagMetadata = [];
|
$tagMetadata = [];
|
||||||
|
|
||||||
foreach($tags as $tag) {
|
foreach ($tags as $tag) {
|
||||||
if ($tag['is_user_addable']) {
|
if ($tag['is_user_addable']) {
|
||||||
$tagMetadata[$tag['name']] = [
|
$tagMetadata[$tag['name']] = [
|
||||||
'label' => $tag['display_name'],
|
'label' => $tag['display_name'],
|
||||||
'description' => $tag['description']
|
'description' => $tag['description']
|
||||||
];
|
];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
return $vars + ['tagMetadata' => $tagMetadata];
|
||||||
return $vars + ['tagMetadata' => $tagMetadata];
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
|
|
||||||
class ReportActions extends Actions
|
class ReportActions extends Actions
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handles all routing requests without a claimId as parameter.
|
* Handles all routing requests without a claimId as parameter.
|
||||||
* E.g. /dmca
|
* E.g. /dmca
|
||||||
|
@ -10,8 +9,8 @@ class ReportActions extends Actions
|
||||||
* @return array
|
* @return array
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
public static function executeDmca() {
|
public static function executeDmca()
|
||||||
|
{
|
||||||
self::setResponseHeader();
|
self::setResponseHeader();
|
||||||
self::redirectIfPostRequest(false, '');
|
self::redirectIfPostRequest(false, '');
|
||||||
|
|
||||||
|
@ -35,8 +34,8 @@ class ReportActions extends Actions
|
||||||
* @return array
|
* @return array
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
public static function executeDmcaWithClaimId(string $claimId): array {
|
public static function executeDmcaWithClaimId(string $claimId): array
|
||||||
|
{
|
||||||
$claimId = htmlspecialchars($claimId);
|
$claimId = htmlspecialchars($claimId);
|
||||||
|
|
||||||
self::setResponseHeader();
|
self::setResponseHeader();
|
||||||
|
@ -63,7 +62,6 @@ class ReportActions extends Actions
|
||||||
*/
|
*/
|
||||||
private static function validateForm(array $values, array $errors)
|
private static function validateForm(array $values, array $errors)
|
||||||
{
|
{
|
||||||
|
|
||||||
foreach (['name', 'email', 'rightsholder', 'identifier'] as $field) {
|
foreach (['name', 'email', 'rightsholder', 'identifier'] as $field) {
|
||||||
$value = Request::getPostParam($field);
|
$value = Request::getPostParam($field);
|
||||||
|
|
||||||
|
@ -82,7 +80,6 @@ class ReportActions extends Actions
|
||||||
Session::setFlash('success', '<h3>Report Submitted</h3><p>We will respond shortly.</p><p>This ID for this report is <strong>' . $values['report_id'] . '</strong>. Please reference this ID when contacting us regarding this report.</p>');
|
Session::setFlash('success', '<h3>Report Submitted</h3><p>We will respond shortly.</p><p>This ID for this report is <strong>' . $values['report_id'] . '</strong>. Please reference this ID when contacting us regarding this report.</p>');
|
||||||
return Controller::redirect(Request::getRelativeUri(), 303);
|
return Controller::redirect(Request::getRelativeUri(), 303);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -101,8 +98,8 @@ class ReportActions extends Actions
|
||||||
*
|
*
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
private static function redirectIfPostRequest(bool $hasClaimId = false, string $claimId = '') {
|
private static function redirectIfPostRequest(bool $hasClaimId = false, string $claimId = '')
|
||||||
|
{
|
||||||
if ($hasClaimId && !empty($claimId)) {
|
if ($hasClaimId && !empty($claimId)) {
|
||||||
$returnValue = ['report/dmca', ['claimId' => $claimId]];
|
$returnValue = ['report/dmca', ['claimId' => $claimId]];
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -39,7 +39,7 @@ class i18nActions extends Actions
|
||||||
Response::setHeader(Response::HEADER_CROSS_ORIGIN, "*");
|
Response::setHeader(Response::HEADER_CROSS_ORIGIN, "*");
|
||||||
|
|
||||||
if ($usecache) {
|
if ($usecache) {
|
||||||
Response::enablePublicMutableCache(md5(json_encode($json)));
|
Response::enablePublicMutableCache(md5(json_encode($json)));
|
||||||
}
|
}
|
||||||
|
|
||||||
return View::renderJson($json);
|
return View::renderJson($json);
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -69,12 +69,12 @@ class Dispatcher
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (boolean)$routes[$httpMethod];
|
return (bool)$routes[$httpMethod];
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$handler = $this->dispatchVariableRoute($httpMethod, $uri);
|
$handler = $this->dispatchVariableRoute($httpMethod, $uri);
|
||||||
return (boolean)$handler;
|
return (bool)$handler;
|
||||||
} catch (HttpRouteNotFoundException | HttpMethodNotAllowedException $e) {
|
} catch (HttpRouteNotFoundException | HttpMethodNotAllowedException $e) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,7 @@ class HandlerResolver implements HandlerResolverInterface
|
||||||
public function resolve($handler)
|
public function resolve($handler)
|
||||||
{
|
{
|
||||||
if (is_array($handler) && is_string($handler[0])) {
|
if (is_array($handler) && is_string($handler[0])) {
|
||||||
$handler[0] = new $handler[0];
|
$handler[0] = new $handler[0]();
|
||||||
}
|
}
|
||||||
|
|
||||||
return $handler;
|
return $handler;
|
||||||
|
|
|
@ -7,19 +7,19 @@ class Route
|
||||||
/**
|
/**
|
||||||
* Constants for before and after filters
|
* Constants for before and after filters
|
||||||
*/
|
*/
|
||||||
const BEFORE = 'before';
|
public const BEFORE = 'before';
|
||||||
const AFTER = 'after';
|
public const AFTER = 'after';
|
||||||
const PREFIX = 'prefix';
|
public const PREFIX = 'prefix';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constants for common HTTP methods
|
* Constants for common HTTP methods
|
||||||
*/
|
*/
|
||||||
const ANY = 'ANY';
|
public const ANY = 'ANY';
|
||||||
const GET = 'GET';
|
public const GET = 'GET';
|
||||||
const HEAD = 'HEAD';
|
public const HEAD = 'HEAD';
|
||||||
const POST = 'POST';
|
public const POST = 'POST';
|
||||||
const PUT = 'PUT';
|
public const PUT = 'PUT';
|
||||||
const PATCH = 'PATCH';
|
public const PATCH = 'PATCH';
|
||||||
const DELETE = 'DELETE';
|
public const DELETE = 'DELETE';
|
||||||
const OPTIONS = 'OPTIONS';
|
public const OPTIONS = 'OPTIONS';
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,9 +4,9 @@ namespace Routing;
|
||||||
|
|
||||||
class RouteCollector
|
class RouteCollector
|
||||||
{
|
{
|
||||||
const DEFAULT_CONTROLLER_ROUTE = 'index';
|
public const DEFAULT_CONTROLLER_ROUTE = 'index';
|
||||||
|
|
||||||
const APPROX_CHUNK_SIZE = 10;
|
public const APPROX_CHUNK_SIZE = 10;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var RouteParser
|
* @var RouteParser
|
||||||
|
|
|
@ -9,7 +9,6 @@ namespace Routing;
|
||||||
*/
|
*/
|
||||||
class RouteParser
|
class RouteParser
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Search through the given route looking for dynamic portions.
|
* Search through the given route looking for dynamic portions.
|
||||||
*
|
*
|
||||||
|
@ -22,7 +21,7 @@ class RouteParser
|
||||||
*
|
*
|
||||||
* Finally we look for an optional '?' which is used to signify an optional route.
|
* Finally we look for an optional '?' which is used to signify an optional route.
|
||||||
*/
|
*/
|
||||||
const VARIABLE_REGEX =
|
public const VARIABLE_REGEX =
|
||||||
"~\{
|
"~\{
|
||||||
\s* ([a-zA-Z0-9_]*) \s*
|
\s* ([a-zA-Z0-9_]*) \s*
|
||||||
(?:
|
(?:
|
||||||
|
@ -33,7 +32,7 @@ class RouteParser
|
||||||
/**
|
/**
|
||||||
* The default parameter character restriction (One or more characters that is not a '/').
|
* The default parameter character restriction (One or more characters that is not a '/').
|
||||||
*/
|
*/
|
||||||
const DEFAULT_DISPATCH_REGEX = '[^/]+';
|
public const DEFAULT_DISPATCH_REGEX = '[^/]+';
|
||||||
|
|
||||||
private $parts;
|
private $parts;
|
||||||
|
|
||||||
|
|
10
lib/thirdparty/Github.class.php
vendored
10
lib/thirdparty/Github.class.php
vendored
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
class Github
|
class Github
|
||||||
{
|
{
|
||||||
const REPO_LBRY_DESKTOP = 'lbry-desktop';
|
public const REPO_LBRY_DESKTOP = 'lbry-desktop';
|
||||||
|
|
||||||
public static function isAssetForOs(array $asset, string $os)
|
public static function isAssetForOs(array $asset, string $os)
|
||||||
{
|
{
|
||||||
|
@ -102,10 +102,10 @@ class Github
|
||||||
}
|
}
|
||||||
|
|
||||||
return CurlWithCache::get(
|
return CurlWithCache::get(
|
||||||
'https://api.github.com' . $endpoint . '?' . http_build_query($params),
|
'https://api.github.com' . $endpoint . '?' . http_build_query($params),
|
||||||
[],
|
[],
|
||||||
['headers' => $headers, 'user_agent' => 'LBRY', 'json_response' => true, 'cache' => $cache === true ? $twoHoursInSeconds : $cache]
|
['headers' => $headers, 'user_agent' => 'LBRY', 'json_response' => true, 'cache' => $cache === true ? $twoHoursInSeconds : $cache]
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function listRoadmapItems($year, $cache = true)
|
public static function listRoadmapItems($year, $cache = true)
|
||||||
|
|
12
lib/thirdparty/LBRY.class.php
vendored
12
lib/thirdparty/LBRY.class.php
vendored
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
class LBRY
|
class LBRY
|
||||||
{
|
{
|
||||||
const DEFAULT_TIMEOUT = 10;
|
public const DEFAULT_TIMEOUT = 10;
|
||||||
|
|
||||||
public static function getApiUrl($endpoint)
|
public static function getApiUrl($endpoint)
|
||||||
{
|
{
|
||||||
|
@ -15,8 +15,8 @@ class LBRY
|
||||||
|
|
||||||
public static function listTags($authToken)
|
public static function listTags($authToken)
|
||||||
{
|
{
|
||||||
$response = Curl::get(static::getApiUrl('/tag/list'), ['auth_token' => $authToken], ['json_response' => true]);
|
$response = Curl::get(static::getApiUrl('/tag/list'), ['auth_token' => $authToken], ['json_response' => true]);
|
||||||
return $response['data'] ?? [];
|
return $response['data'] ?? [];
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function subscribe($email, $tag = null)
|
public static function subscribe($email, $tag = null)
|
||||||
|
@ -31,9 +31,9 @@ class LBRY
|
||||||
{
|
{
|
||||||
list($status, $headers, $body) = Curl::doCurl(
|
list($status, $headers, $body) = Curl::doCurl(
|
||||||
Curl::POST,
|
Curl::POST,
|
||||||
static::getApiUrl('/user_email/status'),
|
static::getApiUrl('/user_email/status'),
|
||||||
['auth_token' => $token],
|
['auth_token' => $token],
|
||||||
['json_response' => true, 'timeout' => static::DEFAULT_TIMEOUT]
|
['json_response' => true, 'timeout' => static::DEFAULT_TIMEOUT]
|
||||||
);
|
);
|
||||||
return array($status,$headers,$body);
|
return array($status,$headers,$body);
|
||||||
}
|
}
|
||||||
|
|
8
lib/thirdparty/Mailgun.class.php
vendored
8
lib/thirdparty/Mailgun.class.php
vendored
|
@ -2,12 +2,12 @@
|
||||||
|
|
||||||
class Mailgun
|
class Mailgun
|
||||||
{
|
{
|
||||||
const BASE_URL = 'https://api.mailgun.net/v3';
|
public const BASE_URL = 'https://api.mailgun.net/v3';
|
||||||
|
|
||||||
const TOP_DOMAIN = 'lbry.com';
|
public const TOP_DOMAIN = 'lbry.com';
|
||||||
const MAIL_DOMAIN = 'mail.lbry.com';
|
public const MAIL_DOMAIN = 'mail.lbry.com';
|
||||||
|
|
||||||
const LIST_GENERAL = 'lbryians@lbry.com';
|
public const LIST_GENERAL = 'lbryians@lbry.com';
|
||||||
|
|
||||||
public static function sendDmcaReport($data)
|
public static function sendDmcaReport($data)
|
||||||
{
|
{
|
||||||
|
|
2
lib/thirdparty/Salesforce.class.php
vendored
2
lib/thirdparty/Salesforce.class.php
vendored
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
class Salesforce
|
class Salesforce
|
||||||
{
|
{
|
||||||
const
|
public const
|
||||||
API_URL = 'https://api.salesforceiq.com/v2/',
|
API_URL = 'https://api.salesforceiq.com/v2/',
|
||||||
DEFAULT_LIST_ID = '58387a94e4b0a1fea2c76f4a';
|
DEFAULT_LIST_ID = '58387a94e4b0a1fea2c76f4a';
|
||||||
|
|
||||||
|
|
2
lib/thirdparty/Transifex.class.php
vendored
2
lib/thirdparty/Transifex.class.php
vendored
|
@ -5,7 +5,7 @@ class Transifex
|
||||||
{
|
{
|
||||||
public static function isConfigured()
|
public static function isConfigured()
|
||||||
{
|
{
|
||||||
return (boolean)Config::get(Config::TRANSIFEX_API_KEY);
|
return (bool)Config::get(Config::TRANSIFEX_API_KEY);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getTranslationResourceFile($project, $resource, $language, $cache = true)
|
public static function getTranslationResourceFile($project, $resource, $language, $cache = true)
|
||||||
|
|
|
@ -2,26 +2,26 @@
|
||||||
|
|
||||||
class Config
|
class Config
|
||||||
{
|
{
|
||||||
const HELP_CONTACT_EMAIL = 'hello@lbry.com';
|
public const HELP_CONTACT_EMAIL = 'hello@lbry.com';
|
||||||
|
|
||||||
//Constant to help with managing strings
|
//Constant to help with managing strings
|
||||||
const IS_PROD = "is_prod";
|
public const IS_PROD = "is_prod";
|
||||||
const CHAINQUERY_DSN = 'chainquery_dsn';
|
public const CHAINQUERY_DSN = 'chainquery_dsn';
|
||||||
const CHAINQUERY_USERNAME = 'chainquery_username';
|
public const CHAINQUERY_USERNAME = 'chainquery_username';
|
||||||
const CHAINQUERY_PASSWORD = 'chainquery_password';
|
public const CHAINQUERY_PASSWORD = 'chainquery_password';
|
||||||
const GITHUB_KEY = "github_key";
|
public const GITHUB_KEY = "github_key";
|
||||||
const GITHUB_APP_CLIENT_ID = "github_app_client_id";
|
public const GITHUB_APP_CLIENT_ID = "github_app_client_id";
|
||||||
const GITHUB_APP_CLIENT_SECRET = "github_app_client_secret";
|
public const GITHUB_APP_CLIENT_SECRET = "github_app_client_secret";
|
||||||
const GITHUB_PERSONAL_AUTH_TOKEN = 'github_personal_auth_token';
|
public const GITHUB_PERSONAL_AUTH_TOKEN = 'github_personal_auth_token';
|
||||||
const LBRY_API_SERVER = "lbry_api_server";
|
public const LBRY_API_SERVER = "lbry_api_server";
|
||||||
const MAILCHIMP_KEY = "mailchimp_key";
|
public const MAILCHIMP_KEY = "mailchimp_key";
|
||||||
const TRANSIFEX_API_KEY = 'transifex_api_key';
|
public const TRANSIFEX_API_KEY = 'transifex_api_key';
|
||||||
const AWS_LOG_ACCESS_KEY = "aws_log_access_key";
|
public const AWS_LOG_ACCESS_KEY = "aws_log_access_key";
|
||||||
const AWS_LOG_SECRET_KEY = "aws_log_secret_key";
|
public const AWS_LOG_SECRET_KEY = "aws_log_secret_key";
|
||||||
const MAILGUN_API_KEY = "mailgun_api_key";
|
public const MAILGUN_API_KEY = "mailgun_api_key";
|
||||||
const SALESFORCE_KEY = "salesforce_key";
|
public const SALESFORCE_KEY = "salesforce_key";
|
||||||
const SALESFORCE_SECRET = "salesforce_secret";
|
public const SALESFORCE_SECRET = "salesforce_secret";
|
||||||
const SLACK_ERROR_NOTIFICATION_URL = "slack_error_notification_url";
|
public const SLACK_ERROR_NOTIFICATION_URL = "slack_error_notification_url";
|
||||||
|
|
||||||
|
|
||||||
protected static $loaded = false;
|
protected static $loaded = false;
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
class Curl
|
class Curl
|
||||||
{
|
{
|
||||||
const
|
public const
|
||||||
GET = 'GET',
|
GET = 'GET',
|
||||||
POST = 'POST',
|
POST = 'POST',
|
||||||
PUT = 'PUT',
|
PUT = 'PUT',
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
class CurlWithCache extends Curl
|
class CurlWithCache extends Curl
|
||||||
{
|
{
|
||||||
const DEFAULT_CACHE = 600000;
|
public const DEFAULT_CACHE = 600000;
|
||||||
|
|
||||||
public static function doCurl($method, $url, $params = [], $options = [])
|
public static function doCurl($method, $url, $params = [], $options = [])
|
||||||
{
|
{
|
||||||
|
|
|
@ -26,13 +26,13 @@ class Debug
|
||||||
$args = isset($frame['args']) ? static::exceptionFrameArgsToString($frame['args']) : '';
|
$args = isset($frame['args']) ? static::exceptionFrameArgsToString($frame['args']) : '';
|
||||||
|
|
||||||
$rtn .= sprintf(
|
$rtn .= sprintf(
|
||||||
"#%s %s(%s): %s(%s)\n",
|
"#%s %s(%s): %s(%s)\n",
|
||||||
$count,
|
$count,
|
||||||
$frame['file'] ?? 'unknown file',
|
$frame['file'] ?? 'unknown file',
|
||||||
$frame['line'] ?? 'unknown line',
|
$frame['line'] ?? 'unknown line',
|
||||||
isset($frame['class']) ? $frame['class'].$frame['type'].$frame['function'] : $frame['function'],
|
isset($frame['class']) ? $frame['class'].$frame['type'].$frame['function'] : $frame['function'],
|
||||||
$args
|
$args
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return $rtn;
|
return $rtn;
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,7 +5,7 @@ class OS
|
||||||
/*
|
/*
|
||||||
* if changing below constants, you should add permanent redirects for old OS names used in URLs
|
* if changing below constants, you should add permanent redirects for old OS names used in URLs
|
||||||
*/
|
*/
|
||||||
const OS_ANDROID = 'android',
|
public const OS_ANDROID = 'android',
|
||||||
OS_IOS = 'ios',
|
OS_IOS = 'ios',
|
||||||
OS_LINUX = 'linux',
|
OS_LINUX = 'linux',
|
||||||
OS_OSX = 'osx',
|
OS_OSX = 'osx',
|
||||||
|
|
|
@ -13,11 +13,11 @@
|
||||||
*/
|
*/
|
||||||
class Smaz
|
class Smaz
|
||||||
{
|
{
|
||||||
const CODEBOOK_DEFAULT = 'default';
|
public const CODEBOOK_DEFAULT = 'default';
|
||||||
const CODEBOOK_EMAIL = 'email';
|
public const CODEBOOK_EMAIL = 'email';
|
||||||
|
|
||||||
const VERBATIM_CHAR = 254;
|
public const VERBATIM_CHAR = 254;
|
||||||
const VERBATIM_STR = 255;
|
public const VERBATIM_STR = 255;
|
||||||
|
|
||||||
protected static $encodeBooks = [];
|
protected static $encodeBooks = [];
|
||||||
protected static $decodeBooks = [
|
protected static $decodeBooks = [
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
class PostException extends Exception {}
|
class PostException extends Exception
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
class PostNotFoundException extends PostException
|
class PostNotFoundException extends PostException
|
||||||
{
|
{
|
||||||
|
@ -12,7 +14,7 @@ class PostMalformedException extends PostException
|
||||||
|
|
||||||
class Post
|
class Post
|
||||||
{
|
{
|
||||||
const SORT_DATE_DESC = 'sort_date_desc',
|
public const SORT_DATE_DESC = 'sort_date_desc',
|
||||||
SORT_ORD_ASC = 'sort_ord_asc';
|
SORT_ORD_ASC = 'sort_ord_asc';
|
||||||
|
|
||||||
protected static $slugMap = [];
|
protected static $slugMap = [];
|
||||||
|
@ -81,7 +83,7 @@ class Post
|
||||||
|
|
||||||
public static function find($folder, $sort = null)
|
public static function find($folder, $sort = null)
|
||||||
{
|
{
|
||||||
$posts = array_filter(array_map(function($file) {
|
$posts = array_filter(array_map(function ($file) {
|
||||||
try {
|
try {
|
||||||
return static::load($file);
|
return static::load($file);
|
||||||
} catch (PostException $e) {
|
} catch (PostException $e) {
|
||||||
|
@ -122,9 +124,9 @@ class Post
|
||||||
$metadata = $post->getMetadata();
|
$metadata = $post->getMetadata();
|
||||||
foreach ($filters as $filterAttr => $filterValue) {
|
foreach ($filters as $filterAttr => $filterValue) {
|
||||||
if (!isset($metadata[$filterAttr]) || (
|
if (!isset($metadata[$filterAttr]) || (
|
||||||
($metadata[$filterAttr] != $filterValue) &&
|
($metadata[$filterAttr] != $filterValue) &&
|
||||||
(!is_array($metadata[$filterAttr]) || !in_array($filterValue, $metadata[$filterAttr]))
|
(!is_array($metadata[$filterAttr]) || !in_array($filterValue, $metadata[$filterAttr]))
|
||||||
)) {
|
)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -311,7 +313,7 @@ class Post
|
||||||
|
|
||||||
$metadata = $this->getMetadata();
|
$metadata = $this->getMetadata();
|
||||||
if (isset($metadata['og']) && $metadata['og']) {
|
if (isset($metadata['og']) && $metadata['og']) {
|
||||||
$urls[] = $metadata['og'];
|
$urls[] = $metadata['og'];
|
||||||
}
|
}
|
||||||
|
|
||||||
$cover = $this->getCover();
|
$cover = $this->getCover();
|
||||||
|
|
BIN
php-cs-fixer
BIN
php-cs-fixer
Binary file not shown.
|
@ -2,18 +2,18 @@
|
||||||
|
|
||||||
class Response
|
class Response
|
||||||
{
|
{
|
||||||
const HEADER_STATUS = 'Status';
|
public const HEADER_STATUS = 'Status';
|
||||||
const HEADER_LOCATION = 'Location';
|
public const HEADER_LOCATION = 'Location';
|
||||||
|
|
||||||
const HEADER_CACHE_CONTROL = 'Cache-Control';
|
public const HEADER_CACHE_CONTROL = 'Cache-Control';
|
||||||
const HEADER_ETAG = 'Etag';
|
public const HEADER_ETAG = 'Etag';
|
||||||
|
|
||||||
const HEADER_CONTENT_TYPE = 'Content-Type';
|
public const HEADER_CONTENT_TYPE = 'Content-Type';
|
||||||
const HEADER_CONTENT_LENGTH = 'Content-Length';
|
public const HEADER_CONTENT_LENGTH = 'Content-Length';
|
||||||
const HEADER_CONTENT_DISPOSITION = 'Content-Disposition';
|
public const HEADER_CONTENT_DISPOSITION = 'Content-Disposition';
|
||||||
const HEADER_CONTENT_TYPE_OPTIONS = 'X-Content-Type-Options';
|
public const HEADER_CONTENT_TYPE_OPTIONS = 'X-Content-Type-Options';
|
||||||
const HEADER_CONTENT_ENCODING = 'Content-Encoding';
|
public const HEADER_CONTENT_ENCODING = 'Content-Encoding';
|
||||||
const HEADER_CROSS_ORIGIN = 'Access-Control-Allow-Origin';
|
public const HEADER_CROSS_ORIGIN = 'Access-Control-Allow-Origin';
|
||||||
|
|
||||||
protected static $metaDescription = '';
|
protected static $metaDescription = '';
|
||||||
protected static $metaTitle = '';
|
protected static $metaTitle = '';
|
||||||
|
@ -357,12 +357,12 @@ class Response
|
||||||
protected static function normalizeHeaderName($name): string
|
protected static function normalizeHeaderName($name): string
|
||||||
{
|
{
|
||||||
return preg_replace_callback(
|
return preg_replace_callback(
|
||||||
'/\-(.)/',
|
'/\-(.)/',
|
||||||
function ($matches) {
|
function ($matches) {
|
||||||
return '-' . strtoupper($matches[1]);
|
return '-' . strtoupper($matches[1]);
|
||||||
},
|
},
|
||||||
strtr(ucfirst(strtolower($name)), '_', '-')
|
strtr(ucfirst(strtolower($name)), '_', '-')
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function addPostRenderCallback($cb)
|
public static function addPostRenderCallback($cb)
|
||||||
|
|
|
@ -12,14 +12,14 @@ function js_end()
|
||||||
|
|
||||||
class View
|
class View
|
||||||
{
|
{
|
||||||
const LAYOUT_PARAMS = '_layout_params';
|
public const LAYOUT_PARAMS = '_layout_params';
|
||||||
|
|
||||||
const WEB_DIR = ROOT_DIR . '/web';
|
public const WEB_DIR = ROOT_DIR . '/web';
|
||||||
const COMPONENTS_DIR = self::WEB_DIR . '/components/sass';
|
public const COMPONENTS_DIR = self::WEB_DIR . '/components/sass';
|
||||||
const COLORS_DIR = self::WEB_DIR . '/scss/color';
|
public const COLORS_DIR = self::WEB_DIR . '/scss/color';
|
||||||
const SCSS_DIR = self::WEB_DIR . '/scss';
|
public const SCSS_DIR = self::WEB_DIR . '/scss';
|
||||||
const CSS_DIR = self::WEB_DIR . '/css';
|
public const CSS_DIR = self::WEB_DIR . '/css';
|
||||||
const JS_DIR = self::WEB_DIR . '/js';
|
public const JS_DIR = self::WEB_DIR . '/js';
|
||||||
|
|
||||||
public static function render($template, array $vars = []): string
|
public static function render($template, array $vars = []): string
|
||||||
{
|
{
|
||||||
|
@ -193,8 +193,7 @@ class View
|
||||||
}
|
}
|
||||||
|
|
||||||
return $parser->saveHTML($dom);
|
return $parser->saveHTML($dom);
|
||||||
}
|
} catch (Error $e) {
|
||||||
catch (Error $e) {
|
|
||||||
Slack::slackGrin();
|
Slack::slackGrin();
|
||||||
return $html;
|
return $html;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1 +1,3 @@
|
||||||
<?php echo json_encode($json ?? [], JSON_PRETTY_PRINT);
|
<?php
|
||||||
|
|
||||||
|
echo json_encode($json ?? [], JSON_PRETTY_PRINT);
|
||||||
|
|
|
@ -1 +1,3 @@
|
||||||
<?php echo file_get_contents($zipPath);
|
<?php
|
||||||
|
|
||||||
|
echo file_get_contents($zipPath);
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
<?php else: ?>
|
<?php else: ?>
|
||||||
<form id="<?php echo $formId ?>" novalidate style="display: none">
|
<form id="<?php echo $formId ?>" novalidate style="display: none">
|
||||||
<section class="email-section">
|
<section class="email-section">
|
||||||
<div style="min-height: 33px"> <?php //hack fix to prevent jumping ?>
|
<div style="min-height: 33px"> <?php //hack fix to prevent jumping?>
|
||||||
<div class="notice notice-error hide spacer-half"></div>
|
<div class="notice notice-error hide spacer-half"></div>
|
||||||
<div class="notice notice-success hide spacer-half">Your email preferences have been updated.</div>
|
<div class="notice notice-success hide spacer-half">Your email preferences have been updated.</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -34,7 +34,7 @@
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section class="tag-section spacer1">
|
<section class="tag-section spacer1">
|
||||||
<div style="min-height: 33px"> <?php //hack fix to prevent jumping ?>
|
<div style="min-height: 33px"> <?php //hack fix to prevent jumping?>
|
||||||
<div class="notice notice-error hide spacer-half"></div>
|
<div class="notice notice-error hide spacer-half"></div>
|
||||||
<div class="notice notice-success hide spacer-half">Your email preferences have been updated.</div>
|
<div class="notice notice-success hide spacer-half">Your email preferences have been updated.</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -42,7 +42,9 @@
|
||||||
|
|
||||||
<?php $tagIndex = 0 ?>
|
<?php $tagIndex = 0 ?>
|
||||||
<?php foreach ($tags as $tag => $enabled): ?>
|
<?php foreach ($tags as $tag => $enabled): ?>
|
||||||
<?php if (!isset($tagMetadata[$tag])) continue; ?>
|
<?php if (!isset($tagMetadata[$tag])) {
|
||||||
|
continue;
|
||||||
|
} ?>
|
||||||
<?php $tagId = 'tag_' . (++$tagIndex) ?>
|
<?php $tagId = 'tag_' . (++$tagIndex) ?>
|
||||||
<div>
|
<div>
|
||||||
<checkbox-element>
|
<checkbox-element>
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?php $error = $error ?? null ?>
|
<?php $error = $error ?? null ?>
|
||||||
<?php $tag = $tag ?? null ?>
|
<?php $tag = $tag ?? null ?>
|
||||||
<?php $largeInput = $largeInput ?? false ?>
|
<?php $largeInput = $largeInput ?? false ?>
|
||||||
<?php $forceUrl = $forceUrl ?? '' //for cross-domain landing pages ?>
|
<?php $forceUrl = $forceUrl ?? '' //for cross-domain landing pages?>
|
||||||
|
|
||||||
<form id="mail_form" action="<?php echo $forceUrl ?>/list/subscribe" method="POST" novalidate>
|
<form id="mail_form" action="<?php echo $forceUrl ?>/list/subscribe" method="POST" novalidate>
|
||||||
<?php if ($error): ?>
|
<?php if ($error): ?>
|
||||||
|
|
Loading…
Add table
Reference in a new issue