forked from trismi/uw-php
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathproject
More file actions
181 lines (159 loc) · 3.57 KB
/
project
File metadata and controls
181 lines (159 loc) · 3.57 KB
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
<?php
class ClientsView //vy
{
/***
* This function renders the list of clients, along with buttons for actions for each client
* Each client's saved Projects will render as a list
* Each client will have an upload button.
* Each client will have a "generate code" button.
* Each client will have a "merge client" button that will merge it's Projects into another client, then delete the client.
***/
public function viewRender(){}
}
//ClientsModel -- database
class ClientsController //vy
{
/***
* This function will create a new client in the database.
**/
public function createNewClient()
{
//DAL:insert
}
/***
* This function will merge the data from one client into another client, then delete the client in question.
***/
public function mergeClient()
{
//DAL:update
//Merges Projects from one client into another client in case of duplicate clients
}
/***
* This function will upload data associated to a client's module.
***/
public function uploadClientData()
{
//DAL:insert
//Merges Projects from one client into another client in case of duplicate clients
}
/***
* Will only be called by mergeClient. Deletes the client
**/
private function deleteClient()
{
//DAL:delete
//deletes a client. should only use after mergeClient (no data loss)
}
}
/*Client Table-
client_id client_name
Module table
module_id client_id code (blob/varchar) category preview_image(blob)
Project Table
project_id client_id shell_id (module)
Project Helper Table
project_id module_id
*/
/***
* Has properties and no functions
*
**/
class Module //vy
{
$client;
$category;// (shell, preheader, nav, header, hero, rescue, etc)
$code;
$preview_image;
$hasChildren;
public function __construct( $cli, $cat, $cod, $pi, $hsCh)
{
}
}
/***
* Represents a Project.
* @var shell -- the shell
* @var module_list -- associated modules for this Project
**/
class ProjectModel //trisha
{
property:shell
property:module list
}
class ProjectView //trisha
{
/***
* Will render the view for this Project.
* Look at the picture to see what panels need to be included
**/
public function render()
{
// -this is the panel that triggers ProjectController / generate button for the code
// -needs to have an "upload images" button
// -module drag&drop reordering
// -load saved Project
// -save Project
}
}
/***
* This class controls the project model (db based)
**/
class ProjectController //trisha
{
private class Parser //trisha & vy
{
parseTags
findInsertTags
setModule
getModule
insertResource
resizeImages
}
/***
* This will return the generated code for the project
* @var shell -- the shell all the other code will reside in
* @var modules -- the list of modules being used
* @var images -- the images to be inserted / resized
**/
public function generateProjectCode()
{
}
/***
* This will save a shell with an associated module list to be quick-loaded for future use
* @var shell
* @var module_list
**/
public function saveProject()
{
}
/***
* This will retreived a project model from the database, and load the view with the appropriate variables.
* @var project_id -- the project id
**/
public function loadProject()
{
}
}
/*
ProjectModel
Shell
Ordered associated modules
client_id project_id module_id
1 2 3
1 2 1
*/
/***
* This is the database access layer. It will be used by the other classes.
**/
class DatabaseAccessLayer //vy
{
/* steal all this crap from asn3*/
/*DAL (database access layer)
connect
disconnect
insert
update
select
delete
*/
}
?>