Some more fixes and code cleanup
Jeremy D

Jeremy D commited on 2011-12-31 17:19:40
Showing 7 changed files, with 212 additions and 11 deletions.

... ...
@@ -0,0 +1,30 @@
1
+<?php
2
+/*
3
+ * SMF Package Manager Generator
4
+ * Author: SleePy (JeremyD)
5
+ * Repository: https://github.com/jdarwood007/smf_package_maker
6
+ * License: BSD 3 Clause; See license.txt
7
+*/
8
+if (!defined('PacManGen')) { exit('[' . basename(__FILE__) . '] Direct access restricted');}
9
+
10
+/* WordPress Integration
11
+ * http://sleepycode.com/2011/11/wordpress-templates-on-non-wordpress-pages/
12
+*/
13
+require_once('../wp-ssi.php');
14
+
15
+// Load the headers up.
16
+function pacman_header($headers)
17
+{
18
+	if (!empty($headers['css']))
19
+		foreach ($headers['css'] as $css)
20
+			wp_enqueue_style($css['name'], $css['href']);
21
+		
22
+	if (!empty($headers['js']))
23
+		foreach ($headers['js'] as $js)
24
+				wp_enqueue_script($js['src'], $js['src']);
25
+}
26
+
27
+// We do nothing for the footer.
28
+function pacman_footer()
29
+{
30
+}
... ...
@@ -68,7 +68,7 @@ function info_section()
68 68
 			<br />
69 69
 			<fieldset id="preview_container" style="display: none;" class="edits" >
70 70
 				<legend>', $text['preview_header'], '</legend>
71
-				<textarea id="preview" cols="150" rows="25"></textarea>
71
+				<textarea id="preview" rows="25"></textarea>
72 72
 			</fieldset>
73 73
 				<br />';
74 74
 
... ...
@@ -88,7 +88,7 @@ function info_templates()
88 88
 			<fieldset id="action-#ACTIONINDEX#" class="edits">
89 89
 				<input type="hidden" id="action-#ACTIONINDEX#-delete" value="0" />
90 90
 				<legend>
91
-					<span class="alignright">
91
+					<span class="floatbuttons">
92 92
 						<a href="#" class="delete_action" data-action="#ACTIONINDEX#">[', $text['button_delete'], ']</a>
93 93
 						<a href="#" class="restore_action" data-action="#ACTIONINDEX#" style="display: none;">[', $text['button_restore'], ']</a>
94 94
 						&nbsp;&mdash;&nbsp;
... ...
@@ -123,7 +123,7 @@ function info_templates()
123 123
 				<fieldset id="action-#ACTIONINDEX#-instruct-#INSTRUCTINDEX#" class="edit">
124 124
 					<input type="hidden" id="action-#ACTIONINDEX#-instruct-#INSTRUCTINDEX#-delete" value="0" />
125 125
 					<legend>
126
-						<span class="alignright">
126
+						<span class="floatbuttons">
127 127
 							<a href="#" class="delete_change" data-action="#ACTIONINDEX#" data-instruct="#INSTRUCTINDEX#">[', $text['button_delete'], ']</a>
128 128
 							<a href="#" class="restore_change" data-action="#ACTIONINDEX#" data-instruct="#INSTRUCTINDEX#" style="display: none;">[', $text['button_restore'], ']</a>
129 129
 							&nbsp;&mdash;&nbsp;
... ...
@@ -60,7 +60,7 @@ function mod_section()
60 60
 			<br />
61 61
 			<fieldset id="preview_container" style="display: none;" class="edits" >
62 62
 				<legend>', $text['preview_header'], '</legend>
63
-				<textarea id="preview" cols="150" rows="25"></textarea>
63
+				<textarea id="preview" rows="25"></textarea>
64 64
 			</fieldset>
65 65
 				<br />';
66 66
 }
... ...
@@ -79,7 +79,7 @@ function mod_templates()
79 79
 			<fieldset id="file-#FILEINDEX#" class="edits">
80 80
 				<input type="hidden" id="file-#FILEINDEX#-delete" value="0" />
81 81
 				<legend>
