Skip to content

Commit

Permalink
Settings function name changes update
Browse files Browse the repository at this point in the history
  • Loading branch information
givanz committed Mar 1, 2024
1 parent d8242dc commit 859e81c
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 11 deletions.
6 changes: 4 additions & 2 deletions component/form.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@
namespace Vvveb\Plugins\ContactForm\Component;

use function Vvveb\__;
use function Vvveb\session;
use function Vvveb\email;
use function Vvveb\humanReadable;
use function Vvveb\session;
use function Vvveb\siteSettings;
use Vvveb\Sql\Plugins\ContactForm\MessageSQL;
use Vvveb\System\Core\Request;
Expand Down Expand Up @@ -132,8 +134,8 @@ function request(&$results, $index = 0) {
list($html, $txt) = $this->arrayToText($meta, $html, $txt);

if ($this->options['email'] == true) {
$site = siteSettings();
$subject = $site['title'] . ' - ' . $formName . (isset($post['subject']) ? ' - ' . $post['subject'] : '');
$site = siteSettings(SITE_ID, session('language_id') ?? 1);
$subject = ($site['description']['title'] ?? '') . ' - ' . $formName . (isset($post['subject']) ? ' - ' . $post['subject'] : '');
$to = $this->options['sendto'] ?? $site['contact-email'] ?? false;

if ($to) {
Expand Down
4 changes: 2 additions & 2 deletions plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
*/

use function Vvveb\__;
use function Vvveb\array_insert_array_after;
use function Vvveb\arrayInsertArrayAfter;
use function Vvveb\model;
use Vvveb\Plugins\ContactForm\Install;
use Vvveb\System\Core\View;
Expand Down Expand Up @@ -81,7 +81,7 @@ function admin() {
$menuEntry['badge-class'] = 'badge bg-success-subtle text-body mx-2';
}

$menu = array_insert_array_after('users', $menu, ['messages' => $menuEntry]);
$menu = arrayInsertArrayAfter('users', $menu, ['messages' => $menuEntry]);

return [$menu];
});
Expand Down
4 changes: 2 additions & 2 deletions sql/mysqli/message.sql
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
)
BEGIN
-- allow only table fields and set defaults for missing values
@FILTER(:message, message);
@FILTER(:message, message)

UPDATE message

Expand All @@ -40,7 +40,7 @@
BEGIN

-- allow only table fields and set defaults for missing values
:message = @FILTER(:message, message);
:message = @FILTER(:message, message)

INSERT INTO message

Expand Down
6 changes: 3 additions & 3 deletions sql/pgsql/message.sql
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
)
BEGIN
-- allow only table fields and set defaults for missing values
@FILTER(:message, message);
@FILTER(:message, message)

UPDATE message

Expand All @@ -40,7 +40,7 @@
BEGIN

-- allow only table fields and set defaults for missing values
:message = @FILTER(:message, message);
:message = @FILTER(:message, message)

INSERT INTO message

Expand Down Expand Up @@ -111,4 +111,4 @@
SELECT count(*) as count
FROM message as _ -- (underscore) _ means that data will be kept in main array
WHERE status = :status LIMIT 1;
END
END
4 changes: 2 additions & 2 deletions sql/sqlite/message.sql
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
)
BEGIN
-- allow only table fields and set defaults for missing values
@FILTER(:message, message);
@FILTER(:message, message)

UPDATE message

Expand All @@ -40,7 +40,7 @@
BEGIN

-- allow only table fields and set defaults for missing values
:message = @FILTER(:message, message);
:message = @FILTER(:message, message)

INSERT INTO message

Expand Down

0 comments on commit 859e81c

Please sign in to comment.