Send newsletter + Listing + Last Step
- fixed Selection React - fixed bulk actions (side effect of muti selection) - added actual sending of newsletter - added Setting::getValue($key, $default) in order to get settings - improved Bridge class to allow override of from/reply_to - added jquery.serializeObject to ease the pain when posting form data
This commit is contained in:
@ -9,16 +9,21 @@ class Setting extends Model {
|
||||
function __construct() {
|
||||
parent::__construct();
|
||||
|
||||
$this->addValidations("name", array(
|
||||
"required" => "name_is_blank",
|
||||
"isString" => "name_is_not_string"
|
||||
));
|
||||
$this->addValidations("value", array(
|
||||
"required" => "value_is_blank",
|
||||
"isString" => "value_is_not_string"
|
||||
$this->addValidations('name', array(
|
||||
'required' => 'name_is_blank',
|
||||
'isString' => 'name_is_not_string'
|
||||
));
|
||||
}
|
||||
|
||||
public static function getValue($key, $default = null) {
|
||||
$setting = Setting::where('name', $key)->findOne();
|
||||
if($setting === false) {
|
||||
return $default;
|
||||
} else {
|
||||
return $setting->value;
|
||||
}
|
||||
}
|
||||
|
||||
public static function createOrUpdate($model) {
|
||||
$exists = self::where('name', $model['name'])
|
||||
->find_one();
|
||||
|
Reference in New Issue
Block a user