Initial Commit
11
.gitignore
vendored
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
#wordpress directory
|
||||||
|
home/
|
||||||
|
|
||||||
|
cgi-bin/
|
||||||
|
|
||||||
|
#lots of binaries, don't need those in the repo
|
||||||
|
chronos/
|
||||||
|
|
||||||
|
#kept elsewhere
|
||||||
|
Resume.pdf
|
||||||
|
Resume.tex
|
9
.htaccess
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
# Use PHP5 Single php.ini as default
|
||||||
|
AddHandler application/x-httpd-php5s .php
|
||||||
|
|
||||||
|
#Custom error pages
|
||||||
|
ErrorDocument 400 /errors/400.php
|
||||||
|
ErrorDocument 401 /errors/401.php
|
||||||
|
ErrorDocument 403 /errors/403.php
|
||||||
|
ErrorDocument 404 /errors/404.php
|
||||||
|
ErrorDocument 500 /errors/500.php
|
21
about/index.php
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
<?php include("../header_top.php"); ?>
|
||||||
|
<title>About Me - aclindsay.com</title>
|
||||||
|
<?php include("../header_bottom.php"); ?>
|
||||||
|
|
||||||
|
<div id="content">
|
||||||
|
<div id="main">
|
||||||
|
<h2>About Me</h2>
|
||||||
|
|
||||||
|
<p>I am a Lutheran, an Eagle Scout, and am currently pursuing a masters degree in Computer Science at Virginia Tech.</p>
|
||||||
|
</div>
|
||||||
|
<div id="sidebar">
|
||||||
|
<span>Links:</span>
|
||||||
|
<ul>
|
||||||
|
<li><a href="http://aclindsay.com/Resume.pdf">My Resume (pdf)</a> (Note: All contact information has been removed - please <a href="http://aclindsay.com/contact">contact me</a> for a full version)</li>
|
||||||
|
<li><a href="http://aclindsay.com/calendar/">My Calendar</a></li>
|
||||||
|
<li><a href="http://onetimeinmexico.wordpress.com/">This One Time in Mexico</a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<?php include("../footer.php"); ?>
|
2
acal/.htaccess
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
# Use PHP5 as default
|
||||||
|
AddHandler application/x-httpd-php5 .php
|
BIN
acal/favicon.ico
Normal file
After Width: | Height: | Size: 198 B |
37
acal/index.php
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
<?php include("../header_top.php"); ?>
|
||||||
|
<title>aCal - aclindsay.com</title>
|
||||||
|
<?php include("../header_bottom.php"); ?>
|
||||||
|
|
||||||
|
<div id="content">
|
||||||
|
<div id="main">
|
||||||
|
<h2>aCal Project</h2>
|
||||||
|
|
||||||
|
<p>aCal is very much still a work in progress. I have not yet posted any code.</p>
|
||||||
|
|
||||||
|
<h3>Aim</h3>
|
||||||
|
|
||||||
|
<p>The eventual goal of this project is to provide an AJAX/Web 2.0 calendar application with a PHP back-end, with many supported databases.
|
||||||
|
This will provide much flexibility and hopefully make this calendar application useful to many people who need a calendar implementation.</p>
|
||||||
|
|
||||||
|
<h3>Proposed Features</h3>
|
||||||
|
<p>
|
||||||
|
<ul>
|
||||||
|
<li>PHP REST web service back-end</li>
|
||||||
|
<li>Ability to export/import/update events and todos with multiple formats (XML, JSON, iCalendar, possibly CSV/Outlook)</li>
|
||||||
|
<li>Calendar access controls (control access by ability to read, write, and view free-busy information on a calendar basis.</li>
|
||||||
|
<li>Well-documented API, making it possible to build other possible UI implementations on top of the same calendaring back-end.)</li>
|
||||||
|
<li>Released under an open-source license to make sure it is able to benefit everyone.</li>
|
||||||
|
</ul>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<div id="sidebar">
|
||||||
|
<span>Related Links:</span>
|
||||||
|
<ul>
|
||||||
|
<li><a href="http://tools.ietf.org/html/rfc2445">iCalendar specification</a></li>
|
||||||
|
<li><a href="http://dojotoolkit.org">Dojo Toolkit</a></li>
|
||||||
|
<li><a href="http://aclindsay.com/Resume.pdf">My Resume (pdf)</a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<?php include("../footer.php"); ?>
|
22
aclindsa-wordpress-theme/404.php
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* @package WordPress
|
||||||
|
* @subpackage Default_Theme
|
||||||
|
*/
|
||||||
|
|
||||||
|
get_header();
|
||||||
|
?>
|
||||||
|
|
||||||
|
<div id="content" class="narrowcolumn">
|
||||||
|
|
||||||
|
<div id="main">
|
||||||
|
<h2 class="center">Error 404 - Page Not Found</h2>
|
||||||
|
<p>Oops, the page you are looking for does not exist. You may search using the search box, or visit the <a href="http://aclindsay.com">homepage</a> to get back on track.</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<?php get_sidebar(); ?>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<?php get_footer(); ?>
|
80
aclindsa-wordpress-theme/archive.php
Normal file
@ -0,0 +1,80 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* @package WordPress
|
||||||
|
* @subpackage Default_Theme
|
||||||
|
*/
|
||||||
|
|
||||||
|
get_header();
|
||||||
|
?>
|
||||||
|
|
||||||
|
<div id="content">
|
||||||
|
<div id="main" class="narrowcolumn" role="main">
|
||||||
|
|
||||||
|
<?php if (have_posts()) : ?>
|
||||||
|
|
||||||
|
<?php $post = $posts[0]; // Hack. Set $post so that the_date() works. ?>
|
||||||
|
<?php /* If this is a category archive */ if (is_category()) { ?>
|
||||||
|
<h2 class="pagetitle">Archive for the ‘<?php single_cat_title(); ?>’ Category</h2>
|
||||||
|
<?php /* If this is a tag archive */ } elseif( is_tag() ) { ?>
|
||||||
|
<h2 class="pagetitle">Posts Tagged ‘<?php single_tag_title(); ?>’</h2>
|
||||||
|
<?php /* If this is a daily archive */ } elseif (is_day()) { ?>
|
||||||
|
<h2 class="pagetitle">Archive for <?php the_time('F jS, Y'); ?></h2>
|
||||||
|
<?php /* If this is a monthly archive */ } elseif (is_month()) { ?>
|
||||||
|
<h2 class="pagetitle">Archive for <?php the_time('F, Y'); ?></h2>
|
||||||
|
<?php /* If this is a yearly archive */ } elseif (is_year()) { ?>
|
||||||
|
<h2 class="pagetitle">Archive for <?php the_time('Y'); ?></h2>
|
||||||
|
<?php /* If this is an author archive */ } elseif (is_author()) { ?>
|
||||||
|
<h2 class="pagetitle">Author Archive</h2>
|
||||||
|
<?php /* If this is a paged archive */ } elseif (isset($_GET['paged']) && !empty($_GET['paged'])) { ?>
|
||||||
|
<h2 class="pagetitle">Blog Archives</h2>
|
||||||
|
<?php } ?>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="navigation">
|
||||||
|
<div class="alignleft"><?php next_posts_link('« Older Entries') ?></div>
|
||||||
|
<div class="alignright"><?php previous_posts_link('Newer Entries »') ?></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<?php while (have_posts()) : the_post(); ?>
|
||||||
|
<div <?php post_class() ?>>
|
||||||
|
<h3 id="post-<?php the_ID(); ?>"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h3>
|
||||||
|
<small><?php the_time('l, F jS, Y') ?></small>
|
||||||
|
|
||||||
|
<div class="entry">
|
||||||
|
<?php the_content() ?>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<p class="postmetadata"><?php the_tags('Tags: ', ', ', '<br />'); ?> Posted in <?php the_category(', ') ?> | <?php edit_post_link('Edit', '', ' | '); ?> <?php comments_popup_link('No Comments »', '1 Comment »', '% Comments »'); ?></p>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<?php endwhile; ?>
|
||||||
|
|
||||||
|
<div class="navigation">
|
||||||
|
<div class="alignleft"><?php next_posts_link('« Older Entries') ?></div>
|
||||||
|
<div class="alignright"><?php previous_posts_link('Newer Entries »') ?></div>
|
||||||
|
</div>
|
||||||
|
<?php else :
|
||||||
|
|
||||||
|
if ( is_category() ) { // If this is a category archive
|
||||||
|
printf("<h2 class='center'>Sorry, but there aren't any posts in the %s category yet.</h2>", single_cat_title('',false));
|
||||||
|
} else if ( is_date() ) { // If this is a date archive
|
||||||
|
echo("<h2>Sorry, but there aren't any posts with this date.</h2>");
|
||||||
|
} else if ( is_author() ) { // If this is a category archive
|
||||||
|
$userdata = get_userdatabylogin(get_query_var('author_name'));
|
||||||
|
printf("<h2 class='center'>Sorry, but there aren't any posts by %s yet.</h2>", $userdata->display_name);
|
||||||
|
} else {
|
||||||
|
echo("<h2 class='center'>No posts found.</h2>");
|
||||||
|
}
|
||||||
|
get_search_form();
|
||||||
|
|
||||||
|
endif;
|
||||||
|
?>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<?php get_sidebar(); ?>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<?php get_footer(); ?>
|
29
aclindsa-wordpress-theme/archives.php
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* @package WordPress
|
||||||
|
* @subpackage Default_Theme
|
||||||
|
*/
|
||||||
|
/*
|
||||||
|
Template Name: Archives
|
||||||
|
*/
|
||||||
|
?>
|
||||||
|
|
||||||
|
<?php get_header(); ?>
|
||||||
|
|
||||||
|
<div id="content" class="widecolumn">
|
||||||
|
|
||||||
|
<?php get_search_form(); ?>
|
||||||
|
|
||||||
|
<h2>Archives by Month:</h2>
|
||||||
|
<ul>
|
||||||
|
<?php wp_get_archives('type=monthly'); ?>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<h2>Archives by Subject:</h2>
|
||||||
|
<ul>
|
||||||
|
<?php wp_list_categories(); ?>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<?php get_footer(); ?>
|
124
aclindsa-wordpress-theme/comments-popup.php
Normal file
@ -0,0 +1,124 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* @package WordPress
|
||||||
|
* @subpackage Default_Theme
|
||||||
|
*/
|
||||||
|
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<head>
|
||||||
|
<title><?php echo get_option('blogname'); ?> - Comments on <?php the_title(); ?></title>
|
||||||
|
|
||||||
|
<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php echo get_option('blog_charset'); ?>" />
|
||||||
|
<style type="text/css" media="screen">
|
||||||
|
@import url( <?php bloginfo('stylesheet_url'); ?> );
|
||||||
|
body { margin: 3px; }
|
||||||
|
</style>
|
||||||
|
|
||||||
|
</head>
|
||||||
|
<body id="commentspopup">
|
||||||
|
|
||||||
|
<h1 id="header"><a href="" title="<?php echo get_option('blogname'); ?>"><?php echo get_option('blogname'); ?></a></h1>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
/* Don't remove these lines. */
|
||||||
|
add_filter('comment_text', 'popuplinks');
|
||||||
|
if ( have_posts() ) :
|
||||||
|
while ( have_posts() ) : the_post();
|
||||||
|
?>
|
||||||
|
<h2 id="comments">Comments</h2>
|
||||||
|
|
||||||
|
<p><a href="<?php echo get_post_comments_feed_link($post->ID); ?>"><abbr title="Really Simple Syndication">RSS</abbr> feed for comments on this post.</a></p>
|
||||||
|
|
||||||
|
<?php if ( pings_open() ) { ?>
|
||||||
|
<p>The <abbr title="Universal Resource Locator">URL</abbr> to TrackBack this entry is: <em><?php trackback_url() ?></em></p>
|
||||||
|
<?php } ?>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
// this line is WordPress' motor, do not delete it.
|
||||||
|
$commenter = wp_get_current_commenter();
|
||||||
|
extract($commenter);
|
||||||
|
$comments = get_approved_comments($id);
|
||||||
|
$post = get_post($id);
|
||||||
|
if ( post_password_required($post) ) { // and it doesn't match the cookie
|
||||||
|
echo(get_the_password_form());
|
||||||
|
} else { ?>
|
||||||
|
|
||||||
|
<?php if ($comments) { ?>
|
||||||
|
<ol id="commentlist">
|
||||||
|
<?php foreach ($comments as $comment) { ?>
|
||||||
|
<li id="comment-<?php comment_ID() ?>">
|
||||||
|
<?php comment_text() ?>
|
||||||
|
<p><cite><?php comment_type('Comment', 'Trackback', 'Pingback'); ?> by <?php comment_author_link() ?> — <?php comment_date() ?> @ <a href="#comment-<?php comment_ID() ?>"><?php comment_time() ?></a></cite></p>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<?php } // end for each comment ?>
|
||||||
|
</ol>
|
||||||
|
<?php } else { // this is displayed if there are no comments so far ?>
|
||||||
|
<p>No comments yet.</p>
|
||||||
|
<?php } ?>
|
||||||
|
|
||||||
|
<?php if ( comments_open() ) { ?>
|
||||||
|
<h2>Leave a comment</h2>
|
||||||
|
<p>Line and paragraph breaks automatic, e-mail address never displayed, <acronym title="Hypertext Markup Language">HTML</acronym> allowed: <code><?php echo allowed_tags(); ?></code></p>
|
||||||
|
|
||||||
|
<form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform">
|
||||||
|
<?php if ( $user_ID ) : ?>
|
||||||
|
<p>Logged in as <a href="<?php echo get_option('siteurl'); ?>/wp-admin/profile.php"><?php echo $user_identity; ?></a>. <a href="<?php echo wp_logout_url(get_permalink()); ?>" title="Log out of this account">Log out »</a></p>
|
||||||
|
<?php else : ?>
|
||||||
|
<p>
|
||||||
|
<input type="text" name="author" id="author" class="textarea" value="<?php echo esc_attr($comment_author); ?>" size="28" tabindex="1" />
|
||||||
|
<label for="author">Name</label>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
<input type="text" name="email" id="email" value="<?php echo esc_attr($comment_author_email); ?>" size="28" tabindex="2" />
|
||||||
|
<label for="email">E-mail</label>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
<input type="text" name="url" id="url" value="<?php echo esc_attr($comment_author_url); ?>" size="28" tabindex="3" />
|
||||||
|
<label for="url"><abbr title="Universal Resource Locator">URL</abbr></label>
|
||||||
|
</p>
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
<label for="comment">Your Comment</label>
|
||||||
|
<br />
|
||||||
|
<textarea name="comment" id="comment" cols="70" rows="4" tabindex="4"></textarea>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
<input type="hidden" name="comment_post_ID" value="<?php echo $id; ?>" />
|
||||||
|
<input type="hidden" name="redirect_to" value="<?php echo esc_attr($_SERVER["REQUEST_URI"]); ?>" />
|
||||||
|
<input name="submit" type="submit" tabindex="5" value="Say It!" />
|
||||||
|
</p>
|
||||||
|
<?php do_action('comment_form', $post->ID); ?>
|
||||||
|
</form>
|
||||||
|
<?php } else { // comments are closed ?>
|
||||||
|
<p>Sorry, the comment form is closed at this time.</p>
|
||||||
|
<?php }
|
||||||
|
} // end password check
|
||||||
|
?>
|
||||||
|
|
||||||
|
<div><strong><a href="javascript:window.close()">Close this window.</a></strong></div>
|
||||||
|
|
||||||
|
<?php // if you delete this the sky will fall on your head
|
||||||
|
endwhile; //endwhile have_posts()
|
||||||
|
else: //have_posts()
|
||||||
|
?>
|
||||||
|
<p>Sorry, no posts matched your criteria.</p>
|
||||||
|
<?php endif; ?>
|
||||||
|
<!-- // this is just the end of the motor - don't touch that line either :) -->
|
||||||
|
<?php //} ?>
|
||||||
|
<p class="credit"><?php timer_stop(1); ?> <cite>Powered by <a href="http://wordpress.org/" title="Powered by WordPress, state-of-the-art semantic personal publishing platform"><strong>WordPress</strong></a></cite></p>
|
||||||
|
<?php // Seen at http://www.mijnkopthee.nl/log2/archive/2003/05/28/esc(18) ?>
|
||||||
|
<script type="text/javascript">
|
||||||
|
<!--
|
||||||
|
document.onkeypress = function esc(e) {
|
||||||
|
if(typeof(e) == "undefined") { e=event; }
|
||||||
|
if (e.keyCode == 27) { self.close(); }
|
||||||
|
}
|
||||||
|
// -->
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
96
aclindsa-wordpress-theme/comments.php
Normal file
@ -0,0 +1,96 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* @package WordPress
|
||||||
|
* @subpackage Default_Theme
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Do not delete these lines
|
||||||
|
if (!empty($_SERVER['SCRIPT_FILENAME']) && 'comments.php' == basename($_SERVER['SCRIPT_FILENAME']))
|
||||||
|
die ('Please do not load this page directly. Thanks!');
|
||||||
|
|
||||||
|
if ( post_password_required() ) { ?>
|
||||||
|
<p class="nocomments">This post is password protected. Enter the password to view comments.</p>
|
||||||
|
<?php
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
|
||||||
|
<!-- You can start editing here. -->
|
||||||
|
|
||||||
|
<?php if ( have_comments() ) : ?>
|
||||||
|
<h3 id="comments"><?php comments_number('No Responses', 'One Response', '% Responses' );?> to “<?php the_title(); ?>”</h3>
|
||||||
|
|
||||||
|
<div class="navigation">
|
||||||
|
<div class="alignleft"><?php previous_comments_link() ?></div>
|
||||||
|
<div class="alignright"><?php next_comments_link() ?></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<ol class="commentlist">
|
||||||
|
<?php wp_list_comments(); ?>
|
||||||
|
</ol>
|
||||||
|
|
||||||
|
<div class="navigation">
|
||||||
|
<div class="alignleft"><?php previous_comments_link() ?></div>
|
||||||
|
<div class="alignright"><?php next_comments_link() ?></div>
|
||||||
|
</div>
|
||||||
|
<?php else : // this is displayed if there are no comments so far ?>
|
||||||
|
|
||||||
|
<?php if ( comments_open() ) : ?>
|
||||||
|
<!-- If comments are open, but there are no comments. -->
|
||||||
|
|
||||||
|
<?php else : // comments are closed ?>
|
||||||
|
<!-- If comments are closed. -->
|
||||||
|
<p class="nocomments">Comments are closed.</p>
|
||||||
|
|
||||||
|
<?php endif; ?>
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
|
|
||||||
|
<?php if ( comments_open() ) : ?>
|
||||||
|
|
||||||
|
<div id="respond">
|
||||||
|
|
||||||
|
<h3><?php comment_form_title( 'Leave a Reply', 'Leave a Reply to %s' ); ?></h3>
|
||||||
|
|
||||||
|
<div class="cancel-comment-reply">
|
||||||
|
<small><?php cancel_comment_reply_link(); ?></small>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<?php if ( get_option('comment_registration') && !is_user_logged_in() ) : ?>
|
||||||
|
<p>You must be <a href="<?php echo wp_login_url( get_permalink() ); ?>">logged in</a> to post a comment.</p>
|
||||||
|
<?php else : ?>
|
||||||
|
|
||||||
|
<form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform">
|
||||||
|
|
||||||
|
<?php if ( is_user_logged_in() ) : ?>
|
||||||
|
|
||||||
|
<p>Logged in as <a href="<?php echo get_option('siteurl'); ?>/wp-admin/profile.php"><?php echo $user_identity; ?></a>. <a href="<?php echo wp_logout_url(get_permalink()); ?>" title="Log out of this account">Log out »</a></p>
|
||||||
|
|
||||||
|
<?php else : ?>
|
||||||
|
|
||||||
|
<p><input type="text" name="author" id="author" value="<?php echo esc_attr($comment_author); ?>" size="22" tabindex="1" <?php if ($req) echo "aria-required='true'"; ?> />
|
||||||
|
<label for="author"><small>Name <?php if ($req) echo "(required)"; ?></small></label></p>
|
||||||
|
|
||||||
|
<p><input type="text" name="email" id="email" value="<?php echo esc_attr($comment_author_email); ?>" size="22" tabindex="2" <?php if ($req) echo "aria-required='true'"; ?> />
|
||||||
|
<label for="email"><small>Mail (will not be published) <?php if ($req) echo "(required)"; ?></small></label></p>
|
||||||
|
|
||||||
|
<p><input type="text" name="url" id="url" value="<?php echo esc_attr($comment_author_url); ?>" size="22" tabindex="3" />
|
||||||
|
<label for="url"><small>Website</small></label></p>
|
||||||
|
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
|
<!--<p><small><strong>XHTML:</strong> You can use these tags: <code><?php echo allowed_tags(); ?></code></small></p>-->
|
||||||
|
|
||||||
|
<p><textarea name="comment" id="comment" cols="100%" rows="10" tabindex="4"></textarea></p>
|
||||||
|
|
||||||
|
<p><input name="submit" type="submit" id="submit" tabindex="5" value="Submit Comment" />
|
||||||
|
<?php comment_id_fields(); ?>
|
||||||
|
</p>
|
||||||
|
<?php do_action('comment_form', $post->ID); ?>
|
||||||
|
|
||||||
|
</form>
|
||||||
|
|
||||||
|
<?php endif; // If registration required and not logged in ?>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<?php endif; // if you delete this the sky will fall on your head ?>
|
29
aclindsa-wordpress-theme/footer.php
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* @package WordPress
|
||||||
|
* @subpackage Default_Theme
|
||||||
|
*/
|
||||||
|
?>
|
||||||
|
|
||||||
|
<div id="footer">
|
||||||
|
<div id="footer-inner">
|
||||||
|
|
||||||
|
<!-- If you'd like to support WordPress, having the "powered by" link somewhere on your blog is the best way; it's our only promotion or advertising. -->
|
||||||
|
<p>
|
||||||
|
<?php bloginfo('name'); ?> is proudly powered by
|
||||||
|
<a href="http://wordpress.org/">WordPress</a>
|
||||||
|
<br /><a href="<?php bloginfo('rss2_url'); ?>">Entries (RSS)</a>
|
||||||
|
and <a href="<?php bloginfo('comments_rss2_url'); ?>">Comments (RSS)</a>.
|
||||||
|
<!-- <?php echo get_num_queries(); ?> queries. <?php timer_stop(1); ?> seconds. -->
|
||||||
|
</p>
|
||||||
|
|
||||||
|
© 2009 - 2011 Aaron Lindsay
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Gorgeous design by Michael Heilemann - http://binarybonsai.com/kubrick/ -->
|
||||||
|
<?php /* "Just what do you think you're doing Dave?" */ ?>
|
||||||
|
|
||||||
|
<?php wp_footer(); ?>
|
||||||
|
</body>
|
||||||
|
</html>
|
425
aclindsa-wordpress-theme/functions.php
Normal file
@ -0,0 +1,425 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* @package WordPress
|
||||||
|
* @subpackage Default_Theme
|
||||||
|
*/
|
||||||
|
|
||||||
|
automatic_feed_links();
|
||||||
|
|
||||||
|
if ( function_exists('register_sidebar') ) {
|
||||||
|
register_sidebar(array(
|
||||||
|
'before_widget' => '<li id="%1$s" class="widget %2$s">',
|
||||||
|
'after_widget' => '</li>',
|
||||||
|
'before_title' => '<h2 class="widgettitle">',
|
||||||
|
'after_title' => '</h2>',
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
/** @ignore */
|
||||||
|
function kubrick_head() {
|
||||||
|
$head = "<style type='text/css'>\n<!--";
|
||||||
|
$output = '';
|
||||||
|
if ( kubrick_header_image() ) {
|
||||||
|
$url = kubrick_header_image_url() ;
|
||||||
|
$output .= "#header { background: url('$url') no-repeat bottom center; }\n";
|
||||||
|
}
|
||||||
|
if ( false !== ( $color = kubrick_header_color() ) ) {
|
||||||
|
$output .= "#headerimg h1 a, #headerimg h1 a:visited, #headerimg .description { color: $color; }\n";
|
||||||
|
}
|
||||||
|
if ( false !== ( $display = kubrick_header_display() ) ) {
|
||||||
|
$output .= "#headerimg { display: $display }\n";
|
||||||
|
}
|
||||||
|
$foot = "--></style>\n";
|
||||||
|
if ( '' != $output )
|
||||||
|
echo $head . $output . $foot;
|
||||||
|
}
|
||||||
|
|
||||||
|
add_action('wp_head', 'kubrick_head');
|
||||||
|
|
||||||
|
function kubrick_header_image() {
|
||||||
|
return apply_filters('kubrick_header_image', get_option('kubrick_header_image'));
|
||||||
|
}
|
||||||
|
|
||||||
|
function kubrick_upper_color() {
|
||||||
|
if (strpos($url = kubrick_header_image_url(), 'header-img.php?') !== false) {
|
||||||
|
parse_str(substr($url, strpos($url, '?') + 1), $q);
|
||||||
|
return $q['upper'];
|
||||||
|
} else
|
||||||
|
return '69aee7';
|
||||||
|
}
|
||||||
|
|
||||||
|
function kubrick_lower_color() {
|
||||||
|
if (strpos($url = kubrick_header_image_url(), 'header-img.php?') !== false) {
|
||||||
|
parse_str(substr($url, strpos($url, '?') + 1), $q);
|
||||||
|
return $q['lower'];
|
||||||
|
} else
|
||||||
|
return '4180b6';
|
||||||
|
}
|
||||||
|
|
||||||
|
function kubrick_header_image_url() {
|
||||||
|
if ( $image = kubrick_header_image() )
|
||||||
|
$url = get_template_directory_uri() . '/images/' . $image;
|
||||||
|
else
|
||||||
|
$url = get_template_directory_uri() . '/images/kubrickheader.jpg';
|
||||||
|
|
||||||
|
return $url;
|
||||||
|
}
|
||||||
|
|
||||||
|
function kubrick_header_color() {
|
||||||
|
return apply_filters('kubrick_header_color', get_option('kubrick_header_color'));
|
||||||
|
}
|
||||||
|
|
||||||
|
function kubrick_header_color_string() {
|
||||||
|
$color = kubrick_header_color();
|
||||||
|
if ( false === $color )
|
||||||
|
return 'white';
|
||||||
|
|
||||||
|
return $color;
|
||||||
|
}
|
||||||
|
|
||||||
|
function kubrick_header_display() {
|
||||||
|
return apply_filters('kubrick_header_display', get_option('kubrick_header_display'));
|
||||||
|
}
|
||||||
|
|
||||||
|
function kubrick_header_display_string() {
|
||||||
|
$display = kubrick_header_display();
|
||||||
|
return $display ? $display : 'inline';
|
||||||
|
}
|
||||||
|
|
||||||
|
add_action('admin_menu', 'kubrick_add_theme_page');
|
||||||
|
|
||||||
|
function kubrick_add_theme_page() {
|
||||||
|
if ( isset( $_GET['page'] ) && $_GET['page'] == basename(__FILE__) ) {
|
||||||
|
if ( isset( $_REQUEST['action'] ) && 'save' == $_REQUEST['action'] ) {
|
||||||
|
check_admin_referer('kubrick-header');
|
||||||
|
if ( isset($_REQUEST['njform']) ) {
|
||||||
|
if ( isset($_REQUEST['defaults']) ) {
|
||||||
|
delete_option('kubrick_header_image');
|
||||||
|
delete_option('kubrick_header_color');
|
||||||
|
delete_option('kubrick_header_display');
|
||||||
|
} else {
|
||||||
|
if ( '' == $_REQUEST['njfontcolor'] )
|
||||||
|
delete_option('kubrick_header_color');
|
||||||
|
else {
|
||||||
|
$fontcolor = preg_replace('/^.*(#[0-9a-fA-F]{6})?.*$/', '$1', $_REQUEST['njfontcolor']);
|
||||||
|
update_option('kubrick_header_color', $fontcolor);
|
||||||
|
}
|
||||||
|
if ( preg_match('/[0-9A-F]{6}|[0-9A-F]{3}/i', $_REQUEST['njuppercolor'], $uc) && preg_match('/[0-9A-F]{6}|[0-9A-F]{3}/i', $_REQUEST['njlowercolor'], $lc) ) {
|
||||||
|
$uc = ( strlen($uc[0]) == 3 ) ? $uc[0]{0}.$uc[0]{0}.$uc[0]{1}.$uc[0]{1}.$uc[0]{2}.$uc[0]{2} : $uc[0];
|
||||||
|
$lc = ( strlen($lc[0]) == 3 ) ? $lc[0]{0}.$lc[0]{0}.$lc[0]{1}.$lc[0]{1}.$lc[0]{2}.$lc[0]{2} : $lc[0];
|
||||||
|
update_option('kubrick_header_image', "header-img.php?upper=$uc&lower=$lc");
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( isset($_REQUEST['toggledisplay']) ) {
|
||||||
|
if ( false === get_option('kubrick_header_display') )
|
||||||
|
update_option('kubrick_header_display', 'none');
|
||||||
|
else
|
||||||
|
delete_option('kubrick_header_display');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
|
||||||
|
if ( isset($_REQUEST['headerimage']) ) {
|
||||||
|
check_admin_referer('kubrick-header');
|
||||||
|
if ( '' == $_REQUEST['headerimage'] )
|
||||||
|
delete_option('kubrick_header_image');
|
||||||
|
else {
|
||||||
|
$headerimage = preg_replace('/^.*?(header-img.php\?upper=[0-9a-fA-F]{6}&lower=[0-9a-fA-F]{6})?.*$/', '$1', $_REQUEST['headerimage']);
|
||||||
|
update_option('kubrick_header_image', $headerimage);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( isset($_REQUEST['fontcolor']) ) {
|
||||||
|
check_admin_referer('kubrick-header');
|
||||||
|
if ( '' == $_REQUEST['fontcolor'] )
|
||||||
|
delete_option('kubrick_header_color');
|
||||||
|
else {
|
||||||
|
$fontcolor = preg_replace('/^.*?(#[0-9a-fA-F]{6})?.*$/', '$1', $_REQUEST['fontcolor']);
|
||||||
|
update_option('kubrick_header_color', $fontcolor);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( isset($_REQUEST['fontdisplay']) ) {
|
||||||
|
check_admin_referer('kubrick-header');
|
||||||
|
if ( '' == $_REQUEST['fontdisplay'] || 'inline' == $_REQUEST['fontdisplay'] )
|
||||||
|
delete_option('kubrick_header_display');
|
||||||
|
else
|
||||||
|
update_option('kubrick_header_display', 'none');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//print_r($_REQUEST);
|
||||||
|
wp_redirect("themes.php?page=functions.php&saved=true");
|
||||||
|
die;
|
||||||
|
}
|
||||||
|
add_action('admin_head', 'kubrick_theme_page_head');
|
||||||
|
}
|
||||||
|
add_theme_page(__('Custom Header'), __('Custom Header'), 'edit_themes', basename(__FILE__), 'kubrick_theme_page');
|
||||||
|
}
|
||||||
|
|
||||||
|
function kubrick_theme_page_head() {
|
||||||
|
?>
|
||||||
|
<script type="text/javascript" src="../wp-includes/js/colorpicker.js"></script>
|
||||||
|
<script type='text/javascript'>
|
||||||
|
// <![CDATA[
|
||||||
|
function pickColor(color) {
|
||||||
|
ColorPicker_targetInput.value = color;
|
||||||
|
kUpdate(ColorPicker_targetInput.id);
|
||||||
|
}
|
||||||
|
function PopupWindow_populate(contents) {
|
||||||
|
contents += '<br /><p style="text-align:center;margin-top:0px;"><input type="button" class="button-secondary" value="<?php esc_attr_e('Close Color Picker'); ?>" onclick="cp.hidePopup(\'prettyplease\')"></input></p>';
|
||||||
|
this.contents = contents;
|
||||||
|
this.populated = false;
|
||||||
|
}
|
||||||
|
function PopupWindow_hidePopup(magicword) {
|
||||||
|
if ( magicword != 'prettyplease' )
|
||||||
|
return false;
|
||||||
|
if (this.divName != null) {
|
||||||
|
if (this.use_gebi) {
|
||||||
|
document.getElementById(this.divName).style.visibility = "hidden";
|
||||||
|
}
|
||||||
|
else if (this.use_css) {
|
||||||
|
document.all[this.divName].style.visibility = "hidden";
|
||||||
|
}
|
||||||
|
else if (this.use_layers) {
|
||||||
|
document.layers[this.divName].visibility = "hidden";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if (this.popupWindow && !this.popupWindow.closed) {
|
||||||
|
this.popupWindow.close();
|
||||||
|
this.popupWindow = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
function colorSelect(t,p) {
|
||||||
|
if ( cp.p == p && document.getElementById(cp.divName).style.visibility != "hidden" )
|
||||||
|
cp.hidePopup('prettyplease');
|
||||||
|
else {
|
||||||
|
cp.p = p;
|
||||||
|
cp.select(t,p);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function PopupWindow_setSize(width,height) {
|
||||||
|
this.width = 162;
|
||||||
|
this.height = 210;
|
||||||
|
}
|
||||||
|
|
||||||
|
var cp = new ColorPicker();
|
||||||
|
function advUpdate(val, obj) {
|
||||||
|
document.getElementById(obj).value = val;
|
||||||
|
kUpdate(obj);
|
||||||
|
}
|
||||||
|
function kUpdate(oid) {
|
||||||
|
if ( 'uppercolor' == oid || 'lowercolor' == oid ) {
|
||||||
|
uc = document.getElementById('uppercolor').value.replace('#', '');
|
||||||
|
lc = document.getElementById('lowercolor').value.replace('#', '');
|
||||||
|
hi = document.getElementById('headerimage');
|
||||||
|
hi.value = 'header-img.php?upper='+uc+'&lower='+lc;
|
||||||
|
document.getElementById('header').style.background = 'url("<?php echo get_template_directory_uri(); ?>/images/'+hi.value+'") center no-repeat';
|
||||||
|
document.getElementById('advuppercolor').value = '#'+uc;
|
||||||
|
document.getElementById('advlowercolor').value = '#'+lc;
|
||||||
|
}
|
||||||
|
if ( 'fontcolor' == oid ) {
|
||||||
|
document.getElementById('header').style.color = document.getElementById('fontcolor').value;
|
||||||
|
document.getElementById('advfontcolor').value = document.getElementById('fontcolor').value;
|
||||||
|
}
|
||||||
|
if ( 'fontdisplay' == oid ) {
|
||||||
|
document.getElementById('headerimg').style.display = document.getElementById('fontdisplay').value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function toggleDisplay() {
|
||||||
|
td = document.getElementById('fontdisplay');
|
||||||
|
td.value = ( td.value == 'none' ) ? 'inline' : 'none';
|
||||||
|
kUpdate('fontdisplay');
|
||||||
|
}
|
||||||
|
function toggleAdvanced() {
|
||||||
|
a = document.getElementById('jsAdvanced');
|
||||||
|
if ( a.style.display == 'none' )
|
||||||
|
a.style.display = 'block';
|
||||||
|
else
|
||||||
|
a.style.display = 'none';
|
||||||
|
}
|
||||||
|
function kDefaults() {
|
||||||
|
document.getElementById('headerimage').value = '';
|
||||||
|
document.getElementById('advuppercolor').value = document.getElementById('uppercolor').value = '#69aee7';
|
||||||
|
document.getElementById('advlowercolor').value = document.getElementById('lowercolor').value = '#4180b6';
|
||||||
|
document.getElementById('header').style.background = 'url("<?php echo get_template_directory_uri(); ?>/images/kubrickheader.jpg") center no-repeat';
|
||||||
|
document.getElementById('header').style.color = '#FFFFFF';
|
||||||
|
document.getElementById('advfontcolor').value = document.getElementById('fontcolor').value = '';
|
||||||
|
document.getElementById('fontdisplay').value = 'inline';
|
||||||
|
document.getElementById('headerimg').style.display = document.getElementById('fontdisplay').value;
|
||||||
|
}
|
||||||
|
function kRevert() {
|
||||||
|
document.getElementById('headerimage').value = '<?php echo esc_js(kubrick_header_image()); ?>';
|
||||||
|
document.getElementById('advuppercolor').value = document.getElementById('uppercolor').value = '#<?php echo esc_js(kubrick_upper_color()); ?>';
|
||||||
|
document.getElementById('advlowercolor').value = document.getElementById('lowercolor').value = '#<?php echo esc_js(kubrick_lower_color()); ?>';
|
||||||
|
document.getElementById('header').style.background = 'url("<?php echo esc_js(kubrick_header_image_url()); ?>") center no-repeat';
|
||||||
|
document.getElementById('header').style.color = '';
|
||||||
|
document.getElementById('advfontcolor').value = document.getElementById('fontcolor').value = '<?php echo esc_js(kubrick_header_color_string()); ?>';
|
||||||
|
document.getElementById('fontdisplay').value = '<?php echo esc_js(kubrick_header_display_string()); ?>';
|
||||||
|
document.getElementById('headerimg').style.display = document.getElementById('fontdisplay').value;
|
||||||
|
}
|
||||||
|
function kInit() {
|
||||||
|
document.getElementById('jsForm').style.display = 'block';
|
||||||
|
document.getElementById('nonJsForm').style.display = 'none';
|
||||||
|
}
|
||||||
|
addLoadEvent(kInit);
|
||||||
|
// ]]>
|
||||||
|
</script>
|
||||||
|
<style type='text/css'>
|
||||||
|
#headwrap {
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
#kubrick-header {
|
||||||
|
font-size: 80%;
|
||||||
|
}
|
||||||
|
#kubrick-header .hibrowser {
|
||||||
|
width: 780px;
|
||||||
|
height: 260px;
|
||||||
|
overflow: scroll;
|
||||||
|
}
|
||||||
|
#kubrick-header #hitarget {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
#kubrick-header #header h1 {
|
||||||
|
font-family: 'Trebuchet MS', 'Lucida Grande', Verdana, Arial, Sans-Serif;
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 4em;
|
||||||
|
text-align: center;
|
||||||
|
padding-top: 70px;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
#kubrick-header #header .description {
|
||||||
|
font-family: 'Lucida Grande', Verdana, Arial, Sans-Serif;
|
||||||
|
font-size: 1.2em;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
#kubrick-header #header {
|
||||||
|
text-decoration: none;
|
||||||
|
color: <?php echo kubrick_header_color_string(); ?>;
|
||||||
|
padding: 0;
|
||||||
|
margin: 0;
|
||||||
|
height: 200px;
|
||||||
|
text-align: center;
|
||||||
|
background: url('<?php echo kubrick_header_image_url(); ?>') center no-repeat;
|
||||||
|
}
|
||||||
|
#kubrick-header #headerimg {
|
||||||
|
margin: 0;
|
||||||
|
height: 200px;
|
||||||
|
width: 100%;
|
||||||
|
display: <?php echo kubrick_header_display_string(); ?>;
|
||||||
|
}
|
||||||
|
#jsForm {
|
||||||
|
display: none;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
#jsForm input.submit, #jsForm input.button, #jsAdvanced input.button {
|
||||||
|
padding: 0px;
|
||||||
|
margin: 0px;
|
||||||
|
}
|
||||||
|
#advanced {
|
||||||
|
text-align: center;
|
||||||
|
width: 620px;
|
||||||
|
}
|
||||||
|
html>body #advanced {
|
||||||
|
text-align: center;
|
||||||
|
position: relative;
|
||||||
|
left: 50%;
|
||||||
|
margin-left: -380px;
|
||||||
|
}
|
||||||
|
#jsAdvanced {
|
||||||
|
text-align: right;
|
||||||
|
}
|
||||||
|
#nonJsForm {
|
||||||
|
position: relative;
|
||||||
|
text-align: left;
|
||||||
|
margin-left: -370px;
|
||||||
|
left: 50%;
|
||||||
|
}
|
||||||
|
#nonJsForm label {
|
||||||
|
padding-top: 6px;
|
||||||
|
padding-right: 5px;
|
||||||
|
float: left;
|
||||||
|
width: 100px;
|
||||||
|
text-align: right;
|
||||||
|
}
|
||||||
|
.defbutton {
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
.zerosize {
|
||||||
|
width: 0px;
|
||||||
|
height: 0px;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
#colorPickerDiv a, #colorPickerDiv a:hover {
|
||||||
|
padding: 1px;
|
||||||
|
text-decoration: none;
|
||||||
|
border-bottom: 0px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
|
||||||
|
function kubrick_theme_page() {
|
||||||
|
if ( isset( $_REQUEST['saved'] ) ) echo '<div id="message" class="updated fade"><p><strong>'.__('Options saved.').'</strong></p></div>';
|
||||||
|
?>
|
||||||
|
<div class='wrap'>
|
||||||
|
<h2><?php _e('Customize Header'); ?></h2>
|
||||||
|
<div id="kubrick-header">
|
||||||
|
<div id="headwrap">
|
||||||
|
<div id="header">
|
||||||
|
<div id="headerimg">
|
||||||
|
<h1><?php bloginfo('name'); ?></h1>
|
||||||
|
<div class="description"><?php bloginfo('description'); ?></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<br />
|
||||||
|
<div id="nonJsForm">
|
||||||
|
<form method="post" action="">
|
||||||
|
<?php wp_nonce_field('kubrick-header'); ?>
|
||||||
|
<div class="zerosize"><input type="submit" name="defaultsubmit" value="<?php esc_attr_e('Save'); ?>" /></div>
|
||||||
|
<label for="njfontcolor"><?php _e('Font Color:'); ?></label><input type="text" name="njfontcolor" id="njfontcolor" value="<?php echo esc_attr(kubrick_header_color()); ?>" /> <?php printf(__('Any CSS color (%s or %s or %s)'), '<code>red</code>', '<code>#FF0000</code>', '<code>rgb(255, 0, 0)</code>'); ?><br />
|
||||||
|
<label for="njuppercolor"><?php _e('Upper Color:'); ?></label><input type="text" name="njuppercolor" id="njuppercolor" value="#<?php echo esc_attr(kubrick_upper_color()); ?>" /> <?php printf(__('HEX only (%s or %s)'), '<code>#FF0000</code>', '<code>#F00</code>'); ?><br />
|
||||||
|
<label for="njlowercolor"><?php _e('Lower Color:'); ?></label><input type="text" name="njlowercolor" id="njlowercolor" value="#<?php echo esc_attr(kubrick_lower_color()); ?>" /> <?php printf(__('HEX only (%s or %s)'), '<code>#FF0000</code>', '<code>#F00</code>'); ?><br />
|
||||||
|
<input type="hidden" name="hi" id="hi" value="<?php echo esc_attr(kubrick_header_image()); ?>" />
|
||||||
|
<input type="submit" name="toggledisplay" id="toggledisplay" value="<?php esc_attr_e('Toggle Text'); ?>" />
|
||||||
|
<input type="submit" name="defaults" value="<?php esc_attr_e('Use Defaults'); ?>" />
|
||||||
|
<input type="submit" class="defbutton" name="submitform" value=" <?php esc_attr_e('Save'); ?> " />
|
||||||
|
<input type="hidden" name="action" value="save" />
|
||||||
|
<input type="hidden" name="njform" value="true" />
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
<div id="jsForm">
|
||||||
|
<form style="display:inline;" method="post" name="hicolor" id="hicolor" action="<?php echo esc_attr($_SERVER['REQUEST_URI']); ?>">
|
||||||
|
<?php wp_nonce_field('kubrick-header'); ?>
|
||||||
|
<input type="button" class="button-secondary" onclick="tgt=document.getElementById('fontcolor');colorSelect(tgt,'pick1');return false;" name="pick1" id="pick1" value="<?php esc_attr_e('Font Color'); ?>"></input>
|
||||||
|
<input type="button" class="button-secondary" onclick="tgt=document.getElementById('uppercolor');colorSelect(tgt,'pick2');return false;" name="pick2" id="pick2" value="<?php esc_attr_e('Upper Color'); ?>"></input>
|
||||||
|
<input type="button" class="button-secondary" onclick="tgt=document.getElementById('lowercolor');colorSelect(tgt,'pick3');return false;" name="pick3" id="pick3" value="<?php esc_attr_e('Lower Color'); ?>"></input>
|
||||||
|
<input type="button" class="button-secondary" name="revert" value="<?php esc_attr_e('Revert'); ?>" onclick="kRevert()" />
|
||||||
|
<input type="button" class="button-secondary" value="<?php esc_attr_e('Advanced'); ?>" onclick="toggleAdvanced()" />
|
||||||
|
<input type="hidden" name="action" value="save" />
|
||||||
|
<input type="hidden" name="fontdisplay" id="fontdisplay" value="<?php echo esc_attr(kubrick_header_display()); ?>" />
|
||||||
|
<input type="hidden" name="fontcolor" id="fontcolor" value="<?php echo esc_attr(kubrick_header_color()); ?>" />
|
||||||
|
<input type="hidden" name="uppercolor" id="uppercolor" value="<?php echo esc_attr(kubrick_upper_color()); ?>" />
|
||||||
|
<input type="hidden" name="lowercolor" id="lowercolor" value="<?php echo esc_attr(kubrick_lower_color()); ?>" />
|
||||||
|
<input type="hidden" name="headerimage" id="headerimage" value="<?php echo esc_attr(kubrick_header_image()); ?>" />
|
||||||
|
<p class="submit"><input type="submit" name="submitform" class="button-primary" value="<?php esc_attr_e('Update Header'); ?>" onclick="cp.hidePopup('prettyplease')" /></p>
|
||||||
|
</form>
|
||||||
|
<div id="colorPickerDiv" style="z-index: 100;background:#eee;border:1px solid #ccc;position:absolute;visibility:hidden;"> </div>
|
||||||
|
<div id="advanced">
|
||||||
|
<form id="jsAdvanced" style="display:none;" action="">
|
||||||
|
<?php wp_nonce_field('kubrick-header'); ?>
|
||||||
|
<label for="advfontcolor"><?php _e('Font Color (CSS):'); ?> </label><input type="text" id="advfontcolor" onchange="advUpdate(this.value, 'fontcolor')" value="<?php echo esc_attr(kubrick_header_color()); ?>" /><br />
|
||||||
|
<label for="advuppercolor"><?php _e('Upper Color (HEX):');?> </label><input type="text" id="advuppercolor" onchange="advUpdate(this.value, 'uppercolor')" value="#<?php echo esc_attr(kubrick_upper_color()); ?>" /><br />
|
||||||
|
<label for="advlowercolor"><?php _e('Lower Color (HEX):'); ?> </label><input type="text" id="advlowercolor" onchange="advUpdate(this.value, 'lowercolor')" value="#<?php echo esc_attr(kubrick_lower_color()); ?>" /><br />
|
||||||
|
<input type="button" class="button-secondary" name="default" value="<?php esc_attr_e('Select Default Colors'); ?>" onclick="kDefaults()" /><br />
|
||||||
|
<input type="button" class="button-secondary" onclick="toggleDisplay();return false;" name="pick" id="pick" value="<?php esc_attr_e('Toggle Text Display'); ?>"></input><br />
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<?php } ?>
|
38
aclindsa-wordpress-theme/header.php
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* @package WordPress
|
||||||
|
* @subpackage Default_Theme
|
||||||
|
*/
|
||||||
|
?>
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>>
|
||||||
|
|
||||||
|
<head profile="http://gmpg.org/xfn/11">
|
||||||
|
<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
|
||||||
|
|
||||||
|
<title><?php wp_title('«', true, 'right'); ?> <?php bloginfo('name'); ?></title>
|
||||||
|
|
||||||
|
<link rel="stylesheet" href="http://aclindsay.com/stylesheet.css" type="text/css" media="screen" />
|
||||||
|
<link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
|
||||||
|
|
||||||
|
<?php if ( is_singular() ) wp_enqueue_script( 'comment-reply' ); ?>
|
||||||
|
|
||||||
|
<?php wp_head(); ?>
|
||||||
|
</head>
|
||||||
|
<body <?php body_class(); ?>>
|
||||||
|
<div id="header">
|
||||||
|
<div id="header-inner">
|
||||||
|
<div id="title"><a href="http://aclindsay.com">aclindsay.com</a></div>
|
||||||
|
|
||||||
|
<div id="tabs">
|
||||||
|
<ul>
|
||||||
|
<li><a href="http://aclindsay.com/home/">Home</a></li>
|
||||||
|
<li><a href="http://aclindsay.com/projects/">Projects</a></li>
|
||||||
|
<li><a href="http://aclindsay.com/about/">About</a></li>
|
||||||
|
<li><a href="http://aclindsay.com/contact/">Contact</a></li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
70
aclindsa-wordpress-theme/image.php
Normal file
@ -0,0 +1,70 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* @package WordPress
|
||||||
|
* @subpackage Default_Theme
|
||||||
|
*/
|
||||||
|
|
||||||
|
get_header();
|
||||||
|
?>
|
||||||
|
|
||||||
|
<div id="content" class="widecolumn">
|
||||||
|
|
||||||
|
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
|
||||||
|
|
||||||
|
<div class="post" id="post-<?php the_ID(); ?>">
|
||||||
|
<h2><a href="<?php echo get_permalink($post->post_parent); ?>" rev="attachment"><?php echo get_the_title($post->post_parent); ?></a> » <?php the_title(); ?></h2>
|
||||||
|
<div class="entry">
|
||||||
|
<p class="attachment"><a href="<?php echo wp_get_attachment_url($post->ID); ?>"><?php echo wp_get_attachment_image( $post->ID, 'medium' ); ?></a></p>
|
||||||
|
<div class="caption"><?php if ( !empty($post->post_excerpt) ) the_excerpt(); // this is the "caption" ?></div>
|
||||||
|
|
||||||
|
<?php the_content('<p class="serif">Read the rest of this entry »</p>'); ?>
|
||||||
|
|
||||||
|
<div class="navigation">
|
||||||
|
<div class="alignleft"><?php previous_image_link() ?></div>
|
||||||
|
<div class="alignright"><?php next_image_link() ?></div>
|
||||||
|
</div>
|
||||||
|
<br class="clear" />
|
||||||
|
|
||||||
|
<p class="postmetadata alt">
|
||||||
|
<small>
|
||||||
|
This entry was posted on <?php the_time('l, F jS, Y') ?> at <?php the_time() ?>
|
||||||
|
and is filed under <?php the_category(', ') ?>.
|
||||||
|
<?php the_taxonomies(); ?>
|
||||||
|
You can follow any responses to this entry through the <?php post_comments_feed_link('RSS 2.0'); ?> feed.
|
||||||
|
|
||||||
|
<?php if ( comments_open() && pings_open() ) {
|
||||||
|
// Both Comments and Pings are open ?>
|
||||||
|
You can <a href="#respond">leave a response</a>, or <a href="<?php trackback_url(); ?>" rel="trackback">trackback</a> from your own site.
|
||||||
|
|
||||||
|
<?php } elseif ( !comments_open() && pings_open() ) {
|
||||||
|
// Only Pings are Open ?>
|
||||||
|
Responses are currently closed, but you can <a href="<?php trackback_url(); ?> " rel="trackback">trackback</a> from your own site.
|
||||||
|
|
||||||
|
<?php } elseif ( comments_open() && !pings_open() ) {
|
||||||
|
// Comments are open, Pings are not ?>
|
||||||
|
You can skip to the end and leave a response. Pinging is currently not allowed.
|
||||||
|
|
||||||
|
<?php } elseif ( !comments_open() && !pings_open() ) {
|
||||||
|
// Neither Comments, nor Pings are open ?>
|
||||||
|
Both comments and pings are currently closed.
|
||||||
|
|
||||||
|
<?php } edit_post_link('Edit this entry.','',''); ?>
|
||||||
|
|
||||||
|
</small>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<?php comments_template(); ?>
|
||||||
|
|
||||||
|
<?php endwhile; else: ?>
|
||||||
|
|
||||||
|
<p>Sorry, no attachments matched your criteria.</p>
|
||||||
|
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<?php get_footer(); ?>
|
47
aclindsa-wordpress-theme/index.php
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* @package WordPress
|
||||||
|
* @subpackage Default_Theme
|
||||||
|
*/
|
||||||
|
|
||||||
|
get_header(); ?>
|
||||||
|
|
||||||
|
<div id="content" class="narrowcolumn" role="main">
|
||||||
|
|
||||||
|
<div id="main">
|
||||||
|
|
||||||
|
<?php if (have_posts()) : ?>
|
||||||
|
|
||||||
|
<?php while (have_posts()) : the_post(); ?>
|
||||||
|
|
||||||
|
<div <?php post_class() ?> id="post-<?php the_ID(); ?>">
|
||||||
|
<h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
|
||||||
|
<small><?php the_time('F jS, Y') ?> <!-- by <?php the_author() ?> --></small>
|
||||||
|
|
||||||
|
<div class="entry">
|
||||||
|
<?php the_content('Read the rest of this entry »'); ?>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<p class="postmetadata"><?php the_tags('Tags: ', ', ', '<br />'); ?> Posted in <?php the_category(', ') ?> | <?php edit_post_link('Edit', '', ' | '); ?> <?php comments_popup_link('No Comments »', '1 Comment »', '% Comments »'); ?></p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<?php endwhile; ?>
|
||||||
|
|
||||||
|
<div class="navigation">
|
||||||
|
<div class="alignleft"><?php next_posts_link('« Older Entries') ?></div>
|
||||||
|
<div class="alignright"><?php previous_posts_link('Newer Entries »') ?></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<?php else : ?>
|
||||||
|
|
||||||
|
<h2 class="center">Not Found</h2>
|
||||||
|
<p class="center">Sorry, but you are looking for something that isn't here.</p>
|
||||||
|
<?php get_search_form(); ?>
|
||||||
|
|
||||||
|
<?php endif; ?>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<?php get_sidebar(); ?>
|
||||||
|
</div>
|
||||||
|
<?php get_footer(); ?>
|
23
aclindsa-wordpress-theme/links.php
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* @package WordPress
|
||||||
|
* @subpackage Default_Theme
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
Template Name: Links
|
||||||
|
*/
|
||||||
|
?>
|
||||||
|
|
||||||
|
<?php get_header(); ?>
|
||||||
|
|
||||||
|
<div id="content" class="widecolumn">
|
||||||
|
|
||||||
|
<h2>Links:</h2>
|
||||||
|
<ul>
|
||||||
|
<?php wp_list_bookmarks(); ?>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<?php get_footer(); ?>
|
27
aclindsa-wordpress-theme/page.php
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* @package WordPress
|
||||||
|
* @subpackage Default_Theme
|
||||||
|
*/
|
||||||
|
|
||||||
|
get_header(); ?>
|
||||||
|
|
||||||
|
<div id="content" class="narrowcolumn" role="main">
|
||||||
|
|
||||||
|
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
|
||||||
|
<div class="post" id="post-<?php the_ID(); ?>">
|
||||||
|
<h2><?php the_title(); ?></h2>
|
||||||
|
<div class="entry">
|
||||||
|
<?php the_content('<p class="serif">Read the rest of this page »</p>'); ?>
|
||||||
|
|
||||||
|
<?php wp_link_pages(array('before' => '<p><strong>Pages:</strong> ', 'after' => '</p>', 'next_or_number' => 'number')); ?>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<?php endwhile; endif; ?>
|
||||||
|
<?php edit_post_link('Edit this entry.', '<p>', '</p>'); ?>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<?php get_sidebar(); ?>
|
||||||
|
|
||||||
|
<?php get_footer(); ?>
|
BIN
aclindsa-wordpress-theme/screenshot.png
Normal file
After Width: | Height: | Size: 10 KiB |
51
aclindsa-wordpress-theme/search.php
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* @package WordPress
|
||||||
|
* @subpackage Default_Theme
|
||||||
|
*/
|
||||||
|
|
||||||
|
get_header(); ?>
|
||||||
|
|
||||||
|
<div id="content">
|
||||||
|
<div id="main" class="narrowcolumn" role="main">
|
||||||
|
|
||||||
|
<?php if (have_posts()) : ?>
|
||||||
|
|
||||||
|
<h2 class="pagetitle">Search Results</h2>
|
||||||
|
|
||||||
|
<div class="navigation">
|
||||||
|
<div class="alignleft"><?php next_posts_link('« Older Entries') ?></div>
|
||||||
|
<div class="alignright"><?php previous_posts_link('Newer Entries »') ?></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<?php while (have_posts()) : the_post(); ?>
|
||||||
|
|
||||||
|
<div <?php post_class() ?>>
|
||||||
|
<h3 id="post-<?php the_ID(); ?>"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h3>
|
||||||
|
<small><?php the_time('l, F jS, Y') ?></small>
|
||||||
|
|
||||||
|
<p class="postmetadata"><?php the_tags('Tags: ', ', ', '<br />'); ?> Posted in <?php the_category(', ') ?> | <?php edit_post_link('Edit', '', ' | '); ?> <?php comments_popup_link('No Comments »', '1 Comment »', '% Comments »'); ?></p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<?php endwhile; ?>
|
||||||
|
|
||||||
|
<div class="navigation">
|
||||||
|
<div class="alignleft"><?php next_posts_link('« Older Entries') ?></div>
|
||||||
|
<div class="alignright"><?php previous_posts_link('Newer Entries »') ?></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<?php else : ?>
|
||||||
|
|
||||||
|
<h2 class="center">No posts found. Try a different search?</h2>
|
||||||
|
<?php get_search_form(); ?>
|
||||||
|
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<?php get_sidebar(); ?>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<?php get_footer(); ?>
|
83
aclindsa-wordpress-theme/sidebar.php
Normal file
@ -0,0 +1,83 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* @package WordPress
|
||||||
|
* @subpackage Default_Theme
|
||||||
|
*/
|
||||||
|
?>
|
||||||
|
<div id="sidebar" role="complementary">
|
||||||
|
<ul>
|
||||||
|
<?php /* Widgetized sidebar, if you have the plugin installed. */
|
||||||
|
if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar() ) : ?>
|
||||||
|
<li>
|
||||||
|
<?php get_search_form(); ?>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<!-- Author information is disabled per default. Uncomment and fill in your details if you want to use it.
|
||||||
|
<li><h2>Author</h2>
|
||||||
|
<p>A little something about you, the author. Nothing lengthy, just an overview.</p>
|
||||||
|
</li>
|
||||||
|
-->
|
||||||
|
|
||||||
|
<?php if ( is_404() || is_category() || is_day() || is_month() ||
|
||||||
|
is_year() || is_search() || is_paged() ) {
|
||||||
|
?> <li>
|
||||||
|
|
||||||
|
<?php /* If this is a 404 page */ if (is_404()) { ?>
|
||||||
|
<?php /* If this is a category archive */ } elseif (is_category()) { ?>
|
||||||
|
<p>You are currently browsing the archives for the <?php single_cat_title(''); ?> category.</p>
|
||||||
|
|
||||||
|
<?php /* If this is a yearly archive */ } elseif (is_day()) { ?>
|
||||||
|
<p>You are currently browsing the <a href="<?php bloginfo('url'); ?>/"><?php echo bloginfo('name'); ?></a> blog archives
|
||||||
|
for the day <?php the_time('l, F jS, Y'); ?>.</p>
|
||||||
|
|
||||||
|
<?php /* If this is a monthly archive */ } elseif (is_month()) { ?>
|
||||||
|
<p>You are currently browsing the <a href="<?php bloginfo('url'); ?>/"><?php echo bloginfo('name'); ?></a> blog archives
|
||||||
|
for <?php the_time('F, Y'); ?>.</p>
|
||||||
|
|
||||||
|
<?php /* If this is a yearly archive */ } elseif (is_year()) { ?>
|
||||||
|
<p>You are currently browsing the <a href="<?php bloginfo('url'); ?>/"><?php echo bloginfo('name'); ?></a> blog archives
|
||||||
|
for the year <?php the_time('Y'); ?>.</p>
|
||||||
|
|
||||||
|
<?php /* If this is a monthly archive */ } elseif (is_search()) { ?>
|
||||||
|
<p>You have searched the <a href="<?php echo bloginfo('url'); ?>/"><?php echo bloginfo('name'); ?></a> blog archives
|
||||||
|
for <strong>'<?php the_search_query(); ?>'</strong>. If you are unable to find anything in these search results, you can try one of these links.</p>
|
||||||
|
|
||||||
|
<?php /* If this is a monthly archive */ } elseif (isset($_GET['paged']) && !empty($_GET['paged'])) { ?>
|
||||||
|
<p>You are currently browsing the <a href="<?php echo bloginfo('url'); ?>/"><?php echo bloginfo('name'); ?></a> blog archives.</p>
|
||||||
|
|
||||||
|
<?php } ?>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
<?php }?>
|
||||||
|
</ul>
|
||||||
|
<ul role="navigation">
|
||||||
|
<?php wp_list_pages('title_li=<h2>Pages</h2>' ); ?>
|
||||||
|
|
||||||
|
<li><h2>Archives</h2>
|
||||||
|
<ul>
|
||||||
|
<?php wp_get_archives('type=monthly'); ?>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<?php wp_list_categories('show_count=1&title_li=<h2>Categories</h2>'); ?>
|
||||||
|
</ul>
|
||||||
|
<ul>
|
||||||
|
<?php /* If this is the frontpage */ if ( is_home() || is_page() ) { ?>
|
||||||
|
<?php wp_list_bookmarks(); ?>
|
||||||
|
|
||||||
|
<li><h2>Meta</h2>
|
||||||
|
<ul>
|
||||||
|
<?php wp_register(); ?>
|
||||||
|
<li><?php wp_loginout(); ?></li>
|
||||||
|
<li><a href="http://validator.w3.org/check/referer" title="This page validates as XHTML 1.0 Transitional">Valid <abbr title="eXtensible HyperText Markup Language">XHTML</abbr></a></li>
|
||||||
|
<li><a href="http://gmpg.org/xfn/"><abbr title="XHTML Friends Network">XFN</abbr></a></li>
|
||||||
|
<li><a href="http://wordpress.org/" title="Powered by WordPress, state-of-the-art semantic personal publishing platform.">WordPress</a></li>
|
||||||
|
<?php wp_meta(); ?>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
<?php } ?>
|
||||||
|
|
||||||
|
<?php endif; ?>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
73
aclindsa-wordpress-theme/single.php
Normal file
@ -0,0 +1,73 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* @package WordPress
|
||||||
|
* @subpackage Default_Theme
|
||||||
|
*/
|
||||||
|
|
||||||
|
get_header();
|
||||||
|
?>
|
||||||
|
|
||||||
|
<div id="content" class="widecolumn" role="main">
|
||||||
|
|
||||||
|
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
|
||||||
|
|
||||||
|
<div class="navigation">
|
||||||
|
<div class="alignleft"><?php previous_post_link('« %link') ?></div>
|
||||||
|
<div class="alignright"><?php next_post_link('%link »') ?></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div <?php post_class() ?> id="post-<?php the_ID(); ?>">
|
||||||
|
<h2><?php the_title(); ?></h2>
|
||||||
|
|
||||||
|
<div class="entry">
|
||||||
|
<?php the_content('<p class="serif">Read the rest of this entry »</p>'); ?>
|
||||||
|
|
||||||
|
<?php wp_link_pages(array('before' => '<p><strong>Pages:</strong> ', 'after' => '</p>', 'next_or_number' => 'number')); ?>
|
||||||
|
<?php the_tags( '<p>Tags: ', ', ', '</p>'); ?>
|
||||||
|
|
||||||
|
<p class="postmetadata alt">
|
||||||
|
<small>
|
||||||
|
This entry was posted
|
||||||
|
<?php /* This is commented, because it requires a little adjusting sometimes.
|
||||||
|
You'll need to download this plugin, and follow the instructions:
|
||||||
|
http://binarybonsai.com/wordpress/time-since/ */
|
||||||
|
/* $entry_datetime = abs(strtotime($post->post_date) - (60*120)); echo time_since($entry_datetime); echo ' ago'; */ ?>
|
||||||
|
on <?php the_time('l, F jS, Y') ?> at <?php the_time() ?>
|
||||||
|
and is filed under <?php the_category(', ') ?>.
|
||||||
|
You can follow any responses to this entry through the <?php post_comments_feed_link('RSS 2.0'); ?> feed.
|
||||||
|
|
||||||
|
<?php if ( comments_open() && pings_open() ) {
|
||||||
|
// Both Comments and Pings are open ?>
|
||||||
|
You can <a href="#respond">leave a response</a>, or <a href="<?php trackback_url(); ?>" rel="trackback">trackback</a> from your own site.
|
||||||
|
|
||||||
|
<?php } elseif ( !comments_open() && pings_open() ) {
|
||||||
|
// Only Pings are Open ?>
|
||||||
|
Responses are currently closed, but you can <a href="<?php trackback_url(); ?> " rel="trackback">trackback</a> from your own site.
|
||||||
|
|
||||||
|
<?php } elseif ( comments_open() && !pings_open() ) {
|
||||||
|
// Comments are open, Pings are not ?>
|
||||||
|
You can skip to the end and leave a response. Pinging is currently not allowed.
|
||||||
|
|
||||||
|
<?php } elseif ( !comments_open() && !pings_open() ) {
|
||||||
|
// Neither Comments, nor Pings are open ?>
|
||||||
|
Both comments and pings are currently closed.
|
||||||
|
|
||||||
|
<?php } edit_post_link('Edit this entry','','.'); ?>
|
||||||
|
|
||||||
|
</small>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<?php comments_template(); ?>
|
||||||
|
|
||||||
|
<?php endwhile; else: ?>
|
||||||
|
|
||||||
|
<p>Sorry, no posts matched your criteria.</p>
|
||||||
|
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<?php get_footer(); ?>
|
12
calendar/index.php
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
<?php include("../header_top.php"); ?>
|
||||||
|
<title>Aaron's Calendar - aclindsay.com</title>
|
||||||
|
<?php include("../header_bottom.php"); ?>
|
||||||
|
|
||||||
|
<div id="content">
|
||||||
|
<div id="main">
|
||||||
|
<h2>Aaron's Calendar</h2>
|
||||||
|
<iframe src="http://www.google.com/calendar/b/0/embed?title=Aaron's%20Calendar&showTitle=0&showPrint=0&showCalendars=0&mode=WEEK&height=600&wkst=1&hl=en&bgcolor=%23eee&src=aclindsa%40gmail.com&color=%232952A3&src=1ogmja9g7rlpa1ftedsc648dmc%40group.calendar.google.com&color=%23A32929&src=4md2hv2oii62t7rs7eksnohptc%40group.calendar.google.com&color=%23B1440E&src=omt0tq084mmeoa7v0st7ebmsqg%40group.calendar.google.com&color=%23AB8B00&src=2gco5ql21vvh2g36p80vbdch00%40group.calendar.google.com&color=%235229A3&src=6eaag5ba9fdmdba01cdtai452c%40group.calendar.google.com&color=%230D7813&src=en.usa%23holiday%40group.v.calendar.google.com&color=%238D6F47&ctz=America%2FNew_York" width="800" height="600" frameborder="0" scrolling="no"></iframe>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<?php include("../footer.php"); ?>
|
28
contact/index.php
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
<?php include("../header_top.php"); ?>
|
||||||
|
<title>Contact Information - aclindsay.com</title>
|
||||||
|
<script type="text/javascript">
|
||||||
|
//Email obfuscation by Javascript insertion
|
||||||
|
window.onload = function() {
|
||||||
|
document.getElementById('emailend').innerHTML="edu";
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<?php include("../header_bottom.php"); ?>
|
||||||
|
|
||||||
|
<div id="content">
|
||||||
|
<div id="main">
|
||||||
|
<h2>Contact Page</h2>
|
||||||
|
|
||||||
|
<!-- Email Obfuscation -->
|
||||||
|
<p>e-mail: aaron <span style="display:none;">@hotmail.com</span>DOT lindsay <span>AT<span style="display:none;">...2@.$97^4</span></span> v<!--blah -->t<span> </span>DOT <span id="emailend"> </span> </p>
|
||||||
|
|
||||||
|
<p>voice:
|
||||||
|
<object type="application/x-shockwave-flash" data="https://clients4.google.com/voice/embed/webCallButton" width="230" height="85"><param name="movie" value="https://clients4.google.com/voice/embed/webCallButton" /><param name="wmode" value="transparent" /><param name="FlashVars" value="id=9892b7fc9d9bab1f95d03625ba9119129d65f9da&style=0" /></object>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<!-- <div id="sidebar">
|
||||||
|
<span>
|
||||||
|
</span>
|
||||||
|
</div> -->
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<?php include("../footer.php"); ?>
|
12
errors/400.php
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
<?php include("../header_top.php"); ?>
|
||||||
|
<title>Bad Request - aclindsay.com</title>
|
||||||
|
<?php include("../header_bottom.php"); ?>
|
||||||
|
|
||||||
|
<div id="content">
|
||||||
|
<div id="main">
|
||||||
|
<h2 class="center">Error 400 - Bad Request</h2>
|
||||||
|
<p>This HTTP request was malformed, and could not be processed. You may attempt to reload this page, but the software you are using (your browser) may be at fault.</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<?php include("../footer.php"); ?>
|
12
errors/401.php
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
<?php include("../header_top.php"); ?>
|
||||||
|
<title>Authorization Required - aclindsay.com</title>
|
||||||
|
<?php include("../header_bottom.php"); ?>
|
||||||
|
|
||||||
|
<div id="content">
|
||||||
|
<div id="main">
|
||||||
|
<h2 class="center">Error 401 - Authorization Required</h2>
|
||||||
|
<p>The page you are requesting requires authorization to view. Please provide your login credentials, if you have them, or continue browsing with our <a href="http://aclindsay.com">homepage</a>.</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<?php include("../footer.php"); ?>
|
12
errors/403.php
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
<?php include("../header_top.php"); ?>
|
||||||
|
<title>Forbidden - aclindsay.com</title>
|
||||||
|
<?php include("../header_bottom.php"); ?>
|
||||||
|
|
||||||
|
<div id="content">
|
||||||
|
<div id="main">
|
||||||
|
<h2 class="center">Error 403 - Forbidden</h2>
|
||||||
|
<p>The page you are requesting will not be returned. Refreshing the page won't help either. Please use your browser's back buttons to return to the page you came from, or continue browsing with our <a href="http://aclindsay.com">homepage</a>.</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<?php include("../footer.php"); ?>
|
12
errors/404.php
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
<?php include("../header_top.php"); ?>
|
||||||
|
<title>Page Not Found - aclindsay.com</title>
|
||||||
|
<?php include("../header_bottom.php"); ?>
|
||||||
|
|
||||||
|
<div id="content">
|
||||||
|
<div id="main">
|
||||||
|
<h2 class="center">Error 404 - Page Not Found</h2>
|
||||||
|
<p>Oops, the page you are looking for does not exist. You may use your browsers back button to return to the page from which you came, or visit the <a href="http://aclindsay.com">homepage</a> to get back on track.</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<?php include("../footer.php"); ?>
|
12
errors/500.php
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
<?php include("../header_top.php"); ?>
|
||||||
|
<title>Internal Server Error - aclindsay.com</title>
|
||||||
|
<?php include("../header_bottom.php"); ?>
|
||||||
|
|
||||||
|
<div id="content">
|
||||||
|
<div id="main">
|
||||||
|
<h2 class="center">Error 500 - Internal Server Error</h2>
|
||||||
|
<p>Oops, the server encountered an error while processing your request for this page. Please refresh the page and try again. If the error persists, please <a href="http://aclindsay.com/contact">contact me</a>.</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<?php include("../footer.php"); ?>
|
BIN
favicon.ico
Normal file
After Width: | Height: | Size: 318 B |
BIN
fonts/Cardo99s.ttf
Normal file
BIN
fonts/IMFePIrm28P.ttf
Normal file
BIN
fonts/ReenieBeanie.ttf
Normal file
BIN
fonts/Tangerine_Bold.ttf
Normal file
BIN
fonts/Tangerine_Regular.ttf
Normal file
8
footer.php
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
<div id="footer">
|
||||||
|
<div id="footer-inner">
|
||||||
|
© 2009 - 2011 Aaron Lindsay
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
BIN
graphics/cornerStripedLeft.png
Normal file
After Width: | Height: | Size: 887 B |
BIN
graphics/cornerStripedRight.png
Normal file
After Width: | Height: | Size: 895 B |
BIN
graphics/stripedTree.png
Normal file
After Width: | Height: | Size: 46 KiB |
14
header_bottom.php
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||||
|
<meta http-equiv="Language" content="en-us" />
|
||||||
|
<meta http-equiv="Owner" content="Aaron Lindsay" />
|
||||||
|
<meta http-equiv="Author" content="Aaron Lindsay" />
|
||||||
|
<link rel="shortcut icon" href="http://aclindsay.com/favicon.ico" />
|
||||||
|
<link rel="stylesheet" type="text/css" href="http://aclindsay.com/stylesheet.css" media="all" />
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="header">
|
||||||
|
<div id="header-inner">
|
||||||
|
<div id="title"><a href="http://aclindsay.com">aclindsay.com</a></div>
|
||||||
|
<?php include("/home1/aclindsa/public_html/tabs.php"); ?>
|
||||||
|
</div>
|
||||||
|
</div>
|
3
header_top.php
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||||
|
<head>
|
3
index.php
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
<?php
|
||||||
|
header('Location: http://aclindsay.com/home/');
|
||||||
|
?>
|
25
projects/index.php
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
<?php include("../header_top.php"); ?>
|
||||||
|
<title>Projects - aclindsay.com</title>
|
||||||
|
<?php include("../header_bottom.php"); ?>
|
||||||
|
|
||||||
|
<div id="content">
|
||||||
|
<div id="main">
|
||||||
|
<h2>Projects</h2>
|
||||||
|
|
||||||
|
<p>I am currently working on <a href="http://chronoslinux.org">ChronOS Linux</a>, a real-time addition to the Linux kernel, as well as associated libraries.</p>
|
||||||
|
<p>One project which I would love to actually work on if I ever had the time, can be found at <a href="http://acal.aclindsay.com">acal.aclindsay.com</a>. </p>
|
||||||
|
<p>My <a href="https://github.com/aclindsa">github page</a> has several small projects I have worked on over time.</p>
|
||||||
|
</div>
|
||||||
|
<div id="sidebar">
|
||||||
|
<span>Other Projects I Like:</span>
|
||||||
|
<ul>
|
||||||
|
<li><a href="http://kernel.org">Linux Kernel</a></li>
|
||||||
|
<li><a href="http://ubuntu.com">Ubuntu</a></li>
|
||||||
|
<li><a href="http://archlinux.org">Arch Linux</a></li>
|
||||||
|
<li><a href="http://www.djangoproject.com/">Django Project</a></li>
|
||||||
|
<li><a href="http://python.org">Python, of course</a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<?php include("../footer.php"); ?>
|
199
stylesheet.css
Normal file
@ -0,0 +1,199 @@
|
|||||||
|
/**
|
||||||
|
* Handle Self-hosted True Type Fonts
|
||||||
|
*/
|
||||||
|
@font-face {
|
||||||
|
font-family: 'Cardo';
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: normal;
|
||||||
|
src: local('Cardo'), url('fonts/Cardo99s.ttf') format('truetype');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* These styles handle layout
|
||||||
|
*/
|
||||||
|
|
||||||
|
body {
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
#header-inner, #content, #footer-inner {
|
||||||
|
width: 80%;
|
||||||
|
min-width: 45em;
|
||||||
|
max-width: 60em;
|
||||||
|
margin: 0 auto;
|
||||||
|
}
|
||||||
|
#main, #sidebar {
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
#main {
|
||||||
|
float: left;
|
||||||
|
width: 73%;
|
||||||
|
}
|
||||||
|
#sidebar {
|
||||||
|
float: right;
|
||||||
|
width: 23%;
|
||||||
|
}
|
||||||
|
#footer {
|
||||||
|
clear: both;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* These styles handle look
|
||||||
|
*/
|
||||||
|
|
||||||
|
body {
|
||||||
|
font: 12pt/18pt Georgia, Palatino, 'Palatino Linotype', Times, 'Times New Roman', serif;
|
||||||
|
font-family: 'Cardo', Georgia, Palatino, 'Palatino Linotype', Times, 'Times New Roman', serif;
|
||||||
|
/* font: normal 100% Helvetica, Arial, sans-serif;*/
|
||||||
|
background-color: #eeeeee;
|
||||||
|
}
|
||||||
|
#header {
|
||||||
|
height: 150px;
|
||||||
|
width: 100%;
|
||||||
|
background-color: #88BBEE;
|
||||||
|
border-bottom: 6px solid #003366;
|
||||||
|
}
|
||||||
|
#header-inner {
|
||||||
|
position: relative;
|
||||||
|
background: url('graphics/stripedTree.png') no-repeat bottom left;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
#header-inner #title {
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
position: absolute;
|
||||||
|
height: 53px;
|
||||||
|
top: 0em;
|
||||||
|
right: 0em;
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 1.2em;
|
||||||
|
background: url('graphics/cornerStripedLeft.png') no-repeat bottom left;
|
||||||
|
}
|
||||||
|
#header-inner #title a{
|
||||||
|
display: block;
|
||||||
|
margin: 0;
|
||||||
|
padding: 15px 20px 10px 20px;
|
||||||
|
text-decoration: none;
|
||||||
|
color: #666666;
|
||||||
|
background: url('graphics/cornerStripedRight.png') no-repeat top right;
|
||||||
|
}
|
||||||
|
#header-inner #title a:hover{
|
||||||
|
color: #FFFFFF;
|
||||||
|
}
|
||||||
|
#content {
|
||||||
|
padding: 1em 0 0 0;
|
||||||
|
}
|
||||||
|
#main {
|
||||||
|
padding: 0 0 2em 0;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
#sidebar {
|
||||||
|
background-color: #f5f5f5;
|
||||||
|
margin: 1em 0 1em 0;
|
||||||
|
border: 2px solid #cccccc;
|
||||||
|
-moz-border-radius: 5px;
|
||||||
|
border-radius: 5px;
|
||||||
|
padding: 5px 0 5px 0;
|
||||||
|
}
|
||||||
|
#sidebar > * {
|
||||||
|
margin: .5em;
|
||||||
|
}
|
||||||
|
#footer {
|
||||||
|
margin: 0;
|
||||||
|
padding: 1em 0 1em 0;
|
||||||
|
background-color: #339933;
|
||||||
|
border-top: 6px solid #006600;
|
||||||
|
border-bottom: 6px solid #663300;
|
||||||
|
}
|
||||||
|
#footer a{
|
||||||
|
color: #003366;
|
||||||
|
}
|
||||||
|
#footer a:hover{
|
||||||
|
color: #000033;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
div#tabs {
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
position: absolute;
|
||||||
|
right: 0px;
|
||||||
|
bottom: 0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
div#tabs ul {
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
list-style: none;
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
|
|
||||||
|
div#tabs ul li {
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
display:inline;
|
||||||
|
}
|
||||||
|
|
||||||
|
div#tabs ul li a {
|
||||||
|
position: relative;
|
||||||
|
bottom: 3px;
|
||||||
|
font-weight: bold;
|
||||||
|
color: #333333;
|
||||||
|
margin: 0 0 0 17px;
|
||||||
|
padding: 3px;
|
||||||
|
text-decoration:none;
|
||||||
|
border-top: #003366 2px solid;
|
||||||
|
background-color: #88BBEE;
|
||||||
|
}
|
||||||
|
div#tabs ul li a:hover {
|
||||||
|
color: #DDD;
|
||||||
|
text-shadow: 3px 3px 3px #346;
|
||||||
|
}
|
||||||
|
a {
|
||||||
|
color: #2288aa;
|
||||||
|
}
|
||||||
|
a:hover {
|
||||||
|
color: #006699;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*Styles for Wordpress*/
|
||||||
|
#sidebar ul {
|
||||||
|
padding: 0px;
|
||||||
|
}
|
||||||
|
#sidebar li {
|
||||||
|
list-style-type: none;
|
||||||
|
}
|
||||||
|
/* Wordpress Captions */
|
||||||
|
.aligncenter,
|
||||||
|
div.aligncenter {
|
||||||
|
display: block;
|
||||||
|
margin-left: auto;
|
||||||
|
margin-right: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wp-caption {
|
||||||
|
border: 1px solid #ddd;
|
||||||
|
text-align: center;
|
||||||
|
background-color: #f3f3f3;
|
||||||
|
padding-top: 4px;
|
||||||
|
margin: 10px;
|
||||||
|
-moz-border-radius: 3px;
|
||||||
|
-khtml-border-radius: 3px;
|
||||||
|
-webkit-border-radius: 3px;
|
||||||
|
border-radius: 3px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wp-caption img {
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
border: 0 none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wp-caption p.wp-caption-text {
|
||||||
|
font-size: 11px;
|
||||||
|
line-height: 17px;
|
||||||
|
padding: 0 4px 5px;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
/* End captions */
|
||||||
|
|
52
svgparser/index.php
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
<?php include("../header_top.php"); ?>
|
||||||
|
<title>SVG Parser - aclindsay.com</title>
|
||||||
|
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/dojo/1.5.0/dojo/dojo.xd.js"></script>
|
||||||
|
<?php include("../header_bottom.php"); ?>
|
||||||
|
|
||||||
|
<div id="content">
|
||||||
|
<div id="main">
|
||||||
|
<h2>Convert to Dojo 'dojox.gfx' format from SVG</h2>
|
||||||
|
<p>The dojox.gfx tool is very powerful, but there is currently no easy way to convert drawings
|
||||||
|
from SVG into the format. The only existing tool I found was <a href="http://download.dojotoolkit.org/release-1.3.0/dojo-release-1.3.0/dojox/gfx/demos/data/svg2gfx.xsl">an XSL file</a>, which was very simplistic,
|
||||||
|
but didn't cover many cases (example: gradient transformations). Therefore, if you wanted to use existing SVG
|
||||||
|
files with dojox.gfx, you had to convert the file by hand. This was extremely tedious, so I have developed a converter tool
|
||||||
|
with which you may convert existing SVG files into Javascript code ready to be used with dojox.gfx. If you have any comments or
|
||||||
|
suggestions for improvement, feel free to let me know at dojox dot gfx @t aclindsay D0T com.</p>
|
||||||
|
<fieldset style="border: solid black 1px;padding: 1em;"><legend>SVG (XML)</legend>
|
||||||
|
<textarea id="input" rows="10" style="width: 100%" wrap="off"></textarea>
|
||||||
|
<button onclick="submit()">Convert To Javascript</button>
|
||||||
|
</fieldset>
|
||||||
|
<fieldset style="border: solid black 1px;padding: 1em;"><legend>Javascript Code</legend>
|
||||||
|
<textarea id="response" rows="30" style="width: 100%" wrap="off"></textarea>
|
||||||
|
</fieldset>
|
||||||
|
<script type="text/javascript">
|
||||||
|
function submit(){
|
||||||
|
var data = dojo.byId("input").value;
|
||||||
|
dojo.rawXhrPost({
|
||||||
|
url: "http://aclindsay.com/svgparser/parser/index.php",
|
||||||
|
handleAs: "text",
|
||||||
|
postData: data,
|
||||||
|
|
||||||
|
// The handle function will be called on a successful response.
|
||||||
|
handle: function(response, ioArgs) {
|
||||||
|
console.log("handle: "+response);
|
||||||
|
dojo.byId("response").value = response;
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
}, true);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
</div>
|
||||||
|
<div id="sidebar">
|
||||||
|
<span>Related Links:</span>
|
||||||
|
<ul>
|
||||||
|
<li><a href="http://dojotoolkit.org">Dojo Toolkit</a></li>
|
||||||
|
<li><a href="http://docs.dojocampus.org/dojox/gfx">dojox.gfx Documentation</a></li>
|
||||||
|
<li><a href="http://www.w3.org/TR/SVG/">W3 SVG Specification</a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<?php include("../footer.php"); ?>
|
4
svgparser/parser/.htaccess
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
RewriteEngine On
|
||||||
|
RewriteCond %{REQUEST_FILENAME} !-d
|
||||||
|
RewriteCond %{REQUEST_FILENAME} !-f
|
||||||
|
RewriteRule ^.*$ index.php
|
281
svgparser/parser/LICENSE
Normal file
@ -0,0 +1,281 @@
|
|||||||
|
GNU GENERAL PUBLIC LICENSE
|
||||||
|
Version 2, June 1991
|
||||||
|
|
||||||
|
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
|
||||||
|
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
Everyone is permitted to copy and distribute verbatim copies
|
||||||
|
of this license document, but changing it is not allowed.
|
||||||
|
|
||||||
|
Preamble
|
||||||
|
|
||||||
|
The licenses for most software are designed to take away your
|
||||||
|
freedom to share and change it. By contrast, the GNU General Public
|
||||||
|
License is intended to guarantee your freedom to share and change free
|
||||||
|
software--to make sure the software is free for all its users. This
|
||||||
|
General Public License applies to most of the Free Software
|
||||||
|
Foundation's software and to any other program whose authors commit to
|
||||||
|
using it. (Some other Free Software Foundation software is covered by
|
||||||
|
the GNU Lesser General Public License instead.) You can apply it to
|
||||||
|
your programs, too.
|
||||||
|
|
||||||
|
When we speak of free software, we are referring to freedom, not
|
||||||
|
price. Our General Public Licenses are designed to make sure that you
|
||||||
|
have the freedom to distribute copies of free software (and charge for
|
||||||
|
this service if you wish), that you receive source code or can get it
|
||||||
|
if you want it, that you can change the software or use pieces of it
|
||||||
|
in new free programs; and that you know you can do these things.
|
||||||
|
|
||||||
|
To protect your rights, we need to make restrictions that forbid
|
||||||
|
anyone to deny you these rights or to ask you to surrender the rights.
|
||||||
|
These restrictions translate to certain responsibilities for you if you
|
||||||
|
distribute copies of the software, or if you modify it.
|
||||||
|
|
||||||
|
For example, if you distribute copies of such a program, whether
|
||||||
|
gratis or for a fee, you must give the recipients all the rights that
|
||||||
|
you have. You must make sure that they, too, receive or can get the
|
||||||
|
source code. And you must show them these terms so they know their
|
||||||
|
rights.
|
||||||
|
|
||||||
|
We protect your rights with two steps: (1) copyright the software, and
|
||||||
|
(2) offer you this license which gives you legal permission to copy,
|
||||||
|
distribute and/or modify the software.
|
||||||
|
|
||||||
|
Also, for each author's protection and ours, we want to make certain
|
||||||
|
that everyone understands that there is no warranty for this free
|
||||||
|
software. If the software is modified by someone else and passed on, we
|
||||||
|
want its recipients to know that what they have is not the original, so
|
||||||
|
that any problems introduced by others will not reflect on the original
|
||||||
|
authors' reputations.
|
||||||
|
|
||||||
|
Finally, any free program is threatened constantly by software
|
||||||
|
patents. We wish to avoid the danger that redistributors of a free
|
||||||
|
program will individually obtain patent licenses, in effect making the
|
||||||
|
program proprietary. To prevent this, we have made it clear that any
|
||||||
|
patent must be licensed for everyone's free use or not licensed at all.
|
||||||
|
|
||||||
|
The precise terms and conditions for copying, distribution and
|
||||||
|
modification follow.
|
||||||
|
|
||||||
|
GNU GENERAL PUBLIC LICENSE
|
||||||
|
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||||
|
|
||||||
|
0. This License applies to any program or other work which contains
|
||||||
|
a notice placed by the copyright holder saying it may be distributed
|
||||||
|
under the terms of this General Public License. The "Program", below,
|
||||||
|
refers to any such program or work, and a "work based on the Program"
|
||||||
|
means either the Program or any derivative work under copyright law:
|
||||||
|
that is to say, a work containing the Program or a portion of it,
|
||||||
|
either verbatim or with modifications and/or translated into another
|
||||||
|
language. (Hereinafter, translation is included without limitation in
|
||||||
|
the term "modification".) Each licensee is addressed as "you".
|
||||||
|
|
||||||
|
Activities other than copying, distribution and modification are not
|
||||||
|
covered by this License; they are outside its scope. The act of
|
||||||
|
running the Program is not restricted, and the output from the Program
|
||||||
|
is covered only if its contents constitute a work based on the
|
||||||
|
Program (independent of having been made by running the Program).
|
||||||
|
Whether that is true depends on what the Program does.
|
||||||
|
|
||||||
|
1. You may copy and distribute verbatim copies of the Program's
|
||||||
|
source code as you receive it, in any medium, provided that you
|
||||||
|
conspicuously and appropriately publish on each copy an appropriate
|
||||||
|
copyright notice and disclaimer of warranty; keep intact all the
|
||||||
|
notices that refer to this License and to the absence of any warranty;
|
||||||
|
and give any other recipients of the Program a copy of this License
|
||||||
|
along with the Program.
|
||||||
|
|
||||||
|
You may charge a fee for the physical act of transferring a copy, and
|
||||||
|
you may at your option offer warranty protection in exchange for a fee.
|
||||||
|
|
||||||
|
2. You may modify your copy or copies of the Program or any portion
|
||||||
|
of it, thus forming a work based on the Program, and copy and
|
||||||
|
distribute such modifications or work under the terms of Section 1
|
||||||
|
above, provided that you also meet all of these conditions:
|
||||||
|
|
||||||
|
a) You must cause the modified files to carry prominent notices
|
||||||
|
stating that you changed the files and the date of any change.
|
||||||
|
|
||||||
|
b) You must cause any work that you distribute or publish, that in
|
||||||
|
whole or in part contains or is derived from the Program or any
|
||||||
|
part thereof, to be licensed as a whole at no charge to all third
|
||||||
|
parties under the terms of this License.
|
||||||
|
|
||||||
|
c) If the modified program normally reads commands interactively
|
||||||
|
when run, you must cause it, when started running for such
|
||||||
|
interactive use in the most ordinary way, to print or display an
|
||||||
|
announcement including an appropriate copyright notice and a
|
||||||
|
notice that there is no warranty (or else, saying that you provide
|
||||||
|
a warranty) and that users may redistribute the program under
|
||||||
|
these conditions, and telling the user how to view a copy of this
|
||||||
|
License. (Exception: if the Program itself is interactive but
|
||||||
|
does not normally print such an announcement, your work based on
|
||||||
|
the Program is not required to print an announcement.)
|
||||||
|
|
||||||
|
These requirements apply to the modified work as a whole. If
|
||||||
|
identifiable sections of that work are not derived from the Program,
|
||||||
|
and can be reasonably considered independent and separate works in
|
||||||
|
themselves, then this License, and its terms, do not apply to those
|
||||||
|
sections when you distribute them as separate works. But when you
|
||||||
|
distribute the same sections as part of a whole which is a work based
|
||||||
|
on the Program, the distribution of the whole must be on the terms of
|
||||||
|
this License, whose permissions for other licensees extend to the
|
||||||
|
entire whole, and thus to each and every part regardless of who wrote it.
|
||||||
|
|
||||||
|
Thus, it is not the intent of this section to claim rights or contest
|
||||||
|
your rights to work written entirely by you; rather, the intent is to
|
||||||
|
exercise the right to control the distribution of derivative or
|
||||||
|
collective works based on the Program.
|
||||||
|
|
||||||
|
In addition, mere aggregation of another work not based on the Program
|
||||||
|
with the Program (or with a work based on the Program) on a volume of
|
||||||
|
a storage or distribution medium does not bring the other work under
|
||||||
|
the scope of this License.
|
||||||
|
|
||||||
|
3. You may copy and distribute the Program (or a work based on it,
|
||||||
|
under Section 2) in object code or executable form under the terms of
|
||||||
|
Sections 1 and 2 above provided that you also do one of the following:
|
||||||
|
|
||||||
|
a) Accompany it with the complete corresponding machine-readable
|
||||||
|
source code, which must be distributed under the terms of Sections
|
||||||
|
1 and 2 above on a medium customarily used for software interchange; or,
|
||||||
|
|
||||||
|
b) Accompany it with a written offer, valid for at least three
|
||||||
|
years, to give any third party, for a charge no more than your
|
||||||
|
cost of physically performing source distribution, a complete
|
||||||
|
machine-readable copy of the corresponding source code, to be
|
||||||
|
distributed under the terms of Sections 1 and 2 above on a medium
|
||||||
|
customarily used for software interchange; or,
|
||||||
|
|
||||||
|
c) Accompany it with the information you received as to the offer
|
||||||
|
to distribute corresponding source code. (This alternative is
|
||||||
|
allowed only for noncommercial distribution and only if you
|
||||||
|
received the program in object code or executable form with such
|
||||||
|
an offer, in accord with Subsection b above.)
|
||||||
|
|
||||||
|
The source code for a work means the preferred form of the work for
|
||||||
|
making modifications to it. For an executable work, complete source
|
||||||
|
code means all the source code for all modules it contains, plus any
|
||||||
|
associated interface definition files, plus the scripts used to
|
||||||
|
control compilation and installation of the executable. However, as a
|
||||||
|
special exception, the source code distributed need not include
|
||||||
|
anything that is normally distributed (in either source or binary
|
||||||
|
form) with the major components (compiler, kernel, and so on) of the
|
||||||
|
operating system on which the executable runs, unless that component
|
||||||
|
itself accompanies the executable.
|
||||||
|
|
||||||
|
If distribution of executable or object code is made by offering
|
||||||
|
access to copy from a designated place, then offering equivalent
|
||||||
|
access to copy the source code from the same place counts as
|
||||||
|
distribution of the source code, even though third parties are not
|
||||||
|
compelled to copy the source along with the object code.
|
||||||
|
|
||||||
|
4. You may not copy, modify, sublicense, or distribute the Program
|
||||||
|
except as expressly provided under this License. Any attempt
|
||||||
|
otherwise to copy, modify, sublicense or distribute the Program is
|
||||||
|
void, and will automatically terminate your rights under this License.
|
||||||
|
However, parties who have received copies, or rights, from you under
|
||||||
|
this License will not have their licenses terminated so long as such
|
||||||
|
parties remain in full compliance.
|
||||||
|
|
||||||
|
5. You are not required to accept this License, since you have not
|
||||||
|
signed it. However, nothing else grants you permission to modify or
|
||||||
|
distribute the Program or its derivative works. These actions are
|
||||||
|
prohibited by law if you do not accept this License. Therefore, by
|
||||||
|
modifying or distributing the Program (or any work based on the
|
||||||
|
Program), you indicate your acceptance of this License to do so, and
|
||||||
|
all its terms and conditions for copying, distributing or modifying
|
||||||
|
the Program or works based on it.
|
||||||
|
|
||||||
|
6. Each time you redistribute the Program (or any work based on the
|
||||||
|
Program), the recipient automatically receives a license from the
|
||||||
|
original licensor to copy, distribute or modify the Program subject to
|
||||||
|
these terms and conditions. You may not impose any further
|
||||||
|
restrictions on the recipients' exercise of the rights granted herein.
|
||||||
|
You are not responsible for enforcing compliance by third parties to
|
||||||
|
this License.
|
||||||
|
|
||||||
|
7. If, as a consequence of a court judgment or allegation of patent
|
||||||
|
infringement or for any other reason (not limited to patent issues),
|
||||||
|
conditions are imposed on you (whether by court order, agreement or
|
||||||
|
otherwise) that contradict the conditions of this License, they do not
|
||||||
|
excuse you from the conditions of this License. If you cannot
|
||||||
|
distribute so as to satisfy simultaneously your obligations under this
|
||||||
|
License and any other pertinent obligations, then as a consequence you
|
||||||
|
may not distribute the Program at all. For example, if a patent
|
||||||
|
license would not permit royalty-free redistribution of the Program by
|
||||||
|
all those who receive copies directly or indirectly through you, then
|
||||||
|
the only way you could satisfy both it and this License would be to
|
||||||
|
refrain entirely from distribution of the Program.
|
||||||
|
|
||||||
|
If any portion of this section is held invalid or unenforceable under
|
||||||
|
any particular circumstance, the balance of the section is intended to
|
||||||
|
apply and the section as a whole is intended to apply in other
|
||||||
|
circumstances.
|
||||||
|
|
||||||
|
It is not the purpose of this section to induce you to infringe any
|
||||||
|
patents or other property right claims or to contest validity of any
|
||||||
|
such claims; this section has the sole purpose of protecting the
|
||||||
|
integrity of the free software distribution system, which is
|
||||||
|
implemented by public license practices. Many people have made
|
||||||
|
generous contributions to the wide range of software distributed
|
||||||
|
through that system in reliance on consistent application of that
|
||||||
|
system; it is up to the author/donor to decide if he or she is willing
|
||||||
|
to distribute software through any other system and a licensee cannot
|
||||||
|
impose that choice.
|
||||||
|
|
||||||
|
This section is intended to make thoroughly clear what is believed to
|
||||||
|
be a consequence of the rest of this License.
|
||||||
|
|
||||||
|
8. If the distribution and/or use of the Program is restricted in
|
||||||
|
certain countries either by patents or by copyrighted interfaces, the
|
||||||
|
original copyright holder who places the Program under this License
|
||||||
|
may add an explicit geographical distribution limitation excluding
|
||||||
|
those countries, so that distribution is permitted only in or among
|
||||||
|
countries not thus excluded. In such case, this License incorporates
|
||||||
|
the limitation as if written in the body of this License.
|
||||||
|
|
||||||
|
9. The Free Software Foundation may publish revised and/or new versions
|
||||||
|
of the General Public License from time to time. Such new versions will
|
||||||
|
be similar in spirit to the present version, but may differ in detail to
|
||||||
|
address new problems or concerns.
|
||||||
|
|
||||||
|
Each version is given a distinguishing version number. If the Program
|
||||||
|
specifies a version number of this License which applies to it and "any
|
||||||
|
later version", you have the option of following the terms and conditions
|
||||||
|
either of that version or of any later version published by the Free
|
||||||
|
Software Foundation. If the Program does not specify a version number of
|
||||||
|
this License, you may choose any version ever published by the Free Software
|
||||||
|
Foundation.
|
||||||
|
|
||||||
|
10. If you wish to incorporate parts of the Program into other free
|
||||||
|
programs whose distribution conditions are different, write to the author
|
||||||
|
to ask for permission. For software which is copyrighted by the Free
|
||||||
|
Software Foundation, write to the Free Software Foundation; we sometimes
|
||||||
|
make exceptions for this. Our decision will be guided by the two goals
|
||||||
|
of preserving the free status of all derivatives of our free software and
|
||||||
|
of promoting the sharing and reuse of software generally.
|
||||||
|
|
||||||
|
NO WARRANTY
|
||||||
|
|
||||||
|
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
||||||
|
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
||||||
|
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
||||||
|
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
||||||
|
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||||
|
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
||||||
|
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
||||||
|
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
||||||
|
REPAIR OR CORRECTION.
|
||||||
|
|
||||||
|
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||||
|
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
||||||
|
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
||||||
|
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
||||||
|
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
||||||
|
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
||||||
|
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
||||||
|
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
||||||
|
POSSIBILITY OF SUCH DAMAGES.
|
||||||
|
|
||||||
|
END OF TERMS AND CONDITIONS
|
||||||
|
|
344
svgparser/parser/index.php
Normal file
@ -0,0 +1,344 @@
|
|||||||
|
<?php
|
||||||
|
/*
|
||||||
|
SVG to dojox.gfx Parser
|
||||||
|
Copyright (C) 2009 Aaron Lindsay <aclindsay@aclindsay.com>
|
||||||
|
|
||||||
|
This program is free software; you can redistribute it and/or
|
||||||
|
modify it under the terms of the GNU General Public License
|
||||||
|
as published by the Free Software Foundation; either version 2
|
||||||
|
of the License, or (at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program; if not, write to the Free Software
|
||||||
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
|
*/
|
||||||
|
|
||||||
|
require_once("parser/Parser.php");
|
||||||
|
|
||||||
|
$requestData = '';
|
||||||
|
if (isset($_SERVER['CONTENT_LENGTH']) && $_SERVER['CONTENT_LENGTH'] > 0) {
|
||||||
|
$httpContent = fopen('php://input', 'r');
|
||||||
|
while ($data = fread($httpContent, 1024)) {
|
||||||
|
$requestData .= $data;
|
||||||
|
}
|
||||||
|
fclose($httpContent);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($requestData == '')
|
||||||
|
exit;
|
||||||
|
|
||||||
|
$parser = new Parser();
|
||||||
|
$svg = $parser->parse($requestData);
|
||||||
|
|
||||||
|
//first, create javascript objects for all the gradients
|
||||||
|
$linearGradients = $svg->getCompleteLinearGradients();
|
||||||
|
$radialGradients = $svg->getCompleteRadialGradients();
|
||||||
|
$paths = $svg->getPaths();
|
||||||
|
$rects = $svg->getRectangles();
|
||||||
|
$circles = $svg->getCircles();
|
||||||
|
$ellipses = $svg->getEllipses();
|
||||||
|
$lines = $svg->getLines();
|
||||||
|
$polylines = $svg->getPolylines();
|
||||||
|
$texts = $svg->getTexts();
|
||||||
|
|
||||||
|
echo "/*
|
||||||
|
SVG to dojox.gfx Parser
|
||||||
|
Copyright (C) 2009 Aaron Lindsay <aclindsay@aclindsay.com>
|
||||||
|
|
||||||
|
This program is free software; you can redistribute it and/or
|
||||||
|
modify it under the terms of the GNU General Public License
|
||||||
|
as published by the Free Software Foundation; either version 2
|
||||||
|
of the License, or (at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program; if not, write to the Free Software
|
||||||
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
|
*/\n\n";
|
||||||
|
echo "//set 'g' equal to the dojo group you want to add this drawing as...\n//ex. var g = surface.createGroup()\n\n";
|
||||||
|
|
||||||
|
//echo all the linear gradients
|
||||||
|
foreach ($linearGradients as $gradient) {
|
||||||
|
//make sure the gradient has its transform(s) applied
|
||||||
|
if (!$gradient->transformsApplied())
|
||||||
|
$gradient->applyTransforms();
|
||||||
|
|
||||||
|
echo "var gradient".$gradient->getId()." = {\n";
|
||||||
|
echo "\ttype: \"linear\",\n";
|
||||||
|
echo "\tx1: ".$gradient->getX1().", y1: ".$gradient->getY1().",\n";
|
||||||
|
echo "\tx2: ".$gradient->getX2().", y2: ".$gradient->getY2().",\n";
|
||||||
|
echo "\tcolors: [\n";
|
||||||
|
|
||||||
|
$stops = $gradient->getStops();
|
||||||
|
for ($i = 0; $i < count($stops)-1; $i++) {
|
||||||
|
echo "\t\t{offset: ".$stops[$i]->getOffset().", color: \"".$stops[$i]->getColor()."\"},\n";
|
||||||
|
}
|
||||||
|
echo "\t\t{offset: ".$stops[count($stops)-1]->getOffset().", color: \"".$stops[count($stops)-1]->getColor()."\"}\n";
|
||||||
|
echo "\t]\n";
|
||||||
|
echo "};\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
//now, do the same for all the radial gradients
|
||||||
|
foreach ($radialGradients as $gradient) {
|
||||||
|
//make sure the gradient has its transform(s) applied
|
||||||
|
if (!$gradient->transformsApplied())
|
||||||
|
$gradient->applyTransforms();
|
||||||
|
|
||||||
|
echo "var gradient".$gradient->getId()." = {\n";
|
||||||
|
echo "\ttype: \"radial\",\n";
|
||||||
|
echo "\tcx: ".$gradient->getCx().", cy: ".$gradient->getCy().",\n";
|
||||||
|
echo "\tr: ".$gradient->getR().",\n";
|
||||||
|
echo "\tfx: ".$gradient->getFx().", fy: ".$gradient->getFy().",\n";
|
||||||
|
echo "\tcolors: [\n";
|
||||||
|
|
||||||
|
$stops = $gradient->getStops();
|
||||||
|
for ($i = 0; $i < count($stops)-1; $i++) {
|
||||||
|
echo "\t\t{offset: ".$stops[$i]->getOffset().", color: \"".$stops[$i]->getColor()."\"},\n";
|
||||||
|
}
|
||||||
|
echo "\t\t{offset: ".$stops[count($stops)-1]->getOffset().", color: \"".$stops[count($stops)-1]->getColor()."\"}\n";
|
||||||
|
echo "\t]\n";
|
||||||
|
echo "};\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
//now, get all the paths
|
||||||
|
foreach ($paths as $path) {
|
||||||
|
echo "g.createPath({type: \"path\", path: \"".$path->getPath()."\"})";
|
||||||
|
addFill($path);
|
||||||
|
addStroke($path);
|
||||||
|
addTransform($path);
|
||||||
|
echo ";\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
//and all rectangles
|
||||||
|
foreach ($rects as $rect) {
|
||||||
|
echo "g.createRect({type: \"rect\", x: ".$rect->getX().", y: ".$rect->getY().", height: ".$rect->getHeight().", width: ".$rect->getWidth().", r: ".$rect->getR()."})";
|
||||||
|
addFill($rect);
|
||||||
|
addStroke($rect);
|
||||||
|
addTransform($rect);
|
||||||
|
|
||||||
|
echo ";\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
//and all circles
|
||||||
|
foreach ($circles as $circle) {
|
||||||
|
echo "g.createCircle({type: \"circle\", cx:".$circle->getCx().", cy:".$circle->getCy().", r: ".$circle->getR()."})";
|
||||||
|
addFill($circle);
|
||||||
|
addStroke($circle);
|
||||||
|
addTransform($circle);
|
||||||
|
|
||||||
|
echo ";\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
//and all ellipses
|
||||||
|
foreach ($ellipses as $ellipse) {
|
||||||
|
echo "g.createEllipse({type: \"ellipse\", cx:".$ellipse->getCx().", cy:".$ellipse->getCy().", rx: ".$ellipse->getRx().", ry: ".$ellipse->getRy()."})";
|
||||||
|
addFill($ellipse);
|
||||||
|
addStroke($ellipse);
|
||||||
|
addTransform($ellipse);
|
||||||
|
|
||||||
|
echo ";\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
//and all lines
|
||||||
|
foreach ($lines as $line) {
|
||||||
|
echo "g.createLine({type: \"line\", x1:".$line->getX1().", y1:".$line->getY1().", x2:".$line->getX2().", y2:".$line->getY2()."})";
|
||||||
|
addStroke($line);
|
||||||
|
addTransform($line);
|
||||||
|
echo ";\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
//and all polylines
|
||||||
|
foreach ($polylines as $polyline) {
|
||||||
|
echo "//TODO - implement polylines\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
//and all texts
|
||||||
|
foreach ($texts as $text) {
|
||||||
|
echo "g.createText({type: \"text\", x: ".$text->getX().", y: ".$text->getY().", text: \"".$text->getText()."\", align: \"".$text->getTextAnchor()."\", decoration: \"".$text->getTextDecoration()."\"})";
|
||||||
|
addFill($text);
|
||||||
|
addStroke($text);
|
||||||
|
addTransform($text);
|
||||||
|
echo ";\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
function addFont($shape) {
|
||||||
|
$putComma = false;
|
||||||
|
|
||||||
|
//get the font family, if available
|
||||||
|
$family = $shape->getStyle("font-family");
|
||||||
|
if ($family != null) {
|
||||||
|
if ($putComma)
|
||||||
|
echo ",";
|
||||||
|
else {
|
||||||
|
echo ".setFont({";
|
||||||
|
$putComma = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
echo "family: \"".$family."\"";
|
||||||
|
}
|
||||||
|
|
||||||
|
//get the font variant, if available
|
||||||
|
$variant = $shape->getStyle("font-variant");
|
||||||
|
if ($variant != null) {
|
||||||
|
if ($putComma)
|
||||||
|
echo ",";
|
||||||
|
else {
|
||||||
|
echo ".setFont({";
|
||||||
|
$putComma = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
echo "variant: \"".$variant."\"";
|
||||||
|
}
|
||||||
|
|
||||||
|
//get the font size, if available
|
||||||
|
$size = $shape->getStyle("font-size");
|
||||||
|
if ($size != null) {
|
||||||
|
if ($putComma)
|
||||||
|
echo ",";
|
||||||
|
else {
|
||||||
|
echo ".setFont({";
|
||||||
|
$putComma = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
echo "size: \"".$size."\"";
|
||||||
|
}
|
||||||
|
|
||||||
|
//get the font style, if available
|
||||||
|
$style = $shape->getStyle("font-style");
|
||||||
|
if ($style != null) {
|
||||||
|
if ($putComma)
|
||||||
|
echo ",";
|
||||||
|
else {
|
||||||
|
echo ".setFont({";
|
||||||
|
$putComma = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
echo "style: \"".$style."\"";
|
||||||
|
}
|
||||||
|
|
||||||
|
//get the font weight, if available
|
||||||
|
$weight = $shape->getStyle("font-weight");
|
||||||
|
if ($weight != null) {
|
||||||
|
if ($putComma)
|
||||||
|
echo ",";
|
||||||
|
else {
|
||||||
|
echo ".setFont({";
|
||||||
|
$putComma = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
echo "style: \"".$weight."\"";
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($putComma)
|
||||||
|
echo "})";
|
||||||
|
}
|
||||||
|
|
||||||
|
function addFill($shape) {
|
||||||
|
$fill = $shape->getStyle("fill");
|
||||||
|
if ($fill == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (ereg("url\(.*\)", $fill)) {
|
||||||
|
$parts = split("[\(\)]", $fill);
|
||||||
|
$url = trim($parts[1], "#");
|
||||||
|
echo ".setFill(gradient".$url.")";
|
||||||
|
} else if (ereg("#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})", $fill)) {
|
||||||
|
echo ".setFill(\"".$fill."\")";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function addStroke($shape) {
|
||||||
|
$putComma = false;
|
||||||
|
|
||||||
|
//get the stroke width, if available
|
||||||
|
$width = $shape->getStyle("stroke-width");
|
||||||
|
if ($width != null) {
|
||||||
|
if ($putComma)
|
||||||
|
echo ",";
|
||||||
|
else {
|
||||||
|
echo ".setStroke({";
|
||||||
|
$putComma = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
$width = trim($width, "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ");
|
||||||
|
echo "width: $width";
|
||||||
|
}
|
||||||
|
|
||||||
|
//get the stroke color, if available
|
||||||
|
$color = $shape->getStyle("stroke");
|
||||||
|
if ($color != null) {
|
||||||
|
if ($putComma)
|
||||||
|
echo ",";
|
||||||
|
else {
|
||||||
|
echo ".setStroke({";
|
||||||
|
$putComma = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
echo "color: \"".$color."\"";
|
||||||
|
}
|
||||||
|
|
||||||
|
//get the stroke cap, if available
|
||||||
|
$cap = $shape->getStyle("stroke-linecap");
|
||||||
|
if ($cap != null) {
|
||||||
|
if ($putComma)
|
||||||
|
echo ",";
|
||||||
|
else {
|
||||||
|
echo ".setStroke({";
|
||||||
|
$putComma = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
echo "cap: \"$cap\"";
|
||||||
|
}
|
||||||
|
|
||||||
|
//get the line join, if available
|
||||||
|
$join = $shape->getStyle("stroke-linejoin");
|
||||||
|
if ($join != null) {
|
||||||
|
if ($putComma)
|
||||||
|
echo ",";
|
||||||
|
else {
|
||||||
|
echo ".setStroke({";
|
||||||
|
$putComma = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($join == "miter")
|
||||||
|
echo "join: 4";
|
||||||
|
else
|
||||||
|
echo "join: \"$join\"";
|
||||||
|
}
|
||||||
|
|
||||||
|
//if any kind of dash is made in SVG, convert it to 'style: "Dash"' in dojox.gfx
|
||||||
|
$style = $shape->getStyle("stroke-dasharray");
|
||||||
|
if ($style != null && $style != 'none') {
|
||||||
|
if ($putComma)
|
||||||
|
echo ",";
|
||||||
|
else {
|
||||||
|
echo ".setStroke({";
|
||||||
|
$putComma = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
echo "style: \"Dash\"";
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($putComma)
|
||||||
|
echo "})";
|
||||||
|
}
|
||||||
|
|
||||||
|
function addTransform($shape) {
|
||||||
|
//echo "\n==== transform:";
|
||||||
|
//var_dump($shape->getTransform());
|
||||||
|
$transform = $shape->getTransform();
|
||||||
|
if (!$transform->isIdentity()) {
|
||||||
|
echo ".setTransform({xx:".$transform->getXx().", xy:".$transform->getXy().", dx:".$transform->getDx().", yy:".$transform->getYy().", yx:".$transform->getYx().", dy:".$transform->getDy()."})";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
41
svgparser/parser/objects/Circle.php
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
<?php
|
||||||
|
/*
|
||||||
|
SVG to dojox.gfx Parser
|
||||||
|
Copyright (C) 2009 Aaron Lindsay <aclindsay@aclindsay.com>
|
||||||
|
|
||||||
|
This program is free software; you can redistribute it and/or
|
||||||
|
modify it under the terms of the GNU General Public License
|
||||||
|
as published by the Free Software Foundation; either version 2
|
||||||
|
of the License, or (at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program; if not, write to the Free Software
|
||||||
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
|
*/
|
||||||
|
|
||||||
|
require_once("objects/Element.php");
|
||||||
|
|
||||||
|
class Circle extends Element {
|
||||||
|
private $cx;
|
||||||
|
private $cy;
|
||||||
|
private $r;
|
||||||
|
|
||||||
|
public function __construct() {
|
||||||
|
$this->cx = 0;
|
||||||
|
$this->cy = 0;
|
||||||
|
$this->r = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getCx() { return $this->cx; }
|
||||||
|
public function getCy() { return $this->cy; }
|
||||||
|
public function getR() { return $this->r; }
|
||||||
|
public function setCx($x) { $this->cx = $x; }
|
||||||
|
public function setCy($x) { $this->cy = $x; }
|
||||||
|
public function setR($x) { $this->r = $x; }
|
||||||
|
}
|
||||||
|
?>
|
183
svgparser/parser/objects/Element.php
Normal file
@ -0,0 +1,183 @@
|
|||||||
|
<?php
|
||||||
|
/*
|
||||||
|
SVG to dojox.gfx Parser
|
||||||
|
Copyright (C) 2009 Aaron Lindsay <aclindsay@aclindsay.com>
|
||||||
|
|
||||||
|
This program is free software; you can redistribute it and/or
|
||||||
|
modify it under the terms of the GNU General Public License
|
||||||
|
as published by the Free Software Foundation; either version 2
|
||||||
|
of the License, or (at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program; if not, write to the Free Software
|
||||||
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
|
*/
|
||||||
|
|
||||||
|
class Element {
|
||||||
|
private $id;
|
||||||
|
private $styles;
|
||||||
|
private $transforms;
|
||||||
|
private $transform;
|
||||||
|
|
||||||
|
public function __construct() {
|
||||||
|
$this->id = "";
|
||||||
|
$this->styles = array();
|
||||||
|
$this->transforms = array();
|
||||||
|
$this->transform = new Transform();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setId($newId) {
|
||||||
|
$this->id = $newId;
|
||||||
|
}
|
||||||
|
public function getId() {
|
||||||
|
return $this->id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setStyles($newStyles) {
|
||||||
|
$this->styles = array();
|
||||||
|
$smallerStyles = split(";", $newStyles);
|
||||||
|
foreach($smallerStyles as $small) {
|
||||||
|
$parts = split(":", $small);
|
||||||
|
$this->styles[$parts[0]] = $parts[1];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public function setStyle($key, $style) {
|
||||||
|
$this->styles[$key] = $style;
|
||||||
|
}
|
||||||
|
public function getStyles() {
|
||||||
|
return $this->styles;
|
||||||
|
}
|
||||||
|
public function getStyle($key) {
|
||||||
|
if ($this->styles && array_key_exists($key, $this->styles))
|
||||||
|
return $this->styles[$key];
|
||||||
|
else
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
public function setStroke($stroke) {
|
||||||
|
$this->styles["stroke"] = $stroke;
|
||||||
|
}
|
||||||
|
public function setStrokeWidth($width) {
|
||||||
|
$this->styles["stroke-width"] = $width;
|
||||||
|
}
|
||||||
|
public function setStrokeLinecap($linecap) {
|
||||||
|
$this->styles["stroke-linecap"] = $linecap;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setFill($fill) {
|
||||||
|
$this->styles["fill"] = $fill;
|
||||||
|
}
|
||||||
|
|
||||||
|
//$transform is a string of transformations
|
||||||
|
public function setTransforms($transform) {
|
||||||
|
$this->transforms = array();
|
||||||
|
$this->addTransforms($transform);
|
||||||
|
$this->combineTransforms();
|
||||||
|
}
|
||||||
|
|
||||||
|
//$transform is a string of transformations
|
||||||
|
public function addTransforms($transform) {
|
||||||
|
$parts = split("\\)", $transform);
|
||||||
|
foreach ($parts as $part) {
|
||||||
|
//because ')' is the last character, we'll get an empty string here if we don't watch out
|
||||||
|
if ($part == "")
|
||||||
|
break;
|
||||||
|
|
||||||
|
$transform = split("\\(", trim($part));
|
||||||
|
switch (trim($transform[0])) {
|
||||||
|
case "matrix":
|
||||||
|
//get all the matrix elements, create a new transform and set them
|
||||||
|
$elements = split("[[:blank:],]+", trim($transform[1]));
|
||||||
|
$transformObject = new Transform();
|
||||||
|
$transformObject->setFullMatrix($elements[0], $elements[1], $elements[2], $elements[3], $elements[4], $elements[5]);
|
||||||
|
$this->transforms[] = $transformObject;
|
||||||
|
break;
|
||||||
|
case "translate":
|
||||||
|
//get all the matrix elements, create a new translate transform and set them
|
||||||
|
$elements = split("[[:blank:],]+", trim($transform[1]));
|
||||||
|
$transformObject = new Transform();
|
||||||
|
$transformObject->setTranslate($elements[0], $elements[1]);
|
||||||
|
$this->transforms[] = $transformObject;
|
||||||
|
break;
|
||||||
|
case "scale":
|
||||||
|
//get all the matrix elements, create a new scale transform and set them
|
||||||
|
$elements = split("[[:blank:],]+", trim($transform[1]));
|
||||||
|
$transformObject = new Transform();
|
||||||
|
if (count($elements) > 1)
|
||||||
|
$transformObject->setScale($elements[0], $elements[1]);
|
||||||
|
else
|
||||||
|
$transformObject->setScale($elements[0]);
|
||||||
|
$this->transforms[] = $transformObject;
|
||||||
|
break;
|
||||||
|
case "rotate":
|
||||||
|
//get all the matrix elements, create a new rotate transform and set them
|
||||||
|
$elements = split("[[:blank:],]+", trim($transform[1]));
|
||||||
|
//if there are 3 arguments, they are angle, and (x,y) coordinates of the point to rotate about
|
||||||
|
//to handle this, we translate, rotate, and translate back
|
||||||
|
if (count($elements) >= 3) {
|
||||||
|
$transformObject1 = new Transform();
|
||||||
|
$transformObject1->setTranslate(-$elements[1], -$elements[2]);
|
||||||
|
$this->transforms[] = $transformObject1;
|
||||||
|
|
||||||
|
$transformObject2 = new Transform();
|
||||||
|
$transformObject2->setRotate($elements[0]);
|
||||||
|
$this->transforms[] = $transformObject2;
|
||||||
|
|
||||||
|
$transformObject3 = new Transform();
|
||||||
|
$transformObject3->setTranslate($elements[1], $elements[2]);
|
||||||
|
$this->transforms[] = $transformObject3;
|
||||||
|
} else {
|
||||||
|
$transformObject = new Transform();
|
||||||
|
$transformObject->setRotate($elements[0]);
|
||||||
|
$this->transforms[] = $transformObject;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case "skewX":
|
||||||
|
//get all the matrix elements, create a new skew transform and set them
|
||||||
|
$elements = split("[[:blank:],]+", trim($transform[1]));
|
||||||
|
$transformObject = new Transform();
|
||||||
|
$transformObject->setSkewX($elements[0]);
|
||||||
|
$this->transforms[] = $transformObject;
|
||||||
|
break;
|
||||||
|
case "skewY":
|
||||||
|
//get all the matrix elements, create a new skew transform and set them
|
||||||
|
$elements = split("[[:blank:],]+", trim($transform[1]));
|
||||||
|
$transformObject = new Transform();
|
||||||
|
$transformObject->setSkewY($elements[0]);
|
||||||
|
$this->transforms[] = $transformObject;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//combine all these into one transform
|
||||||
|
$this->combineTransforms();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//combine all transforms into one transform and store in $this->transform
|
||||||
|
private function combineTransforms() {
|
||||||
|
$one = new Transform();
|
||||||
|
foreach ($this->transforms as $transform)
|
||||||
|
$one->multiplyBy($transform);
|
||||||
|
$this->transform = $one;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setTransform($transform) {
|
||||||
|
$this->transform = $transform;
|
||||||
|
$this->transforms = array();
|
||||||
|
$this->transforms[] = $transform;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getTransform() {
|
||||||
|
return $this->transform;
|
||||||
|
}
|
||||||
|
|
||||||
|
//an ARRAY of Transform objects is returned
|
||||||
|
public function getTransforms() {
|
||||||
|
return $this->transforms;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
45
svgparser/parser/objects/Ellipse.php
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
<?php
|
||||||
|
/*
|
||||||
|
SVG to dojox.gfx Parser
|
||||||
|
Copyright (C) 2009 Aaron Lindsay <aclindsay@aclindsay.com>
|
||||||
|
|
||||||
|
This program is free software; you can redistribute it and/or
|
||||||
|
modify it under the terms of the GNU General Public License
|
||||||
|
as published by the Free Software Foundation; either version 2
|
||||||
|
of the License, or (at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program; if not, write to the Free Software
|
||||||
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
|
*/
|
||||||
|
|
||||||
|
require_once("objects/Element.php");
|
||||||
|
|
||||||
|
class Ellipse extends Element {
|
||||||
|
private $cx;
|
||||||
|
private $cy;
|
||||||
|
private $rx;
|
||||||
|
private $ry;
|
||||||
|
|
||||||
|
public function __construct() {
|
||||||
|
$this->cx = 0;
|
||||||
|
$this->cy = 0;
|
||||||
|
$this->rx = 0;
|
||||||
|
$this->ry = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getCx() { return $this->cx; }
|
||||||
|
public function getCy() { return $this->cy; }
|
||||||
|
public function getRx() { return $this->rx; }
|
||||||
|
public function getRy() { return $this->ry; }
|
||||||
|
public function setCx($x) { $this->cx = $x; }
|
||||||
|
public function setCy($x) { $this->cy = $x; }
|
||||||
|
public function setRx($x) { $this->rx = $x; }
|
||||||
|
public function setRy($x) { $this->ry = $x; }
|
||||||
|
}
|
||||||
|
?>
|
55
svgparser/parser/objects/Gradient.php
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
<?php
|
||||||
|
/*
|
||||||
|
SVG to dojox.gfx Parser
|
||||||
|
Copyright (C) 2009 Aaron Lindsay <aclindsay@aclindsay.com>
|
||||||
|
|
||||||
|
This program is free software; you can redistribute it and/or
|
||||||
|
modify it under the terms of the GNU General Public License
|
||||||
|
as published by the Free Software Foundation; either version 2
|
||||||
|
of the License, or (at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program; if not, write to the Free Software
|
||||||
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
|
*/
|
||||||
|
|
||||||
|
require_once("objects/Element.php");
|
||||||
|
|
||||||
|
require_once("objects/Transform.php");
|
||||||
|
|
||||||
|
class Gradient extends Element{
|
||||||
|
private $link;
|
||||||
|
private $stops;
|
||||||
|
|
||||||
|
public function __construct() {
|
||||||
|
parent::__construct();
|
||||||
|
$this->stops = array();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setLink($link) {
|
||||||
|
$this->link = trim($link, " \t\n\r#");
|
||||||
|
}
|
||||||
|
public function getLink() {
|
||||||
|
return isset($this->link)?$this->link:null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function addStop($stop) {
|
||||||
|
$this->stops[] = $stop;
|
||||||
|
}
|
||||||
|
public function setStops($stops) {
|
||||||
|
$this->stops = $stops;
|
||||||
|
}
|
||||||
|
public function getStops() {
|
||||||
|
return $this->stops;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function isValid() {
|
||||||
|
return count($this->stops) > 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
58
svgparser/parser/objects/GradientStop.php
Normal file
@ -0,0 +1,58 @@
|
|||||||
|
<?php
|
||||||
|
/*
|
||||||
|
SVG to dojox.gfx Parser
|
||||||
|
Copyright (C) 2009 Aaron Lindsay <aclindsay@aclindsay.com>
|
||||||
|
|
||||||
|
This program is free software; you can redistribute it and/or
|
||||||
|
modify it under the terms of the GNU General Public License
|
||||||
|
as published by the Free Software Foundation; either version 2
|
||||||
|
of the License, or (at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program; if not, write to the Free Software
|
||||||
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
|
*/
|
||||||
|
|
||||||
|
class GradientStop extends Element{
|
||||||
|
private $offset;
|
||||||
|
|
||||||
|
public function __construct() {
|
||||||
|
parent::__construct();
|
||||||
|
$this->offset = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setColor($color) {
|
||||||
|
$this->setStyle("stop-color", $color);
|
||||||
|
}
|
||||||
|
public function getColor() {
|
||||||
|
$color = $this->getStyle("stop-color");
|
||||||
|
if ($color == null)
|
||||||
|
return "#000000";
|
||||||
|
else
|
||||||
|
return $color;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setOpacity($opacity) {
|
||||||
|
$this->setStyle("stop-opacity", $opacity);
|
||||||
|
}
|
||||||
|
public function getOpacity() {
|
||||||
|
$opacity = $this->getStyle("stop-opacity");
|
||||||
|
if ($opacity == null)
|
||||||
|
return 1;
|
||||||
|
else
|
||||||
|
return $opacity;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setOffset($offset) {
|
||||||
|
$this->offset = $offset;
|
||||||
|
}
|
||||||
|
public function getOffset() {
|
||||||
|
return isset($this->offset)?$this->offset:0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
43
svgparser/parser/objects/Line.php
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
<?php
|
||||||
|
/*
|
||||||
|
SVG to dojox.gfx Parser
|
||||||
|
Copyright (C) 2009 Aaron Lindsay <aclindsay@aclindsay.com>
|
||||||
|
|
||||||
|
This program is free software; you can redistribute it and/or
|
||||||
|
modify it under the terms of the GNU General Public License
|
||||||
|
as published by the Free Software Foundation; either version 2
|
||||||
|
of the License, or (at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program; if not, write to the Free Software
|
||||||
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
|
*/
|
||||||
|
|
||||||
|
class Line extends Element {
|
||||||
|
private $x1;
|
||||||
|
private $y1;
|
||||||
|
private $x2;
|
||||||
|
private $y2;
|
||||||
|
|
||||||
|
public function __construct() {
|
||||||
|
$this->x1 = 0;
|
||||||
|
$this->y1 = 0;
|
||||||
|
$this->x2 = 0;
|
||||||
|
$this->y2 = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getX1() { return $this->x1; }
|
||||||
|
public function getY1() { return $this->y1; }
|
||||||
|
public function getX2() { return $this->x2; }
|
||||||
|
public function getY2() { return $this->y2; }
|
||||||
|
public function setX1($x) { $this->x1 = $x; }
|
||||||
|
public function setY1($x) { $this->y1 = $x; }
|
||||||
|
public function setX2($x) { $this->x2 = $x; }
|
||||||
|
public function setY2($x) { $this->y2 = $x; }
|
||||||
|
}
|
||||||
|
?>
|
90
svgparser/parser/objects/LinearGradient.php
Normal file
@ -0,0 +1,90 @@
|
|||||||
|
<?php
|
||||||
|
/*
|
||||||
|
SVG to dojox.gfx Parser
|
||||||
|
Copyright (C) 2009 Aaron Lindsay <aclindsay@aclindsay.com>
|
||||||
|
|
||||||
|
This program is free software; you can redistribute it and/or
|
||||||
|
modify it under the terms of the GNU General Public License
|
||||||
|
as published by the Free Software Foundation; either version 2
|
||||||
|
of the License, or (at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program; if not, write to the Free Software
|
||||||
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
|
*/
|
||||||
|
|
||||||
|
require_once("objects/Gradient.php");
|
||||||
|
|
||||||
|
class LinearGradient extends Gradient {
|
||||||
|
private $x1;
|
||||||
|
private $y1;
|
||||||
|
private $x2;
|
||||||
|
private $y2;
|
||||||
|
|
||||||
|
private $transformsApplied = false;
|
||||||
|
|
||||||
|
public function __construct() {
|
||||||
|
parent::__construct();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setX1($x) {
|
||||||
|
$this->x1 = $x;
|
||||||
|
}
|
||||||
|
public function setY1($x) {
|
||||||
|
$this->y1 = $x;
|
||||||
|
}
|
||||||
|
public function setX2($x) {
|
||||||
|
$this->x2 = $x;
|
||||||
|
}
|
||||||
|
public function setY2($x) {
|
||||||
|
$this->y2 = $x;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getX1() {
|
||||||
|
return $this->x1;
|
||||||
|
}
|
||||||
|
public function getY1() {
|
||||||
|
return $this->y1;
|
||||||
|
}
|
||||||
|
public function getX2() {
|
||||||
|
return $this->x2;
|
||||||
|
}
|
||||||
|
public function getY2() {
|
||||||
|
return $this->y2;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function isValid() {
|
||||||
|
if (!parent::isValid())
|
||||||
|
return false;
|
||||||
|
if (!isset($this->x1) || !isset($this->y1) || !isset($this->x2) || !isset($this->y2))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function transformsApplied() {
|
||||||
|
return $this->transformsApplied;
|
||||||
|
}
|
||||||
|
|
||||||
|
//apply all the transforms to the points in this gradient
|
||||||
|
public function applyTransforms() {
|
||||||
|
$transforms = $this->getTransforms();
|
||||||
|
foreach($transforms as $transform) {
|
||||||
|
$oldX1 = $this->x1;
|
||||||
|
$oldY1 = $this->y1;
|
||||||
|
$oldX2 = $this->x2;
|
||||||
|
$oldY2 = $this->y2;
|
||||||
|
$this->x1 = $transform->applyToX($oldX1, $oldY1);
|
||||||
|
$this->y1 = $transform->applyToY($oldX1, $oldY1);
|
||||||
|
$this->x2 = $transform->applyToX($oldX2, $oldY2);
|
||||||
|
$this->y2 = $transform->applyToY($oldX2, $oldY2);
|
||||||
|
}
|
||||||
|
$this->transformsApplied = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
38
svgparser/parser/objects/Path.php
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
<?php
|
||||||
|
/*
|
||||||
|
SVG to dojox.gfx Parser
|
||||||
|
Copyright (C) 2009 Aaron Lindsay <aclindsay@aclindsay.com>
|
||||||
|
|
||||||
|
This program is free software; you can redistribute it and/or
|
||||||
|
modify it under the terms of the GNU General Public License
|
||||||
|
as published by the Free Software Foundation; either version 2
|
||||||
|
of the License, or (at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program; if not, write to the Free Software
|
||||||
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
|
*/
|
||||||
|
|
||||||
|
require_once("objects/Element.php");
|
||||||
|
|
||||||
|
class Path extends Element {
|
||||||
|
private $path;
|
||||||
|
|
||||||
|
public function __construct() {
|
||||||
|
parent::__construct();
|
||||||
|
$this->path = "";
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setPath($newPath) {
|
||||||
|
$this->path = $newPath;
|
||||||
|
}
|
||||||
|
public function getPath() {
|
||||||
|
return $this->path;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
37
svgparser/parser/objects/Polyline.php
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
<?php
|
||||||
|
/*
|
||||||
|
SVG to dojox.gfx Parser
|
||||||
|
Copyright (C) 2009 Aaron Lindsay <aclindsay@aclindsay.com>
|
||||||
|
|
||||||
|
This program is free software; you can redistribute it and/or
|
||||||
|
modify it under the terms of the GNU General Public License
|
||||||
|
as published by the Free Software Foundation; either version 2
|
||||||
|
of the License, or (at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program; if not, write to the Free Software
|
||||||
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
|
*/
|
||||||
|
|
||||||
|
require_once("objects/Element.php");
|
||||||
|
|
||||||
|
class Polyline extends Element {
|
||||||
|
private $points;
|
||||||
|
|
||||||
|
public function __construct() {
|
||||||
|
$this->points="";
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getPoints() {
|
||||||
|
return $this->points;
|
||||||
|
}
|
||||||
|
public function setPoints($x) {
|
||||||
|
$this->points = $x;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
97
svgparser/parser/objects/RadialGradient.php
Normal file
@ -0,0 +1,97 @@
|
|||||||
|
<?php
|
||||||
|
/*
|
||||||
|
SVG to dojox.gfx Parser
|
||||||
|
Copyright (C) 2009 Aaron Lindsay <aclindsay@aclindsay.com>
|
||||||
|
|
||||||
|
This program is free software; you can redistribute it and/or
|
||||||
|
modify it under the terms of the GNU General Public License
|
||||||
|
as published by the Free Software Foundation; either version 2
|
||||||
|
of the License, or (at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program; if not, write to the Free Software
|
||||||
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
|
*/
|
||||||
|
|
||||||
|
require_once("objects/Gradient.php");
|
||||||
|
|
||||||
|
class RadialGradient extends Gradient {
|
||||||
|
private $cx;
|
||||||
|
private $cy;
|
||||||
|
private $r;
|
||||||
|
private $fx;
|
||||||
|
private $fy;
|
||||||
|
|
||||||
|
private $transformsApplied = false;
|
||||||
|
|
||||||
|
public function __construct() {
|
||||||
|
parent::__construct();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setCx($x) {
|
||||||
|
$this->cx = $x;
|
||||||
|
}
|
||||||
|
public function setCy($x) {
|
||||||
|
$this->cy = $x;
|
||||||
|
}
|
||||||
|
public function setR($x) {
|
||||||
|
$this->r = $x;
|
||||||
|
}
|
||||||
|
public function setFx($x) {
|
||||||
|
$this->fx = $x;
|
||||||
|
}
|
||||||
|
public function setFy($x) {
|
||||||
|
$this->fy = $x;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getCx() {
|
||||||
|
return $this->cx;
|
||||||
|
}
|
||||||
|
public function getCy() {
|
||||||
|
return $this->cy;
|
||||||
|
}
|
||||||
|
public function getR() {
|
||||||
|
return $this->r;
|
||||||
|
}
|
||||||
|
public function getFx() {
|
||||||
|
return $this->fx;
|
||||||
|
}
|
||||||
|
public function getFy() {
|
||||||
|
return $this->fy;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function isValid() {
|
||||||
|
if (!parent::isValid())
|
||||||
|
return false;
|
||||||
|
if (!isset($this->cx) || !isset($this->cy) || !isset($this->r) || !isset($this->fx) || !isset($this->fy))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function transformsApplied() {
|
||||||
|
return $this->transformsApplied;
|
||||||
|
}
|
||||||
|
|
||||||
|
//apply all the transforms to the points in this gradient
|
||||||
|
public function applyTransforms() {
|
||||||
|
$transforms = $this->getTransforms();
|
||||||
|
foreach($transforms as $transform) {
|
||||||
|
$oldCx = $this->cx;
|
||||||
|
$oldCy = $this->cy;
|
||||||
|
$oldFx = $this->fx;
|
||||||
|
$oldFy = $this->fy;
|
||||||
|
$this->cx = $transform->applyToX($oldCx, $oldCy);
|
||||||
|
$this->cy = $transform->applyToY($oldCx, $oldCy);
|
||||||
|
$this->fx = $transform->applyToX($oldFx, $oldFy);
|
||||||
|
$this->fy = $transform->applyToY($oldFx, $oldFy);
|
||||||
|
}
|
||||||
|
$this->transformsApplied = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
66
svgparser/parser/objects/Rectangle.php
Normal file
@ -0,0 +1,66 @@
|
|||||||
|
<?php
|
||||||
|
/*
|
||||||
|
SVG to dojox.gfx Parser
|
||||||
|
Copyright (C) 2009 Aaron Lindsay <aclindsay@aclindsay.com>
|
||||||
|
|
||||||
|
This program is free software; you can redistribute it and/or
|
||||||
|
modify it under the terms of the GNU General Public License
|
||||||
|
as published by the Free Software Foundation; either version 2
|
||||||
|
of the License, or (at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program; if not, write to the Free Software
|
||||||
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
|
*/
|
||||||
|
|
||||||
|
require_once("objects/Element.php");
|
||||||
|
|
||||||
|
class Rectangle extends Element {
|
||||||
|
private $x;
|
||||||
|
private $y;
|
||||||
|
private $height;
|
||||||
|
private $width;
|
||||||
|
private $rx;
|
||||||
|
private $ry;
|
||||||
|
|
||||||
|
public function __construct() {
|
||||||
|
$this->x = 0;
|
||||||
|
$this->y = 0;
|
||||||
|
$this->height = 0;
|
||||||
|
$this->width = 0;
|
||||||
|
$this->rx = null;
|
||||||
|
$this->ry = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getX() { return $this->x; }
|
||||||
|
public function getY() { return $this->y; }
|
||||||
|
public function getHeight() { return $this->height; }
|
||||||
|
public function getWidth() { return $this->width; }
|
||||||
|
public function getRx() { return ($this->rx != null)?$this->rx:0; }
|
||||||
|
public function getRy() { return ($this->ry != null)?$this->ry:0; }
|
||||||
|
public function getR() {
|
||||||
|
if ($this->rx != null && $this->ry != null)
|
||||||
|
return ($this->rx + $this->ry) / 2;
|
||||||
|
else if ($this->rx != null)
|
||||||
|
return $this->rx;
|
||||||
|
else if ($this->ry != null)
|
||||||
|
return $this->ry;
|
||||||
|
else
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setX($x) { $this->x = $x; }
|
||||||
|
public function setY($x) { $this->y = $x; }
|
||||||
|
public function setHeight($x) { $this->height = $x; }
|
||||||
|
public function setWidth($x) { $this->width = $x; }
|
||||||
|
public function setRx($x) { $this->rx = $x; }
|
||||||
|
public function setRy($x) { $this->ry = $x; }
|
||||||
|
public function setR($r) { $this->setRx($r); $this->setRy($r); }
|
||||||
|
|
||||||
|
}
|
||||||
|
?>
|
153
svgparser/parser/objects/SVG.php
Normal file
@ -0,0 +1,153 @@
|
|||||||
|
<?php
|
||||||
|
/*
|
||||||
|
SVG to dojox.gfx Parser
|
||||||
|
Copyright (C) 2009 Aaron Lindsay <aclindsay@aclindsay.com>
|
||||||
|
|
||||||
|
This program is free software; you can redistribute it and/or
|
||||||
|
modify it under the terms of the GNU General Public License
|
||||||
|
as published by the Free Software Foundation; either version 2
|
||||||
|
of the License, or (at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program; if not, write to the Free Software
|
||||||
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
|
*/
|
||||||
|
|
||||||
|
class SVG {
|
||||||
|
private $paths;
|
||||||
|
private $rects;
|
||||||
|
private $circles;
|
||||||
|
private $ellipses;
|
||||||
|
private $lines;
|
||||||
|
private $polylines;
|
||||||
|
private $texts;
|
||||||
|
private $linearGradients;
|
||||||
|
private $radialGradients;
|
||||||
|
|
||||||
|
public function __construct() {
|
||||||
|
$this->paths = array();
|
||||||
|
$this->rects = array();
|
||||||
|
$this->circles = array();
|
||||||
|
$this->ellipses = array();
|
||||||
|
$this->lines = array();
|
||||||
|
$this->polylines = array();
|
||||||
|
$this->texts = array();
|
||||||
|
|
||||||
|
$this->linearGradients = array();
|
||||||
|
$this->radialGradients = array();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function addPath($path) {
|
||||||
|
$this->paths[] = $path;
|
||||||
|
}
|
||||||
|
public function getPaths() {
|
||||||
|
return $this->paths;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function addRectangle($rect) {
|
||||||
|
$this->rects[] = $rect;
|
||||||
|
}
|
||||||
|
public function getRectangles() {
|
||||||
|
return $this->rects;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function addCircle($circle) {
|
||||||
|
$this->circles[] = $circle;
|
||||||
|
}
|
||||||
|
public function getCircles() {
|
||||||
|
return $this->circles;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function addEllipse($ellipse) {
|
||||||
|
$this->ellipses[] = $ellipse;
|
||||||
|
}
|
||||||
|
public function getEllipses() {
|
||||||
|
return $this->ellipses;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function addLine($line) {
|
||||||
|
$this->lines[] = $line;
|
||||||
|
}
|
||||||
|
public function getLines() {
|
||||||
|
return $this->lines;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function addPolyline($polyline) {
|
||||||
|
$this->polylines[] = $polyline;
|
||||||
|
}
|
||||||
|
public function getPolylines() {
|
||||||
|
return $this->polylines;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function addText($text) {
|
||||||
|
$this->texts[] = $text;
|
||||||
|
}
|
||||||
|
public function getTexts() {
|
||||||
|
return $this->texts;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function addLinearGradient($gradient) {
|
||||||
|
$this->linearGradients[] = $gradient;
|
||||||
|
}
|
||||||
|
public function getLinearGradients() {
|
||||||
|
return $this->linearGradients;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function addRadialGradient($gradient) {
|
||||||
|
$this->radialGradients[] = $gradient;
|
||||||
|
}
|
||||||
|
public function getRadialGradients() {
|
||||||
|
return $this->radialGradients;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getCompleteLinearGradients() {
|
||||||
|
$validGradients = array();
|
||||||
|
foreach($this->linearGradients as $gradient) {
|
||||||
|
if ($gradient->isValid()) {
|
||||||
|
$validGradients[] = $gradient;
|
||||||
|
} else if ($gradient->getLink() != null) {
|
||||||
|
$newGradient = $this->linkGradient($gradient);
|
||||||
|
if ($newGradient->isValid()) {
|
||||||
|
$validGradients[] = $newGradient;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $validGradients;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getCompleteRadialGradients() {
|
||||||
|
$validGradients = array();
|
||||||
|
foreach($this->radialGradients as $gradient) {
|
||||||
|
if ($gradient->isValid()) {
|
||||||
|
$validGradients[] = $gradient;
|
||||||
|
} else if ($gradient->getLink() != null) {
|
||||||
|
$newGradient = $this->linkGradient($gradient);
|
||||||
|
if ($newGradient->isValid())
|
||||||
|
$validGradients[] = $gradient;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $validGradients;
|
||||||
|
}
|
||||||
|
|
||||||
|
private function linkGradient($gradient) {
|
||||||
|
//search through all gradients for one with an id matching the link field
|
||||||
|
$link = $gradient->getLink();
|
||||||
|
$toLink = null;
|
||||||
|
foreach($this->linearGradients as $match) {
|
||||||
|
if ($match->getId() == $link) {
|
||||||
|
$toLink = $match;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ($toLink != null) {
|
||||||
|
$gradient->setStops($toLink->getStops());
|
||||||
|
}
|
||||||
|
return $gradient;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
61
svgparser/parser/objects/Text.php
Normal file
@ -0,0 +1,61 @@
|
|||||||
|
<?php
|
||||||
|
/*
|
||||||
|
SVG to dojox.gfx Parser
|
||||||
|
Copyright (C) 2009 Aaron Lindsay <aclindsay@aclindsay.com>
|
||||||
|
|
||||||
|
This program is free software; you can redistribute it and/or
|
||||||
|
modify it under the terms of the GNU General Public License
|
||||||
|
as published by the Free Software Foundation; either version 2
|
||||||
|
of the License, or (at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program; if not, write to the Free Software
|
||||||
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
|
*/
|
||||||
|
|
||||||
|
class Text extends Element {
|
||||||
|
private $x;
|
||||||
|
private $y;
|
||||||
|
private $text;
|
||||||
|
|
||||||
|
public function __construct() {
|
||||||
|
$this->x = 0;
|
||||||
|
$this->y = 0;
|
||||||
|
$this->text = "";
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getX() { return $this->x; }
|
||||||
|
public function getY() { return $this->y; }
|
||||||
|
public function getText() { return $this->text; }
|
||||||
|
public function setX($x) { $this->x = $x; }
|
||||||
|
public function setY($x) { $this->y = $x; }
|
||||||
|
public function setText($x) { $this->text = $x; }
|
||||||
|
|
||||||
|
public function setTextAnchor($anchor) {
|
||||||
|
$this->setStyle("text-anchor", $anchor);
|
||||||
|
}
|
||||||
|
public function getTextAnchor() {
|
||||||
|
$anchor = $this->getStyle("text-anchor");
|
||||||
|
if ($anchor == null)
|
||||||
|
return "start";
|
||||||
|
else
|
||||||
|
return $anchor;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setTextDecoration($decoration) {
|
||||||
|
$this->setStyle("text-decoration", $decoration);
|
||||||
|
}
|
||||||
|
public function getTextDecoration() {
|
||||||
|
$decoration = $this->getStyle("text-decoration");
|
||||||
|
if ($decoration == null)
|
||||||
|
return "none";
|
||||||
|
else
|
||||||
|
return $decoration;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
106
svgparser/parser/objects/Transform.php
Normal file
@ -0,0 +1,106 @@
|
|||||||
|
<?php
|
||||||
|
/*
|
||||||
|
SVG to dojox.gfx Parser
|
||||||
|
Copyright (C) 2009 Aaron Lindsay <aclindsay@aclindsay.com>
|
||||||
|
|
||||||
|
This program is free software; you can redistribute it and/or
|
||||||
|
modify it under the terms of the GNU General Public License
|
||||||
|
as published by the Free Software Foundation; either version 2
|
||||||
|
of the License, or (at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program; if not, write to the Free Software
|
||||||
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
|
*/
|
||||||
|
|
||||||
|
class Transform {
|
||||||
|
private $xx;
|
||||||
|
private $xy;
|
||||||
|
private $yx;
|
||||||
|
private $yy;
|
||||||
|
private $dx;
|
||||||
|
private $dy;
|
||||||
|
|
||||||
|
public function __construct() {
|
||||||
|
$this->xx = 1;
|
||||||
|
$this->xy = 0;
|
||||||
|
$this->yx = 0;
|
||||||
|
$this->yy = 1;
|
||||||
|
$this->dx = 0;
|
||||||
|
$this->dy = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setFullMatrix($newXx, $newXy, $newYx, $newYy, $newDx, $newDy) {
|
||||||
|
$this->xx = $newXx;
|
||||||
|
$this->xy = $newXy;
|
||||||
|
$this->yx = $newYx;
|
||||||
|
$this->yy = $newYy;
|
||||||
|
$this->dx = $newDx;
|
||||||
|
$this->dy = $newDy;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getXx() { return $this->xx; }
|
||||||
|
public function getXy() { return $this->xy; }
|
||||||
|
public function getYx() { return $this->yx; }
|
||||||
|
public function getYy() { return $this->yy; }
|
||||||
|
public function getDx() { return $this->dx; }
|
||||||
|
public function getDy() { return $this->dy; }
|
||||||
|
public function setXx($x) { $this->xx = $x; }
|
||||||
|
public function setXy($x) { $this->xy = $x; }
|
||||||
|
public function setYx($x) { $this->yx = $x; }
|
||||||
|
public function setYy($x) { $this->yy = $x; }
|
||||||
|
public function setDx($x) { $this->dx = $x; }
|
||||||
|
public function setDy($x) { $this->dy = $x; }
|
||||||
|
|
||||||
|
public function setTranslate($newDx, $newDy = 0) {
|
||||||
|
$this->setFullMatrix(1,0,0,1,$newDx, $newDy);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setScale($scaleX, $scaleY = -1) {
|
||||||
|
if ($scaleY == -1)
|
||||||
|
$scaleY = $scaleX;
|
||||||
|
$this->setFullMatrix($scaleX, 0, 0, $scaleY, 0, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setRotate($angle) {
|
||||||
|
$this->setFullMatrix(cos(deg2rad($angle)), sin(deg2rad($angle)), -sin(deg2rad($angle)), cos(deg2rad($angle)), 0, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setSkewX($angle) {
|
||||||
|
$this->setFullMatrix(1, 0, tan(deg2rad($angle)), 1, 0, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setSkewY($angle) {
|
||||||
|
$this->setFullMatrix(1, tan(deg2rad($angle)), 0, 1, 0, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function applyToX($x, $y) {
|
||||||
|
return $this->xx * $x + $this->xy * $y + $this->dx;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function applyToY($x, $y) {
|
||||||
|
return $this->yx * $x + $this->yy * $y + $this->dy;
|
||||||
|
}
|
||||||
|
|
||||||
|
//does multiplication of the form [$this]*[$other]
|
||||||
|
//and stores the result in $this
|
||||||
|
public function multiplyBy($other) {
|
||||||
|
$xx = ($this->xx*$other->xx + $this->xy*$other->yx);
|
||||||
|
$xy = ($this->xx*$other->xy + $this->xy*$other->yy);
|
||||||
|
$dx = ($this->xx*$other->dx + $this->xy*$other->dy + $this->dx);
|
||||||
|
$yx = ($this->yx*$other->xx + $this->yy*$other->yx);
|
||||||
|
$yy = ($this->yx*$other->xy + $this->yy*$other->yy);
|
||||||
|
$dy = ($this->yx*$other->yx + $this->yy*$other->dy + $this->dy);
|
||||||
|
$this->setFullMatrix($xx, $xy, $yx, $yy, $dx, $dy);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function isIdentity() {
|
||||||
|
return ($this->xx == 1 && $this->xy == 0 && $this->yx == 0 && $this->yy == 1 && $this->dx == 0 && $this->dy == 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
397
svgparser/parser/parser/Parser.php
Normal file
@ -0,0 +1,397 @@
|
|||||||
|
<?php
|
||||||
|
/*
|
||||||
|
SVG to dojox.gfx Parser
|
||||||
|
Copyright (C) 2009 Aaron Lindsay <aclindsay@aclindsay.com>
|
||||||
|
|
||||||
|
This program is free software; you can redistribute it and/or
|
||||||
|
modify it under the terms of the GNU General Public License
|
||||||
|
as published by the Free Software Foundation; either version 2
|
||||||
|
of the License, or (at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program; if not, write to the Free Software
|
||||||
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
|
*/
|
||||||
|
|
||||||
|
require_once("objects/SVG.php");
|
||||||
|
|
||||||
|
require_once("objects/Path.php");
|
||||||
|
require_once("objects/Rectangle.php");
|
||||||
|
require_once("objects/Circle.php");
|
||||||
|
require_once("objects/Ellipse.php");
|
||||||
|
require_once("objects/Line.php");
|
||||||
|
require_once("objects/Polyline.php");
|
||||||
|
require_once("objects/Line.php");
|
||||||
|
require_once("objects/Text.php");
|
||||||
|
|
||||||
|
require_once("objects/Gradient.php");
|
||||||
|
require_once("objects/RadialGradient.php");
|
||||||
|
require_once("objects/LinearGradient.php");
|
||||||
|
require_once("objects/GradientStop.php");
|
||||||
|
|
||||||
|
require_once("objects/Transform.php");
|
||||||
|
|
||||||
|
class Parser {
|
||||||
|
private $elementStack;
|
||||||
|
private $svg;
|
||||||
|
private $transformStack;
|
||||||
|
private $characterDataStack;
|
||||||
|
|
||||||
|
public function parse($SVGstring) {
|
||||||
|
//reset the stack of elements in case someone already ran this
|
||||||
|
unset($this->elementStack);
|
||||||
|
$this->elementStack = array();
|
||||||
|
|
||||||
|
//reset the stack of transforms in case someone already ran this
|
||||||
|
unset($this->transformStack);
|
||||||
|
$this->transformStack = array();
|
||||||
|
|
||||||
|
//reset the stack of character data (this is used for the text fields)
|
||||||
|
$this->characterDataStack = array();
|
||||||
|
|
||||||
|
$this->svg = new SVG();
|
||||||
|
|
||||||
|
//create the parser object
|
||||||
|
$parser = xml_parser_create();
|
||||||
|
xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, 0); //set to 0 so all the elements don't get converted to upper case
|
||||||
|
xml_parser_set_option($parser, XML_OPTION_SKIP_WHITE, 1); //we don't like extra white-space so skip it
|
||||||
|
|
||||||
|
//set the handlers
|
||||||
|
xml_set_element_handler($parser, array($this, "startElementHandler"), array($this,"endElementHandler"));
|
||||||
|
xml_set_character_data_handler($parser, array($this, "characterDataHandler"));
|
||||||
|
|
||||||
|
xml_parse($parser, $SVGstring);
|
||||||
|
xml_parser_free($parser); //parser... be free!!!
|
||||||
|
|
||||||
|
return $this->svg;
|
||||||
|
}
|
||||||
|
|
||||||
|
private function startElementHandler($parser, $name, $attribs) {
|
||||||
|
$currentTransform = new Transform();
|
||||||
|
|
||||||
|
switch ($name) {
|
||||||
|
case "path":
|
||||||
|
$path = new Path();
|
||||||
|
if (array_key_exists("id", $attribs))
|
||||||
|
$path->setId($attribs["id"]);
|
||||||
|
if (array_key_exists("d", $attribs))
|
||||||
|
$path->setPath($attribs["d"]);
|
||||||
|
if (array_key_exists("style", $attribs))
|
||||||
|
$path->setStyles($attribs["style"]);
|
||||||
|
if (array_key_exists("stroke", $attribs))
|
||||||
|
$path->setStroke($attribs["stroke"]);
|
||||||
|
if (array_key_exists("stroke-width", $attribs))
|
||||||
|
$path->setStrokeWidth($attribs["stroke-width"]);
|
||||||
|
if (array_key_exists("stroke-linecap", $attribs))
|
||||||
|
$path->setStrokeLinecap($attribs["stroke-linecap"]);
|
||||||
|
if (array_key_exists("fill", $attribs))
|
||||||
|
$path->setFill($attribs["fill"]);
|
||||||
|
if (array_key_exists("transform", $attribs)) {
|
||||||
|
$path->setTransforms($attribs["transform"]);
|
||||||
|
$currentTransform = $path->getTransform();
|
||||||
|
}
|
||||||
|
$this->elementStack[] = $path;
|
||||||
|
break;
|
||||||
|
case "rect":
|
||||||
|
$rect = new Rectangle();
|
||||||
|
if (array_key_exists("id", $attribs))
|
||||||
|
$rect->setId($attribs["id"]);
|
||||||
|
if (array_key_exists("x", $attribs))
|
||||||
|
$rect->setX($attribs["x"]);
|
||||||
|
if (array_key_exists("y", $attribs))
|
||||||
|
$rect->setY($attribs["y"]);
|
||||||
|
if (array_key_exists("height", $attribs))
|
||||||
|
$rect->setHeight($attribs["height"]);
|
||||||
|
if (array_key_exists("width", $attribs))
|
||||||
|
$rect->setWidth($attribs["width"]);
|
||||||
|
if (array_key_exists("rx", $attribs))
|
||||||
|
$rect->setRx($attribs["rx"]);
|
||||||
|
if (array_key_exists("ry", $attribs))
|
||||||
|
$rect->setRy($attribs["ry"]);
|
||||||
|
if (array_key_exists("style", $attribs))
|
||||||
|
$rect->setStyles($attribs["style"]);
|
||||||
|
if (array_key_exists("stroke", $attribs))
|
||||||
|
$rect->setStroke($attribs["stroke"]);
|
||||||
|
if (array_key_exists("stroke-width", $attribs))
|
||||||
|
$rect->setStrokeWidth($attribs["stroke-width"]);
|
||||||
|
if (array_key_exists("stroke-linecap", $attribs))
|
||||||
|
$rect->setStrokeLinecap($attribs["stroke-linecap"]);
|
||||||
|
if (array_key_exists("fill", $attribs))
|
||||||
|
$rect->setFill($attribs["fill"]);
|
||||||
|
if (array_key_exists("transform", $attribs)) {
|
||||||
|
$rect->setTransforms($attribs["transform"]);
|
||||||
|
$currentTransform = $rect->getTransform();
|
||||||
|
}
|
||||||
|
$this->elementStack[] = $rect;
|
||||||
|
break;
|
||||||
|
case "circle":
|
||||||
|
$circle = new Circle();
|
||||||
|
if (array_key_exists("id", $attribs))
|
||||||
|
$circle->setId($attribs["id"]);
|
||||||
|
if (array_key_exists("cx", $attribs))
|
||||||
|
$circle->setCx($attribs["cx"]);
|
||||||
|
if (array_key_exists("cy", $attribs))
|
||||||
|
$circle->setCy($attribs["cy"]);
|
||||||
|
if (array_key_exists("r", $attribs))
|
||||||
|
$circle->setR($attribs["r"]);
|
||||||
|
if (array_key_exists("style", $attribs))
|
||||||
|
$circle->setStyles($attribs["style"]);
|
||||||
|
if (array_key_exists("stroke", $attribs))
|
||||||
|
$circle->setStroke($attribs["stroke"]);
|
||||||
|
if (array_key_exists("stroke-width", $attribs))
|
||||||
|
$circle->setStrokeWidth($attribs["stroke-width"]);
|
||||||
|
if (array_key_exists("stroke-linecap", $attribs))
|
||||||
|
$circle->setStrokeLinecap($attribs["stroke-linecap"]);
|
||||||
|
if (array_key_exists("fill", $attribs))
|
||||||
|
$circle->setFill($attribs["fill"]);
|
||||||
|
if (array_key_exists("transform", $attribs)) {
|
||||||
|
$circle->setTransforms($attribs["transform"]);
|
||||||
|
$currentTransform = $circle->getTransform();
|
||||||
|
}
|
||||||
|
$this->elementStack[] = $circle;
|
||||||
|
break;
|
||||||
|
case "ellipse":
|
||||||
|
$ellipse = new Ellipse();
|
||||||
|
if (array_key_exists("id", $attribs))
|
||||||
|
$ellipse->setId($attribs["id"]);
|
||||||
|
if (array_key_exists("cx", $attribs))
|
||||||
|
$ellipse->setCx($attribs["cx"]);
|
||||||
|
if (array_key_exists("cy", $attribs))
|
||||||
|
$ellipse->setCy($attribs["cy"]);
|
||||||
|
if (array_key_exists("rx", $attribs))
|
||||||
|
$ellipse->setRx($attribs["rx"]);
|
||||||
|
if (array_key_exists("ry", $attribs))
|
||||||
|
$ellipse->setRy($attribs["ry"]);
|
||||||
|
if (array_key_exists("style", $attribs))
|
||||||
|
$ellipse->setStyles($attribs["style"]);
|
||||||
|
if (array_key_exists("stroke", $attribs))
|
||||||
|
$ellipse->setStroke($attribs["stroke"]);
|
||||||
|
if (array_key_exists("stroke-width", $attribs))
|
||||||
|
$ellipse->setStrokeWidth($attribs["stroke-width"]);
|
||||||
|
if (array_key_exists("stroke-linecap", $attribs))
|
||||||
|
$ellipse->setStrokeLinecap($attribs["stroke-linecap"]);
|
||||||
|
if (array_key_exists("fill", $attribs))
|
||||||
|
$ellipse->setFill($attribs["fill"]);
|
||||||
|
if (array_key_exists("transform", $attribs)) {
|
||||||
|
$ellipse->setTransforms($attribs["transform"]);
|
||||||
|
$currentTransform = $ellipse->getTransform();
|
||||||
|
}
|
||||||
|
$this->elementStack[] = $ellipse;
|
||||||
|
break;
|
||||||
|
case "line":
|
||||||
|
$line = new Line();
|
||||||
|
if (array_key_exists("id", $attribs))
|
||||||
|
$line->setId($attribs["id"]);
|
||||||
|
if (array_key_exists("x1", $attribs))
|
||||||
|
$line->setX1($attribs["x1"]);
|
||||||
|
if (array_key_exists("y1", $attribs))
|
||||||
|
$line->setY1($attribs["y1"]);
|
||||||
|
if (array_key_exists("x2", $attribs))
|
||||||
|
$line->setX2($attribs["x2"]);
|
||||||
|
if (array_key_exists("y2", $attribs))
|
||||||
|
$line->setY2($attribs["y2"]);
|
||||||
|
if (array_key_exists("style", $attribs))
|
||||||
|
$line->setStyles($attribs["style"]);
|
||||||
|
if (array_key_exists("stroke", $attribs))
|
||||||
|
$line->setStroke($attribs["stroke"]);
|
||||||
|
if (array_key_exists("stroke-width", $attribs))
|
||||||
|
$line->setStrokeWidth($attribs["stroke-width"]);
|
||||||
|
if (array_key_exists("stroke-linecap", $attribs))
|
||||||
|
$line->setStrokeLinecap($attribs["stroke-linecap"]);
|
||||||
|
if (array_key_exists("transform", $attribs)) {
|
||||||
|
$line->setTransforms($attribs["transform"]);
|
||||||
|
$currentTransform = $line->getTransform();
|
||||||
|
}
|
||||||
|
$this->elementStack[] = $line;
|
||||||
|
break;
|
||||||
|
case "polyline":
|
||||||
|
$polyline = new Polyline();
|
||||||
|
if (array_key_exists("id", $attribs))
|
||||||
|
$polyline->setId($attribs["id"]);
|
||||||
|
if (array_key_exists("points", $attribs))
|
||||||
|
$polyline->setPoints($attribs["points"]);
|
||||||
|
if (array_key_exists("style", $attribs))
|
||||||
|
$polyline->setStyles($attribs["style"]);
|
||||||
|
if (array_key_exists("stroke", $attribs))
|
||||||
|
$polyline->setStroke($attribs["stroke"]);
|
||||||
|
if (array_key_exists("stroke-width", $attribs))
|
||||||
|
$polyline->setStrokeWidth($attribs["stroke-width"]);
|
||||||
|
if (array_key_exists("stroke-linecap", $attribs))
|
||||||
|
$polyline->setStrokeLinecap($attribs["stroke-linecap"]);
|
||||||
|
if (array_key_exists("transform", $attribs)) {
|
||||||
|
$polyline->setTransforms($attribs["transform"]);
|
||||||
|
$currentTransform = $polyline->getTransform();
|
||||||
|
}
|
||||||
|
$this->elementStack[] = $polyline;
|
||||||
|
break;
|
||||||
|
case "text":
|
||||||
|
case "tspan":
|
||||||
|
$text = new Text();
|
||||||
|
if (array_key_exists("id", $attribs))
|
||||||
|
$text->setId($attribs["id"]);
|
||||||
|
if (array_key_exists("x", $attribs))
|
||||||
|
$text->setX($attribs["x"]);
|
||||||
|
if (array_key_exists("y", $attribs))
|
||||||
|
$text->setY($attribs["y"]);
|
||||||
|
if (array_key_exists("style", $attribs))
|
||||||
|
$text->setStyles($attribs["style"]);
|
||||||
|
if (array_key_exists("stroke", $attribs))
|
||||||
|
$text->setStroke($attribs["stroke"]);
|
||||||
|
if (array_key_exists("stroke-width", $attribs))
|
||||||
|
$text->setStrokeWidth($attribs["stroke-width"]);
|
||||||
|
if (array_key_exists("stroke-linecap", $attribs))
|
||||||
|
$text->setStrokeLinecap($attribs["stroke-linecap"]);
|
||||||
|
if (array_key_exists("fill", $attribs))
|
||||||
|
$text->setFill($attribs["fill"]);
|
||||||
|
if (array_key_exists("text-anchor", $attribs))
|
||||||
|
$text->setTextAnchor($attribs["text-anchor"]);
|
||||||
|
if (array_key_exists("text-decoration", $attribs))
|
||||||
|
$text->setTextDecoration($attribs["text-decoration"]);
|
||||||
|
if (array_key_exists("transform", $attribs)) {
|
||||||
|
$text->setTransforms($attribs["transform"]);
|
||||||
|
$currentTransform = $text->getTransform();
|
||||||
|
}
|
||||||
|
$this->elementStack[] = $text;
|
||||||
|
break;
|
||||||
|
case "linearGradient":
|
||||||
|
$linearGradient = new LinearGradient();
|
||||||
|
if (array_key_exists("id", $attribs))
|
||||||
|
$linearGradient->setId($attribs["id"]);
|
||||||
|
if (array_key_exists("style", $attribs))
|
||||||
|
$linearGradient->setStyles($attribs["style"]);
|
||||||
|
if (array_key_exists("gradientTransform", $attribs))
|
||||||
|
$linearGradient->setTransforms($attribs["gradientTransform"]);
|
||||||
|
if (array_key_exists("xlink:href", $attribs))
|
||||||
|
$linearGradient->setLink($attribs["xlink:href"]);
|
||||||
|
if (array_key_exists("x1", $attribs))
|
||||||
|
$linearGradient->setX1($attribs["x1"]);
|
||||||
|
if (array_key_exists("y1", $attribs))
|
||||||
|
$linearGradient->setY1($attribs["y1"]);
|
||||||
|
if (array_key_exists("x2", $attribs))
|
||||||
|
$linearGradient->setX2($attribs["x2"]);
|
||||||
|
if (array_key_exists("y2", $attribs))
|
||||||
|
$linearGradient->setY2($attribs["y2"]);
|
||||||
|
$this->elementStack[] = $linearGradient;
|
||||||
|
break;
|
||||||
|
case "stop":
|
||||||
|
$stop = new GradientStop();
|
||||||
|
if (array_key_exists("id", $attribs))
|
||||||
|
$stop->setId($attribs["id"]);
|
||||||
|
if (array_key_exists("style", $attribs))
|
||||||
|
$stop->setStyles($attribs["style"]);
|
||||||
|
if (array_key_exists("offset", $attribs))
|
||||||
|
$stop->setOffset($attribs["offset"]);
|
||||||
|
$this->elementStack[] = $stop;
|
||||||
|
break;
|
||||||
|
case "radialGradient":
|
||||||
|
$radialGradient = new RadialGradient();
|
||||||
|
if (array_key_exists("id", $attribs))
|
||||||
|
$radialGradient->setId($attribs["id"]);
|
||||||
|
if (array_key_exists("style", $attribs))
|
||||||
|
$radialGradient->setStyles($attribs["style"]);
|
||||||
|
if (array_key_exists("gradientTransform", $attribs))
|
||||||
|
$radialGradient->setTransforms($attribs["gradientTransform"]);
|
||||||
|
if (array_key_exists("xlink:href", $attribs))
|
||||||
|
$radialGradient->setLink($attribs["xlink:href"]);
|
||||||
|
if (array_key_exists("cx", $attribs))
|
||||||
|
$radialGradient->setCx($attribs["cx"]);
|
||||||
|
if (array_key_exists("cy", $attribs))
|
||||||
|
$radialGradient->setCy($attribs["cy"]);
|
||||||
|
if (array_key_exists("r", $attribs))
|
||||||
|
$radialGradient->setR($attribs["r"]);
|
||||||
|
if (array_key_exists("fx", $attribs))
|
||||||
|
$radialGradient->setFx($attribs["fx"]);
|
||||||
|
if (array_key_exists("fy", $attribs))
|
||||||
|
$radialGradient->setFy($attribs["fy"]);
|
||||||
|
$this->elementStack[] = $radialGradient;
|
||||||
|
break;
|
||||||
|
case "g":
|
||||||
|
if (array_key_exists("transform", $attribs)) {
|
||||||
|
$element = new Element();
|
||||||
|
$element->setTransforms($attribs["transform"]);
|
||||||
|
$currentTransform = $element->getTransform();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
//dump the transforms on the stack of them so if there are any nested elements, they can access them
|
||||||
|
$this->transformStack[] = $currentTransform;
|
||||||
|
}
|
||||||
|
|
||||||
|
private function characterDataHandler($parser, $data) {
|
||||||
|
$this->characterDataStack[] = $data;
|
||||||
|
}
|
||||||
|
|
||||||
|
private function endElementHandler($parser, $name) {
|
||||||
|
//as well as the last text data
|
||||||
|
$lastText = array_pop($this->characterDataStack);
|
||||||
|
|
||||||
|
switch ($name) {
|
||||||
|
case "path":
|
||||||
|
$element = array_pop($this->elementStack);
|
||||||
|
$element->setTransform($this->getFullCurrentTransform());
|
||||||
|
$this->svg->addPath($element);
|
||||||
|
break;
|
||||||
|
case "rect":
|
||||||
|
$element = array_pop($this->elementStack);
|
||||||
|
$element->setTransform($this->getFullCurrentTransform());
|
||||||
|
$this->svg->addRectangle($element);
|
||||||
|
break;
|
||||||
|
case "circle":
|
||||||
|
$element = array_pop($this->elementStack);
|
||||||
|
$element->setTransform($this->getFullCurrentTransform());
|
||||||
|
$this->svg->addCircle($element);
|
||||||
|
break;
|
||||||
|
case "ellipse":
|
||||||
|
$element = array_pop($this->elementStack);
|
||||||
|
$element->setTransform($this->getFullCurrentTransform());
|
||||||
|
$this->svg->addEllipse($element);
|
||||||
|
break;
|
||||||
|
case "line":
|
||||||
|
$element = array_pop($this->elementStack);
|
||||||
|
$element->setTransform($this->getFullCurrentTransform());
|
||||||
|
$this->svg->addLine($element);
|
||||||
|
break;
|
||||||
|
case "polyline":
|
||||||
|
$element = array_pop($this->elementStack);
|
||||||
|
$element->setTransform($this->getFullCurrentTransform());
|
||||||
|
$this->svg->addPolyline($element);
|
||||||
|
break;
|
||||||
|
case "text":
|
||||||
|
case "tspan":
|
||||||
|
$element = array_pop($this->elementStack);
|
||||||
|
$element->setTransform($this->getFullCurrentTransform());
|
||||||
|
$element->setText($lastText);
|
||||||
|
//add the element only if the text has at least some non-whitespace
|
||||||
|
if (trim($lastText) != "")
|
||||||
|
$this->svg->addText($element);
|
||||||
|
break;
|
||||||
|
case "linearGradient":
|
||||||
|
$this->svg->addLinearGradient(array_pop($this->elementStack));
|
||||||
|
break;
|
||||||
|
case "stop":
|
||||||
|
$stop = array_pop($this->elementStack);
|
||||||
|
if ($this->elementStack[count($this->elementStack)-1] instanceof Gradient)
|
||||||
|
$this->elementStack[count($this->elementStack)-1]->addStop($stop);
|
||||||
|
break;
|
||||||
|
case "radialGradient":
|
||||||
|
$this->svg->addRadialGradient(array_pop($this->elementStack));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
//pop the last transform off the stack
|
||||||
|
array_pop($this->transformStack);
|
||||||
|
}
|
||||||
|
|
||||||
|
private function getFullCurrentTransform() {
|
||||||
|
$one = new Transform();
|
||||||
|
foreach ($this->transformStack as $transform)
|
||||||
|
$one->multiplyBy($transform);
|
||||||
|
return $one;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
8
tabs.php
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
<div id="tabs">
|
||||||
|
<ul>
|
||||||
|
<li><a href="http://aclindsay.com/home/">Home</a></li>
|
||||||
|
<li><a href="http://aclindsay.com/projects/">Projects</a></li>
|
||||||
|
<li><a href="http://aclindsay.com/about/">About</a></li>
|
||||||
|
<li><a href="http://aclindsay.com/contact/">Contact</a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
BIN
wedding/flowery.png
Normal file
After Width: | Height: | Size: 9.3 KiB |
29
wedding/index.html
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>Our Wedding</title>
|
||||||
|
<link rel="stylesheet" href="http://aclindsay.com/wedding/stylesheet.css" type="text/css" media="screen" />
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="header">
|
||||||
|
<div id="header-inner">
|
||||||
|
<div id="header-wedding">The wedding of...</div>
|
||||||
|
<div id="header-aaron">Aaron Charles Lindsay</div>
|
||||||
|
<div id="header-and">and</div>
|
||||||
|
<div id="header-elizabeth">Elizabeth Snow Pressman</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div id="content">
|
||||||
|
<div id="main">
|
||||||
|
main
|
||||||
|
</div>
|
||||||
|
<div id="sidebar">
|
||||||
|
side
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div id="footer">
|
||||||
|
<div id="footer-inner">
|
||||||
|
© 2010 - 2011 Aaron Lindsay and Elizabeth Pressman
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
168
wedding/stylesheet.css
Normal file
@ -0,0 +1,168 @@
|
|||||||
|
/**
|
||||||
|
* These styles handle importing the fonts
|
||||||
|
*/
|
||||||
|
@font-face {
|
||||||
|
font-family: 'Tangerine';
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: bold;
|
||||||
|
src: local('Tangerine'), url('http://aclindsay.com/fonts/Tangerine_Bold.ttf') format('truetype');
|
||||||
|
}
|
||||||
|
@font-face {
|
||||||
|
font-family: 'Tangerine';
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: normal;
|
||||||
|
src: local('Tangerine'), url('http://aclindsay.com/fonts/Tangerine_Regular.ttf') format('truetype');
|
||||||
|
}
|
||||||
|
@font-face {
|
||||||
|
font-family: 'IM Fell DW Pica';
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: normal;
|
||||||
|
src: local('IM FELL DW Pica Roman'), local('IM_FELL_DW_Pica_Roman'), url('http://aclindsay.com/fonts/IMFePIrm28P.ttf') format('truetype');
|
||||||
|
}
|
||||||
|
@font-face {
|
||||||
|
font-family: 'Reenie Beanie';
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: normal;
|
||||||
|
src: local('Reenie Beanie'), url('http://aclindsay.com/fonts/ReenieBeanie.ttf') format('truetype');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* These styles handle layout
|
||||||
|
*/
|
||||||
|
|
||||||
|
body {
|
||||||
|
font-family: Helvetica, Arial, sans-serif;
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
#header-inner, #content, #footer-inner {
|
||||||
|
width: 80%;
|
||||||
|
min-width: 45em;
|
||||||
|
max-width: 60em;
|
||||||
|
margin: 0 auto;
|
||||||
|
}
|
||||||
|
#main, #sidebar {
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
#main {
|
||||||
|
float: left;
|
||||||
|
width: 73%;
|
||||||
|
}
|
||||||
|
#sidebar {
|
||||||
|
float: right;
|
||||||
|
width: 23%;
|
||||||
|
}
|
||||||
|
#footer {
|
||||||
|
clear: both;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* These styles handle look
|
||||||
|
*/
|
||||||
|
|
||||||
|
body {
|
||||||
|
font: normal 100% Helvetica, Arial, sans-serif;
|
||||||
|
background-color: #eeeeee;
|
||||||
|
}
|
||||||
|
#header {
|
||||||
|
height: 150px;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
#header-inner {
|
||||||
|
position: relative;
|
||||||
|
background: #bb99bb url('flowery.png') 100% 90% no-repeat;
|
||||||
|
height: 100%;
|
||||||
|
-moz-border-radius-bottomleft: 15px;
|
||||||
|
-moz-border-radius-bottomright: 15px;
|
||||||
|
border-bottom-right-radius: 15px;
|
||||||
|
border-bottom-left-radius: 15px;
|
||||||
|
border-left: 2px solid #664455;
|
||||||
|
border-right: 2px solid #664455;
|
||||||
|
border-bottom: 2px solid #664455;
|
||||||
|
color: #222;
|
||||||
|
}
|
||||||
|
#header-inner #header-wedding {
|
||||||
|
position: absolute;
|
||||||
|
font-family: 'Reenie Beanie', arial, serif;
|
||||||
|
font-color: #444;
|
||||||
|
font-size: 1.2em;
|
||||||
|
top: .8em;
|
||||||
|
left: 14em;
|
||||||
|
}
|
||||||
|
#header-inner #header-aaron {
|
||||||
|
position: absolute;
|
||||||
|
font-family: 'IM Fell DW Pica', arial, serif;
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 1.5em;
|
||||||
|
top: 2.5em;
|
||||||
|
left: 3em;
|
||||||
|
}
|
||||||
|
#header-inner #header-and {
|
||||||
|
position: absolute;
|
||||||
|
font-family: 'Reenie Beanie', arial, serif;
|
||||||
|
font-color: #444;
|
||||||
|
top: 5.5em;
|
||||||
|
left: 19.5em;
|
||||||
|
}
|
||||||
|
#header-inner #header-elizabeth {
|
||||||
|
position: absolute;
|
||||||
|
font-family: 'Tangerine', arial, serif;
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 2em;
|
||||||
|
top: 3em;
|
||||||
|
left: 11em;
|
||||||
|
}
|
||||||
|
#header-inner #title {
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
position: absolute;
|
||||||
|
height: 53px;
|
||||||
|
top: 0em;
|
||||||
|
right: 0em;
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 1.2em;
|
||||||
|
background: url('graphics/cornerStripedLeft.png') no-repeat bottom left;
|
||||||
|
}
|
||||||
|
#header-inner #title a{
|
||||||
|
display: block;
|
||||||
|
margin: 0;
|
||||||
|
padding: 15px 20px 10px 20px;
|
||||||
|
text-decoration: none;
|
||||||
|
color: #666666;
|
||||||
|
background: url('graphics/cornerStripedRight.png') no-repeat top right;
|
||||||
|
}
|
||||||
|
#header-inner #title a:hover{
|
||||||
|
color: #FFFFFF;
|
||||||
|
}
|
||||||
|
#content {
|
||||||
|
padding: 1em 0 0 0;
|
||||||
|
}
|
||||||
|
#main {
|
||||||
|
padding: 0 0 2em 0;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
#sidebar {
|
||||||
|
background-color: #ffeeee;
|
||||||
|
margin: 1em 0 1em 0;
|
||||||
|
border: 2px solid #eebb88;
|
||||||
|
-moz-border-radius: 15px;
|
||||||
|
border-radius: 15px;
|
||||||
|
padding: 5px 0 5px 0;
|
||||||
|
}
|
||||||
|
#sidebar > * {
|
||||||
|
margin: .5em;
|
||||||
|
}
|
||||||
|
#footer {
|
||||||
|
margin: 0;
|
||||||
|
padding: 1em 0 1em 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
#footer-inner {
|
||||||
|
height: 25px;
|
||||||
|
padding: 1em 0 1em 0;
|
||||||
|
text-align: center;
|
||||||
|
background-color: #ccbbaa;
|
||||||
|
border: 2px solid #664455;
|
||||||
|
-moz-border-radius: 15px;
|
||||||
|
border-radius: 15px;
|
||||||
|
}
|