diff options
author | Bharat Mediratta <bharat@menalto.com> | 2009-01-11 02:27:00 +0000 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2009-01-11 02:27:00 +0000 |
commit | 01666c5579b3de40981d9a06a627166e3bddedf6 (patch) | |
tree | 2621b656b07de422be1a7c014a9019ab84fa4bc6 | |
parent | afb90768b4c61ad7c0fd10dd04bf9bfe9458d4af (diff) |
Fix all file structure issues (tabs, bad preambles, etc).
Note: installer/install.php is now on the "direct access" list.
-rw-r--r-- | core/tests/File_Structure_Test.php | 5 | ||||
-rw-r--r-- | core/views/admin_themes_preview.html.php | 1 | ||||
-rw-r--r-- | installer/install.php | 3 | ||||
-rw-r--r-- | installer/views/installer.html.php | 14 | ||||
-rw-r--r-- | installer/views/installer.txt.php | 7 | ||||
-rw-r--r-- | modules/comment/views/admin_comments.html.php | 85 |
6 files changed, 58 insertions, 57 deletions
diff --git a/core/tests/File_Structure_Test.php b/core/tests/File_Structure_Test.php index 0779dea7..c1160b57 100644 --- a/core/tests/File_Structure_Test.php +++ b/core/tests/File_Structure_Test.php @@ -71,8 +71,9 @@ class File_Structure_Test extends Unit_Test_Case { "in file: {$file->getPathname()}"); } else if (preg_match("|\.php$|", $file->getPathname())) { $actual = $this->_get_preamble($file->getPathname()); - if (strtr($file->getPathName(), DIRECTORY_SEPARATOR, '/') == DOCROOT . "index.php") { - // index.php allows direct access, so modify our expectations for the first line + if (strtr($file->getPathName(), DIRECTORY_SEPARATOR, '/') == DOCROOT . "index.php" || + strtr($file->getPathName(), DIRECTORY_SEPARATOR, '/') == DOCROOT . "installer/install.php") { + // index.php and installer.php allow direct access, so modify our expectations for them $index_expected = $expected; $index_expected[0] = "<?php"; $this->assert_equal($index_expected, $actual, "in file: {$file->getPathname()}"); diff --git a/core/views/admin_themes_preview.html.php b/core/views/admin_themes_preview.html.php index c31d4118..b29c2a48 100644 --- a/core/views/admin_themes_preview.html.php +++ b/core/views/admin_themes_preview.html.php @@ -1,3 +1,4 @@ +<?php defined("SYSPATH") or die("No direct script access.") ?> <h1> <?= t("Theme Preview: {{theme_name}}", array("theme_name" => $info->name)) ?> </h1> <iframe src="<?= $url ?>" style="width: 600px; height: 500px"></iframe> <p> diff --git a/installer/install.php b/installer/install.php index eaf73b6f..a644b1c9 100644 --- a/installer/install.php +++ b/installer/install.php @@ -17,7 +17,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ - /** * Batch Install program this is to only be run from the command line. The web interface uses * a different approach to invoking the installer @@ -36,7 +35,7 @@ if (PHP_SAPI != 'cli') { $redirect = str_replace("install.php", "index.php", $_SERVER["REQUEST_URI"]); - + header("Location: $redirect"); return; } diff --git a/installer/views/installer.html.php b/installer/views/installer.html.php index 34bcb56c..ed372600 100644 --- a/installer/views/installer.html.php +++ b/installer/views/installer.html.php @@ -1,15 +1,15 @@ -<?php defined("SYSPATH") or die("No direct script access."); ?> +<?php defined("SYSPATH") or die("No direct script access.") ?> <!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> - + <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> - + <title>Gallery3 Requirements Verification</title> - + <style type="text/css"> body { width: 42em; margin: 0 auto; font-family: sans-serif; font-size: 90%; } - + #tests table { border-collapse: collapse; width: 100%; } #tests table th, #tests table td { padding: 0.2em 0.4em; text-align: left; vertical-align: top; } @@ -27,14 +27,14 @@ <body> <? foreach (self::$messages as $section) : ?> <h1><?php print $section["header"] ?></h1> - + <p><?php print $section["description"] ?></p> <div id="tests"> <table cellspacing="0"> <?php foreach ($section["msgs"] as $header => $msg): ?> - + <tr> <th><?php echo $header ?></th> <td class="<?php echo empty($msg["error"]) ? "pass" : "fail" ?>"> diff --git a/installer/views/installer.txt.php b/installer/views/installer.txt.php index 3b6f0512..e7dc155f 100644 --- a/installer/views/installer.txt.php +++ b/installer/views/installer.txt.php @@ -1,4 +1,5 @@ -<?php defined("SYSPATH") or die("No direct script access."); +<?php defined("SYSPATH") or die("No direct script access.") ?> +<? function green_start() { return "\x1B[32m"; } @@ -16,7 +17,7 @@ function magenta_start() { } function print_msg($header, $msg, $error) { - $format = "| %-21.21s | %-81.81s |\n"; + $format = "| %-21.21s | %-81.81s |\n"; foreach (explode("\n", wordwrap($msg, 72)) as $text) { if ($error) { printf($format, $header, red_start() . $text . color_end()); @@ -36,7 +37,7 @@ foreach (self::$messages as $section) { echo "+", str_repeat("-", 98), "+\n"; foreach ($section["msgs"] as $header => $msg) { - print_msg($header, $msg["text"], $msg["error"]); + print_msg($header, $msg["text"], $msg["error"]); } } diff --git a/modules/comment/views/admin_comments.html.php b/modules/comment/views/admin_comments.html.php index e6741b35..9d18c054 100644 --- a/modules/comment/views/admin_comments.html.php +++ b/modules/comment/views/admin_comments.html.php @@ -14,25 +14,24 @@ var delete_url = "<?= url::site("admin/comments/delete/__ID__?csrf=" . access::csrf_token()) ?>"; -function del(id) { - $.get(delete_url.replace("__ID__", id), - {}, - function() { - $("#gComment-" + id).slideUp(); - update_menu(); - }); -} - -function update_menu() { - $.get("<?= url::site("admin/comments/menu_labels") ?>", {}, - function(data) { - for (var i = 0; i < data.length; i++) { - $("#gAdminCommentsMenu li:eq(" + i + ") a").html(data[i]); - } - }, - "json"); -} + function del(id) { + $.get(delete_url.replace("__ID__", id), + {}, + function() { + $("#gComment-" + id).slideUp(); + update_menu(); + }); + } + function update_menu() { + $.get("<?= url::site("admin/comments/menu_labels") ?>", {}, + function(data) { + for (var i = 0; i < data.length; i++) { + $("#gAdminCommentsMenu li:eq(" + i + ") a").html(data[i]); + } + }, + "json"); + } </script> <div id="gAdminComments"> @@ -53,15 +52,15 @@ function update_menu() { <? if ($spam_caught > 0): ?> <p> <?= t(array("one" => "Gallery has caught {{count}} spam for you since you installed spam filtering.", - "other" => "Gallery has caught {{count}} spam for you since you installed spam filtering."), - array("count" => $spam_caught)) ?> + "other" => "Gallery has caught {{count}} spam for you since you installed spam filtering."), + array("count" => $spam_caught)) ?> </p> <? endif ?> <p> <? if ($spam->count()): ?> <?= t(array("one" => "There is currently one comment in your spam queue. You can delete it with a single click, but there is no undo operation so you may want to check the message first to make sure that it really is spam.", - "other" => "There are currently {{count}} comments in your spam queue. You can delete them all with a single click, but there is no undo operation so you may want to check the messages first to make sure that they really are spam. All spam messages will be deleted after 7 days automatically."), - array("count" => $spam->count())) ?> + "other" => "There are currently {{count}} comments in your spam queue. You can delete them all with a single click, but there is no undo operation so you may want to check the messages first to make sure that they really are spam. All spam messages will be deleted after 7 days automatically."), + array("count" => $spam->count())) ?> </p> <p> <a href="<?= url::site("admin/comments/delete_all_spam?csrf=" . access::csrf_token()) ?>"> @@ -99,25 +98,25 @@ function update_menu() { <td> <a href="#"> <img src="<?= $user->avatar_url(40, $theme->url("images/avatar.jpg")) ?>" - class="gAvatar" - alt="<?= $comment->author_name() ?>" - width="40" - height="40" /> - </a><br/> + class="gAvatar" + alt="<?= $comment->author_name() ?>" + width="40" + height="40" /> + </a><br/> <a href="mailto:<?= $comment->author_email() ?>" title="<?= $comment->author_email() ?>"> <?= $comment->author_name() ?> </a> </td> <td> - <div class="right"> - <? $item = $comment->item(); ?> - <a href="<?= $item->url() ?>"> - <img src="<?= $item->thumb_url() ?>" - alt="<?= $item->title ?>" - <?= photo::img_dimensions($item->thumb_width, $item->thumb_height, 75) ?> - /> - </a><br/> - <a href="<?= $item->url() ?>"> <?= $item->title ?> </a> - </div> + <div class="right"> + <? $item = $comment->item(); ?> + <a href="<?= $item->url() ?>"> + <img src="<?= $item->thumb_url() ?>" + alt="<?= $item->title ?>" + <?= photo::img_dimensions($item->thumb_width, $item->thumb_height, 75) ?> + /> + </a><br/> + <a href="<?= $item->url() ?>"> <?= $item->title ?> </a> + </div> <p><?= date("Y-M-d", $comment->created); ?></p> <?= $comment->text ?> </td> @@ -126,7 +125,7 @@ function update_menu() { <? if ($comment->state != "unpublished"): ?> <li> <a href="javascript:set_state('unpublished',<?=$comment->id?>)"> - <?= t("Unapprove") ?> + <?= t("Unapprove") ?> </a> </li> <? endif ?> @@ -134,7 +133,7 @@ function update_menu() { <? if ($comment->state != "published"): ?> <li> <a href="javascript:set_state('published',<?=$comment->id?>)"> - <?= t("Approve") ?> + <?= t("Approve") ?> </a> </li> <? endif ?> @@ -142,26 +141,26 @@ function update_menu() { <? if ($comment->state != "spam"): ?> <li> <a href="javascript:set_state('spam',<?=$comment->id?>)"> - <?= t("Spam") ?> + <?= t("Spam") ?> </a> </li> <? endif ?> <li> <a href="javascript:reply(<?=$comment->id?>)"> - <?= t("Reply") ?> + <?= t("Reply") ?> </a> </li> <li> <a href="javascript:Edit(<?=$comment->id?>)"> - <?= t("Edit") ?> + <?= t("Edit") ?> </a> </li> <li> <a href="javascript:set_state('deleted',<?=$comment->id?>)"> - <?= t("Delete") ?> + <?= t("Delete") ?> </a> </li> </ul> |