Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
e7476f1
[hot fix] bug fix
madoublet Jul 16, 2018
1bdafaa
minor bug fixes
madoublet Sep 28, 2018
0c31b3f
quick bug fix
madoublet Sep 28, 2018
ae5d237
implement cache buster
madoublet Sep 28, 2018
90b9360
Publishing a component results in HTTP 400 (Bad Request) error #591
madoublet Sep 30, 2018
8ac50c4
Apply layout properties to .block instead of .row
axis80 Oct 13, 2018
7eae591
Merge pull request #593 from axis80/apply-layout-properties-to-block-…
axis80 Oct 16, 2018
f7132b5
Pretty print pages.json when removing page
axis80 Oct 29, 2018
9295e2c
Remove extraneous directory separator
axis80 Oct 29, 2018
e5ec8ae
Pass current page data to plugins per documentation
axis80 Nov 24, 2018
10a4b68
Remove typo introduced by code editor
axis80 Nov 24, 2018
537a8c2
various bug fixes, remove duplicate themes
madoublet Jan 5, 2019
cb193ba
remove unused theme folders, cleanup gulp
madoublet Jan 6, 2019
293546d
rebuild zip
madoublet Jan 7, 2019
9adbac4
Make respond work on php 7.3
cweiske Jan 26, 2019
f85c24d
Bump version number, change git path to fix issue #598
axis80 Feb 16, 2019
250b238
Added links to installation instructions
axis80 Feb 16, 2019
2e06265
Define default gulp task
axis80 Feb 16, 2019
5262287
Merge pull request #600 from cweiske/php73
axis80 Feb 16, 2019
9cc197d
Merge pull request #596 from axis80/fix-plugins-current-page-data
axis80 Feb 16, 2019
4b4e423
minor bugfixes, add input types to theme customizer & plugins
axis80 Feb 16, 2019
f74a806
Remove extraneous string from plugin dropdown menus
axis80 Feb 19, 2019
fbed843
rebuild production, add prod zip
madoublet Mar 6, 2019
5531623
update zip for release
madoublet Mar 6, 2019
15b9200
Set license to MIT per https://github.com/madoublet/respond/issues/601
madoublet Mar 6, 2019
94c8d9e
add new contextual menu
madoublet Mar 7, 2019
ef8a174
add updated release
madoublet Mar 7, 2019
caff62e
add support for querystring in create
madoublet Apr 11, 2019
beb2766
Update French translations
chuckinchucks Oct 1, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
Commercial License
MIT License

Copyright (c) 2016 Matthew Smith
Copyright (c) 2019 Matthew Smith

Licensed for personal and/or commercial with a valid license purchased from respondcms.com.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
Expand Down
15 changes: 14 additions & 1 deletion app/Http/Controllers/CodeController.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
use App\Respond\Models\Page;

// DOM parser
use Sunra\PhpSimple\HtmlDomParser;
use KubAT\PhpSimple\HtmlDomParser;

class CodeController extends Controller
{
Expand Down Expand Up @@ -389,8 +389,15 @@ public function save(Request $request)
// save to file
file_put_contents($path, $value);

// combine css
Publish::combineCSS($site);

// re-publish the templates to update date/time stamp
Publish::publishTemplates($user, $site);

// re-publish plugins
Publish::publishPlugins($user, $site);

// return 200
return response('Ok', 200);
}
Expand All @@ -410,6 +417,12 @@ public function save(Request $request)
// combine JS to site.all.js
Publish::combineJS($site);

// re-publish the templates to update date/time stamp
Publish::publishTemplates($user, $site);

// re-publish plugins
Publish::publishPlugins($user, $site);

// return 200
return response('Ok', 200);
}
Expand Down
6 changes: 3 additions & 3 deletions app/Http/Controllers/EditController.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
use App\Respond\Models\Setting;

// DOM parser
use Sunra\PhpSimple\HtmlDomParser;
use KubAT\PhpSimple\HtmlDomParser;

class EditController extends Controller
{
Expand Down Expand Up @@ -188,7 +188,7 @@ public function edit(Request $request)

// set block elements
if($blocks === NULL) {
$blocks = '.row';
$blocks = '.block';
}

// find body element
Expand Down Expand Up @@ -301,4 +301,4 @@ public function edit(Request $request)

}

}
}
10 changes: 5 additions & 5 deletions app/Http/Controllers/SiteController.php
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ public function reload(Request $request)
// publish plugins
Publish::publishPlugins($user, $site);

