Commit b0c1af85 authored by Dave Lane's avatar Dave Lane

making progress, addressing Theme Check's REQUIRED changes

parent 9cbfa267
......@@ -7,13 +7,13 @@ get_header(); ?>
<section class="error-404 not-found">
<header class="page-header">
<h1 class="page-title"><?php _e( 'Sorry, something can\'t be found', 'oeru_theme' ); ?></h1>
<h1 class="page-title"><?php esc_html_e( 'Sorry, something can\'t be found', 'oeru_course' ); ?></h1>
</header><!-- .page-header -->
<div class="page-content">
<p><?php _e( 'It looks like nothing was found at this location.', 'oeru_theme' ); ?></p>
<p><?php esc_html_e( 'It looks like nothing was found at this location.', 'oeru_course' ); ?></p>
<?php get_template_part("parts/search-form/standard"); ?>
<?php get_template_part( 'parts/search-form/standard' ); ?>
</div><!-- .page-content -->
</section><!-- .error-404 -->
......
# wordpress-oeru_theme for WordPress
# wordpress-oeru_course for WordPress
The original work embodied here is licensed under
the GNU General Public License v2 or later (GNU GPL v2.0).
the [GNU General Public License v2](https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html) or later (GNU GPL v2.0).
Please see the COPYING file for the complete license text.
For convenience, this repository includes a number
......@@ -189,4 +189,3 @@ HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
# wordpress-oeru_theme
# wordpress-oeru_course
An OERu theme from the newSplash design to allow deploying
courses in a WordPress instance.
......
......@@ -8,13 +8,13 @@ get_header(); ?>
<?php if ( have_posts() ) : ?>
<header class="archive-header">
<h1 class="archive-title"><?php printf( __( 'Category Archives: %s', 'twentyfourteen' ), single_cat_title( '', false ) ); ?></h1>
<h1 class="archive-title"><?php printf( esc_html__( 'Category Archives: %s', 'oeru_course' ), single_cat_title( '', false ) ); ?></h1>
<?php
// Show an optional term description.
$term_description = term_description();
if ( ! empty( $term_description ) ) :
printf( '<div class="taxonomy-description">%s</div>', $term_description );
printf( esc_html__('<div class="taxonomy-description">%s</div>', 'oeru_course'), $term_description );
endif;
?>
</header><!-- .archive-header -->
......
......@@ -10,8 +10,13 @@ if ( post_password_required() ) {
<?php if ( have_comments() ) : ?>
<h2 class="comments-title">
<?php
printf( _nx( 'One thought on &ldquo;%2$s&rdquo;', '%1$s thoughts on &ldquo;%2$s&rdquo;', get_comments_number(), 'comments title', 'oeru_theme' ),
number_format_i18n( get_comments_number() ), get_the_title() );
$comments_number = get_comments_number();
if ( '1' === $comments_number ) {
printf( _x( 'One thought on &ldquo;%2$s&rdquo;', 'comments title', 'oeru_course' ), get_the_title() );
} else {
printf( esc_html( _nx( 'One thought on &ldquo;%2$s&rdquo;', '%1$s thoughts on &ldquo;%2$s&rdquo;', $comments_number, 'comments title', 'oeru_course' ),
number_format_i18n( $comments_number ) ), get_the_title() );
}
?>
</h2>
<ol class="comment-list">
......@@ -29,7 +34,7 @@ if ( post_password_required() ) {
// If comments are closed and there are comments, let's leave a little note, shall we?
if ( ! comments_open() && get_comments_number() && post_type_supports( get_post_type(), 'comments' ) ) :
?>
<p class="no-comments"><?php _e( 'Comments are closed.', 'oeru_theme' ); ?></p>
<p class="no-comments"><?php _e( 'Comments are closed.', 'oeru_course' ); ?></p>
<?php endif; ?>
<?php comment_form(); ?>
......
......@@ -10,21 +10,21 @@
</div>
</div>
</header>
<div class="entry-and-comments container">
<div class="entry-and-comments container">
<div class="entry-content">
<?php if ( is_home() && current_user_can( 'publish_posts' ) ) : ?>
<p><?php printf( __( 'Ready to publish your first post? <a href="%1$s">Get started here</a>.', 'twentyfifteen' ), esc_url( admin_url( 'post-new.php' ) ) ); ?></p>
<p><?php printf( __( 'Ready to publish your first post? <a href="%1$s">Get started here</a>.', 'oeru_course' ), esc_url( admin_url( 'post-new.php' ) ) ); ?></p>
<?php elseif ( is_search() ) : ?>
<p><?php _e( 'Sorry, but nothing matched your search terms. Please try again with some different keywords.', 'twentyfifteen' ); ?></p>
<p><?php _e( 'Sorry, but nothing matched your search terms. Please try again with some different keywords.', 'oeru_course' ); ?></p>
<?php get_search_form(); ?>
<?php else : ?>
<p><?php _e( 'It seems we can&rsquo;t find what you&rsquo;re looking for. Perhaps searching can help.', 'twentyfifteen' ); ?></p>
<p><?php _e( 'It seems we can&rsquo;t find what you&rsquo;re looking for. Perhaps searching can help.', 'oeru_course' ); ?></p>
<?php get_search_form(); ?>
<?php endif; ?>
......
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<?php
if(is_page() || is_single()) :
if(get_theme_mod("third_level_menu")!="off"){
oeru_third_level_menu();
}
endif;
?>
<header class="entry-header container">
<div class="row">
......@@ -14,35 +14,46 @@
<div class="panel">
<div class="panel-body">
<?php
if ( is_single() ) :
the_title( '<h1>', '</h1>' );
else :
the_title( '<h1><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h1>' );
endif;
?>
</div>
</div>
</div>
</div>
</header>
<div class="entry-and-comments container">
<div class="entry-and-comments container">
<div class="entry-content">
<?php
the_content( sprintf(
__( 'Continue reading %s <span class="meta-nav">&rarr;</span>', 'oeru_theme' ),
__( 'Continue reading %s <span class="meta-nav">&rarr;</span>', 'oeru_course' ),
the_title( '<span class="screen-reader-text">', '</span>', false )
) );
wp_link_pages( array(
'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'oeru_theme' ) . '</span>',
'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'oeru_course' ) . '</span>',
'after' => '</div>',
'link_before' => '<span>',
'link_after' => '</span>',
) ); ?>
) ); ?>
</div>
<div class="oeru_footer">
/* translators: used between list items, there is a space after the comma. */
$tags_list = get_the_tag_list( '', __( ', ', 'oeru_course' ) );
if ( $tags_list ) {
printf(
/* translators: 1: SVG icon. 2: posted in label, only visible to screen readers. 3: list of tags. */
'<span class="tags-links">%1$s<span class="screen-reader-text">%2$s </span>%3$s</span>',
twentynineteen_get_icon_svg( 'tag', 16 ),
__( 'Tags:', 'oeru_course' ),
$tags_list
); // WPCS: XSS OK.
}
<?php do_action("oeru_post_footer"); ?>
</div>
<?php
......
.wp-caption {
}
.wp-caption-text {
}
.sticky {
}
.screen-reader-text {
}
.gallery-caption {
}
.bypostauthor {
}
.alignright {
text-align: left;
}
.alignleft {
text-align: left;
}
.aligncenter {
text-align: center;
}
</div><!-- #main -->
<?php if(get_theme_mod("scan_page")=="on" || get_option("oeru_theme_scan_page")=="on"):
<?php if(get_theme_mod("scan_page")=="on" || get_option("oeru_course_scan_page")=="on"):
?><div class="modal fade in" id="siteMapmodal" tabindex="-1" role="dialog" aria-labelledby="siteMapLabel" aria-hidden="false">
<div class="modal-dialog">
<div class="modal-content">
......@@ -12,14 +12,14 @@
if(get_theme_mod("scan_page")=="on"):
$oeru_theme = get_option( 'oeru_theme' );
echo $oeru_theme['scan_page_html'];
$oeru_course = get_option( 'oeru_course' );
echo $oeru_course['scan_page_html'];
else:
if(get_option('oeru_theme_scan_page_html')):
if(get_option('oeru_course_scan_page_html')):
echo get_option( 'oeru_theme_scan_page_html');
echo get_option( 'oeru_course_scan_page_html');
endif;
......
This diff is collapsed.
This diff is collapsed.
......@@ -4,7 +4,7 @@
<meta charset="<?php bloginfo( 'charset' ); ?>">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title><?php echo wp_title( '|', true, 'right' ); ?></title>
<?php wp_head(); ?>
<link rel="profile" href="http://gmpg.org/xfn/11">
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>">
<?php
......@@ -14,13 +14,13 @@
}
?>
<link rel="icon" href="<?php echo $favicon_url; ?>">
<?php oeru_theme_extra_style(); ?>
<?php oeru_course_extra_style(); ?>
<?php wp_head(); ?>
<!--[if lt IE 9]>
<script src="<?php echo get_template_directory_uri(); ?>/js/html5.js"></script>
<![endif]-->
</head>
<body <?php body_class(oeru_theme_body_class()); ?>>
<body <?php body_class(oeru_course_body_class()); ?>>
<script>var dataLayer = window.dataLayer = window.dataLayer || [];</script>
<!-- Google Tag Manager --> <noscript><iframe src="//www.googletagmanager.com/ns.html?id=GTM-WVTG5T" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript> <script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src= '//www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f); })(window,document,'script','dataLayer','GTM-WVTG5T');</script> <!-- End Google Tag Manager -->
<div id="page" class="hfeed site">
......@@ -65,7 +65,7 @@
</div>
<div class="navbar-custom">
<ul class="nav navbar-nav navbar-right">
<?php if (get_theme_mod("scan_page")=="on" || get_option("oeru_theme_scan_page")=="on"): ?>
<?php if (get_theme_mod("scan_page")=="on" || get_option("oeru_course_scan_page")=="on"): ?>
<li><a data-toggle="modal" data-target="#siteMapmodal"><span class="glyphicon glyphicon-tree-conifer"></span></a></li>
<?php endif; ?>
</ul>
......
<?php
function oeru_theme_analytics_page(){
add_submenu_page('oeru-theme-admin', 'Analytics', 'Analytics', 'manage_options', 'oeru-theme-analytics', 'oeru_theme_analytics');
function oeru_course_analytics_page(){
add_submenu_page('oeru-course-admin', 'Analytics', 'Analytics', 'manage_options', 'oeru-course-analytics', 'oeru_course_analytics');
}
add_action('admin_menu', 'oeru_theme_analytics_page');
add_action('admin_menu', 'oeru_course_analytics_page');
function oeru_theme_analytics_form( &$icon_sets, $header = Null ) {
function oeru_course_analytics_form( &$icon_sets, $header = Null ) {
$current_set = get_theme_mod( 'icon_set', 'Line' );
echo '<div class="wrap"><h2>Web Analytics</h2>';
if ( $header ) {
......@@ -14,7 +14,7 @@ function oeru_theme_analytics_form( &$icon_sets, $header = Null ) {
echo <<<EOL
<form action="" method="POST">
EOL;
wp_nonce_field( "oeru_theme_analytics", "oeru_theme_analytics" );
wp_nonce_field( "oeru_course_analytics", "oeru_course_analytics" );
$piwiksiteid = get_theme_mod( 'piwiksiteid', '' );
$piwikurl = get_theme_mod( 'piwikurl', '//stats.oeru.org' );
$ganalytics = get_theme_mod( 'ganalytics', '' );
......@@ -50,10 +50,10 @@ EOL;
EOL;
}
function oeru_theme_analytics(){
function oeru_course_analytics(){
$r = NULL;
if(isset($_POST['piwiksiteid'])){
if( wp_verify_nonce($_POST["oeru_theme_analytics"], "oeru_theme_analytics" )){
if( wp_verify_nonce($_POST["oeru_course_analytics"], "oeru_course_analytics" )){
set_theme_mod( 'piwiksiteid', trim( $_POST['piwiksiteid'] ) );
set_theme_mod( 'piwikurl', trim( $_POST['piwikurl'] ) );
set_theme_mod( 'ganalytics', trim( $_POST['ganalytics'] ) );
......@@ -62,12 +62,12 @@ function oeru_theme_analytics(){
$r = 'Sorry, there was a session error. Please refresh the page.';
}
}
oeru_theme_analytics_form( $oeru_theme_analytics, $r );
oeru_course_analytics_form( $oeru_course_analytics, $r );
}
add_action( 'wp_footer', 'oeru_theme_analytics_js' );
add_action( 'wp_footer', 'oeru_course_analytics_js' );
// actually put the tracking scripts at the bottom of the page
function oeru_theme_analytics_js() {
function oeru_course_analytics_js() {
$analytics = array(
'piwiksiteid' => get_theme_mod( 'piwiksiteid' ),
'piwikurl' => get_theme_mod( 'piwikurl' ),
......
......@@ -18,12 +18,12 @@
*
* @since Twenty Fourteen 1.0
*/
function twentyfourteen_switch_theme() {
function oeru_course_switch_theme() {
switch_theme( WP_DEFAULT_THEME, WP_DEFAULT_THEME );
unset( $_GET['activated'] );
add_action( 'admin_notices', 'twentyfourteen_upgrade_notice' );
add_action( 'admin_notices', 'oeru_course_upgrade_notice' );
}
add_action( 'after_switch_theme', 'twentyfourteen_switch_theme' );
add_action( 'after_switch_theme', 'oeru_course_switch_theme' );
/**
* Add message for unsuccessful theme switch.
......@@ -33,8 +33,8 @@ add_action( 'after_switch_theme', 'twentyfourteen_switch_theme' );
*
* @since Twenty Fourteen 1.0
*/
function twentyfourteen_upgrade_notice() {
$message = sprintf( __( 'Twenty Fourteen requires at least WordPress version 3.6. You are running version %s. Please upgrade and try again.', 'twentyfourteen' ), $GLOBALS['wp_version'] );
function oeru_course_upgrade_notice() {
$message = sprintf( __( 'Twenty Fourteen requires at least WordPress version 3.6. You are running version %s. Please upgrade and try again.', 'oeru_course' ), $GLOBALS['wp_version'] );
printf( '<div class="error"><p>%s</p></div>', $message );
}
......@@ -43,21 +43,21 @@ function twentyfourteen_upgrade_notice() {
*
* @since Twenty Fourteen 1.0
*/
function twentyfourteen_customize() {
wp_die( sprintf( __( 'Twenty Fourteen requires at least WordPress version 3.6. You are running version %s. Please upgrade and try again.', 'twentyfourteen' ), $GLOBALS['wp_version'] ), '', array(
function oeru_course_customize() {
wp_die( sprintf( __( 'Twenty Fourteen requires at least WordPress version 3.6. You are running version %s. Please upgrade and try again.', 'oeru_course' ), $GLOBALS['wp_version'] ), '', array(
'back_link' => true,
) );
}
add_action( 'load-customize.php', 'twentyfourteen_customize' );
add_action( 'load-customize.php', 'oeru_course_customize' );
/**
* Prevent the Theme Preview from being loaded on WordPress versions prior to 3.4.
*
* @since Twenty Fourteen 1.0
*/
function twentyfourteen_preview() {
function oeru_course_preview() {
if ( isset( $_GET['preview'] ) ) {
wp_die( sprintf( __( 'Twenty Fourteen requires at least WordPress version 3.6. You are running version %s. Please upgrade and try again.', 'twentyfourteen' ), $GLOBALS['wp_version'] ) );
wp_die( sprintf( __( 'Twenty Fourteen requires at least WordPress version 3.6. You are running version %s. Please upgrade and try again.', 'oeru_course' ), $GLOBALS['wp_version'] ) );
}
}
add_action( 'template_redirect', 'twentyfourteen_preview' );
add_action( 'template_redirect', 'oeru_course_preview' );
<?php
function oeru_theme_colour_page(){
add_submenu_page('oeru-theme-admin', 'Colour Scheme', 'Colour Scheme', 'manage_options', 'oeru-theme-colour', 'oeru_theme_colour');
function oeru_course_colour_page(){
add_submenu_page('oeru-course-admin', 'Colour Scheme', 'Colour Scheme', 'manage_options', 'oeru-course-colour', 'oeru_course_colour');
}
add_action('admin_menu', 'oeru_theme_colour_page');
add_action('admin_menu', 'oeru_course_colour_page');
function oeru_theme_colour_menu($colours, $header=null) {
function oeru_course_colour_menu($colours, $header=null) {
echo "<h2>Colour Scheme</h2>";
if ($header) {
echo "<h3>$header</h3>";
......@@ -19,7 +19,7 @@ EOL;
<input type="radio" name="colour" value="$colour">$colour<br>
EOL;
}
wp_nonce_field( "oeru_theme_colour", "oeru_theme_colour" );
wp_nonce_field( "oeru_course_colour", "oeru_course_colour" );
echo <<<EOL
<br>
<input type="submit" value="Change Colours" class="button button-primary" />
......@@ -205,7 +205,7 @@ $oeru_colours = array(
),*/
);
function oeru_theme_set_colours( $colour_name ) {
function oeru_course_set_colours( $colour_name ) {
global $oeru_colours;
foreach ($oeru_colours[$colour_name] as $k => $v) {
......@@ -213,23 +213,23 @@ function oeru_theme_set_colours( $colour_name ) {
}
}
function oeru_theme_colour(){
function oeru_course_colour(){
global $oeru_colours;
if(isset($_POST['colour'])){
if(wp_verify_nonce($_POST["oeru_theme_colour"], "oeru_theme_colour")){
if(wp_verify_nonce($_POST["oeru_course_colour"], "oeru_course_colour")){
if (isset($oeru_colours[$_POST['colour']])) {
$c = $_POST['colour'];
oeru_theme_set_colours( $c );
oeru_theme_colour_menu($oeru_colours,
oeru_course_set_colours( $c );
oeru_course_colour_menu($oeru_colours,
"Colours changed: $c");
} else {
oeru_theme_colour_menu($oeru_colours, 'Unrecognized colour');
oeru_course_colour_menu($oeru_colours, 'Unrecognized colour');
}
}else{
echo "<p>Sorry, the nonce did not verify, please refresh the page</p>";
}
}else{
oeru_theme_colour_menu($oeru_colours);
oeru_course_colour_menu($oeru_colours);
}
}
<?php
function oeru_theme_customize_register_modify( $wp_customize ) {
function oeru_course_customize_register_modify( $wp_customize ) {
$wp_customize->get_setting( 'blogname' )->transport = 'postMessage';
$wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage';
$wp_customize->get_setting( 'header_textcolor' )->transport = 'postMessage';
$wp_customize->get_section( 'header_image' )->title = __( 'Site Image', 'oeru_theme' );
$wp_customize->get_section( 'header_image' )->title = __( 'Site Image', 'oeru_course' );
$wp_customize->remove_section( 'colors' );
}
function oeru_theme_customize_register_front_page_layout( $wp_customize ){
function oeru_course_customize_register_front_page_layout( $wp_customize ){
$wp_customize->add_section( 'front_page_layout' , array(
'title' => __( 'Front Page Layout', 'oeru_theme' ),
'title' => __( 'Front Page Layout', 'oeru_course' ),
'priority' => 2,
) );
......@@ -47,7 +47,7 @@ function oeru_theme_customize_register_front_page_layout( $wp_customize ){
);
$wp_customize->add_section( 'front_page_custom_html' , array(
'title' => __( 'Front Page Custom HTML', 'oeru_theme' ),
'title' => __( 'Front Page Custom HTML', 'oeru_course' ),
'priority' => 2,
) );
......@@ -69,10 +69,10 @@ function oeru_theme_customize_register_front_page_layout( $wp_customize ){
}
function oeru_theme_customize_navigation( $wp_customize ){
function oeru_course_customize_navigation( $wp_customize ){
$wp_customize->add_section( 'site_navigation' , array(
'title' => __( 'Site Navigation', 'oeru_theme' ),
'title' => __( 'Site Navigation', 'oeru_course' ),
'priority' => 2,
) );
......@@ -218,10 +218,10 @@ function oeru_theme_customize_navigation( $wp_customize ){
}
function oeru_theme_customize_register_fav_icon( $wp_customize ){
function oeru_course_customize_register_fav_icon( $wp_customize ){
$wp_customize->add_section( 'fav_icon' , array(
'title' => __( 'Fav Icon', 'oeru_theme' ),
'title' => __( 'Fav Icon', 'oeru_course' ),
'priority' => 2,
) );
......@@ -243,7 +243,7 @@ function oeru_theme_customize_register_fav_icon( $wp_customize ){
}
function oeru_theme_customize_register_add_site_colours( $wp_customize ) {
function oeru_course_customize_register_add_site_colours( $wp_customize ) {
// map setting name to human readable customizer label
$c_colors = array(
......@@ -304,7 +304,7 @@ function oeru_theme_customize_register_add_site_colours( $wp_customize ) {
);
$wp_customize->add_section( 'site_colours' , array(
'title' => __( 'Site Colours', 'oeru_theme' ),
'title' => __( 'Site Colours', 'oeru_course' ),
'priority' => 30,
) );
......@@ -331,7 +331,7 @@ function oeru_theme_customize_register_add_site_colours( $wp_customize ) {
}
}
function oeru_theme_customize_register_modify_static_page( $wp_customize ) {
function oeru_course_customize_register_modify_static_page( $wp_customize ) {
$wp_customize->add_setting(
'front_page_options',
......@@ -355,21 +355,21 @@ function oeru_theme_customize_register_modify_static_page( $wp_customize ) {
}
function oeru_theme_customize_register( $wp_customize ) {
function oeru_course_customize_register( $wp_customize ) {
oeru_theme_customize_register_modify( $wp_customize );
oeru_theme_customize_register_add_site_colours( $wp_customize );
oeru_theme_customize_register_modify_static_page( $wp_customize );
oeru_theme_customize_register_front_page_layout( $wp_customize );
oeru_theme_customize_register_fav_icon( $wp_customize );
oeru_theme_customize_navigation( $wp_customize );
oeru_course_customize_register_modify( $wp_customize );
oeru_course_customize_register_add_site_colours( $wp_customize );
oeru_course_customize_register_modify_static_page( $wp_customize );
oeru_course_customize_register_front_page_layout( $wp_customize );
oeru_course_customize_register_fav_icon( $wp_customize );
oeru_course_customize_navigation( $wp_customize );
}
add_action( 'customize_register', 'oeru_theme_customize_register' );
add_action( 'customize_register', 'oeru_course_customize_register' );
function oeru_theme_customize_preview_js() {
wp_enqueue_script( 'oeru_theme_customizer', get_template_directory_uri() . '/js/oeru_theme_customiser.js', array( 'customize-preview' ), '20131205', true );
function oeru_course_customize_preview_js() {
wp_enqueue_script( 'oeru_course_customizer', get_template_directory_uri() . '/js/oeru_course_customiser.js', array( 'customize-preview' ), '20131205', true );
}
add_action( 'customize_preview_init', 'oeru_theme_customize_preview_js' );
add_action( 'customize_preview_init', 'oeru_course_customize_preview_js' );
<?php
function oeru_theme_admin_page(){
add_submenu_page('oeru-theme-admin', 'Colour Scheme', 'Colour Scheme', 'manage_options', 'oeru-theme-colour', 'oeru_theme_colour');
function oeru_course_admin_page(){
add_submenu_page('oeru-course-admin', 'Colour Scheme', 'Colour Scheme', 'manage_options', 'oeru-course-colour', 'oeru_course_colour');
}
add_action('admin_menu', 'oeru_theme_admin_page');
add_action('admin_menu', 'oeru_course_admin_page');
function oeru_theme_colour(){
function oeru_course_colour(){
if(isset($_POST['menu_create'])){
if(wp_verify_nonce($_POST["oeru_theme_menu_create"], "oeru_theme_menu_create")){
if(wp_verify_nonce($_POST["oeru_course_menu_create"], "oeru_course_menu_create")){
?><h2>Menu Creation</h2><?php
$menu_id = oeru_theme_create_menu();
$menu_id = oeru_course_create_menu();
if($menu_id!=false){
?><p>Menu being created....</p><?php
oeru_theme_menu_hierarchy($menu_id, 0, 0);
oeru_course_menu_hierarchy($menu_id, 0, 0);
?><p>Menu Created</p>
<p>Menu can be changed on the <a href='nav-menus.php'>Menu Admin</a> page</p>
<?php
......@@ -36,11 +36,11 @@ function oeru_theme_colour(){
<p>The menu at present will look as such. </p>
<p>You can delete pages or alter their parents (where it sits in the menu by editing a page) by clicking on the post name to edit it</p>
<p>If you edit a page, this display won't refresh until you do so, but the menu created will reflect your changes.</p>
<div class="half-width"><?php oeru_theme_get_pages_no_parent(0); ?></div>
<div class="half-width"><?php oeru_course_get_pages_no_parent(0); ?></div>
<div class="half-width">
<form action="" method="POST">
<?php
wp_nonce_field( "oeru_theme_menu_create", "oeru_theme_menu_create" );
wp_nonce_field( "oeru_course_menu_create", "oeru_course_menu_create" );
?>
<input type="hidden" name="menu_create" value="go" />
<input type="submit" value="Create Menu" />
......
<?php
function oeru_theme_icon_page(){
add_submenu_page('oeru-theme-admin', 'Icon Set', 'Icon Set', 'manage_options', 'oeru-theme-icons', 'oeru_theme_icons');
function oeru_course_icon_page(){
add_submenu_page('oeru-course-admin', 'Icon Set', 'Icon Set', 'manage_options', 'oeru-course-icons', 'oeru_course_icons');
}
add_action('admin_menu', 'oeru_theme_icon_page');
add_action('admin_menu', 'oeru_course_icon_page');
$oeru_theme_icon_sets = array(
$oeru_course_icon_sets = array(
"Line" => "",
"Line-black" => "/black",
"Ind" => "/ind"
);
function oeru_theme_icons_form( &$icon_sets, $header = Null ) {
function oeru_course_icons_form( &$icon_sets, $header = Null ) {
$current_set = get_theme_mod( 'icon_set', 'Line' );
echo "<h2>Icon Set</h2>";
if ( $header ) {
......@@ -20,7 +20,7 @@ function oeru_theme_icons_form( &$icon_sets, $header = Null ) {
echo <<<EOL
<form action="" method="POST">
EOL;
wp_nonce_field( "oeru_theme_icons", "oeru_theme_icons" );
wp_nonce_field( "oeru_course_icons", "oeru_course_icons" );
foreach ($icon_sets as $k => $v) {
$maybeselected = ($k == $current_set) ? "checked" : "";
echo <<<EOL
......@@ -35,20 +35,20 @@ EOL;
EOL;
}
function oeru_theme_icons(){
global $oeru_theme_icon_sets;
function oeru_course_icons(){
global $oeru_course_icon_sets;
if(isset($_POST['iconset'])){
if(wp_verify_nonce($_POST["oeru_theme_icons"], "oeru_theme_icons")){
if( array_key_exists( $_POST['iconset'], $oeru_theme_icon_sets ) ) {
if(wp_verify_nonce($_POST["oeru_course_icons"], "oeru_course_icons")){
if( array_key_exists( $_POST['iconset'], $oeru_course_icon_sets ) ) {
set_theme_mod( 'icon_set', $_POST['iconset'] );
oeru_theme_icons_form( $oeru_theme_icon_sets, "Icon set selected: " . $_POST['iconset']);
oeru_course_icons_form( $oeru_course_icon_sets, "Icon set selected: " . $_POST['iconset']);
} else {
oeru_theme_icons_form( $oeru_theme_icon_sets, "Unknown icon set ${_POST['iconset']}" );
oeru_course_icons_form( $oeru_course_icon_sets, "Unknown icon set ${_POST['iconset']}" );
}
}else{
echo "Sorry, the nonce did not verify, please refresh the page</p>";
}
}else{
oeru_theme_icons_form( $oeru_theme_icon_sets );
oeru_course_icons_form( $oeru_course_icon_sets );
}
}
<?php
function oeru_theme_attachment_field_credit( $form_fields, $post ) {
function oeru_course_attachment_field_credit( $form_fields, $post ) {
$form_fields['oeru-attribution-name'] = array(
'label' => 'Attribution Name',
'input' => 'textarea',
......@@ -24,9 +24,9 @@ function oeru_theme_attachment_field_credit( $form_fields, $post ) {
return $form_fields;
}
add_filter( 'attachment_fields_to_edit', 'oeru_theme_attachment_field_credit', 10, 2 );
add_filter( 'attachment_fields_to_edit', 'oeru_course_attachment_field_credit', 10, 2 );
function oeru_theme_attachment_field_credit_save( $post, $attachment ) {
function oeru_course_attachment_field_credit_save( $post, $attachment ) {
if( isset( $attachment['oeru-attribution-name'] ) )
update_post_meta( $post['ID'], 'oeru-attribution-name', $attachment['oeru-attribution-name'] );
......@@ -38,7 +38,7 @@ function oeru_theme_attachment_field_credit_save( $post, $attachment ) {
return $post;