82
-					<span class="alignright">
82
+					<span class="floatbuttons">
83 83
 						<a href="#" class="delete_file" data-file="#FILEINDEX#">[', $text['button_delete'], ']</a>
84 84
 						<a href="#" class="restore_file" data-file="#FILEINDEX#" style="display: none;">[', $text['button_restore'], ']</a>
85 85
 						&nbsp;&mdash;&nbsp;
... ...
@@ -120,7 +120,7 @@ function mod_templates()
120 120
 				<fieldset id="file-#FILEINDEX#-edit-#EDITINDEX#" class="edit">
121 121
 					<input type="hidden" id="file-#FILEINDEX#-edit-#EDITINDEX#-delete" value="0" />
122 122
 					<legend>
123
-						<span class="alignright">
123
+						<span class="floatbuttons">
124 124
 							<a href="#" class="delete_change" data-file="#FILEINDEX#" data-edit="#EDITINDEX#">[', $text['button_delete'], ']</a>
125 125
 							<a href="#" class="restore_change" data-file="#FILEINDEX#" data-edit="#EDITINDEX#" style="display: none;">[', $text['button_restore'], ']</a>
126 126
 							&nbsp;&mdash;&nbsp;
... ...
@@ -47,7 +48,8 @@ img
47 48
 {
48 49
 	clear: both;
49 50
 }
50
-a, a:link, a:visited{
51
+a, a:link, a:visited
52
+{
51 53
 	color: #333;
52 54
 	text-decoration: underline;
53 55
 }
... ...
@@ -142,6 +150,23 @@ input, textarea
142 150
 	min-height: 41em;
143 151
 }
144 152
 
153
+/* Fixes some wordpress integrations */
154
+.entry #pacmangen
155
+{
156
+	margin-top: -2em;
157
+	margin-bottom: -5em;
158
+}
159
+
160
+#preview_container #preview
161
+{
162
+	width: 100%;
163
+}
164
+
165
+.floatbuttons
166
+{
167
+	float: right;
168
+}
169
+
145 170
 dl.info dt
146 171
 {
147 172
 	clear: both;
... ...
@@ -258,3 +285,7 @@ fieldset.edits legend
258 285
 	width: 100%;
259 286
 }
260 287
 
