Skip to content
This repository was archived by the owner on Aug 15, 2024. It is now read-only.

Commit 415fd5a

Browse files
committed
add new files
1 parent 7443cc6 commit 415fd5a

File tree

16 files changed

+331
-76
lines changed

16 files changed

+331
-76
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?php
2+
/**
3+
* Magento Chatbot Integration
4+
* Copyright (C) 2017
5+
*
6+
* This file is part of Werules/Chatbot.
7+
*
8+
* Werules/Chatbot is free software: you can redistribute it and/or modify
9+
* it under the terms of the GNU General Public License as published by
10+
* the Free Software Foundation, either version 3 of the License, or
11+
* (at your option) any later version.
12+
*
13+
* This program is distributed in the hope that it will be useful,
14+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16+
* GNU General Public License for more details.
17+
*
18+
* You should have received a copy of the GNU General Public License
19+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
20+
*/
21+
22+
class Werules_Chatbot_Block_Messenger extends Mage_Core_Block_Template
23+
{
24+
25+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?php
2+
/**
3+
* Magento Chatbot Integration
4+
* Copyright (C) 2017
5+
*
6+
* This file is part of Werules/Chatbot.
7+
*
8+
* Werules/Chatbot is free software: you can redistribute it and/or modify
9+
* it under the terms of the GNU General Public License as published by
10+
* the Free Software Foundation, either version 3 of the License, or
11+
* (at your option) any later version.
12+
*
13+
* This program is distributed in the hope that it will be useful,
14+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16+
* GNU General Public License for more details.
17+
*
18+
* You should have received a copy of the GNU General Public License
19+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
20+
*/
21+
22+
class Werules_Chatbot_Block_Telegram extends Mage_Core_Block_Template
23+
{
24+
25+
}
Lines changed: 48 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,55 @@
11
<?php
2+
/**
3+
* Magento Chatbot Integration
4+
* Copyright (C) 2017
5+
*
6+
* This file is part of Werules/Chatbot.
7+
*
8+
* Werules/Chatbot is free software: you can redistribute it and/or modify
9+
* it under the terms of the GNU General Public License as published by
10+
* the Free Software Foundation, either version 3 of the License, or
11+
* (at your option) any later version.
12+
*
13+
* This program is distributed in the hope that it will be useful,
14+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16+
* GNU General Public License for more details.
17+
*
18+
* You should have received a copy of the GNU General Public License
19+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
20+
*/
21+
222
// this class is used to replace Magento own class that contains a glitch
323
class Werules_Chatbot_Model_Adminhtml_Serialized extends Mage_Adminhtml_Model_System_Config_Backend_Serialized
424
{
5-
protected function _afterLoad()
6-
{
7-
if (!is_array($this->getValue())) {
8-
$serializedValue = $this->getValue();
9-
$unserializedValue = false;
10-
if ($serializedValue) {
11-
try {
12-
$unserializedValue = Mage::helper('core/unserializeArray')
13-
->unserialize((string)$serializedValue); // fix magento unserializing bug
14-
} catch (Exception $e) {
15-
Mage::logException($e);
16-
}
17-
}
18-
$this->setValue($unserializedValue);
19-
}
20-
}
25+
protected function _afterLoad()
26+
{
27+
if (!is_array($this->getValue())) {
28+
$serializedValue = $this->getValue();
29+
$unserializedValue = false;
30+
if ($serializedValue) {
31+
try {
32+
$unserializedValue = Mage::helper('core/unserializeArray')
33+
->unserialize((string)$serializedValue); // fix magento unserializing bug
34+
} catch (Exception $e) {
35+
Mage::logException($e);
36+
}
37+
}
38+
$this->setValue($unserializedValue);
39+
}
40+
}
2141

22-
protected function _beforeSave()
23-
{
24-
$value = $this->getValue();
25-
if (is_array($value)) {
26-
unset($value['__empty']);
27-
}
28-
$this->setValue($value);
42+
protected function _beforeSave()
43+
{
44+
$value = $this->getValue();
45+
if (is_array($value)) {
46+
unset($value['__empty']);
47+
}
48+
$this->setValue($value);
2949

30-
if (is_array($this->getValue()))
31-
{
32-
$this->setValue(serialize($this->getValue()));
33-
}
34-
}
50+
if (is_array($this->getValue()))
51+
{
52+
$this->setValue(serialize($this->getValue()));
53+
}
54+
}
3555
}
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<?php
2+
/**
3+
* Magento Chatbot Integration
4+
* Copyright (C) 2017
5+
*
6+
* This file is part of Werules/Chatbot.
7+
*
8+
* Werules/Chatbot is free software: you can redistribute it and/or modify
9+
* it under the terms of the GNU General Public License as published by
10+
* the Free Software Foundation, either version 3 of the License, or
11+
* (at your option) any later version.
12+
*
13+
* This program is distributed in the hope that it will be useful,
14+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16+
* GNU General Public License for more details.
17+
*
18+
* You should have received a copy of the GNU General Public License
19+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
20+
*/
21+
22+
class Werules_Chatbot_IndexController extends Mage_Core_Controller_Front_Action{
23+
public function IndexAction() {
24+
25+
$this->loadLayout();
26+
$this->getLayout()->getBlock("head")->setTitle($this->__("Titlename"));
27+
$breadcrumbs = $this->getLayout()->getBlock("breadcrumbs");
28+
$breadcrumbs->addCrumb("home", array(
29+
"label" => $this->__("Home Page"),
30+
"title" => $this->__("Home Page"),
31+
"link" => Mage::getBaseUrl()
32+
));
33+
34+
$breadcrumbs->addCrumb("titlename", array(
35+
"label" => $this->__("Titlename"),
36+
"title" => $this->__("Titlename")
37+
));
38+
39+
$this->renderLayout();
40+
41+
}
42+
}
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<?php
2+
/**
3+
* Magento Chatbot Integration
4+
* Copyright (C) 2017
5+
*
6+
* This file is part of Werules/Chatbot.
7+
*
8+
* Werules/Chatbot is free software: you can redistribute it and/or modify
9+
* it under the terms of the GNU General Public License as published by
10+
* the Free Software Foundation, either version 3 of the License, or
11+
* (at your option) any later version.
12+
*
13+
* This program is distributed in the hope that it will be useful,
14+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16+
* GNU General Public License for more details.
17+
*
18+
* You should have received a copy of the GNU General Public License
19+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
20+
*/
21+
22+
class Werules_Chatbot_IndexController extends Mage_Core_Controller_Front_Action{
23+
public function IndexAction() {
24+
25+
$this->loadLayout();
26+
$this->getLayout()->getBlock("head")->setTitle($this->__("Titlename"));
27+
$breadcrumbs = $this->getLayout()->getBlock("breadcrumbs");
28+
$breadcrumbs->addCrumb("home", array(
29+
"label" => $this->__("Home Page"),
30+
"title" => $this->__("Home Page"),
31+
"link" => Mage::getBaseUrl()
32+
));
33+
34+
$breadcrumbs->addCrumb("titlename", array(
35+
"label" => $this->__("Titlename"),
36+
"title" => $this->__("Titlename")
37+
));
38+
39+
$this->renderLayout();
40+
41+
}
42+
}
Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,31 @@
11
<?xml version="1.0"?>
2-
<config>
3-
<acl>
4-
<resources>
5-
<admin>
6-
<children>
7-
<system>
8-
<children>
9-
<config>
10-
<children>
11-
<werules_chatbot_general translate="title" module="chatbot">
12-
<title>General Settings Section</title>
13-
<sort_order>0</sort_order>
14-
</werules_chatbot_general>
15-
<werules_chatbot_messenger translate="title" module="chatbot">
16-
<title>Messenger Settings Section</title>
17-
<sort_order>1</sort_order>
18-
</werules_chatbot_messenger>
19-
<werules_chatbot_danger translate="title" module="chatbot">
20-
<title>Danger Zone Section</title>
21-
<sort_order>2</sort_order>
22-
</werules_chatbot_danger>
23-
</children>
24-
</config>
25-
</children>
26-
</system>
27-
</children>
28-
</admin>
29-
</resources>
30-
</acl>
31-
</config>
2+
<config>
3+
<acl>
4+
<resources>
5+
<admin>
6+
<children>
7+
<system>
8+
<children>
9+
<config>
10+
<children>
11+
<werules_chatbot_general translate="title" module="chatbot">
12+
<title>General Settings</title>
13+
<sort_order>0</sort_order>
14+
</werules_chatbot_general>
15+
<werules_chatbot_messenger translate="title" module="chatbot">
16+
<title>Messenger Settings</title>
17+
<sort_order>1</sort_order>
18+
</werules_chatbot_messenger>
19+
<werules_chatbot_danger translate="title" module="chatbot">
20+
<title>Danger Zone</title>
21+
<sort_order>2</sort_order>
22+
</werules_chatbot_danger>
23+
</children>
24+
</config>
25+
</children>
26+
</system>
27+
</children>
28+
</admin>
29+
</resources>
30+
</acl>
31+
</config>

Magento1/app/code/community/Werules/Chatbot/etc/config.xml

Lines changed: 31 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,37 @@
66
</Werules_Chatbot>
77
</modules>
88
<frontend>
9+
<translate>
10+
<modules>
11+
<Werules_Chatbot>
12+
<files>
13+
<default>Werules_Chatbot.csv</default>
14+
</files>
15+
</Werules_Chatbot>
16+
</modules>
17+
</translate>
18+
<layout>
19+
<updates>
20+
<chatbot>
21+
<file>chatbot_customer_index.xml</file>
22+
</chatbot>
23+
</updates>
24+
<updates>
25+
<chatbot>
26+
<file>chatbot_webhook_index.xml</file>
27+
</chatbot>
28+
</updates>
29+
<updates>
30+
<chatbot>
31+
<file>chatbot_webhook_messenger.xml</file>
32+
</chatbot>
33+
</updates>
34+
<updates>
35+
<chatbot>
36+
<file>chatbot_webhook_telegram.xml</file>
37+
</chatbot>
38+
</updates>
39+
</layout>
940
<routers>
1041
<chatbot>
1142
<use>standard</use>
@@ -15,13 +46,6 @@
1546
</args>
1647
</chatbot>
1748
</routers>
18-
<layout>
19-
<updates>
20-
<chatbot>
21-
<file>chatbot.xml</file>
22-
</chatbot>
23-
</updates>
24-
</layout>
2549
</frontend>
2650
<global>
2751
<helpers>

Magento1/app/code/community/Werules/Chatbot/sql/chatbot_setup/mysql4-install-1.0.0.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,23 @@
11
<?php
2+
/**
3+
* Magento Chatbot Integration
4+
* Copyright (C) 2017
5+
*
6+
* This file is part of Werules/Chatbot.
7+
*
8+
* Werules/Chatbot is free software: you can redistribute it and/or modify
9+
* it under the terms of the GNU General Public License as published by
10+
* the Free Software Foundation, either version 3 of the License, or
11+
* (at your option) any later version.
12+
*
13+
* This program is distributed in the hope that it will be useful,
14+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16+
* GNU General Public License for more details.
17+
*
18+
* You should have received a copy of the GNU General Public License
19+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
20+
*/
221

322
$table = 'wr_chatbot';
423
$installer = $this;

Magento1/app/design/frontend/base/default/layout/chatbot.xml

Lines changed: 0 additions & 11 deletions
This file was deleted.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?xml version="1.0"?>
2+
<layout version="1.0.0">
3+
<customer_account>
4+
<reference name="customer_account_navigation">
5+
<action method="addLink">
6+
<name>chatbot_settings</name>
7+
<path>chatbot/customer/index</path>
8+
<label>Chatbot Settings</label>
9+
</action>
10+
</reference>
11+
</customer_account>
12+
<chatbot_customer_index> <!-- module/controller/action -->
13+
<update handle="customer_account" />
14+
<reference name="my.account.wrapper">
15+
<block type="core/template" name="chatbot_settings" template="chatbot/settings.phtml"/>
16+
</reference>
17+
</chatbot_customer_index>
18+
</layout>

0 commit comments

Comments
 (0)