141 |
142 |
143 |
144 |
145 |
146 |
147 |
--------------------------------------------------------------------------------
/includes/class-wsu-student-financial-services-theme.php:
--------------------------------------------------------------------------------
1 | setup_hooks();
31 | }
32 | return self::$instance;
33 | }
34 |
35 | /**
36 | * Setup hooks to include.
37 | *
38 | * @since 0.0.1
39 | */
40 | public function setup_hooks() {
41 | add_filter( 'spine_child_theme_version', array( $this, 'theme_version' ) );
42 | add_action( 'init', array( $this, 'register_menu' ), 10 );
43 | add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
44 | add_filter( 'body_class', array( $this, 'browser_body_class' ) );
45 | add_filter( 'wsuwp_content_syndicate_json', array( $this, 'announcements_html' ), 10, 2 );
46 | add_filter( 'nav_menu_css_class', array( $this, 'menu_classes' ), 12, 3 );
47 | }
48 |
49 | /**
50 | * Provide a theme version for use in cache busting.
51 | *
52 | * @since 0.0.1
53 | *
54 | * @return string
55 | */
56 | public function theme_version() {
57 | return $this->script_version;
58 | }
59 |
60 | /**
61 | * Register the additional menu used in the theme footer.
62 | *
63 | * @since 0.0.1
64 | */
65 | public function register_menu() {
66 | register_nav_menu( 'footer', 'Footer' );
67 | }
68 |
69 | /**
70 | * Enqueue the scripts used in the theme.
71 | *
72 | * @since 0.0.1
73 | */
74 | public function enqueue_scripts() {
75 | if ( is_front_page() ) {
76 | wp_enqueue_script( 'sfs-scripts', get_stylesheet_directory_uri() . '/js/home.min.js', array( 'jquery' ), $this->script_version, true );
77 | }
78 |
79 | $post = get_post();
80 |
81 | if ( isset( $post->post_content ) && strpos( $post->post_content, 'js-accordion' ) ) {
82 | wp_enqueue_script( 'sfs-scripts', get_stylesheet_directory_uri() . '/js/accordion.min.js', array( 'jquery' ), $this->script_version, true );
83 | }
84 |
85 | if ( isset( $post->post_content ) && has_shortcode( $post->post_content, 'wsuwp_toc' ) ) {
86 | $body_classes = get_post_meta( $post->ID, '_wsuwp_body_class', true );
87 |
88 | if ( false !== strpos( $body_classes, 'convert-toc-to-select' ) ) {
89 | wp_enqueue_script( 'sfs-convert-toc', get_stylesheet_directory_uri() . '/js/toc-select.min.js', array( 'wsuwp-toc-generator', 'jquery' ), $this->script_version, true );
90 | }
91 | }
92 | }
93 |
94 | /**
95 | * Apply 'gecko' as a body class on the home page for Firefox users.
96 | *
97 | * @since 0.0.3
98 | *
99 | * @param array $classes Original body classes.
100 | *
101 | * @return array $classes Modified body classes.
102 | */
103 | public function browser_body_class( $classes ) {
104 | global $is_gecko;
105 |
106 | if ( is_front_page() && $is_gecko ) {
107 | $classes[] = 'gecko';
108 | }
109 |
110 | return $classes;
111 | }
112 |
113 | /**
114 | * Provide a custom HTML template for use with syndicated content.
115 | *
116 | * @param string $content The unfiltered content.
117 | * @param stdClass $atts Shortcode attributes.
118 | *
119 | * @return string Modified HTML to output.
120 | */
121 | public function announcements_html( $content, $atts ) {
122 | return str_replace( '', ' » Read More', $content );
123 | }
124 |
125 | /**
126 | * Filter menu item classes for event category pages.
127 | *
128 | * @param array $classes Current list of nav menu classes.
129 | * @param WP_Post $item Post object representing the menu item.
130 | * @param stdClass $args Arguments used to create the menu.
131 | *
132 | * @return array
133 | */
134 | public function menu_classes( $classes, $item, $args ) {
135 | // Bail if this isn't the site menu.
136 | if ( 'site' !== $args->menu ) {
137 | return $classes;
138 | }
139 |
140 | // Bail if this isn't an Events Category page.
141 | if ( ! is_tax( 'tribe_events_cat' ) ) {
142 | return $classes;
143 | }
144 |
145 | // Run applicable URLs through `trailingslashit` just to be safe.
146 | $current_url = trailingslashit( get_term_link( get_query_var( 'term' ), 'tribe_events_cat' ) );
147 | $menu_item_url = trailingslashit( $item->url );
148 |
149 | if ( $current_url === $menu_item_url ) {
150 | $classes[] = 'active';
151 | } else {
152 | $classes = array();
153 | }
154 |
155 | return $classes;
156 | }
157 | }
158 |
--------------------------------------------------------------------------------
/functions.php:
--------------------------------------------------------------------------------
1 | 'Actions',
33 | 'id' => 'site-actions',
34 | 'description' => 'Displays the action links on the top of every page.',
35 | );
36 |
37 | register_sidebar( $header_args );
38 |
39 | $footer_args = array(
40 | 'name' => 'Give Link',
41 | 'id' => 'give-link',
42 | 'description' => 'Displays the "give" link in the site footer.',
43 | );
44 |
45 | register_sidebar( $footer_args );
46 |
47 | } );
48 |
49 | /**
50 | * Determine what should be displayed in the main header area.
51 | *
52 | * @since 0.0.1
53 | *
54 | * @return array List of elements for output in main header.
55 | */
56 | function sfs_get_header_elements() {
57 | $sfs_headers = array(
58 | 'section_title' => '',
59 | 'page_sup' => '',
60 | 'page_sub' => '',
61 | );
62 |
63 | // Section title.
64 | if ( is_page() ) {
65 | // Retrieve the title of the top-level category for pages.
66 | $category = get_the_category();
67 | if ( $category ) {
68 | $category_parents = get_category_parents( $category[0]->term_id );
69 | $top_category = explode( '/', $category_parents );
70 | $section = rtrim( $top_category[0], '/' );
71 | if ( $section ) {
72 | $sfs_headers['section_title'] = $section;
73 | }
74 | } else {
75 | // Fall back to the page title if the page has no categories.
76 | $sfs_headers['section_title'] = get_the_title();
77 | }
78 | } elseif ( is_singular( 'post' ) || ( is_archive() && ! is_post_type_archive( 'tribe_events' ) ) ) {
79 | // For posts and archive views (excluding events archives), use "Latest".
80 | $sfs_headers['section_title'] = 'Latest';
81 | } elseif ( is_single() && ! is_singular( 'tribe_events' ) ) {
82 | // For all other post types except events, retrieve:
83 | // 1) a category name; or
84 | // 2) the post type name.
85 | $category = get_the_category();
86 | if ( $category ) {
87 | $sfs_headers['section_title'] = $category[0]->cat_name;
88 | } else {
89 | $post_type = get_post_type_object( get_post_type() );
90 | $sfs_headers['section_title'] = $post_type->labels->name;
91 | }
92 | }
93 |
94 | if ( '' === $sfs_headers['section_title'] ) {
95 | // Use the Spine parent theme's sub header value for anything else.
96 | $spine_main_header_values = spine_get_main_header();
97 | $sfs_headers['section_title'] = $spine_main_header_values['sub_header_default'];
98 | }
99 |
100 | // Page sup header.
101 | $page_sup = get_post_meta( get_the_ID(), 'sup-header', true );
102 | if ( $page_sup ) {
103 | $sfs_headers['page_sup'] = $page_sup;
104 | }
105 |
106 | // Page sub header.
107 | if ( is_singular( 'post' ) ) {
108 | // For posts, retrieve:
109 | // 1) a category name; or
110 | // 2) the post type name.
111 | $category = get_the_category();
112 | if ( $category ) {
113 | $sfs_headers['page_sub'] = $category[0]->cat_name;
114 | } else {
115 | $post_type = get_post_type_object( get_post_type() );
116 | $sfs_headers['page_sub'] = $post_type->labels->name;
117 | }
118 | } elseif ( is_singular( 'tribe_events' ) ) {
119 | // For individual events, retrieve:
120 | // 1) an event category name; or
121 | // 2) "Events".
122 | $event_category = get_the_terms( get_queried_object_id(), 'tribe_events_cat' );
123 | if ( $event_category ) {
124 | $sfs_headers['page_sub'] = $event_category[0]->name;
125 | } else {
126 | $sfs_headers['page_sub'] = 'Events';
127 | }
128 | } elseif ( is_post_type_archive( 'tribe_events' ) ) {
129 | if ( is_tax() ) {
130 | // Retrieve the term title for Event taxonomy archives.
131 | $sfs_headers['page_sub'] = single_term_title( '', false );
132 | } else {
133 | // Output "Full Calendar" for the main Events archive view.
134 | $sfs_headers['page_sub'] = 'Full Calendar';
135 | }
136 | } elseif ( is_archive() ) {
137 | // Use the Spine parent theme's sub header value for anything else.
138 | $spine_main_header_values = spine_get_main_header();
139 | $sfs_headers['page_sub'] = $spine_main_header_values['sub_header_default'];
140 | } else {
141 | // For everything else, grab the Spine Main Header Bottom Header Text, or the post title
142 | $page_sub = get_post_meta( get_the_ID(), 'sub-header', true );
143 | $sfs_headers['page_sub'] = ( $page_sub ) ? $page_sub : get_the_title();
144 | }
145 |
146 | return apply_filters( 'sfs_theme_header_elements', $sfs_headers );
147 | }
148 |
--------------------------------------------------------------------------------
/css/07-home-page.css:
--------------------------------------------------------------------------------
1 | .crimson-top {
2 | border-top: 5px solid #981e32;
3 | }
4 |
5 | /* Video/intro section */
6 | section.video {
7 | padding-bottom: 3rem;
8 | position: relative;
9 | z-index: 1;
10 | }
11 |
12 | .column.video {
13 | position: static;
14 | }
15 |
16 | .video-container {
17 | height: 100%;
18 | left: 0;
19 | mix-blend-mode: multiply;
20 | overflow: hidden;
21 | position: absolute;
22 | top: 0;
23 | width: 100%;
24 | z-index: -1;
25 | display: flex;
26 | justify-content: center;
27 | }
28 |
29 | .video-container video {
30 | min-height: 100%;
31 | width: auto;
32 | }
33 |
34 | .video-container:after {
35 | background: rgba(0, 0, 0, .1);
36 | content: "";
37 | height: 100%;
38 | position: absolute;
39 | width: 100%;
40 | }
41 |
42 | .multiply .transparent-crimson-back {
43 | background: none;
44 | }
45 |
46 | .no-mix-blend-mode .multiply .transparent-crimson-back {
47 | background: rgba(152, 30, 50, .9);
48 | }
49 |
50 | .multiply .transparent-crimson-back:before {
51 | background: #940606;
52 | content: "";
53 | position: absolute;
54 | width: 100%;
55 | height: 100%;
56 | left: 0;
57 | top: 0;
58 | z-index: -2;
59 | }
60 |
61 | .false-header1 {
62 | border-bottom: solid 2px #981e32;
63 | color: #fff;
64 | font-size: 1.2em;
65 | font-weight: 800;
66 | letter-spacing: 1px;
67 | margin-bottom: 2.5em;
68 | padding-bottom: .5em;
69 | text-transform: uppercase;
70 | }
71 |
72 | .help {
73 | color: #fff;
74 | font-size: 4em;
75 | font-weight: 800;
76 | margin-bottom: 5px;
77 | }
78 |
79 | .five-steps {
80 | counter-reset: count-it;
81 | list-style: none;
82 | padding: 0 0 2.5rem;
83 | }
84 |
85 | .five-steps li {
86 | padding: 0;
87 | }
88 |
89 | .five-steps a,
90 | .five-steps a:hover {
91 | border-bottom: 1px solid #717171;
92 | color: #fff;
93 | display: block;
94 | font-size: 1.1em;
95 | font-weight: 400;
96 | margin-left: 4.5rem;
97 | padding: .5em 0;
98 | position: relative;
99 | transition: color .4s, padding .4s;
100 | }
101 |
102 | .five-steps a:before {
103 | align-items: center;
104 | background: #b5babe;
105 | color: #fff;
106 | content: counter(count-it);
107 | counter-increment: count-it;
108 | display: flex;
109 | height: calc(100% - .2em);
110 | justify-content: center;
111 | left: -4.5rem;
112 | position: absolute;
113 | text-align: center;
114 | top: .2em;
115 | transition: background .4s, color .4s;
116 | width: 2.5rem;
117 | }
118 |
119 | .five-steps a:hover {
120 | background: none;
121 | padding-left: .75em;
122 | }
123 |
124 | .five-steps a:hover:before {
125 | background: #fff;
126 | color: #981e32;
127 | }
128 |
129 | /* Announcements and quicklinks */
130 | .home .wsuwp-content-syndicate-list {
131 | list-style-type: none;
132 | }
133 |
134 | .home .wsuwp-content-syndicate-item {
135 | margin-bottom: 1em;
136 | }
137 |
138 | .home .wsuwp-content-syndicate-item a,
139 | .home-calendar .wsuwp-content-syndicate-event a {
140 | text-decoration: none;
141 | color: #393939;
142 | border-bottom: none;
143 | }
144 |
145 | .home .wsuwp-content-syndicate-item a .read-more,
146 | .home-calendar .wsuwp-content-syndicate-event a .read-more {
147 | font-size: .75em;
148 | font-weight: 700;
149 | color: #981e32;
150 | }
151 |
152 | .home .wsuwp-content-syndicate-item a:hover {
153 | color: #981e32;
154 | border-bottom: solid 1px #981e32;
155 | }
156 |
157 | .home .content-item-byline-author,
158 | .home .content-item-read-story {
159 | display: none;
160 | }
161 |
162 | .home main .quicklinks {
163 | display: flex;
164 | }
165 |
166 | .home main .quicklinks ul {
167 | list-style: none;
168 | margin: auto;
169 | padding: 0;
170 | }
171 |
172 | .home main .quicklinks li + li {
173 | margin-top: 1rem;
174 | }
175 |
176 | .home main .quicklinks a {
177 | border: 2px solid #981e32;
178 | box-sizing: border-box;
179 | color: #981e32;
180 | display: inline-block;
181 | font-size: .9em;
182 | font-weight: 600;
183 | letter-spacing: 2px;
184 | padding: 14px;
185 | text-align: center;
186 | text-transform: uppercase;
187 | transition: background .4s, color .4s;
188 | width: 100%;
189 | }
190 |
191 | .home main .quicklinks a:hover {
192 | background: #981e32;
193 | color: #fff;
194 | }
195 |
196 | /* Home page events */
197 | .home-calendar .wsuwp-content-syndicate-wrapper {
198 | overflow: hidden;
199 | padding-bottom: 2rem;
200 | }
201 |
202 | .home-calendar .wsuwp-content-syndicate-list {
203 | display: flex;
204 | padding: 0;
205 | position: relative;
206 | }
207 |
208 | .home-calendar .wsuwp-content-syndicate-event {
209 | box-sizing: border-box;
210 | flex: 1 0 25%;
211 | list-style: none;
212 | padding: .5em 1em 0 0;
213 | transition: background .4s;
214 | width: 25%;
215 | }
216 |
217 | .home-calendar .content-item-event-date {
218 | box-sizing: border-box;
219 | color: #fff;
220 | float: left;
221 | font-size: 32px;
222 | font-weight: 600;
223 | line-height: 50px;
224 | position: relative;
225 | text-align: center;
226 | text-transform: uppercase;
227 | width: 3.5rem;
228 | word-spacing: 3rem;
229 | z-index: 1;
230 | }
231 |
232 | .home-calendar .content-item-event-date:first-line {
233 | font-size: 12px;
234 | font-weight: 300;
235 | line-height: 24px;
236 | }
237 |
238 | .gecko .home-calendar .content-item-event-date {
239 | line-height: 33px;
240 | height: 74px;
241 | }
242 |
243 | .gecko .home-calendar .content-item-event-date:first-line {
244 | vertical-align: top;
245 | }
246 |
247 | .home-calendar .content-item-event-date:before,
248 | .home-calendar .content-item-event-date:after {
249 | content: "";
250 | left: 0;
251 | position: absolute;
252 | transition: background .4s;
253 | width: 100%;
254 | z-index: -1;
255 | }
256 |
257 | .home-calendar .content-item-event-date:before {
258 | background: #717171;
259 | height: 24px;
260 | top: 0;
261 | }
262 |
263 | .home-calendar .content-item-event-date:after {
264 | background: #b5babe;
265 | bottom: 0;
266 | height: 48px;
267 | }
268 |
269 | .home-calendar li:hover .content-item-event-date:before {
270 | background: #b5babe;
271 | }
272 |
273 | .home-calendar li:hover .content-item-event-date:after {
274 | background: #981e32;
275 | }
276 |
277 | .home-calendar .content-item-event-title {
278 | display: block;
279 | margin-left: 4.25rem;
280 | }
281 |
282 | .home-calendar .content-item-event-title a {
283 | border-bottom: 0;
284 | }
285 |
286 | .home-calendar .content-item-event-meta {
287 | display: none;
288 | }
289 |
290 | /* Home page event navigation */
291 | .event-control {
292 | border: none;
293 | display: block;
294 | height: 3rem;
295 | overflow: hidden;
296 | position: absolute;
297 | text-indent: -5rem;
298 | top: 50%;
299 | transform: translateY(-50%);
300 | width: 2rem;
301 | }
302 |
303 | .event-control:hover {
304 | background: none;
305 | border-bottom: none;
306 | }
307 |
308 | .event-control:before,
309 | .event-control:after {
310 | border: 1.5rem solid transparent;
311 | box-sizing: border-box;
312 | content: "";
313 | position: absolute;
314 | top: 0;
315 | }
316 |
317 | .event-control.prev {
318 | margin-left: -2.5rem;
319 | }
320 |
321 | .event-control.prev:before {
322 | border-right-color: #717171;
323 | right: 0;
324 | transition: border-right-color .4s;
325 | }
326 |
327 | .event-control.prev:hover:before {
328 | border-right-color: #981e32;
329 | }
330 |
331 | .event-control.prev:after {
332 | border-right-color: #fff;
333 | right: -.25rem;
334 | }
335 |
336 | .event-control.next {
337 | right: -.5rem;
338 | }
339 |
340 | .event-control.next:before {
341 | border-left-color: #717171;
342 | left: 0;
343 | transition: border-left-color .4s;
344 | }
345 |
346 | .event-control.next:hover:before {
347 | border-left-color: #981e32;
348 | }
349 |
350 | .event-control.next:after {
351 | border-left-color: #fff;
352 | left: -.25rem;
353 | }
354 |
355 | .social-media-channels {
356 | display: flex;
357 | justify-content: space-between;
358 | list-style: none;
359 | }
360 |
361 | .social-media-channels li {
362 | padding: 0;
363 | }
364 |
365 | .social-media-channels a {
366 | border: none;
367 | box-sizing: border-box;
368 | display: block;
369 | font-size: 1.8em;
370 | height: 33px;
371 | line-height: 33px;
372 | position: relative;
373 | text-indent: -99164px;
374 | width: 33px;
375 | }
376 |
377 | .social-media-channels a:hover {
378 | background: none;
379 | border: none;
380 | }
381 |
382 | .social-media-channels a:before {
383 | font-family: Spine-Icons;
384 | height: 33px;
385 | left: 0;
386 | position: absolute;
387 | text-align: center;
388 | text-indent: 0;
389 | top: 0;
390 | width: 33px;
391 | -webkit-font-smoothing: antialiased;
392 | -moz-osx-font-smoothing: grayscale;
393 | }
394 |
395 | .social-media-channels .facebook a:before {
396 | color: #3b5998;
397 | content: "F";
398 | }
399 |
400 | .social-media-channels .twitter a:before {
401 | color: #55acee;
402 | content: "T";
403 | }
404 |
405 | .social-media-channels .youtube a:before {
406 | color: #cc181e;
407 | content: "Y";
408 | }
409 |
410 | .social-media-channels .instagram a:before {
411 | color: #517fa5;
412 | content: "I";
413 | }
414 |
415 | .social-media-channels li a:hover:before {
416 | color: #981e32;
417 | }
418 |
419 | .home .site-action-links > ul > li {
420 | display: none;
421 | }
422 |
423 | .home .site-action-links .widget_polylang {
424 | border-left: none;
425 | display: block;
426 | }
427 |
428 | html[lang="es-ES"] .help {
429 | font-size: 3.5em;
430 | }
431 |
432 | @media only screen and (max-width: 1090px) {
433 |
434 | html[lang="es-ES"] .help {
435 | font-size: 4.5vw;
436 | }
437 | }
438 |
439 | @media screen and (max-width: 791px) {
440 |
441 | .home-calendar .wsuwp-content-syndicate-list li {
442 | flex: 1 0 50%;
443 | width: 50%;
444 | }
445 | }
446 |
447 | @media only screen and (max-width: 693px) {
448 |
449 | .home .halves .column.one {
450 | min-height: 350px;
451 | padding-left: 0;
452 | padding-right: 0;
453 | }
454 |
455 | html[lang="es-ES"] .help {
456 | font-size: 2.5em;
457 | }
458 | }
459 |
460 | @media only screen and (max-width: 530px) {
461 |
462 | .home-calendar .wsuwp-content-syndicate-list li {
463 | flex: 1 0 100%;
464 | width: 100%;
465 | }
466 |
467 | .home .column.intro p {
468 | font-size: 1.5em;
469 | }
470 |
471 | .home h1 {
472 | font-size: 3em;
473 | }
474 | }
475 |
476 | @media only screen and (min-width: 694px) {
477 |
478 | .home .halves .column.two {
479 | padding: 6rem 2rem;
480 | }
481 | }
482 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | WSU Student Financial Services Theme
2 |
3 | Copyright 2016 by Washington State University
4 |
5 | This program is free software; you can redistribute it and/or modify
6 | it under the terms of the GNU General Public License as published by
7 | the Free Software Foundation; either version 2 of the License, or
8 | (at your option) any later version.
9 |
10 | This program is distributed in the hope that it will be useful,
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | GNU General Public License for more details.
14 |
15 | You should have received a copy of the GNU General Public License
16 | along with this program; if not, write to the Free Software
17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 |
19 | =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
20 |
21 | GNU GENERAL PUBLIC LICENSE
22 | Version 2, June 1991
23 |
24 | Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
25 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
26 | Everyone is permitted to copy and distribute verbatim copies
27 | of this license document, but changing it is not allowed.
28 |
29 | Preamble
30 |
31 | The licenses for most software are designed to take away your
32 | freedom to share and change it. By contrast, the GNU General Public
33 | License is intended to guarantee your freedom to share and change free
34 | software--to make sure the software is free for all its users. This
35 | General Public License applies to most of the Free Software
36 | Foundation's software and to any other program whose authors commit to
37 | using it. (Some other Free Software Foundation software is covered by
38 | the GNU Lesser General Public License instead.) You can apply it to
39 | your programs, too.
40 |
41 | When we speak of free software, we are referring to freedom, not
42 | price. Our General Public Licenses are designed to make sure that you
43 | have the freedom to distribute copies of free software (and charge for
44 | this service if you wish), that you receive source code or can get it
45 | if you want it, that you can change the software or use pieces of it
46 | in new free programs; and that you know you can do these things.
47 |
48 | To protect your rights, we need to make restrictions that forbid
49 | anyone to deny you these rights or to ask you to surrender the rights.
50 | These restrictions translate to certain responsibilities for you if you
51 | distribute copies of the software, or if you modify it.
52 |
53 | For example, if you distribute copies of such a program, whether
54 | gratis or for a fee, you must give the recipients all the rights that
55 | you have. You must make sure that they, too, receive or can get the
56 | source code. And you must show them these terms so they know their
57 | rights.
58 |
59 | We protect your rights with two steps: (1) copyright the software, and
60 | (2) offer you this license which gives you legal permission to copy,
61 | distribute and/or modify the software.
62 |
63 | Also, for each author's protection and ours, we want to make certain
64 | that everyone understands that there is no warranty for this free
65 | software. If the software is modified by someone else and passed on, we
66 | want its recipients to know that what they have is not the original, so
67 | that any problems introduced by others will not reflect on the original
68 | authors' reputations.
69 |
70 | Finally, any free program is threatened constantly by software
71 | patents. We wish to avoid the danger that redistributors of a free
72 | program will individually obtain patent licenses, in effect making the
73 | program proprietary. To prevent this, we have made it clear that any
74 | patent must be licensed for everyone's free use or not licensed at all.
75 |
76 | The precise terms and conditions for copying, distribution and
77 | modification follow.
78 |
79 | GNU GENERAL PUBLIC LICENSE
80 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
81 |
82 | 0. This License applies to any program or other work which contains
83 | a notice placed by the copyright holder saying it may be distributed
84 | under the terms of this General Public License. The "Program", below,
85 | refers to any such program or work, and a "work based on the Program"
86 | means either the Program or any derivative work under copyright law:
87 | that is to say, a work containing the Program or a portion of it,
88 | either verbatim or with modifications and/or translated into another
89 | language. (Hereinafter, translation is included without limitation in
90 | the term "modification".) Each licensee is addressed as "you".
91 |
92 | Activities other than copying, distribution and modification are not
93 | covered by this License; they are outside its scope. The act of
94 | running the Program is not restricted, and the output from the Program
95 | is covered only if its contents constitute a work based on the
96 | Program (independent of having been made by running the Program).
97 | Whether that is true depends on what the Program does.
98 |
99 | 1. You may copy and distribute verbatim copies of the Program's
100 | source code as you receive it, in any medium, provided that you
101 | conspicuously and appropriately publish on each copy an appropriate
102 | copyright notice and disclaimer of warranty; keep intact all the
103 | notices that refer to this License and to the absence of any warranty;
104 | and give any other recipients of the Program a copy of this License
105 | along with the Program.
106 |
107 | You may charge a fee for the physical act of transferring a copy, and
108 | you may at your option offer warranty protection in exchange for a fee.
109 |
110 | 2. You may modify your copy or copies of the Program or any portion
111 | of it, thus forming a work based on the Program, and copy and
112 | distribute such modifications or work under the terms of Section 1
113 | above, provided that you also meet all of these conditions:
114 |
115 | a) You must cause the modified files to carry prominent notices
116 | stating that you changed the files and the date of any change.
117 |
118 | b) You must cause any work that you distribute or publish, that in
119 | whole or in part contains or is derived from the Program or any
120 | part thereof, to be licensed as a whole at no charge to all third
121 | parties under the terms of this License.
122 |
123 | c) If the modified program normally reads commands interactively
124 | when run, you must cause it, when started running for such
125 | interactive use in the most ordinary way, to print or display an
126 | announcement including an appropriate copyright notice and a
127 | notice that there is no warranty (or else, saying that you provide
128 | a warranty) and that users may redistribute the program under
129 | these conditions, and telling the user how to view a copy of this
130 | License. (Exception: if the Program itself is interactive but
131 | does not normally print such an announcement, your work based on
132 | the Program is not required to print an announcement.)
133 |
134 | These requirements apply to the modified work as a whole. If
135 | identifiable sections of that work are not derived from the Program,
136 | and can be reasonably considered independent and separate works in
137 | themselves, then this License, and its terms, do not apply to those
138 | sections when you distribute them as separate works. But when you
139 | distribute the same sections as part of a whole which is a work based
140 | on the Program, the distribution of the whole must be on the terms of
141 | this License, whose permissions for other licensees extend to the
142 | entire whole, and thus to each and every part regardless of who wrote it.
143 |
144 | Thus, it is not the intent of this section to claim rights or contest
145 | your rights to work written entirely by you; rather, the intent is to
146 | exercise the right to control the distribution of derivative or
147 | collective works based on the Program.
148 |
149 | In addition, mere aggregation of another work not based on the Program
150 | with the Program (or with a work based on the Program) on a volume of
151 | a storage or distribution medium does not bring the other work under
152 | the scope of this License.
153 |
154 | 3. You may copy and distribute the Program (or a work based on it,
155 | under Section 2) in object code or executable form under the terms of
156 | Sections 1 and 2 above provided that you also do one of the following:
157 |
158 | a) Accompany it with the complete corresponding machine-readable
159 | source code, which must be distributed under the terms of Sections
160 | 1 and 2 above on a medium customarily used for software interchange; or,
161 |
162 | b) Accompany it with a written offer, valid for at least three
163 | years, to give any third party, for a charge no more than your
164 | cost of physically performing source distribution, a complete
165 | machine-readable copy of the corresponding source code, to be
166 | distributed under the terms of Sections 1 and 2 above on a medium
167 | customarily used for software interchange; or,
168 |
169 | c) Accompany it with the information you received as to the offer
170 | to distribute corresponding source code. (This alternative is
171 | allowed only for noncommercial distribution and only if you
172 | received the program in object code or executable form with such
173 | an offer, in accord with Subsection b above.)
174 |
175 | The source code for a work means the preferred form of the work for
176 | making modifications to it. For an executable work, complete source
177 | code means all the source code for all modules it contains, plus any
178 | associated interface definition files, plus the scripts used to
179 | control compilation and installation of the executable. However, as a
180 | special exception, the source code distributed need not include
181 | anything that is normally distributed (in either source or binary
182 | form) with the major components (compiler, kernel, and so on) of the
183 | operating system on which the executable runs, unless that component
184 | itself accompanies the executable.
185 |
186 | If distribution of executable or object code is made by offering
187 | access to copy from a designated place, then offering equivalent
188 | access to copy the source code from the same place counts as
189 | distribution of the source code, even though third parties are not
190 | compelled to copy the source along with the object code.
191 |
192 | 4. You may not copy, modify, sublicense, or distribute the Program
193 | except as expressly provided under this License. Any attempt
194 | otherwise to copy, modify, sublicense or distribute the Program is
195 | void, and will automatically terminate your rights under this License.
196 | However, parties who have received copies, or rights, from you under
197 | this License will not have their licenses terminated so long as such
198 | parties remain in full compliance.
199 |
200 | 5. You are not required to accept this License, since you have not
201 | signed it. However, nothing else grants you permission to modify or
202 | distribute the Program or its derivative works. These actions are
203 | prohibited by law if you do not accept this License. Therefore, by
204 | modifying or distributing the Program (or any work based on the
205 | Program), you indicate your acceptance of this License to do so, and
206 | all its terms and conditions for copying, distributing or modifying
207 | the Program or works based on it.
208 |
209 | 6. Each time you redistribute the Program (or any work based on the
210 | Program), the recipient automatically receives a license from the
211 | original licensor to copy, distribute or modify the Program subject to
212 | these terms and conditions. You may not impose any further
213 | restrictions on the recipients' exercise of the rights granted herein.
214 | You are not responsible for enforcing compliance by third parties to
215 | this License.
216 |
217 | 7. If, as a consequence of a court judgment or allegation of patent
218 | infringement or for any other reason (not limited to patent issues),
219 | conditions are imposed on you (whether by court order, agreement or
220 | otherwise) that contradict the conditions of this License, they do not
221 | excuse you from the conditions of this License. If you cannot
222 | distribute so as to satisfy simultaneously your obligations under this
223 | License and any other pertinent obligations, then as a consequence you
224 | may not distribute the Program at all. For example, if a patent
225 | license would not permit royalty-free redistribution of the Program by
226 | all those who receive copies directly or indirectly through you, then
227 | the only way you could satisfy both it and this License would be to
228 | refrain entirely from distribution of the Program.
229 |
230 | If any portion of this section is held invalid or unenforceable under
231 | any particular circumstance, the balance of the section is intended to
232 | apply and the section as a whole is intended to apply in other
233 | circumstances.
234 |
235 | It is not the purpose of this section to induce you to infringe any
236 | patents or other property right claims or to contest validity of any
237 | such claims; this section has the sole purpose of protecting the
238 | integrity of the free software distribution system, which is
239 | implemented by public license practices. Many people have made
240 | generous contributions to the wide range of software distributed
241 | through that system in reliance on consistent application of that
242 | system; it is up to the author/donor to decide if he or she is willing
243 | to distribute software through any other system and a licensee cannot
244 | impose that choice.
245 |
246 | This section is intended to make thoroughly clear what is believed to
247 | be a consequence of the rest of this License.
248 |
249 | 8. If the distribution and/or use of the Program is restricted in
250 | certain countries either by patents or by copyrighted interfaces, the
251 | original copyright holder who places the Program under this License
252 | may add an explicit geographical distribution limitation excluding
253 | those countries, so that distribution is permitted only in or among
254 | countries not thus excluded. In such case, this License incorporates
255 | the limitation as if written in the body of this License.
256 |
257 | 9. The Free Software Foundation may publish revised and/or new versions
258 | of the General Public License from time to time. Such new versions will
259 | be similar in spirit to the present version, but may differ in detail to
260 | address new problems or concerns.
261 |
262 | Each version is given a distinguishing version number. If the Program
263 | specifies a version number of this License which applies to it and "any
264 | later version", you have the option of following the terms and conditions
265 | either of that version or of any later version published by the Free
266 | Software Foundation. If the Program does not specify a version number of
267 | this License, you may choose any version ever published by the Free Software
268 | Foundation.
269 |
270 | 10. If you wish to incorporate parts of the Program into other free
271 | programs whose distribution conditions are different, write to the author
272 | to ask for permission. For software which is copyrighted by the Free
273 | Software Foundation, write to the Free Software Foundation; we sometimes
274 | make exceptions for this. Our decision will be guided by the two goals
275 | of preserving the free status of all derivatives of our free software and
276 | of promoting the sharing and reuse of software generally.
277 |
278 | NO WARRANTY
279 |
280 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
281 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
282 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
283 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
284 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
285 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
286 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
287 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
288 | REPAIR OR CORRECTION.
289 |
290 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
291 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
292 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
293 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
294 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
295 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
296 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
297 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
298 | POSSIBILITY OF SUCH DAMAGES.
299 |
300 | END OF TERMS AND CONDITIONS
301 |
302 | How to Apply These Terms to Your New Programs
303 |
304 | If you develop a new program, and you want it to be of the greatest
305 | possible use to the public, the best way to achieve this is to make it
306 | free software which everyone can redistribute and change under these terms.
307 |
308 | To do so, attach the following notices to the program. It is safest
309 | to attach them to the start of each source file to most effectively
310 | convey the exclusion of warranty; and each file should have at least
311 | the "copyright" line and a pointer to where the full notice is found.
312 |
313 |
314 | Copyright (C)
315 |
316 | This program is free software; you can redistribute it and/or modify
317 | it under the terms of the GNU General Public License as published by
318 | the Free Software Foundation; either version 2 of the License, or
319 | (at your option) any later version.
320 |
321 | This program is distributed in the hope that it will be useful,
322 | but WITHOUT ANY WARRANTY; without even the implied warranty of
323 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
324 | GNU General Public License for more details.
325 |
326 | You should have received a copy of the GNU General Public License along
327 | with this program; if not, write to the Free Software Foundation, Inc.,
328 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
329 |
330 | Also add information on how to contact you by electronic and paper mail.
331 |
332 | If the program is interactive, make it output a short notice like this
333 | when it starts in an interactive mode:
334 |
335 | Gnomovision version 69, Copyright (C) year name of author
336 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
337 | This is free software, and you are welcome to redistribute it
338 | under certain conditions; type `show c' for details.
339 |
340 | The hypothetical commands `show w' and `show c' should show the appropriate
341 | parts of the General Public License. Of course, the commands you use may
342 | be called something other than `show w' and `show c'; they could even be
343 | mouse-clicks or menu items--whatever suits your program.
344 |
345 | You should also get your employer (if you work as a programmer) or your
346 | school, if any, to sign a "copyright disclaimer" for the program, if
347 | necessary. Here is a sample; alter the names:
348 |
349 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program
350 | `Gnomovision' (which makes passes at compilers) written by James Hacker.
351 |
352 | , 1 April 1989
353 | Ty Coon, President of Vice
354 |
355 | This General Public License does not permit incorporating your program into
356 | proprietary programs. If your program is a subroutine library, you may
357 | consider it more useful to permit linking proprietary applications with the
358 | library. If this is what you want to do, use the GNU Lesser General
359 | Public License instead of this License.
360 |
361 | WRITTEN OFFER
362 |
363 | The source code for any program binaries or compressed scripts that are
364 | included with the WSU Student Financial Services Theme can be freely obtained
365 | at the following URL:
366 |
367 | https://github.com/washingtonstateuniversity/finaid.wsu.edu/
368 |
--------------------------------------------------------------------------------
/includes/cost-tables.php:
--------------------------------------------------------------------------------
1 | 'Session',
27 | 'plural' => 'Sessions',
28 | 'description' => '',
29 | 'slug' => 'session',
30 | ),
31 | array(
32 | 'singular' => 'Campus',
33 | 'plural' => 'Campuses',
34 | 'description' => '',
35 | 'slug' => 'campus',
36 | ),
37 | array(
38 | 'singular' => 'Career Path',
39 | 'plural' => 'Career Paths',
40 | 'description' => '',
41 | 'slug' => 'career-path',
42 | ),
43 | );
44 | }
45 |
46 | add_action( 'init', 'WSU\Financial_Aid\Cost_Tables\register_post_type' );
47 | add_filter( 'pll_get_post_types', 'WSU\Financial_Aid\Cost_Tables\add_to_pll', 10, 2 );
48 | add_action( 'add_meta_boxes_' . post_type_slug(), 'WSU\Financial_Aid\Cost_Tables\add_meta_boxes' );
49 | add_action( 'edit_form_after_title', 'WSU\Financial_Aid\Cost_Tables\edit_form_after_title' );
50 | add_action( 'admin_enqueue_scripts', 'WSU\Financial_Aid\Cost_Tables\admin_enqueue_scripts' );
51 | add_action( 'save_post_' . post_type_slug(), 'WSU\Financial_Aid\Cost_Tables\save_post', 10, 2 );
52 |
53 | add_action( 'init', 'WSU\Financial_Aid\Cost_Tables\register_taxonomies' );
54 | add_action( 'init', 'WSU\Financial_Aid\Cost_Tables\register_meta', 25 );
55 | foreach ( taxonomies() as $taxonomy ) {
56 | if ( 'campus' === $taxonomy['slug'] ) {
57 | continue;
58 | }
59 |
60 | add_action( "{$taxonomy['slug']}_edit_form_fields", 'WSU\Financial_Aid\Cost_Tables\edit_term_meta_fields', 10 );
61 | add_action( "edit_{$taxonomy['slug']}", 'WSU\Financial_Aid\Cost_Tables\save_term_fields' );
62 | }
63 | add_filter( 'wsuwp_taxonomy_metabox_post_types', 'WSU\Financial_Aid\Cost_Tables\taxonomy_meta_box' );
64 |
65 | add_shortcode( 'sfs_cost_tables', 'WSU\Financial_Aid\Cost_Tables\display_sfs_cost_tables' );
66 | add_action( 'wp_ajax_nopriv_cost_tables', 'WSU\Financial_Aid\Cost_Tables\ajax_callback' );
67 | add_action( 'wp_ajax_cost_tables', 'WSU\Financial_Aid\Cost_Tables\ajax_callback' );
68 |
69 | add_shortcode( 'sfs_cost_table', 'WSU\Financial_Aid\Cost_Tables\display_sfs_cost_table' );
70 |
71 | /**
72 | * Registers a post type for tracking cost of attendance data.
73 | *
74 | * @since 0.1.0
75 | */
76 | function register_post_type() {
77 | $args = array(
78 | 'labels' => array(
79 | 'name' => 'Cost Tables',
80 | 'singular_name' => 'Cost Table',
81 | 'all_items' => 'All Cost Tables',
82 | 'view_item' => 'View Cost Table',
83 | 'add_new_item' => 'Add New Cost Table',
84 | 'edit_item' => 'Edit Cost Table',
85 | 'update_item' => 'Update Cost Table',
86 | 'search_items' => 'Search Cost Tables',
87 | 'not_found' => 'No Cost Tables found',
88 | 'not_found_in_trash' => 'No Cost Tables found in Trash',
89 | ),
90 | 'description' => 'Cost of attendance breakdowns.',
91 | 'public' => false,
92 | 'show_ui' => true,
93 | 'menu_position' => 7,
94 | 'menu_icon' => 'dashicons-clipboard',
95 | 'supports' => array(
96 | 'title',
97 | ),
98 | );
99 |
100 | \register_post_type( post_type_slug(), $args );
101 | }
102 |
103 | /**
104 | * Adds Polylang support to the Cost Tables post type.
105 | *
106 | * @since 0.1.0
107 | *
108 | * @param array $post_types Post types with Polylang support.
109 | *
110 | * @return array
111 | */
112 | function add_to_pll( $post_types ) {
113 | $post_types[ post_type_slug() ] = post_type_slug();
114 |
115 | return $post_types;
116 | }
117 |
118 | /**
119 | * Adds the metaboxes used to capture attendance cost data.
120 | *
121 | * @since 0.1.0
122 | */
123 | function add_meta_boxes() {
124 | add_meta_box(
125 | 'cost-table-meta',
126 | 'Attendance Cost Details',
127 | 'WSU\Financial_Aid\Cost_Tables\display_cost_meta_box',
128 | post_type_slug(),
129 | 'normal',
130 | 'high'
131 | );
132 | }
133 |
134 | /**
135 | * Displays the metabox used to capture attendance cost data.
136 | *
137 | * @since 0.1.0
138 | *
139 | * @param WP_Post $post Object for the post currently being edited.
140 | */
141 | function display_cost_meta_box( $post ) {
142 | wp_nonce_field( 'save-cost-table-meta', '_cost_table_meta_nonce' );
143 |
144 | $data = get_post_meta( $post->ID, '_cost_table_data', true );
145 | ?>
146 |
147 |
' . $notice . ' Please check the Career Path drop-down for other options offered at ' . $campus_name . ' during this session, or select another campus.
';
743 | break;
744 | case 'career':
745 | // Theoretically, no one should make it in here...
746 | $data['table'] = "
We don't seem to have an estimate for the selected options. Please try another combination.