288
+.action_index ol li
289
+{
290
+	line-height: 2em;
291
+}
... ...
@@ -0,0 +1,149 @@
1
+/*** The Specific CSS starts here, the rest is the headers, footers and general ***/
2
+#pacmangen
3
+{
4
+	width: 100%;
5
+	background: #fff;
6
+	min-height: 41em;
7
+}
8
+
9
+/* Fixes some wordpress integrations */
10
+.entry #pacmangen
11
+{
12
+	margin-top: -2em;
13
+	margin-bottom: -4em;
14
+}
15
+
16
+#preview_container #preview
17
+{
18
+	width: 100%;
19
+}
20
+
21
+.floatbuttons
22
+{
23
+	float: right;
24
+}
25
+
26
+dl.info dt
27
+{
28
+	clear: both;
29
+	float: left;
30
+	margin: 0 0 10px;
31
+	padding: 0;
32
+	width: 48%;
33
+}
34
+
35
+dl.info dd
36
+{
37
+	float: left;
38
+	margin: 0 0 3px;
39
+	padding: 0;
40
+	width: 48%;
41
+}
42
+
43
+dl.edits dt
44
+{
45
+	clear: both;
46
+	float: left;
47
+	margin: 0 0 10px;
48
+	padding: 0;
49
+	width: 15em;
50
+}
51
+
52
+dl.edits dd
53
+{
54
+	float: left;
55
+	margin: 0 0 3px;
56
+	padding: 0;
57
+}
58
+
59
+@font-face
60
+{
61
+	font-family: 'Paytone One';
62
+	font-style: normal;
63
+	font-weight: normal;
64
+	src: local('Paytone One'), local('PaytoneOne'), url('http://themes.googleusercontent.com/static/fonts/paytoneone/v4/D_d4Nj6jwG2cmUCLYeqgKYbN6UDyHWBl620a-IRfuBk.woff') format('woff');
65
+}
66
+
67
+.alignleft
68
+{
69
+	float: left;
70
+}
71
+
72
+.alignright
73
+{
74
+	float: right;
75
+}
76
+
77
+#basic_info
78
+{
79
+	float: left;
80
+	margin-left: 10%;
81
+}
82
+
83
+#details_info
84
+{
85
+	float: right;
86
+	margin-right: 10%;
87
+}
88
+
89
+#basic_info, #details_info
90
+{
91
+	padding: 5px 10px;
92
+	background: #eee;
93
+	max-width: 25em;
94
+}
95
+
96
+#basic_info legend, #details_info legend
97
+{
98
+	padding: 3px 3px 1px 3px;
99
+	border-bottom: 1px solid #000;
100
+	background: #fff;
101
+}
102
+
103
+fieldset.edits
104
+{
105
+	padding: 5px 10px;
106
+	margin: 0 10px;
107
+	background: #eee;
108
+	border: 1px solid #000;
109
+}
110
+
111
+fieldset.edits fieldset
112
+{
113
+	padding: 5px 10px;
114
+	background: #eee;
115
+	border: 1px solid #000;
116
+	border-top: 1px dotted #000;
117
+}
118
+
119
+fieldset.edits legend
120
+{
121
+	width: 100%;
122
+	background: transparent;
123
+}
124
+
125
+.pad
126
+{
127
+	padding-left: 3em;
128
+}
129
+
130
+.action_index p#welcome
131
+{
132
+	padding: 3px 3px 1px 3px;
133
+	border: 1px solid #000;
134
+	background: #eee;
135
+	margin: 0 1em 2em 1em;
136
+}
137
+
138
+.action_index ol
139
+{
140
+	list-style: decimal;
141
+	font-size: 200%;
142
+	margin-left: 2em;
143
+	width: 100%;
144
+}
145
+
146
+.action_index ol li
147
+{
148
+	line-height: 2em;
149
+}
0 150
\ No newline at end of file
... ...
@@ -18,7 +18,7 @@ require_once(dirname(__FILE__) . '/settings.php');
18 18
 require_once(dirname(__FILE__) . '/_' . $pmg_action . 'maker.php');
19 19
 require_once(dirname(__FILE__) . '/language/' . $pmg['language'] . '.php');
20 20
 
21
-if (!empty($pmg['theme_integration_file']) && isset($pmg['theme_integration_file']) && file_exists($pmg['theme_integration_file']))
21
+if (!empty($pmg['theme_integration']) && isset($pmg['theme_integration_file']) && file_exists($pmg['theme_integration_file']))
22 22
 	require_once($pmg['theme_integration_file']);
23 23
 
24 24
 $headers['css'][] = array('name' => $pmg['style'] . '-css', 'href' => $pmg['assets'] . '/' . $pmg['style'] . '.css', 'media' => 'all');
... ...
@@ -8,7 +8,7 @@
8 8
 if (!defined('PacManGen')) { exit('[' . basename(__FILE__) . '] Direct access restricted');}
9 9
 
10 10
 // Assets URL location.
11
-$pmg['assets'] = 'http://sleepycode.com/PacManGen/assets';
11
+$pmg['assets'] = './assets';
12 12
 
13 13
 // The name of this script (can also be the url).
14 14
 $pmg['scriptname'] = 'index.php';
... ...
@@ -20,7 +20,7 @@ $pmg['downloadname'] = 'downloader.php';
20 20
 $pmg['style'] = 'default';
21 21
 
22 22
 // Integration with another site.
23
-$pmg['theme_integration'] = true;
23
+$pmg['theme_integration'] = false;
24 24
 
25 25
 // If we are integrating, what file to include.  Needs to have pacman_header and pacmanfooter
26 26
 $pmg['theme_integration_file'] = '__integrate.php';
... ...
@@ -29,7 +29,7 @@ $pmg['theme_integration_file'] = '__integrate.php';
29 29
 $pmg['use_php'] = true;
30 30
 
31 31
 // The page title.
32
-$pmg['page_title'] = 'SleePyCode Package Manager Generator';
32
+$pmg['page_title'] = 'SMF Package Manager Generator';
33 33
 
34 34
 // Commenting out logo will remove it.
35 35
 $pmg['logo'] = $pmg['assets'] . '/logo.png';
36 36