return response('Ok', 200);
return response()->json(array());

}

Expand Down Expand Up @@ -327,7 +327,7 @@ public function republishTemplates(Request $request)
// re-publish the settings
Publish::publishSettings($user, $site);

return response('Ok', 200);
return response()->json(array());

}

Expand All @@ -354,7 +354,7 @@ public function updatePlugins(Request $request)
// re-publish plugins
Publish::publishPlugins($user, $site);

return response('Ok', 200);
return response()->json(array());

}

Expand All @@ -379,7 +379,7 @@ public function generateSitemap(Request $request)
// publish site map
Publish::publishSiteMap($user, $site);

return response('Ok', 200);
return response()->json(array());

}

Expand Down Expand Up @@ -407,7 +407,7 @@ public function reindexPages(Request $request)
// publish site map
Publish::publishSiteMap($user, $site);

return response('Ok', 200);
return response()->json(array());

}

Expand Down
3 changes: 3 additions & 0 deletions app/Http/Controllers/ThemeController.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ public function edit(Request $request)
// re-publish the templates
Publish::publishTemplates($user, $site);

// re-publish plugins
Publish::publishPlugins($user, $site);

return response('Ok', 200);

}
Expand Down
36 changes: 30 additions & 6 deletions app/Respond/Libraries/Publish.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
use App\Respond\Models\Theme;

// DOM parser
use Sunra\PhpSimple\HtmlDomParser;
use KubAT\PhpSimple\HtmlDomParser;

// Twig Extensions
use App\Respond\Extensions\BetterSortTwigExtension;
Expand Down Expand Up @@ -839,7 +839,7 @@ public static function publishPluginsForPage($page, $user, $site, $pages = null)

$html = file_get_contents($location);

// setup current page
// setup meta info
$meta = array(
'url' => $page->url,
'firstName' => $page->firstName,
Expand All @@ -849,7 +849,7 @@ public static function publishPluginsForPage($page, $user, $site, $pages = null)
);

// inject plugin HTML to the page
$dom = Publish::injectPluginHTML($html, $user, $site, $meta, $pages);
$dom = Publish::injectPluginHTML($html, $user, $site, $meta, $pages, $page);

