Made some updates.
git-svn-id: http://svn.cleancode.org/svn/pickles@37 4d10bc64-7434-11dc-a737-d2d0f8310089
This commit is contained in:
parent
66338a66bb
commit
68b925b213
7 changed files with 38 additions and 55 deletions
36
Pickles.php
36
Pickles.php
|
@ -11,40 +11,4 @@ function __autoload($class) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class Pickles extends Object {
|
|
||||||
|
|
||||||
/*
|
|
||||||
protected $config = null;
|
|
||||||
|
|
||||||
private $controller = null;
|
|
||||||
|
|
||||||
public function __construct($site, $controller = 'Web') {
|
|
||||||
parent::__construct();
|
|
||||||
|
|
||||||
new Controller($controller);
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
if (Config::getSession() && !isset($_SESSION)) {
|
|
||||||
session_start();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Use the FCKeditor instead of textareas
|
|
||||||
// @todo add a wrapper for these two
|
|
||||||
if (Config::getFCKEditor()) {
|
|
||||||
require_once JLIB_PATH . 'common/static/fckeditor/fckeditor.php';
|
|
||||||
}
|
|
||||||
|
|
||||||
// Load up MagpieRSS is so desired
|
|
||||||
if (Config::getMagpieRSS()) {
|
|
||||||
require_once JLIB_PATH . '/var/www/josh/common/contrib/magpierss/rss_fetch.inc';
|
|
||||||
}
|
|
||||||
|
|
||||||
//Request::load();
|
|
||||||
*/
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -29,7 +29,7 @@ class Controller extends Object {
|
||||||
if ($this->config->get('disabled')) {
|
if ($this->config->get('disabled')) {
|
||||||
exit("<h2><em>{$_SERVER['SERVER_NAME']} is currently down for maintenance</em></h2>");
|
exit("<h2><em>{$_SERVER['SERVER_NAME']} is currently down for maintenance</em></h2>");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Grab the passed in model or use the default
|
// Grab the passed in model or use the default
|
||||||
$name = isset($_REQUEST['model']) ? str_replace('-', '_', $_REQUEST['model']) : $this->config->get('navigation', 'default');
|
$name = isset($_REQUEST['model']) ? str_replace('-', '_', $_REQUEST['model']) : $this->config->get('navigation', 'default');
|
||||||
|
|
||||||
|
|
|
@ -24,11 +24,23 @@ class Mail {
|
||||||
$prefix = isset($defaults['prefix']) ? $defaults['prefix'] : null;
|
$prefix = isset($defaults['prefix']) ? $defaults['prefix'] : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
$subject = str_replace("\n", '', (isset($prefix) ? "[{$prefix}] " : '') . $_REQUEST['subject']);
|
if (isset($defaults['subject'])) {
|
||||||
|
$subject = $defaults['subject'];
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$subject = str_replace("\n", '', (isset($prefix) ? "[{$prefix}] " : '') . $_REQUEST['subject']);
|
||||||
|
}
|
||||||
|
|
||||||
if (mail($to, $subject, stripslashes($_REQUEST['message']), "From: {$_REQUEST['email']}\r\n")) {
|
if (isset($_REQUEST['name'])) {
|
||||||
|
$from = "{$_REQUEST['name']} <{$_REQUEST['email']}>";
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$from = $_REQUEST['email'];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (mail($to, $subject, stripslashes($_REQUEST['message']), "From: {$from}\r\n")) {
|
||||||
$type = 'success';
|
$type = 'success';
|
||||||
$message = 'Message sent successfully';
|
$message = isset($defaults['response']) ? $defaults['response'] : 'Message sent successfully';
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$type = 'error';
|
$type = 'error';
|
||||||
|
@ -36,7 +48,7 @@ class Mail {
|
||||||
}
|
}
|
||||||
|
|
||||||
$return = array(
|
$return = array(
|
||||||
'type' => $type,
|
'type' => $type,
|
||||||
'message' => $message
|
'message' => $message
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -65,7 +65,10 @@ class Viewer_Smarty extends Viewer_Common {
|
||||||
// Pass all of our controller values to Smarty
|
// Pass all of our controller values to Smarty
|
||||||
$smarty->assign('navigation', $navigation);
|
$smarty->assign('navigation', $navigation);
|
||||||
$smarty->assign('section', $this->model->get('section'));
|
$smarty->assign('section', $this->model->get('section'));
|
||||||
$smarty->assign('action', $this->model->get('action')); // @todo rename me to event
|
$smarty->assign('model', $this->model->get('name'));
|
||||||
|
$smarty->assign('action', $this->model->get('action')); // @todo rename me to event...
|
||||||
|
$smarty->assign('event', $this->model->get('action')); // but it almost seems like we don't need these anymore at all
|
||||||
|
// Thanks to new naming conventions
|
||||||
$smarty->assign('admin', $this->config->get('admin', 'sections'));
|
$smarty->assign('admin', $this->config->get('admin', 'sections'));
|
||||||
$smarty->assign('template', '../templates/' . $this->model->get('name') . '.tpl'); //$template);
|
$smarty->assign('template', '../templates/' . $this->model->get('name') . '.tpl'); //$template);
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,8 @@
|
||||||
</sections>
|
</sections>
|
||||||
</admin>
|
</admin>
|
||||||
<contact>
|
<contact>
|
||||||
<prefix>RN</prefix>
|
<subject>Ribbon Nutrition Contact Request</subject>
|
||||||
|
<response>Thank you. A member of our staff will respond to your message as soon as possible.</response>
|
||||||
<recipients>
|
<recipients>
|
||||||
<recipient>joshsherman@gmail.com</recipient>
|
<recipient>joshsherman@gmail.com</recipient>
|
||||||
</recipients>
|
</recipients>
|
||||||
|
|
23
static/css/foundation.css
vendored
23
static/css/foundation.css
vendored
|
@ -1,10 +1,13 @@
|
||||||
.center { text-align: center; }
|
.center { text-align: center }
|
||||||
.left { text-align: left; }
|
.left { text-align: left }
|
||||||
.right { text-align: right; }
|
.right { text-align: right }
|
||||||
.top { vertical-align: top; }
|
.top { vertical-align: top }
|
||||||
.middle { vertical-align: middle; }
|
.middle { vertical-align: middle }
|
||||||
.bottom { vertical-align: bottom; }
|
.bottom { vertical-align: bottom }
|
||||||
.nowrap { white-space: nowrap; }
|
.nowrap { white-space: nowrap }
|
||||||
.bold { font-weight: bold; }
|
.bold { font-weight: bold }
|
||||||
.italic { font-style: italic; }
|
.italic { font-style: italic }
|
||||||
.clear { clear: both; }
|
.clear { clear: both }
|
||||||
|
.underline { text-decoration: underline }
|
||||||
|
.float-left { float: left }
|
||||||
|
.float-right { float: right }
|
||||||
|
|
|
@ -14,7 +14,7 @@ function getForm(form) {
|
||||||
case 'textarea':
|
case 'textarea':
|
||||||
// Check if it's required
|
// Check if it's required
|
||||||
if (element.title == 'required' && element.value == '') {
|
if (element.title == 'required' && element.value == '') {
|
||||||
alert('Error: The ' + element.name + ' field is required.');
|
alert('Error: The ' + element.name.replace('_', ' ') + ' field is required.');
|
||||||
element.focus();
|
element.focus();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -60,7 +60,7 @@ function createRequest() {
|
||||||
|
|
||||||
function ajaxSubmit(form) {
|
function ajaxSubmit(form) {
|
||||||
var params = '';
|
var params = '';
|
||||||
|
|
||||||
if (params = getForm(form)) {
|
if (params = getForm(form)) {
|
||||||
createRequest();
|
createRequest();
|
||||||
request.open(form.method, form.action, true);
|
request.open(form.method, form.action, true);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue