From 49ce41fdc95f9bfeb1673611775f042b6bd0acf3 Mon Sep 17 00:00:00 2001 From: John Bintz Date: Thu, 5 Nov 2009 07:00:29 -0500 Subject: [PATCH] rearrange a bunch of things, eliminate the idea of addons --- classes/ComicPressAddon.inc | 21 --- .../Core.inc => classes/ComicPressAdmin.inc | 169 ++++++------------ classes/ComicPressFilters.inc | 78 +++++++- .../edit_area/autocompletion.js | 0 .../Core => classes}/edit_area/edit_area.css | 0 .../Core => classes}/edit_area/edit_area.js | 0 .../edit_area/edit_area_compressor.php | 0 .../edit_area/edit_area_full.gz | Bin .../edit_area/edit_area_full.js | 0 .../edit_area/edit_area_full_with_plugins.gz | Bin .../edit_area/edit_area_full_with_plugins.js | 0 .../edit_area/edit_area_functions.js | 0 .../edit_area/edit_area_loader.js | 0 .../edit_area/elements_functions.js | 0 .../Core => classes}/edit_area/highlight.js | 0 .../edit_area/images/autocompletion.gif | Bin .../edit_area/images/close.gif | Bin .../edit_area/images/fullscreen.gif | Bin .../edit_area/images/go_to_line.gif | Bin .../edit_area/images/help.gif | Bin .../edit_area/images/highlight.gif | Bin .../edit_area/images/load.gif | Bin .../edit_area/images/move.gif | Bin .../edit_area/images/newdocument.gif | Bin .../edit_area/images/opacity.png | Bin .../edit_area/images/processing.gif | Bin .../edit_area/images/redo.gif | Bin .../edit_area/images/reset_highlight.gif | Bin .../edit_area/images/save.gif | Bin .../edit_area/images/search.gif | Bin .../edit_area/images/smooth_selection.gif | Bin .../edit_area/images/spacer.gif | Bin .../edit_area/images/statusbar_resize.gif | Bin .../edit_area/images/undo.gif | Bin .../edit_area/images/word_wrap.gif | Bin .../Core => classes}/edit_area/keyboard.js | 0 .../Core => classes}/edit_area/langs/bg.js | 0 .../Core => classes}/edit_area/langs/cs.js | 0 .../Core => classes}/edit_area/langs/de.js | 0 .../Core => classes}/edit_area/langs/dk.js | 0 .../Core => classes}/edit_area/langs/en.js | 0 .../Core => classes}/edit_area/langs/eo.js | 0 .../Core => classes}/edit_area/langs/es.js | 0 .../Core => classes}/edit_area/langs/fi.js | 0 .../Core => classes}/edit_area/langs/fr.js | 0 .../Core => classes}/edit_area/langs/hr.js | 0 .../Core => classes}/edit_area/langs/it.js | 0 .../Core => classes}/edit_area/langs/ja.js | 0 .../Core => classes}/edit_area/langs/mk.js | 0 .../Core => classes}/edit_area/langs/nl.js | 0 .../Core => classes}/edit_area/langs/pl.js | 0 .../Core => classes}/edit_area/langs/pt.js | 0 .../Core => classes}/edit_area/langs/ru.js | 0 .../Core => classes}/edit_area/langs/sk.js | 0 .../Core => classes}/edit_area/langs/zh.js | 0 .../edit_area/license_apache.txt | 0 .../edit_area/license_bsd.txt | 0 .../edit_area/license_lgpl.txt | 0 .../Core => classes}/edit_area/manage_area.js | 0 .../edit_area/plugins/charmap/charmap.js | 0 .../edit_area/plugins/charmap/css/charmap.css | 0 .../plugins/charmap/images/charmap.gif | Bin .../edit_area/plugins/charmap/jscripts/map.js | 0 .../edit_area/plugins/charmap/langs/bg.js | 0 .../edit_area/plugins/charmap/langs/cs.js | 0 .../edit_area/plugins/charmap/langs/de.js | 0 .../edit_area/plugins/charmap/langs/dk.js | 0 .../edit_area/plugins/charmap/langs/en.js | 0 .../edit_area/plugins/charmap/langs/eo.js | 0 .../edit_area/plugins/charmap/langs/es.js | 0 .../edit_area/plugins/charmap/langs/fr.js | 0 .../edit_area/plugins/charmap/langs/hr.js | 0 .../edit_area/plugins/charmap/langs/it.js | 0 .../edit_area/plugins/charmap/langs/ja.js | 0 .../edit_area/plugins/charmap/langs/mk.js | 0 .../edit_area/plugins/charmap/langs/nl.js | 0 .../edit_area/plugins/charmap/langs/pl.js | 0 .../edit_area/plugins/charmap/langs/pt.js | 0 .../edit_area/plugins/charmap/langs/ru.js | 0 .../edit_area/plugins/charmap/langs/sk.js | 0 .../edit_area/plugins/charmap/langs/zh.js | 0 .../edit_area/plugins/charmap/popup.html | 0 .../edit_area/plugins/test/css/test.css | 0 .../edit_area/plugins/test/images/Thumbs.db | Bin .../edit_area/plugins/test/images/test.gif | Bin .../edit_area/plugins/test/langs/bg.js | 0 .../edit_area/plugins/test/langs/cs.js | 0 .../edit_area/plugins/test/langs/de.js | 0 .../edit_area/plugins/test/langs/dk.js | 0 .../edit_area/plugins/test/langs/en.js | 0 .../edit_area/plugins/test/langs/eo.js | 0 .../edit_area/plugins/test/langs/es.js | 0 .../edit_area/plugins/test/langs/fr.js | 0 .../edit_area/plugins/test/langs/hr.js | 0 .../edit_area/plugins/test/langs/it.js | 0 .../edit_area/plugins/test/langs/ja.js | 0 .../edit_area/plugins/test/langs/mk.js | 0 .../edit_area/plugins/test/langs/nl.js | 0 .../edit_area/plugins/test/langs/pl.js | 0 .../edit_area/plugins/test/langs/pt.js | 0 .../edit_area/plugins/test/langs/ru.js | 0 .../edit_area/plugins/test/langs/sk.js | 0 .../edit_area/plugins/test/langs/zh.js | 0 .../edit_area/plugins/test/test.js | 0 .../edit_area/plugins/test/test2.js | 0 .../Core => classes}/edit_area/reg_syntax.js | 0 .../edit_area/reg_syntax/basic.js | 0 .../edit_area/reg_syntax/brainfuck.js | 0 .../edit_area/reg_syntax/c.js | 0 .../edit_area/reg_syntax/coldfusion.js | 0 .../edit_area/reg_syntax/cpp.js | 0 .../edit_area/reg_syntax/css.js | 0 .../edit_area/reg_syntax/html.js | 0 .../edit_area/reg_syntax/java.js | 0 .../edit_area/reg_syntax/js.js | 0 .../edit_area/reg_syntax/pas.js | 0 .../edit_area/reg_syntax/perl.js | 0 .../edit_area/reg_syntax/php.js | 0 .../edit_area/reg_syntax/python.js | 0 .../edit_area/reg_syntax/robotstxt.js | 0 .../edit_area/reg_syntax/ruby.js | 0 .../edit_area/reg_syntax/sql.js | 0 .../edit_area/reg_syntax/tsql.js | 0 .../edit_area/reg_syntax/vb.js | 0 .../edit_area/reg_syntax/xml.js | 0 {addons/Core => classes}/edit_area/regexp.js | 0 .../Core => classes}/edit_area/resize_area.js | 0 .../edit_area/search_replace.js | 0 .../Core => classes}/edit_area/template.html | 0 .../FloatedDivConstructor.js | 0 .../LayoutConstructorsTest.html | 0 .../TableLayoutConstructor.js | 0 .../layout_constructors/testcase.js | 0 .../layout_manager/LayoutEditor.js | 0 .../layout_manager/index.html | 0 .../layout_manager/prototype.js | 0 .../_comic-image-ordering-sorters.inc | 0 .../partials/_comic-image-ordering.inc | 0 .../partials/edit-partials.inc | 0 .../partials/layout-editor.inc | 0 .../partials/options-admin.inc | 0 .../widgets}/BookmarkWidget.inc | 4 +- functions.php | 59 ++---- 143 files changed, 141 insertions(+), 190 deletions(-) rename addons/Core/Core.inc => classes/ComicPressAdmin.inc (81%) rename {addons/Core => classes}/edit_area/autocompletion.js (100%) rename {addons/Core => classes}/edit_area/edit_area.css (100%) rename {addons/Core => classes}/edit_area/edit_area.js (100%) rename {addons/Core => classes}/edit_area/edit_area_compressor.php (100%) rename {addons/Core => classes}/edit_area/edit_area_full.gz (100%) rename {addons/Core => classes}/edit_area/edit_area_full.js (100%) rename {addons/Core => classes}/edit_area/edit_area_full_with_plugins.gz (100%) rename {addons/Core => classes}/edit_area/edit_area_full_with_plugins.js (100%) rename {addons/Core => classes}/edit_area/edit_area_functions.js (100%) rename {addons/Core => classes}/edit_area/edit_area_loader.js (100%) rename {addons/Core => classes}/edit_area/elements_functions.js (100%) rename {addons/Core => classes}/edit_area/highlight.js (100%) rename {addons/Core => classes}/edit_area/images/autocompletion.gif (100%) rename {addons/Core => classes}/edit_area/images/close.gif (100%) rename {addons/Core => classes}/edit_area/images/fullscreen.gif (100%) rename {addons/Core => classes}/edit_area/images/go_to_line.gif (100%) rename {addons/Core => classes}/edit_area/images/help.gif (100%) rename {addons/Core => classes}/edit_area/images/highlight.gif (100%) rename {addons/Core => classes}/edit_area/images/load.gif (100%) rename {addons/Core => classes}/edit_area/images/move.gif (100%) rename {addons/Core => classes}/edit_area/images/newdocument.gif (100%) rename {addons/Core => classes}/edit_area/images/opacity.png (100%) rename {addons/Core => classes}/edit_area/images/processing.gif (100%) rename {addons/Core => classes}/edit_area/images/redo.gif (100%) rename {addons/Core => classes}/edit_area/images/reset_highlight.gif (100%) rename {addons/Core => classes}/edit_area/images/save.gif (100%) rename {addons/Core => classes}/edit_area/images/search.gif (100%) rename {addons/Core => classes}/edit_area/images/smooth_selection.gif (100%) rename {addons/Core => classes}/edit_area/images/spacer.gif (100%) rename {addons/Core => classes}/edit_area/images/statusbar_resize.gif (100%) rename {addons/Core => classes}/edit_area/images/undo.gif (100%) rename {addons/Core => classes}/edit_area/images/word_wrap.gif (100%) rename {addons/Core => classes}/edit_area/keyboard.js (100%) rename {addons/Core => classes}/edit_area/langs/bg.js (100%) rename {addons/Core => classes}/edit_area/langs/cs.js (100%) rename {addons/Core => classes}/edit_area/langs/de.js (100%) rename {addons/Core => classes}/edit_area/langs/dk.js (100%) rename {addons/Core => classes}/edit_area/langs/en.js (100%) rename {addons/Core => classes}/edit_area/langs/eo.js (100%) rename {addons/Core => classes}/edit_area/langs/es.js (100%) rename {addons/Core => classes}/edit_area/langs/fi.js (100%) rename {addons/Core => classes}/edit_area/langs/fr.js (100%) rename {addons/Core => classes}/edit_area/langs/hr.js (100%) rename {addons/Core => classes}/edit_area/langs/it.js (100%) rename {addons/Core => classes}/edit_area/langs/ja.js (100%) rename {addons/Core => classes}/edit_area/langs/mk.js (100%) rename {addons/Core => classes}/edit_area/langs/nl.js (100%) rename {addons/Core => classes}/edit_area/langs/pl.js (100%) rename {addons/Core => classes}/edit_area/langs/pt.js (100%) rename {addons/Core => classes}/edit_area/langs/ru.js (100%) rename {addons/Core => classes}/edit_area/langs/sk.js (100%) rename {addons/Core => classes}/edit_area/langs/zh.js (100%) rename {addons/Core => classes}/edit_area/license_apache.txt (100%) rename {addons/Core => classes}/edit_area/license_bsd.txt (100%) rename {addons/Core => classes}/edit_area/license_lgpl.txt (100%) rename {addons/Core => classes}/edit_area/manage_area.js (100%) rename {addons/Core => classes}/edit_area/plugins/charmap/charmap.js (100%) rename {addons/Core => classes}/edit_area/plugins/charmap/css/charmap.css (100%) rename {addons/Core => classes}/edit_area/plugins/charmap/images/charmap.gif (100%) rename {addons/Core => classes}/edit_area/plugins/charmap/jscripts/map.js (100%) rename {addons/Core => classes}/edit_area/plugins/charmap/langs/bg.js (100%) rename {addons/Core => classes}/edit_area/plugins/charmap/langs/cs.js (100%) rename {addons/Core => classes}/edit_area/plugins/charmap/langs/de.js (100%) rename {addons/Core => classes}/edit_area/plugins/charmap/langs/dk.js (100%) rename {addons/Core => classes}/edit_area/plugins/charmap/langs/en.js (100%) rename {addons/Core => classes}/edit_area/plugins/charmap/langs/eo.js (100%) rename {addons/Core => classes}/edit_area/plugins/charmap/langs/es.js (100%) rename {addons/Core => classes}/edit_area/plugins/charmap/langs/fr.js (100%) rename {addons/Core => classes}/edit_area/plugins/charmap/langs/hr.js (100%) rename {addons/Core => classes}/edit_area/plugins/charmap/langs/it.js (100%) rename {addons/Core => classes}/edit_area/plugins/charmap/langs/ja.js (100%) rename {addons/Core => classes}/edit_area/plugins/charmap/langs/mk.js (100%) rename {addons/Core => classes}/edit_area/plugins/charmap/langs/nl.js (100%) rename {addons/Core => classes}/edit_area/plugins/charmap/langs/pl.js (100%) rename {addons/Core => classes}/edit_area/plugins/charmap/langs/pt.js (100%) rename {addons/Core => classes}/edit_area/plugins/charmap/langs/ru.js (100%) rename {addons/Core => classes}/edit_area/plugins/charmap/langs/sk.js (100%) rename {addons/Core => classes}/edit_area/plugins/charmap/langs/zh.js (100%) rename {addons/Core => classes}/edit_area/plugins/charmap/popup.html (100%) rename {addons/Core => classes}/edit_area/plugins/test/css/test.css (100%) rename {addons/Core => classes}/edit_area/plugins/test/images/Thumbs.db (100%) rename {addons/Core => classes}/edit_area/plugins/test/images/test.gif (100%) rename {addons/Core => classes}/edit_area/plugins/test/langs/bg.js (100%) rename {addons/Core => classes}/edit_area/plugins/test/langs/cs.js (100%) rename {addons/Core => classes}/edit_area/plugins/test/langs/de.js (100%) rename {addons/Core => classes}/edit_area/plugins/test/langs/dk.js (100%) rename {addons/Core => classes}/edit_area/plugins/test/langs/en.js (100%) rename {addons/Core => classes}/edit_area/plugins/test/langs/eo.js (100%) rename {addons/Core => classes}/edit_area/plugins/test/langs/es.js (100%) rename {addons/Core => classes}/edit_area/plugins/test/langs/fr.js (100%) rename {addons/Core => classes}/edit_area/plugins/test/langs/hr.js (100%) rename {addons/Core => classes}/edit_area/plugins/test/langs/it.js (100%) rename {addons/Core => classes}/edit_area/plugins/test/langs/ja.js (100%) rename {addons/Core => classes}/edit_area/plugins/test/langs/mk.js (100%) rename {addons/Core => classes}/edit_area/plugins/test/langs/nl.js (100%) rename {addons/Core => classes}/edit_area/plugins/test/langs/pl.js (100%) rename {addons/Core => classes}/edit_area/plugins/test/langs/pt.js (100%) rename {addons/Core => classes}/edit_area/plugins/test/langs/ru.js (100%) rename {addons/Core => classes}/edit_area/plugins/test/langs/sk.js (100%) rename {addons/Core => classes}/edit_area/plugins/test/langs/zh.js (100%) rename {addons/Core => classes}/edit_area/plugins/test/test.js (100%) rename {addons/Core => classes}/edit_area/plugins/test/test2.js (100%) rename {addons/Core => classes}/edit_area/reg_syntax.js (100%) rename {addons/Core => classes}/edit_area/reg_syntax/basic.js (100%) rename {addons/Core => classes}/edit_area/reg_syntax/brainfuck.js (100%) rename {addons/Core => classes}/edit_area/reg_syntax/c.js (100%) rename {addons/Core => classes}/edit_area/reg_syntax/coldfusion.js (100%) rename {addons/Core => classes}/edit_area/reg_syntax/cpp.js (100%) rename {addons/Core => classes}/edit_area/reg_syntax/css.js (100%) rename {addons/Core => classes}/edit_area/reg_syntax/html.js (100%) rename {addons/Core => classes}/edit_area/reg_syntax/java.js (100%) rename {addons/Core => classes}/edit_area/reg_syntax/js.js (100%) rename {addons/Core => classes}/edit_area/reg_syntax/pas.js (100%) rename {addons/Core => classes}/edit_area/reg_syntax/perl.js (100%) rename {addons/Core => classes}/edit_area/reg_syntax/php.js (100%) rename {addons/Core => classes}/edit_area/reg_syntax/python.js (100%) rename {addons/Core => classes}/edit_area/reg_syntax/robotstxt.js (100%) rename {addons/Core => classes}/edit_area/reg_syntax/ruby.js (100%) rename {addons/Core => classes}/edit_area/reg_syntax/sql.js (100%) rename {addons/Core => classes}/edit_area/reg_syntax/tsql.js (100%) rename {addons/Core => classes}/edit_area/reg_syntax/vb.js (100%) rename {addons/Core => classes}/edit_area/reg_syntax/xml.js (100%) rename {addons/Core => classes}/edit_area/regexp.js (100%) rename {addons/Core => classes}/edit_area/resize_area.js (100%) rename {addons/Core => classes}/edit_area/search_replace.js (100%) rename {addons/Core => classes}/edit_area/template.html (100%) rename {addons/Core => classes}/layout_constructors/FloatedDivConstructor.js (100%) rename {addons/Core => classes}/layout_constructors/LayoutConstructorsTest.html (100%) rename {addons/Core => classes}/layout_constructors/TableLayoutConstructor.js (100%) rename {addons/Core => classes}/layout_constructors/testcase.js (100%) rename {addons/Core => classes}/layout_manager/LayoutEditor.js (100%) rename {addons/Core => classes}/layout_manager/index.html (100%) rename {addons/Core => classes}/layout_manager/prototype.js (100%) rename {addons/Core => classes}/partials/_comic-image-ordering-sorters.inc (100%) rename {addons/Core => classes}/partials/_comic-image-ordering.inc (100%) rename {addons/Core => classes}/partials/edit-partials.inc (100%) rename {addons/Core => classes}/partials/layout-editor.inc (100%) rename {addons/Core => classes}/partials/options-admin.inc (100%) rename {addons/BookmarkWidget => classes/widgets}/BookmarkWidget.inc (92%) diff --git a/classes/ComicPressAddon.inc b/classes/ComicPressAddon.inc index ab9e4c0..80aedfc 100644 --- a/classes/ComicPressAddon.inc +++ b/classes/ComicPressAddon.inc @@ -1,27 +1,6 @@ array(), - 'warn' => array(), - 'error' => array() - ); - - function info($message) { $this->messages['info'][] = $message; } - function warn($message) { $this->messages['warn'][] = $message; } - function error($message) { $this->messages['error'][] = $message; } - - function display_messages() { - foreach ($this->messages as $type => $messages) { - if (!empty($messages)) { - echo '
'; - foreach ($messages as $message) { - echo '

' . $message . '

'; - } - echo '
'; - } - } - } } ?> \ No newline at end of file diff --git a/addons/Core/Core.inc b/classes/ComicPressAdmin.inc similarity index 81% rename from addons/Core/Core.inc rename to classes/ComicPressAdmin.inc index d694244..5dc12aa 100644 --- a/addons/Core/Core.inc +++ b/classes/ComicPressAdmin.inc @@ -1,10 +1,6 @@ comicpress_options['helpers']['show_inline_comic_ordering'])) { add_filter('comicpress_attached_image', array(&$this, 'comicpress_attached_image'), 10, 3); @@ -34,6 +22,12 @@ class ComicPressAddonCore extends ComicPressAddon { 'rss' => __('RSS', 'comicpress'), 'archive' => __('Archive', 'comicpress') ); + + if (is_admin()) { + add_action('admin_notices', array(&$this, 'display_messages')); + } else { + add_action('wp_head', array(&$this, 'display_messages')); + } } function comicpress_attached_image($content, $attachment_id, $index) { @@ -66,40 +60,6 @@ class ComicPressAddonCore extends ComicPressAddon { return $content; } - /** - * Callback to send the reader to a random comic. - */ - function go_to_random_comic() { - $random_comic_query = new WP_Query(); - $random_comic_query->query('showposts=1&orderby=rand&cat=' . $this->comicpress->get_all_comic_categories_as_cat_string()); - while ($random_comic_query->have_posts()) { - $random_comic_query->the_post(); - $random_comic_id = get_the_ID(); - break; - } - if (!empty($random_comic_id)) { - wp_redirect(get_permalink( $random_comic_id )); - } - } - - /** - * Markup to insert a comic into the comic feed. - */ - function comic_feed() { ?> -

comic_feed() . $content; - } else { - return $content; - } - } - /** * Set up the admin interface and meta boxes. */ @@ -107,14 +67,14 @@ class ComicPressAddonCore extends ComicPressAddon { global $plugin_page, $pagenow, $post; add_theme_page(__("ComicPress", 'comicpress'), __('ComicPress', 'comicpress'), 'edit_themes', 'comicpress/render_admin', array(&$this, 'render_admin')); - + if (strpos($pagenow, "post") === 0) { add_meta_box("comic-image-ordering", __("Comic Image Ordering", 'comicpress'), array(&$this, 'render_comic_image_ordering'), "post", "normal", "low"); wp_enqueue_script('cp-ordering', get_stylesheet_directory_uri() . '/js/ComicImageOrdering.js', array('scriptaculous', 'scriptaculous-slider')); wp_enqueue_style('cp-admin', get_stylesheet_directory_uri() . '/css/cp-admin.css'); add_action('admin_footer', array(&$this, 'admin_footer')); } - + if ($plugin_page == 'comicpress/render_admin') { wp_enqueue_style('cp-admin', get_stylesheet_directory_uri() . '/css/cp-admin.css'); wp_enqueue_script('cp-admin', get_stylesheet_directory_uri() . '/js/Storyline.js', array('prototype', 'scriptaculous')); @@ -134,50 +94,6 @@ class ComicPressAddonCore extends ComicPressAddon { } comicpress->comicpress_options['comic_space']) { - case "comic_only": - $comic_post = new ComicPressComicPost($post_to_use, &$this->comicpress); - $comic_post->{$method}($format); - break; - case "post_content": - $t = $post; - $post = $post_to_use; - include_partial('index-blog-post'); - $post = $t; - break; - } - } - - /** - * Show a comic. - */ - function show_comic($override_post = null, $format = "%s
") { - $this->show_media($override_post, "display_comics", $format); - } - - /** - * Show an archive comic. - */ - function show_archive($override_post = null, $format = "%s
") { - $this->show_media($override_post, "display_archive", $format); - } - - /** - * Show an RSS comic. - */ - function show_rss($override_post = null, $format = "%s
") { - $this->show_media($override_post, "display_rss", $format); - } /** * Modify the Media Gallery for ComicPress use. @@ -491,24 +407,33 @@ class ComicPressAddonCore extends ComicPressAddon { /** * Handle an update. */ - function handle_update($info) { - if (isset($_POST['attachments'])) { - //coming from media editor - $this->handle_update_attachments(); - } else if (isset($info['action'])) { - $method = 'handle_update_' . strtolower(str_replace('-', '_', $info['action'])); - if (method_exists($this, $method)) { - $this->{$method}($info); + function handle_update() { + if (is_array($_REQUEST['cp'])) { + if (isset($_REQUEST['cp']['_nonce'])) { + if (wp_verify_nonce($_REQUEST['cp']['_nonce'], 'comicpress')) { + if (isset($_POST['attachments'])) { + //coming from media editor + $this->handle_update_attachments(); + } else if (isset($_REQUEST['cp']['action'])) { + $method = 'handle_update_' . strtolower(str_replace('-', '_', $_REQUEST['cp']['action'])); + if (method_exists($this, $method)) { + $this->{$method}($_REQUEST['cp']); + } + } else { + //coming from us + // clean this up O_o + $this->handle_update_comicpress_options($_REQUEST['cp']); + + $this->comicpress->save(); + + $this->info(__("ComicPress configuration updated.", 'comicpress')); + + $this->comicpress->init(); + } + + $this->comicpress->load(); + } } - } else { - //coming from us - $this->handle_update_comicpress_options($info); - - $this->comicpress->save(); - - $this->info(__("ComicPress configuration updated.", 'comicpress')); - - $this->comicpress->init(); } } @@ -522,6 +447,28 @@ class ComicPressAddonCore extends ComicPressAddon { } return implode("\n", $output); } + + var $messages = array( + 'info' => array(), + 'warn' => array(), + 'error' => array() + ); + + function info($message) { $this->messages['info'][] = $message; } + function warn($message) { $this->messages['warn'][] = $message; } + function error($message) { $this->messages['error'][] = $message; } + + function display_messages() { + foreach ($this->messages as $type => $messages) { + if (!empty($messages)) { + echo '
'; + foreach ($messages as $message) { + echo '

' . $message . '

'; + } + echo '
'; + } + } + } } -?> +?> \ No newline at end of file diff --git a/classes/ComicPressFilters.inc b/classes/ComicPressFilters.inc index 423f52d..95e019a 100644 --- a/classes/ComicPressFilters.inc +++ b/classes/ComicPressFilters.inc @@ -1,17 +1,83 @@ comicpress =& ComicPress::get_instance(); + + foreach (array( + 'comicpress_display_attached_images' => 3, + 'the_content' => 1, + 'show_media' => 3 + ) as $filter => $param_count) { + add_filter($filter, array(&$__comicpress_filters, $filter), 10, $param_count); + } + + } + function comicpress_display_attached_images($images, $post_id, $content) { return array($images, $post_id, implode("\n", $images)); } -} -$__comicpress_filters = new ComicPressFilters(); + /** + * Callback to send the reader to a random comic. + */ + function template_redirect() { + global $post; + if (get_query_var(apply_filters('comicpress_random_comic_string', 'randomcomic'))) { + $random_comic_query = new WP_Query(); + $random_comic_query->query('showposts=1&orderby=rand&cat=' . $this->comicpress->get_all_comic_categories_as_cat_string()); + while ($random_comic_query->have_posts()) { + $random_comic_query->the_post(); + break; + } + if (!empty($post)) { + wp_redirect(get_permalink($post->ID)); + } else { + wp_redirect(get_bloginfo('url')); + } + } + } -foreach (array( - 'comicpress_display_attached_images' => 3 -) as $filter => $param_count) { - add_filter($filter, array(&$__comicpress_filters, $filter), 10, $param_count); + /** + * Markup to insert a comic into the comic feed. + */ + function comic_feed() { ?> +

comic_feed() . $content; + } else { + return $content; + } + } + + /** + * Show comic media. + * @param object $override_post If not null, the post to use instead of the current Loop post. + * @param string $method The method to call on the comic post. + */ + function show_media($override_post, $method, $format) { + global $post; + $post_to_use = !empty($override_post) ? $override_post : $post; + + switch ($this->comicpress->comicpress_options['comic_space']) { + case "comic_only": + $comic_post = new ComicPressComicPost($post_to_use, &$this->comicpress); + $comic_post->{$method}($format); + break; + case "post_content": + $t = $post; + $post = $post_to_use; + include_partial('index-blog-post'); + $post = $t; + break; + } + } } ?> \ No newline at end of file diff --git a/addons/Core/edit_area/autocompletion.js b/classes/edit_area/autocompletion.js similarity index 100% rename from addons/Core/edit_area/autocompletion.js rename to classes/edit_area/autocompletion.js diff --git a/addons/Core/edit_area/edit_area.css b/classes/edit_area/edit_area.css similarity index 100% rename from addons/Core/edit_area/edit_area.css rename to classes/edit_area/edit_area.css diff --git a/addons/Core/edit_area/edit_area.js b/classes/edit_area/edit_area.js similarity index 100% rename from addons/Core/edit_area/edit_area.js rename to classes/edit_area/edit_area.js diff --git a/addons/Core/edit_area/edit_area_compressor.php b/classes/edit_area/edit_area_compressor.php similarity index 100% rename from addons/Core/edit_area/edit_area_compressor.php rename to classes/edit_area/edit_area_compressor.php diff --git a/addons/Core/edit_area/edit_area_full.gz b/classes/edit_area/edit_area_full.gz similarity index 100% rename from addons/Core/edit_area/edit_area_full.gz rename to classes/edit_area/edit_area_full.gz diff --git a/addons/Core/edit_area/edit_area_full.js b/classes/edit_area/edit_area_full.js similarity index 100% rename from addons/Core/edit_area/edit_area_full.js rename to classes/edit_area/edit_area_full.js diff --git a/addons/Core/edit_area/edit_area_full_with_plugins.gz b/classes/edit_area/edit_area_full_with_plugins.gz similarity index 100% rename from addons/Core/edit_area/edit_area_full_with_plugins.gz rename to classes/edit_area/edit_area_full_with_plugins.gz diff --git a/addons/Core/edit_area/edit_area_full_with_plugins.js b/classes/edit_area/edit_area_full_with_plugins.js similarity index 100% rename from addons/Core/edit_area/edit_area_full_with_plugins.js rename to classes/edit_area/edit_area_full_with_plugins.js diff --git a/addons/Core/edit_area/edit_area_functions.js b/classes/edit_area/edit_area_functions.js similarity index 100% rename from addons/Core/edit_area/edit_area_functions.js rename to classes/edit_area/edit_area_functions.js diff --git a/addons/Core/edit_area/edit_area_loader.js b/classes/edit_area/edit_area_loader.js similarity index 100% rename from addons/Core/edit_area/edit_area_loader.js rename to classes/edit_area/edit_area_loader.js diff --git a/addons/Core/edit_area/elements_functions.js b/classes/edit_area/elements_functions.js similarity index 100% rename from addons/Core/edit_area/elements_functions.js rename to classes/edit_area/elements_functions.js diff --git a/addons/Core/edit_area/highlight.js b/classes/edit_area/highlight.js similarity index 100% rename from addons/Core/edit_area/highlight.js rename to classes/edit_area/highlight.js diff --git a/addons/Core/edit_area/images/autocompletion.gif b/classes/edit_area/images/autocompletion.gif similarity index 100% rename from addons/Core/edit_area/images/autocompletion.gif rename to classes/edit_area/images/autocompletion.gif diff --git a/addons/Core/edit_area/images/close.gif b/classes/edit_area/images/close.gif similarity index 100% rename from addons/Core/edit_area/images/close.gif rename to classes/edit_area/images/close.gif diff --git a/addons/Core/edit_area/images/fullscreen.gif b/classes/edit_area/images/fullscreen.gif similarity index 100% rename from addons/Core/edit_area/images/fullscreen.gif rename to classes/edit_area/images/fullscreen.gif diff --git a/addons/Core/edit_area/images/go_to_line.gif b/classes/edit_area/images/go_to_line.gif similarity index 100% rename from addons/Core/edit_area/images/go_to_line.gif rename to classes/edit_area/images/go_to_line.gif diff --git a/addons/Core/edit_area/images/help.gif b/classes/edit_area/images/help.gif similarity index 100% rename from addons/Core/edit_area/images/help.gif rename to classes/edit_area/images/help.gif diff --git a/addons/Core/edit_area/images/highlight.gif b/classes/edit_area/images/highlight.gif similarity index 100% rename from addons/Core/edit_area/images/highlight.gif rename to classes/edit_area/images/highlight.gif diff --git a/addons/Core/edit_area/images/load.gif b/classes/edit_area/images/load.gif similarity index 100% rename from addons/Core/edit_area/images/load.gif rename to classes/edit_area/images/load.gif diff --git a/addons/Core/edit_area/images/move.gif b/classes/edit_area/images/move.gif similarity index 100% rename from addons/Core/edit_area/images/move.gif rename to classes/edit_area/images/move.gif diff --git a/addons/Core/edit_area/images/newdocument.gif b/classes/edit_area/images/newdocument.gif similarity index 100% rename from addons/Core/edit_area/images/newdocument.gif rename to classes/edit_area/images/newdocument.gif diff --git a/addons/Core/edit_area/images/opacity.png b/classes/edit_area/images/opacity.png similarity index 100% rename from addons/Core/edit_area/images/opacity.png rename to classes/edit_area/images/opacity.png diff --git a/addons/Core/edit_area/images/processing.gif b/classes/edit_area/images/processing.gif similarity index 100% rename from addons/Core/edit_area/images/processing.gif rename to classes/edit_area/images/processing.gif diff --git a/addons/Core/edit_area/images/redo.gif b/classes/edit_area/images/redo.gif similarity index 100% rename from addons/Core/edit_area/images/redo.gif rename to classes/edit_area/images/redo.gif diff --git a/addons/Core/edit_area/images/reset_highlight.gif b/classes/edit_area/images/reset_highlight.gif similarity index 100% rename from addons/Core/edit_area/images/reset_highlight.gif rename to classes/edit_area/images/reset_highlight.gif diff --git a/addons/Core/edit_area/images/save.gif b/classes/edit_area/images/save.gif similarity index 100% rename from addons/Core/edit_area/images/save.gif rename to classes/edit_area/images/save.gif diff --git a/addons/Core/edit_area/images/search.gif b/classes/edit_area/images/search.gif similarity index 100% rename from addons/Core/edit_area/images/search.gif rename to classes/edit_area/images/search.gif diff --git a/addons/Core/edit_area/images/smooth_selection.gif b/classes/edit_area/images/smooth_selection.gif similarity index 100% rename from addons/Core/edit_area/images/smooth_selection.gif rename to classes/edit_area/images/smooth_selection.gif diff --git a/addons/Core/edit_area/images/spacer.gif b/classes/edit_area/images/spacer.gif similarity index 100% rename from addons/Core/edit_area/images/spacer.gif rename to classes/edit_area/images/spacer.gif diff --git a/addons/Core/edit_area/images/statusbar_resize.gif b/classes/edit_area/images/statusbar_resize.gif similarity index 100% rename from addons/Core/edit_area/images/statusbar_resize.gif rename to classes/edit_area/images/statusbar_resize.gif diff --git a/addons/Core/edit_area/images/undo.gif b/classes/edit_area/images/undo.gif similarity index 100% rename from addons/Core/edit_area/images/undo.gif rename to classes/edit_area/images/undo.gif diff --git a/addons/Core/edit_area/images/word_wrap.gif b/classes/edit_area/images/word_wrap.gif similarity index 100% rename from addons/Core/edit_area/images/word_wrap.gif rename to classes/edit_area/images/word_wrap.gif diff --git a/addons/Core/edit_area/keyboard.js b/classes/edit_area/keyboard.js similarity index 100% rename from addons/Core/edit_area/keyboard.js rename to classes/edit_area/keyboard.js diff --git a/addons/Core/edit_area/langs/bg.js b/classes/edit_area/langs/bg.js similarity index 100% rename from addons/Core/edit_area/langs/bg.js rename to classes/edit_area/langs/bg.js diff --git a/addons/Core/edit_area/langs/cs.js b/classes/edit_area/langs/cs.js similarity index 100% rename from addons/Core/edit_area/langs/cs.js rename to classes/edit_area/langs/cs.js diff --git a/addons/Core/edit_area/langs/de.js b/classes/edit_area/langs/de.js similarity index 100% rename from addons/Core/edit_area/langs/de.js rename to classes/edit_area/langs/de.js diff --git a/addons/Core/edit_area/langs/dk.js b/classes/edit_area/langs/dk.js similarity index 100% rename from addons/Core/edit_area/langs/dk.js rename to classes/edit_area/langs/dk.js diff --git a/addons/Core/edit_area/langs/en.js b/classes/edit_area/langs/en.js similarity index 100% rename from addons/Core/edit_area/langs/en.js rename to classes/edit_area/langs/en.js diff --git a/addons/Core/edit_area/langs/eo.js b/classes/edit_area/langs/eo.js similarity index 100% rename from addons/Core/edit_area/langs/eo.js rename to classes/edit_area/langs/eo.js diff --git a/addons/Core/edit_area/langs/es.js b/classes/edit_area/langs/es.js similarity index 100% rename from addons/Core/edit_area/langs/es.js rename to classes/edit_area/langs/es.js diff --git a/addons/Core/edit_area/langs/fi.js b/classes/edit_area/langs/fi.js similarity index 100% rename from addons/Core/edit_area/langs/fi.js rename to classes/edit_area/langs/fi.js diff --git a/addons/Core/edit_area/langs/fr.js b/classes/edit_area/langs/fr.js similarity index 100% rename from addons/Core/edit_area/langs/fr.js rename to classes/edit_area/langs/fr.js diff --git a/addons/Core/edit_area/langs/hr.js b/classes/edit_area/langs/hr.js similarity index 100% rename from addons/Core/edit_area/langs/hr.js rename to classes/edit_area/langs/hr.js diff --git a/addons/Core/edit_area/langs/it.js b/classes/edit_area/langs/it.js similarity index 100% rename from addons/Core/edit_area/langs/it.js rename to classes/edit_area/langs/it.js diff --git a/addons/Core/edit_area/langs/ja.js b/classes/edit_area/langs/ja.js similarity index 100% rename from addons/Core/edit_area/langs/ja.js rename to classes/edit_area/langs/ja.js diff --git a/addons/Core/edit_area/langs/mk.js b/classes/edit_area/langs/mk.js similarity index 100% rename from addons/Core/edit_area/langs/mk.js rename to classes/edit_area/langs/mk.js diff --git a/addons/Core/edit_area/langs/nl.js b/classes/edit_area/langs/nl.js similarity index 100% rename from addons/Core/edit_area/langs/nl.js rename to classes/edit_area/langs/nl.js diff --git a/addons/Core/edit_area/langs/pl.js b/classes/edit_area/langs/pl.js similarity index 100% rename from addons/Core/edit_area/langs/pl.js rename to classes/edit_area/langs/pl.js diff --git a/addons/Core/edit_area/langs/pt.js b/classes/edit_area/langs/pt.js similarity index 100% rename from addons/Core/edit_area/langs/pt.js rename to classes/edit_area/langs/pt.js diff --git a/addons/Core/edit_area/langs/ru.js b/classes/edit_area/langs/ru.js similarity index 100% rename from addons/Core/edit_area/langs/ru.js rename to classes/edit_area/langs/ru.js diff --git a/addons/Core/edit_area/langs/sk.js b/classes/edit_area/langs/sk.js similarity index 100% rename from addons/Core/edit_area/langs/sk.js rename to classes/edit_area/langs/sk.js diff --git a/addons/Core/edit_area/langs/zh.js b/classes/edit_area/langs/zh.js similarity index 100% rename from addons/Core/edit_area/langs/zh.js rename to classes/edit_area/langs/zh.js diff --git a/addons/Core/edit_area/license_apache.txt b/classes/edit_area/license_apache.txt similarity index 100% rename from addons/Core/edit_area/license_apache.txt rename to classes/edit_area/license_apache.txt diff --git a/addons/Core/edit_area/license_bsd.txt b/classes/edit_area/license_bsd.txt similarity index 100% rename from addons/Core/edit_area/license_bsd.txt rename to classes/edit_area/license_bsd.txt diff --git a/addons/Core/edit_area/license_lgpl.txt b/classes/edit_area/license_lgpl.txt similarity index 100% rename from addons/Core/edit_area/license_lgpl.txt rename to classes/edit_area/license_lgpl.txt diff --git a/addons/Core/edit_area/manage_area.js b/classes/edit_area/manage_area.js similarity index 100% rename from addons/Core/edit_area/manage_area.js rename to classes/edit_area/manage_area.js diff --git a/addons/Core/edit_area/plugins/charmap/charmap.js b/classes/edit_area/plugins/charmap/charmap.js similarity index 100% rename from addons/Core/edit_area/plugins/charmap/charmap.js rename to classes/edit_area/plugins/charmap/charmap.js diff --git a/addons/Core/edit_area/plugins/charmap/css/charmap.css b/classes/edit_area/plugins/charmap/css/charmap.css similarity index 100% rename from addons/Core/edit_area/plugins/charmap/css/charmap.css rename to classes/edit_area/plugins/charmap/css/charmap.css diff --git a/addons/Core/edit_area/plugins/charmap/images/charmap.gif b/classes/edit_area/plugins/charmap/images/charmap.gif similarity index 100% rename from addons/Core/edit_area/plugins/charmap/images/charmap.gif rename to classes/edit_area/plugins/charmap/images/charmap.gif diff --git a/addons/Core/edit_area/plugins/charmap/jscripts/map.js b/classes/edit_area/plugins/charmap/jscripts/map.js similarity index 100% rename from addons/Core/edit_area/plugins/charmap/jscripts/map.js rename to classes/edit_area/plugins/charmap/jscripts/map.js diff --git a/addons/Core/edit_area/plugins/charmap/langs/bg.js b/classes/edit_area/plugins/charmap/langs/bg.js similarity index 100% rename from addons/Core/edit_area/plugins/charmap/langs/bg.js rename to classes/edit_area/plugins/charmap/langs/bg.js diff --git a/addons/Core/edit_area/plugins/charmap/langs/cs.js b/classes/edit_area/plugins/charmap/langs/cs.js similarity index 100% rename from addons/Core/edit_area/plugins/charmap/langs/cs.js rename to classes/edit_area/plugins/charmap/langs/cs.js diff --git a/addons/Core/edit_area/plugins/charmap/langs/de.js b/classes/edit_area/plugins/charmap/langs/de.js similarity index 100% rename from addons/Core/edit_area/plugins/charmap/langs/de.js rename to classes/edit_area/plugins/charmap/langs/de.js diff --git a/addons/Core/edit_area/plugins/charmap/langs/dk.js b/classes/edit_area/plugins/charmap/langs/dk.js similarity index 100% rename from addons/Core/edit_area/plugins/charmap/langs/dk.js rename to classes/edit_area/plugins/charmap/langs/dk.js diff --git a/addons/Core/edit_area/plugins/charmap/langs/en.js b/classes/edit_area/plugins/charmap/langs/en.js similarity index 100% rename from addons/Core/edit_area/plugins/charmap/langs/en.js rename to classes/edit_area/plugins/charmap/langs/en.js diff --git a/addons/Core/edit_area/plugins/charmap/langs/eo.js b/classes/edit_area/plugins/charmap/langs/eo.js similarity index 100% rename from addons/Core/edit_area/plugins/charmap/langs/eo.js rename to classes/edit_area/plugins/charmap/langs/eo.js diff --git a/addons/Core/edit_area/plugins/charmap/langs/es.js b/classes/edit_area/plugins/charmap/langs/es.js similarity index 100% rename from addons/Core/edit_area/plugins/charmap/langs/es.js rename to classes/edit_area/plugins/charmap/langs/es.js diff --git a/addons/Core/edit_area/plugins/charmap/langs/fr.js b/classes/edit_area/plugins/charmap/langs/fr.js similarity index 100% rename from addons/Core/edit_area/plugins/charmap/langs/fr.js rename to classes/edit_area/plugins/charmap/langs/fr.js diff --git a/addons/Core/edit_area/plugins/charmap/langs/hr.js b/classes/edit_area/plugins/charmap/langs/hr.js similarity index 100% rename from addons/Core/edit_area/plugins/charmap/langs/hr.js rename to classes/edit_area/plugins/charmap/langs/hr.js diff --git a/addons/Core/edit_area/plugins/charmap/langs/it.js b/classes/edit_area/plugins/charmap/langs/it.js similarity index 100% rename from addons/Core/edit_area/plugins/charmap/langs/it.js rename to classes/edit_area/plugins/charmap/langs/it.js diff --git a/addons/Core/edit_area/plugins/charmap/langs/ja.js b/classes/edit_area/plugins/charmap/langs/ja.js similarity index 100% rename from addons/Core/edit_area/plugins/charmap/langs/ja.js rename to classes/edit_area/plugins/charmap/langs/ja.js diff --git a/addons/Core/edit_area/plugins/charmap/langs/mk.js b/classes/edit_area/plugins/charmap/langs/mk.js similarity index 100% rename from addons/Core/edit_area/plugins/charmap/langs/mk.js rename to classes/edit_area/plugins/charmap/langs/mk.js diff --git a/addons/Core/edit_area/plugins/charmap/langs/nl.js b/classes/edit_area/plugins/charmap/langs/nl.js similarity index 100% rename from addons/Core/edit_area/plugins/charmap/langs/nl.js rename to classes/edit_area/plugins/charmap/langs/nl.js diff --git a/addons/Core/edit_area/plugins/charmap/langs/pl.js b/classes/edit_area/plugins/charmap/langs/pl.js similarity index 100% rename from addons/Core/edit_area/plugins/charmap/langs/pl.js rename to classes/edit_area/plugins/charmap/langs/pl.js diff --git a/addons/Core/edit_area/plugins/charmap/langs/pt.js b/classes/edit_area/plugins/charmap/langs/pt.js similarity index 100% rename from addons/Core/edit_area/plugins/charmap/langs/pt.js rename to classes/edit_area/plugins/charmap/langs/pt.js diff --git a/addons/Core/edit_area/plugins/charmap/langs/ru.js b/classes/edit_area/plugins/charmap/langs/ru.js similarity index 100% rename from addons/Core/edit_area/plugins/charmap/langs/ru.js rename to classes/edit_area/plugins/charmap/langs/ru.js diff --git a/addons/Core/edit_area/plugins/charmap/langs/sk.js b/classes/edit_area/plugins/charmap/langs/sk.js similarity index 100% rename from addons/Core/edit_area/plugins/charmap/langs/sk.js rename to classes/edit_area/plugins/charmap/langs/sk.js diff --git a/addons/Core/edit_area/plugins/charmap/langs/zh.js b/classes/edit_area/plugins/charmap/langs/zh.js similarity index 100% rename from addons/Core/edit_area/plugins/charmap/langs/zh.js rename to classes/edit_area/plugins/charmap/langs/zh.js diff --git a/addons/Core/edit_area/plugins/charmap/popup.html b/classes/edit_area/plugins/charmap/popup.html similarity index 100% rename from addons/Core/edit_area/plugins/charmap/popup.html rename to classes/edit_area/plugins/charmap/popup.html diff --git a/addons/Core/edit_area/plugins/test/css/test.css b/classes/edit_area/plugins/test/css/test.css similarity index 100% rename from addons/Core/edit_area/plugins/test/css/test.css rename to classes/edit_area/plugins/test/css/test.css diff --git a/addons/Core/edit_area/plugins/test/images/Thumbs.db b/classes/edit_area/plugins/test/images/Thumbs.db similarity index 100% rename from addons/Core/edit_area/plugins/test/images/Thumbs.db rename to classes/edit_area/plugins/test/images/Thumbs.db diff --git a/addons/Core/edit_area/plugins/test/images/test.gif b/classes/edit_area/plugins/test/images/test.gif similarity index 100% rename from addons/Core/edit_area/plugins/test/images/test.gif rename to classes/edit_area/plugins/test/images/test.gif diff --git a/addons/Core/edit_area/plugins/test/langs/bg.js b/classes/edit_area/plugins/test/langs/bg.js similarity index 100% rename from addons/Core/edit_area/plugins/test/langs/bg.js rename to classes/edit_area/plugins/test/langs/bg.js diff --git a/addons/Core/edit_area/plugins/test/langs/cs.js b/classes/edit_area/plugins/test/langs/cs.js similarity index 100% rename from addons/Core/edit_area/plugins/test/langs/cs.js rename to classes/edit_area/plugins/test/langs/cs.js diff --git a/addons/Core/edit_area/plugins/test/langs/de.js b/classes/edit_area/plugins/test/langs/de.js similarity index 100% rename from addons/Core/edit_area/plugins/test/langs/de.js rename to classes/edit_area/plugins/test/langs/de.js diff --git a/addons/Core/edit_area/plugins/test/langs/dk.js b/classes/edit_area/plugins/test/langs/dk.js similarity index 100% rename from addons/Core/edit_area/plugins/test/langs/dk.js rename to classes/edit_area/plugins/test/langs/dk.js diff --git a/addons/Core/edit_area/plugins/test/langs/en.js b/classes/edit_area/plugins/test/langs/en.js similarity index 100% rename from addons/Core/edit_area/plugins/test/langs/en.js rename to classes/edit_area/plugins/test/langs/en.js diff --git a/addons/Core/edit_area/plugins/test/langs/eo.js b/classes/edit_area/plugins/test/langs/eo.js similarity index 100% rename from addons/Core/edit_area/plugins/test/langs/eo.js rename to classes/edit_area/plugins/test/langs/eo.js diff --git a/addons/Core/edit_area/plugins/test/langs/es.js b/classes/edit_area/plugins/test/langs/es.js similarity index 100% rename from addons/Core/edit_area/plugins/test/langs/es.js rename to classes/edit_area/plugins/test/langs/es.js diff --git a/addons/Core/edit_area/plugins/test/langs/fr.js b/classes/edit_area/plugins/test/langs/fr.js similarity index 100% rename from addons/Core/edit_area/plugins/test/langs/fr.js rename to classes/edit_area/plugins/test/langs/fr.js diff --git a/addons/Core/edit_area/plugins/test/langs/hr.js b/classes/edit_area/plugins/test/langs/hr.js similarity index 100% rename from addons/Core/edit_area/plugins/test/langs/hr.js rename to classes/edit_area/plugins/test/langs/hr.js diff --git a/addons/Core/edit_area/plugins/test/langs/it.js b/classes/edit_area/plugins/test/langs/it.js similarity index 100% rename from addons/Core/edit_area/plugins/test/langs/it.js rename to classes/edit_area/plugins/test/langs/it.js diff --git a/addons/Core/edit_area/plugins/test/langs/ja.js b/classes/edit_area/plugins/test/langs/ja.js similarity index 100% rename from addons/Core/edit_area/plugins/test/langs/ja.js rename to classes/edit_area/plugins/test/langs/ja.js diff --git a/addons/Core/edit_area/plugins/test/langs/mk.js b/classes/edit_area/plugins/test/langs/mk.js similarity index 100% rename from addons/Core/edit_area/plugins/test/langs/mk.js rename to classes/edit_area/plugins/test/langs/mk.js diff --git a/addons/Core/edit_area/plugins/test/langs/nl.js b/classes/edit_area/plugins/test/langs/nl.js similarity index 100% rename from addons/Core/edit_area/plugins/test/langs/nl.js rename to classes/edit_area/plugins/test/langs/nl.js diff --git a/addons/Core/edit_area/plugins/test/langs/pl.js b/classes/edit_area/plugins/test/langs/pl.js similarity index 100% rename from addons/Core/edit_area/plugins/test/langs/pl.js rename to classes/edit_area/plugins/test/langs/pl.js diff --git a/addons/Core/edit_area/plugins/test/langs/pt.js b/classes/edit_area/plugins/test/langs/pt.js similarity index 100% rename from addons/Core/edit_area/plugins/test/langs/pt.js rename to classes/edit_area/plugins/test/langs/pt.js diff --git a/addons/Core/edit_area/plugins/test/langs/ru.js b/classes/edit_area/plugins/test/langs/ru.js similarity index 100% rename from addons/Core/edit_area/plugins/test/langs/ru.js rename to classes/edit_area/plugins/test/langs/ru.js diff --git a/addons/Core/edit_area/plugins/test/langs/sk.js b/classes/edit_area/plugins/test/langs/sk.js similarity index 100% rename from addons/Core/edit_area/plugins/test/langs/sk.js rename to classes/edit_area/plugins/test/langs/sk.js diff --git a/addons/Core/edit_area/plugins/test/langs/zh.js b/classes/edit_area/plugins/test/langs/zh.js similarity index 100% rename from addons/Core/edit_area/plugins/test/langs/zh.js rename to classes/edit_area/plugins/test/langs/zh.js diff --git a/addons/Core/edit_area/plugins/test/test.js b/classes/edit_area/plugins/test/test.js similarity index 100% rename from addons/Core/edit_area/plugins/test/test.js rename to classes/edit_area/plugins/test/test.js diff --git a/addons/Core/edit_area/plugins/test/test2.js b/classes/edit_area/plugins/test/test2.js similarity index 100% rename from addons/Core/edit_area/plugins/test/test2.js rename to classes/edit_area/plugins/test/test2.js diff --git a/addons/Core/edit_area/reg_syntax.js b/classes/edit_area/reg_syntax.js similarity index 100% rename from addons/Core/edit_area/reg_syntax.js rename to classes/edit_area/reg_syntax.js diff --git a/addons/Core/edit_area/reg_syntax/basic.js b/classes/edit_area/reg_syntax/basic.js similarity index 100% rename from addons/Core/edit_area/reg_syntax/basic.js rename to classes/edit_area/reg_syntax/basic.js diff --git a/addons/Core/edit_area/reg_syntax/brainfuck.js b/classes/edit_area/reg_syntax/brainfuck.js similarity index 100% rename from addons/Core/edit_area/reg_syntax/brainfuck.js rename to classes/edit_area/reg_syntax/brainfuck.js diff --git a/addons/Core/edit_area/reg_syntax/c.js b/classes/edit_area/reg_syntax/c.js similarity index 100% rename from addons/Core/edit_area/reg_syntax/c.js rename to classes/edit_area/reg_syntax/c.js diff --git a/addons/Core/edit_area/reg_syntax/coldfusion.js b/classes/edit_area/reg_syntax/coldfusion.js similarity index 100% rename from addons/Core/edit_area/reg_syntax/coldfusion.js rename to classes/edit_area/reg_syntax/coldfusion.js diff --git a/addons/Core/edit_area/reg_syntax/cpp.js b/classes/edit_area/reg_syntax/cpp.js similarity index 100% rename from addons/Core/edit_area/reg_syntax/cpp.js rename to classes/edit_area/reg_syntax/cpp.js diff --git a/addons/Core/edit_area/reg_syntax/css.js b/classes/edit_area/reg_syntax/css.js similarity index 100% rename from addons/Core/edit_area/reg_syntax/css.js rename to classes/edit_area/reg_syntax/css.js diff --git a/addons/Core/edit_area/reg_syntax/html.js b/classes/edit_area/reg_syntax/html.js similarity index 100% rename from addons/Core/edit_area/reg_syntax/html.js rename to classes/edit_area/reg_syntax/html.js diff --git a/addons/Core/edit_area/reg_syntax/java.js b/classes/edit_area/reg_syntax/java.js similarity index 100% rename from addons/Core/edit_area/reg_syntax/java.js rename to classes/edit_area/reg_syntax/java.js diff --git a/addons/Core/edit_area/reg_syntax/js.js b/classes/edit_area/reg_syntax/js.js similarity index 100% rename from addons/Core/edit_area/reg_syntax/js.js rename to classes/edit_area/reg_syntax/js.js diff --git a/addons/Core/edit_area/reg_syntax/pas.js b/classes/edit_area/reg_syntax/pas.js similarity index 100% rename from addons/Core/edit_area/reg_syntax/pas.js rename to classes/edit_area/reg_syntax/pas.js diff --git a/addons/Core/edit_area/reg_syntax/perl.js b/classes/edit_area/reg_syntax/perl.js similarity index 100% rename from addons/Core/edit_area/reg_syntax/perl.js rename to classes/edit_area/reg_syntax/perl.js diff --git a/addons/Core/edit_area/reg_syntax/php.js b/classes/edit_area/reg_syntax/php.js similarity index 100% rename from addons/Core/edit_area/reg_syntax/php.js rename to classes/edit_area/reg_syntax/php.js diff --git a/addons/Core/edit_area/reg_syntax/python.js b/classes/edit_area/reg_syntax/python.js similarity index 100% rename from addons/Core/edit_area/reg_syntax/python.js rename to classes/edit_area/reg_syntax/python.js diff --git a/addons/Core/edit_area/reg_syntax/robotstxt.js b/classes/edit_area/reg_syntax/robotstxt.js similarity index 100% rename from addons/Core/edit_area/reg_syntax/robotstxt.js rename to classes/edit_area/reg_syntax/robotstxt.js diff --git a/addons/Core/edit_area/reg_syntax/ruby.js b/classes/edit_area/reg_syntax/ruby.js similarity index 100% rename from addons/Core/edit_area/reg_syntax/ruby.js rename to classes/edit_area/reg_syntax/ruby.js diff --git a/addons/Core/edit_area/reg_syntax/sql.js b/classes/edit_area/reg_syntax/sql.js similarity index 100% rename from addons/Core/edit_area/reg_syntax/sql.js rename to classes/edit_area/reg_syntax/sql.js diff --git a/addons/Core/edit_area/reg_syntax/tsql.js b/classes/edit_area/reg_syntax/tsql.js similarity index 100% rename from addons/Core/edit_area/reg_syntax/tsql.js rename to classes/edit_area/reg_syntax/tsql.js diff --git a/addons/Core/edit_area/reg_syntax/vb.js b/classes/edit_area/reg_syntax/vb.js similarity index 100% rename from addons/Core/edit_area/reg_syntax/vb.js rename to classes/edit_area/reg_syntax/vb.js diff --git a/addons/Core/edit_area/reg_syntax/xml.js b/classes/edit_area/reg_syntax/xml.js similarity index 100% rename from addons/Core/edit_area/reg_syntax/xml.js rename to classes/edit_area/reg_syntax/xml.js diff --git a/addons/Core/edit_area/regexp.js b/classes/edit_area/regexp.js similarity index 100% rename from addons/Core/edit_area/regexp.js rename to classes/edit_area/regexp.js diff --git a/addons/Core/edit_area/resize_area.js b/classes/edit_area/resize_area.js similarity index 100% rename from addons/Core/edit_area/resize_area.js rename to classes/edit_area/resize_area.js diff --git a/addons/Core/edit_area/search_replace.js b/classes/edit_area/search_replace.js similarity index 100% rename from addons/Core/edit_area/search_replace.js rename to classes/edit_area/search_replace.js diff --git a/addons/Core/edit_area/template.html b/classes/edit_area/template.html similarity index 100% rename from addons/Core/edit_area/template.html rename to classes/edit_area/template.html diff --git a/addons/Core/layout_constructors/FloatedDivConstructor.js b/classes/layout_constructors/FloatedDivConstructor.js similarity index 100% rename from addons/Core/layout_constructors/FloatedDivConstructor.js rename to classes/layout_constructors/FloatedDivConstructor.js diff --git a/addons/Core/layout_constructors/LayoutConstructorsTest.html b/classes/layout_constructors/LayoutConstructorsTest.html similarity index 100% rename from addons/Core/layout_constructors/LayoutConstructorsTest.html rename to classes/layout_constructors/LayoutConstructorsTest.html diff --git a/addons/Core/layout_constructors/TableLayoutConstructor.js b/classes/layout_constructors/TableLayoutConstructor.js similarity index 100% rename from addons/Core/layout_constructors/TableLayoutConstructor.js rename to classes/layout_constructors/TableLayoutConstructor.js diff --git a/addons/Core/layout_constructors/testcase.js b/classes/layout_constructors/testcase.js similarity index 100% rename from addons/Core/layout_constructors/testcase.js rename to classes/layout_constructors/testcase.js diff --git a/addons/Core/layout_manager/LayoutEditor.js b/classes/layout_manager/LayoutEditor.js similarity index 100% rename from addons/Core/layout_manager/LayoutEditor.js rename to classes/layout_manager/LayoutEditor.js diff --git a/addons/Core/layout_manager/index.html b/classes/layout_manager/index.html similarity index 100% rename from addons/Core/layout_manager/index.html rename to classes/layout_manager/index.html diff --git a/addons/Core/layout_manager/prototype.js b/classes/layout_manager/prototype.js similarity index 100% rename from addons/Core/layout_manager/prototype.js rename to classes/layout_manager/prototype.js diff --git a/addons/Core/partials/_comic-image-ordering-sorters.inc b/classes/partials/_comic-image-ordering-sorters.inc similarity index 100% rename from addons/Core/partials/_comic-image-ordering-sorters.inc rename to classes/partials/_comic-image-ordering-sorters.inc diff --git a/addons/Core/partials/_comic-image-ordering.inc b/classes/partials/_comic-image-ordering.inc similarity index 100% rename from addons/Core/partials/_comic-image-ordering.inc rename to classes/partials/_comic-image-ordering.inc diff --git a/addons/Core/partials/edit-partials.inc b/classes/partials/edit-partials.inc similarity index 100% rename from addons/Core/partials/edit-partials.inc rename to classes/partials/edit-partials.inc diff --git a/addons/Core/partials/layout-editor.inc b/classes/partials/layout-editor.inc similarity index 100% rename from addons/Core/partials/layout-editor.inc rename to classes/partials/layout-editor.inc diff --git a/addons/Core/partials/options-admin.inc b/classes/partials/options-admin.inc similarity index 100% rename from addons/Core/partials/options-admin.inc rename to classes/partials/options-admin.inc diff --git a/addons/BookmarkWidget/BookmarkWidget.inc b/classes/widgets/BookmarkWidget.inc similarity index 92% rename from addons/BookmarkWidget/BookmarkWidget.inc rename to classes/widgets/BookmarkWidget.inc index 700f6a0..bc6415e 100644 --- a/addons/BookmarkWidget/BookmarkWidget.inc +++ b/classes/widgets/BookmarkWidget.inc @@ -1,8 +1,6 @@ __('Let your readers save their place via a cookie.', 'comicpress'))); diff --git a/functions.php b/functions.php index 86baa9b..88721c8 100644 --- a/functions.php +++ b/functions.php @@ -17,61 +17,22 @@ function __comicpress_init() { foreach ($classes_search as $path) { foreach (glob(dirname(__FILE__) . $path . '*.inc') as $file) { - if (is_file($file)) { require_once($file); } + if (is_file($file)) { + require_once($file); + } } } $comicpress = ComicPress::get_instance(); $comicpress->init(); - $addons = array(); - - if (is_dir($addons_dir = (dirname(__FILE__) . '/addons'))) { - $entries = glob($addons_dir . '/*'); - if (is_array($entries)) { - foreach ($entries as $entry) { - if (is_dir($entry)) { - $classname = basename($entry); - if (file_exists($entry . "/${classname}.inc")) { - require_once($entry . "/${classname}.inc"); - $classname = "ComicPressAddon${classname}"; - if (class_exists($classname)) { - $addon =& new $classname(); - if ( - $comicpress->comicpress_options['addons'][$addon->name] || - $addon->is_addon_manager - ) { - $addon->init(); - if (current_user_can('edit_posts')) { - if (is_array($_REQUEST['cp'])) { - if (isset($_REQUEST['cp']['_nonce'])) { - if (wp_verify_nonce($_REQUEST['cp']['_nonce'], 'comicpress')) { - if (method_exists($addon, 'handle_update')) { - $addon->handle_update($_REQUEST['cp']); - $comicpress->load(); - } - } - } - } - if (is_admin()) { - add_action('admin_notices', array(&$addon, 'display_messages')); - } else { - add_action('wp_head', array(&$addon, 'display_messages')); - } - } - } - $addons[] = $addon; - } - } - } - } - } - } - - foreach ($addons as $addon) { - if ($addon->is_addon_manager) { $addon->all_addons =& $addons; break; } - } - + $comicpress_admin = new ComicPressAdmin(); + $comicpress_admin->init(); + $comicpress_admin->handle_update(); + + $comicpress_filters = new ComicPressFilters(); + $comicpress_filters->init(); + $layouts = $comicpress->get_layout_choices(); if (isset($layouts[$comicpress->comicpress_options['layout']])) { if (isset($layouts[$comicpress->comicpress_options['layout']]['Sidebars'])) {