-
Notifications
You must be signed in to change notification settings - Fork 1
/
SeoDiary.ctrl.php
223 lines (194 loc) · 5.18 KB
/
SeoDiary.ctrl.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
<?php
/**
* Copyright (C) 2009-2019 www.seopanel.in. All rights reserved.
* @author Geo Varghese
*
*/
// include plugins controller if not included
include_once (SP_CTRLPATH . '/seoplugins.ctrl.php');
class SeoDiary extends SeoPluginsController {
// plugin settings controller object
var $settingsCtrler;
// the plugin text database table
var $textTable = "texts";
// the plugin text category
var $textCategory = "seodiary";
// plugin directory name
var $directoryName = "SeoDiary";
/*
* function to init plugin details before each plugin action
*/
function initPlugin($data) {
$this->setPluginTextsForRender ( $this->textCategory, $this->textTable );
$this->set ( 'pluginText', $this->pluginText );
$this->set ( 'spTextPanel', $this->getLanguageTexts('panel', $_SESSION['lang_code']));
$settingsCtrler = $this->createHelper('SDSettings');
$settingsCtrler->defineAllPluginSystemSettings();
if (! defined ( 'PLUGIN_PATH' )) {
define ( 'PLUGIN_PATH', $this->pluginPath );
}
}
/*
* function to show the first page while access plugin
*/
function index($data) {
if (isAdmin() || SD_ALLOW_USER_PROJECTS) {
$this->projectManager( $data );
} else {
$this->myTasks($data);
}
}
function projectManager($data) {
$projectCtrler = $this->createHelper ( 'Project' );
$projectCtrler->showProjectsManager ( $data );
}
/*
* func to show create new project form
*/
function newProject($data) {
$projectCtrler = $this->createHelper ( 'Project' );
$projectCtrler->newProject ( $data );
}
/*
* func to create new project
*/
function createProject($data) {
$projectCtrler = $this->createHelper ( 'Project' );
$projectCtrler->createProject ( $data );
}
/*
* func to show edit project form
*/
function editProject($data) {
$projectCtrler = $this->createHelper ( 'Project' );
$projectCtrler->editProject ( $data ['project_id'] );
}
/*
* func to update project
*/
function updateProject($data) {
$projectCtrler = $this->createHelper ( 'Project' );
$projectCtrler->updateProject ( $data );
}
/*
* func to delete project
*/
function deleteProject($data) {
$projectCtrler = $this->createHelper ( 'Project' );
$projectCtrler->deleteProject ( $data ['project_id'] );
}
/*
* function to activate project
*/
function Activate($data) {
if (! empty ( $data ['project_id'] )) {
$ctrler = $this->createHelper ( 'Project' );
$ctrler->__changeStatus ( $data ['project_id'], 1 );
$ctrler->showProjectsManager ();
}
}
/*
* function to deactivate project
*/
function Inactivate($data) {
if (! empty ( $data ['project_id'] )) {
$ctrler = $this->createHelper ( 'Project' );
$ctrler->__changeStatus ( $data ['project_id'], 0 );
$ctrler->showProjectsManager ();
}
}
/*
* function to show the first page while access plugin
*/
function diaryManager($data) {
$sdMgrCtrler = $this->createHelper ( 'SD_Manager' );
$sdMgrCtrler->showSDList ( $data );
}
/*
* function to show the first page while access plugin
*/
function myTasks($data) {
$sdMgrCtrler = $this->createHelper ( 'SD_Manager' );
$sdMgrCtrler->showTaskList ( $data );
}
/*
* function to show the first page of the Seo-Diary Manager
*/
function newDiary($data) {
$sdMgrCtrler = $this->createHelper ( 'SD_Manager' );
$sdMgrCtrler->newDiary ( $data );
}
/*
* func to create new project
*/
function createDiary($data) {
$sdMgrCtrler = $this->createHelper ( 'SD_Manager' );
$sdMgrCtrler->createDiary ( $data );
}
/*
* func to edit the diary
*/
function editDiary($data) {
$sdMgrCtrler = $this->createHelper ( 'SD_Manager' );
$sdMgrCtrler->editDiary ( $data ['project_id'] );
}
/*
* func to update project
*/
function updateDiary($data) {
$sdMgrCtrler = $this->createHelper ( 'SD_Manager' );
$sdMgrCtrler->updateDiary ( $data );
}
/*
* func to delete project
*/
function deleteDiary($data) {
$sdMgrCtrler = $this->createHelper ( 'SD_Manager' );
$sdMgrCtrler->deleteDiary ( $data ['project_id'] );
}
/*
* func to show create new diary comment form
*/
function newComment($data) {
$sdMgrCtrler = $this->createHelper ( 'SD_Manager' );
$sdMgrCtrler->newDiaryComments ( $data );
}
/*
* func to create new project
*/
function createComment($data) {
$sdMgrCtrler = $this->createHelper ( 'SD_Manager' );
$sdMgrCtrler->createDiaryComment ( $data );
}
/*
* function show system settings
*/
function settings($data) {
checkAdminLoggedIn ();
$settingsCtrler = $this->createHelper ( 'sdsettings' );
$settingsCtrler->showSDPluginSettings ();
}
/*
* function to save plugin settings
*/
function updateSettings($data) {
checkAdminLoggedIn ();
$settingsCtrler = $this->createHelper ( 'sdsettings' );
$settingsCtrler->updatePluginSettings ( $data );
}
/*
* function show system settings
*/
function projectSummery($data) {
$sdMgrCtrler = $this->createHelper('SD_Manager');
$sdMgrCtrler->showProjectSummery( $data );
}
/*
* function for start sending status to social media networks like fb, twitter, linkedin using cron
*/
function cronjob() {
$reportCtrler = $this->createHelper ( 'SD_Manager' );
$reportCtrler->startCronJob( $data );
}
}
?>