// put html back
file_put_contents($location, $dom);
Expand All @@ -870,7 +870,7 @@ public static function publishPluginsForPage($page, $user, $site, $pages = null)
* @param {User} $user
* @param {Site} $site
*/
public static function injectPluginHTML($html, $user, $site, $meta, $pages = null) {
public static function injectPluginHTML($html, $user, $site, $meta, $pages = null, $page = null) {

// caches the values of these variables across the request to improve performance
static $forms = array();
Expand Down Expand Up @@ -924,8 +924,32 @@ public static function injectPluginHTML($html, $user, $site, $meta, $pages = nul
'timeZone' => $site->timeZone,
);

// If page data is provided
if($page) {

// setup current page
$current_page = array(
'title' => $page->title,
'description' => $page->description,
'keywords' => $page->keywords,
'callout' => $page->callout,
'url' => $page->url,
'photo' => $page->photo,
'thumb' => $page->thumb,
'language' => $page->language,
'direction' => $page->direction,
'firstName' => $page->firstName,
'lastName' => $page->lastName,
'lastModifiedBy' => $page->lastModifiedBy,
'lastModifiedDate' => $page->lastModifiedDate
);

} else {
$current_page = array();
}

// get plugins for the site
$dir = app()->basePath().'/public/sites/'.$site->id.'/plugins/';
$dir = app()->basePath().'/public/sites/'.$site->id.'/plugins';
$exts = array('html', 'php');

if(!$files) {
Expand Down Expand Up @@ -985,7 +1009,7 @@ public static function injectPluginHTML($html, $user, $site, $meta, $pages = nul
if(array_search($el->type, $plugins) !== FALSE) {

// render array
$render_arr = array('page' => $meta,
$render_arr = array('page' => $current_page,
'meta' => $meta,
'site' => $current_site,
'pages' => $pages,
Expand Down
16 changes: 11 additions & 5 deletions app/Respond/Libraries/Utilities.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
use \Firebase\JWT\JWT;

use App\Respond\Models\Setting;
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\Exception;

class Utilities
{
Expand Down Expand Up @@ -364,7 +366,9 @@ public static function sendEmailFromFile($to, $from, $fromName, $subject, $repla
public static function sendEmail($to, $from, $fromName, $subject, $content, $site = NULL)
{

$mail = new \PHPMailer\PHPMailer\PHPMailer;
set_time_limit(30);

$mail = new PHPMailer(true);

// if null, grab settings from env()
if($site == NULL) {
Expand Down Expand Up @@ -470,13 +474,15 @@ public static function sendEmail($to, $from, $fromName, $subject, $content, $sit

$mail->Subject = $subject;
$mail->Body = html_entity_decode($content, ENT_COMPAT, 'UTF-8');
$mail->Timeout = 10;

if (!$mail->send()) {
return true;
try {
$mail->send();
return true;
} catch (Exception $e) {
return false;
}

return false;

}

/**
Expand Down
2 changes: 1 addition & 1 deletion app/Respond/Models/Component.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
use App\Respond\Models\User;

// DOM parser
use Sunra\PhpSimple\HtmlDomParser;
use KubAT\PhpSimple\HtmlDomParser;

/**
* Models a component
Expand Down
22 changes: 10 additions & 12 deletions app/Respond/Models/Page.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
use Lullabot\AMP\Validate\Scope;

// DOM parser
use Sunra\PhpSimple\HtmlDomParser;
use KubAT\PhpSimple\HtmlDomParser;

/**
* Models a page
Expand Down Expand Up @@ -235,13 +235,10 @@ public static function add($data, $site, $user, $replace = NULL){
*/
public static function edit($url, $changes, $site, $user){

// get a reference to the page object
$page = Page::GetByUrl($url, $site->id);

// get page
$location = app()->basePath().'/public/sites/'.$site->id.'/'.$url.'.html';

if($page != NULL && file_exists($location)) {
if(file_exists($location)) {

// get html
$html = file_get_contents($location);
Expand All @@ -255,6 +252,9 @@ public static function edit($url, $changes, $site, $user){
// determine if it is a component
if(isset($el)) {

// get a reference to the page object
$page = Page::GetByUrl($url, $site->id);

// content placeholder
$main_content = '';

Expand Down Expand Up @@ -289,6 +289,9 @@ public static function edit($url, $changes, $site, $user){
// set text to main_content
$page->text = $text;

// saves the page
$page->save($site, $user);

}
else {

Expand All @@ -303,8 +306,6 @@ public static function edit($url, $changes, $site, $user){

}

// saves the page
$page->save($site, $user);

return TRUE;

Expand Down Expand Up @@ -388,7 +389,7 @@ public function remove($user, $site){
$json_arr = array_values($pages);

// re-encode json
$json_text = json_encode($json_arr);
$json_text = json_encode($json_arr, JSON_PRETTY_PRINT);

file_put_contents($json_file, $json_text);

Expand Down Expand Up @@ -449,9 +450,6 @@ public function injectTemplate($page_html, $site, $user) {

}

// get font
$font_script = Publish::getFontScripts($site->id);

// replace name and description
$template_html = str_replace('{{page.title}}', $this->title, $template_html);
$template_html = str_replace('{{page.description}}', $this->description, $template_html);
Expand Down Expand Up @@ -1091,4 +1089,4 @@ public static function refreshJSON($user, $site) {
}


}
}
2 changes: 1 addition & 1 deletion app/Respond/Models/Setting.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
use App\Respond\Models\User;

// DOM parser
use Sunra\PhpSimple\HtmlDomParser;
use KubAT\PhpSimple\HtmlDomParser;

// Encrypt/Decrypt
use Illuminate\Support\Facades\Crypt;
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"vlucas/phpdotenv": "~2.2",
"firebase/php-jwt": "dev-master",
"phpmailer/phpmailer": "~6.0",
"sunra/php-simple-html-dom-parser": "1.5.1",
"kub-at/php-simple-html-dom-parser": "^1.7",
"symfony/yaml": "3.0.3",
"alchemy/zippy": "^0.4.9",
"guzzlehttp/guzzle": "^6.2.3",
Expand Down
Binary file modified dist/release.zip
Binary file not shown.
Loading