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
|
<!-- cmsindex.php -->
<div id="cmsContentWrapper" class="cmsContent">
<div id="cmsContentHeader">
<?php
//$userType
if($userType=='Teacher') {
echo '
<div class="cmsButton right abowHeaderLine">Add Student</div>
<div class="cmsButton right abowHeaderLine">View students</div>
<div class="cmsButton right belowHeaderLine">Add Category</div>
';
}
?>
</div>
<div id="cmsContentBody">
<?php
//$filetree[];
foreach ($filetree as $category => $subCategories) {
echo '<div id="'.$category.'">
<div name="'.$category.'" class="categoryName">'
.$category.
'</div>';
foreach ($subCategories as $subCategory => $subCategoryContents) {
echo '<div name="'.$subCategory.'" class="subCategoryName">'
.$subCategory.
'</div>';
foreach ($subCategoryContents['examples'] as $example) {
echo '<div name="'.$example.'" class="exampleName">'
.$example.
'</div>';
}
foreach ($subCategoryContents['quizzes'] as $quiz) {
echo '<div name="'.$quiz.'" class="quizName">'
.$quiz.
'</div>';
}
}
echo '</div><!-- end of category div -->';
}
?>
<!-- Loops down below makes it possible to load values from a source -->
<?php
/*$counter=1;
foreach ($titles as $category => $categoryArray){
$categoryData = explode(',', $category);
$counter++;
if($counter % 2){ // Lös detta på bättre sätt
echo '<div id="'.$category.'" class="banner row">
<h1 class="categoryName" name="'.$category.'">
<p class="categoryIcon expanded" onclick="categoryExpand("'.$category.'");">?</p>'.$category.'
</h1>
<div class="categoryMoveUp" onclick="categoryMoveUp("'.$category.'");">&</div>
<div class="categoryMoveDown" onclick="categoryMoveDown("'.$category.'");">&</div>';
foreach ($categoryArray as $subCategory => $subCatArray){
if(!is_numeric($subCategory)){
echo '<div class="categoryBorder"></div>
<div id='.$subCategory.'>
<h3 class="subCategoryName row">
<p class="categoryIcon expanded" onclick="categoryExpand("'.$subCategory.'")">?</p>'.$subCategory.'
</h3>';
if(count($subCatArray)>0){
foreach ($subCatArray as $example){
echo '<div class="categoryBorder"></div>
<div class="exampleBorder"></div>
<a href="#" class="exampleName row">
<div class="exampleIcon"></div>
'.$example.'
</a>';
}
}
echo '</div>';
}
}
echo '</div>';
}
}*/
?>
</div><!-- end of cmsContentBody div -->
</div>
|