remove layout stuff

This commit is contained in:
John Bintz 2009-11-07 12:23:10 -05:00
parent ce743bd8df
commit 88b9e6cf83
4 changed files with 1 additions and 180 deletions

View File

@ -44,22 +44,6 @@ function __comicpress_init() {
}
}
function comicpress_init() {
global $post, $comicpress;
if (!empty($post)) {
if (in_comic_category() && $comicpress->is_multicomic() && !is_index()) {
$comicpress->setup_multicomic_partial_paths($post->ID);
}
}
$comicpress->partial_paths[] = get_template_directory() . '/partials';
}
function comicpress_get_header() {
get_header();
}
function include_partial($partials = '') {
global $comicpress, $post, $nav_comics;
@ -80,9 +64,6 @@ function include_partial($partials = '') {
}
}
function in_comic_category() {
global $post, $comicpress;
}
/**
* Display the list of Storyline categories.
@ -127,74 +108,4 @@ function comicpress_list_storyline_categories($args = "") {
echo $output;
}
/**
* Display the comic transcript
* Transcript must be entered into a custom field named "transcript"
* @param string $displaymode, "raw" (straight from the field), "br" (includes html line breaks), "styled" (fully css styled with JavaScript expander)
*/
function the_transcript($displaymode = 'raw') {
$transcript = get_post_meta( get_the_ID(), "transcript", true );
switch ($displaymode) {
case "raw":
echo $transcript;
break;
case "br":
echo nl2br($transcript);
break;
case "styled":
if (!empty($transcript)) { ?>
<script type='text/javascript'>
<!--
function toggle_expander(id) {
var e = document.getElementById(id);
if(e.style.height == 'auto')
e.style.height = '1px';
else
e.style.height = 'auto';
}
//-->
</script>
<div class="transcript-border"><div id="transcript"><a href="javascript:toggle_expander('transcript-content');" class="transcript-title">&darr; Transcript</a><div id="transcript-content"><?php echo nl2br($transcript); ?><br /><br /></div></div></div>
<script type='text/javascript'>
<!--
document.getElementById('transcript-content').style.height = '1px';
//-->
</script><?php
}
break;
}
}
// Register Sidebar and Define Widgets
function widget_comicpress_latest_comics() { ?>
<li>
<h2>Latest Comics</h2>
<ul>
<?php global $post;
$latestcomics = get_posts('numberposts=5&category='.get_all_comic_categories_as_cat_string());
foreach($latestcomics as $post) : ?>
<li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
<?php endforeach; ?>
</ul>
</li>
<?php } if ( function_exists('register_sidebar_widget') )
register_sidebar_widget(__('Latest Comics'), 'widget_comicpress_latest_comics');
function widget_comicpress_random_comic() { ?>
<li>
<h2><a href="?randomcomic"><span class="random-comic-icon">?</span> Random Comic</a></h2>
</li>
<?php } if ( function_exists('register_sidebar_widget') )
register_sidebar_widget(__('Random Comic'), 'widget_comicpress_random_comic');
function widget_comicpress_archive_dropdown() { ?>
<li class="archive-dropdown-wrap">
<select name="archive-dropdown" class="archive-dropdown" onChange='document.location.href=this.options[this.selectedIndex].value;'>
<option value=""><?php echo attribute_escape(__('Archives...')); ?></option>
<?php wp_get_archives('type=monthly&format=option&show_post_count=1'); ?> </select>
</li>
<?php } if ( function_exists('register_sidebar_widget') )
register_sidebar_widget(__('Archive Dropdown'), 'widget_comicpress_archive_dropdown');
?>

View File

@ -1,19 +0,0 @@
<?php
/*
Layout Name: Classic
Sidebars: right
*/
?>
<?php get_header() ?>
<?php echo $comic ?>
<div id="content" class="narrowcolumn">
<?php echo $content ?>
</div>
<?php get_sidebar('right') ?>
<?php get_footer() ?>

View File

@ -1,21 +0,0 @@
<?php
/*
Layout Name: Three Column
Sidebars: left,right
*/
?>
<?php get_header() ?>
<?php echo $comic ?>
<?php get_sidebar('left') ?>
<div id="content" class="narrowcolumn">
<?php echo $content ?>
</div>
<?php get_sidebar('right') ?>
<?php get_footer() ?>

View File

@ -12,57 +12,7 @@ class ComicPressTest extends PHPUnit_Framework_TestCase {
unset($post);
$this->cp = new ComicPress();
}
function providerTestGetLayoutChoices() {
return array(
array(
array(),
array()
),
array(
array(
'layout.php' => <<<FILE
Test
FILE
),
array()
),
array(
array(
'layout.php' => <<<FILE
/*
Layout Name: Test
Sidebars: left,right
*/
FILE
),
array('layout.php' => array(
'Layout Name' => 'Test',
'Sidebars' => 'left,right',
))
),
);
}
/**
* @dataProvider providerTestGetLayoutChoices
*/
function testGetLayoutChoices($files, $expected_results) {
$cp = $this->getMock('ComicPress', array('_glob', '_file_get_contents'));
_set_template_directory('/test');
$file_names = array();
foreach (array_keys($files) as $file) { $file_names[] = '/test/layouts/' . $file; }
$cp->expects($this->once())->method('_glob')->with('/test/layouts/*')->will($this->returnValue($file_names));
foreach ($files as $file => $contents) {
$cp->expects($this->once())->method('_file_get_contents')->with('/test/layouts/' . $file)->will($this->returnValue($contents));
}
$this->assertEquals($expected_results, $cp->get_layout_choices());
}
function providerTestGetSortedPostCategories() {
return array(
array(