diff options
author | Bharat Mediratta <bharat@menalto.com> | 2008-11-04 05:22:06 +0000 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2008-11-04 05:22:06 +0000 |
commit | ade1650846605d648da2565994e309414d908ac5 (patch) | |
tree | b49d2e1fbda2a0bdd9de36954124fe82f6120d7f | |
parent | f8b22c5aa9f70824004905fc864dead72bef67ea (diff) |
Add a test to detect tabs in our code, and convert all tabs to spaces
so that the test passes.
-rw-r--r-- | core/controllers/welcome.php | 22 | ||||
-rw-r--r-- | core/helpers/core_installer.php | 42 | ||||
-rw-r--r-- | core/tests/File_Structure_Test.php | 77 | ||||
-rw-r--r-- | core/views/welcome.html.php | 84 | ||||
-rw-r--r-- | core/views/welcome_syscheck.html.php | 4 | ||||
-rw-r--r-- | modules/gallery_unit_test/controllers/test.php | 4 | ||||
-rw-r--r-- | modules/gallery_unit_test/views/kohana_unit_test.php | 48 | ||||
-rw-r--r-- | themes/default/css/forms.css | 188 | ||||
-rw-r--r-- | themes/default/css/styles.css | 314 | ||||
-rw-r--r-- | themes/default/views/album.html.php | 112 | ||||
-rw-r--r-- | themes/default/views/header.html.php | 56 | ||||
-rw-r--r-- | themes/default/views/page.html.php | 12 | ||||
-rw-r--r-- | themes/default/views/sidebar.html.php | 54 |
13 files changed, 515 insertions, 502 deletions
diff --git a/core/controllers/welcome.php b/core/controllers/welcome.php index 93670cfe..f1201cff 100644 --- a/core/controllers/welcome.php +++ b/core/controllers/welcome.php @@ -74,18 +74,18 @@ class Welcome_Controller extends Template_Controller { } else { $old_handler = set_error_handler(array("Welcome_Controller", "_error_handler")); try { - Database::instance()->connect(); + Database::instance()->connect(); } catch (Exception $e) { - $error = new stdClass(); - $error->message = "Database error: {$e->getMessage()}"; - $db_name = Kohana::config("database.default.connection.database"); - if (strchr($error->message, "Unknown database")) { - $error->instructions[] = "mysqladmin -uroot create $db_name"; - } else { - $error->instructions = array(); - $error->message2 = "Check " . VARPATH . "database.php"; - } - $errors[] = $error; + $error = new stdClass(); + $error->message = "Database error: {$e->getMessage()}"; + $db_name = Kohana::config("database.default.connection.database"); + if (strchr($error->message, "Unknown database")) { + $error->instructions[] = "mysqladmin -uroot create $db_name"; + } else { + $error->instructions = array(); + $error->message2 = "Check " . VARPATH . "database.php"; + } + $errors[] = $error; } set_error_handler($old_handler); } diff --git a/core/helpers/core_installer.php b/core/helpers/core_installer.php index ea01a0c0..5720976b 100644 --- a/core/helpers/core_installer.php +++ b/core/helpers/core_installer.php @@ -24,38 +24,38 @@ class core_installer { $base_version = ORM::factory("module")->where("name", "core")->find()->version; } catch (Exception $e) { if ($e->getMessage() == "Table modules does not exist in your database.") { - $base_version = 0; + $base_version = 0; } else { - throw $e; + throw $e; } } if ($base_version == 0) { $db->query("CREATE TABLE `modules` ( - `id` int(9) NOT NULL auto_increment, - `name` char(255) default NULL, - `version` int(9) default NULL, - PRIMARY KEY (`id`), + `id` int(9) NOT NULL auto_increment, + `name` char(255) default NULL, + `version` int(9) default NULL, + PRIMARY KEY (`id`), UNIQUE KEY(`name`)) - ENGINE=InnoDB DEFAULT CHARSET=utf8;"); + ENGINE=InnoDB DEFAULT CHARSET=utf8;"); $db->query("CREATE TABLE `items` ( - `id` int(9) NOT NULL auto_increment, - `type` char(32) default NULL, - `title` char(255) default NULL, - `description` char(255) default NULL, - `path` char(255) default NULL, - `left` int(9) default NULL, - `right` int(9) default NULL, - `parent_id` int(9) default NULL, - `scope` int(9) default NULL, - PRIMARY KEY (`id`), - KEY `parent_id` (`parent_id`), - KEY `type` (`type`)) - ENGINE=InnoDB DEFAULT CHARSET=utf8;"); + `id` int(9) NOT NULL auto_increment, + `type` char(32) default NULL, + `title` char(255) default NULL, + `description` char(255) default NULL, + `path` char(255) default NULL, + `left` int(9) default NULL, + `right` int(9) default NULL, + `parent_id` int(9) default NULL, + `scope` int(9) default NULL, + PRIMARY KEY (`id`), + KEY `parent_id` (`parent_id`), + KEY `type` (`type`)) + ENGINE=InnoDB DEFAULT CHARSET=utf8;"); foreach (array("albums", "thumbnails") as $dir) { - @mkdir(VARPATH . $dir); + @mkdir(VARPATH . $dir); } $core = ORM::factory("module")->where("name", "core")->find(); diff --git a/core/tests/File_Structure_Test.php b/core/tests/File_Structure_Test.php index a34c61b2..00663bc6 100644 --- a/core/tests/File_Structure_Test.php +++ b/core/tests/File_Structure_Test.php @@ -24,9 +24,9 @@ class File_Structure_Test extends Unit_Test_Case { $incorrect = array(); foreach ($dir as $file) { if (!preg_match("|\.html\.php$|", $file->getPathname())) { - $this->assert_false( - preg_match('/\?\>\s*$/', file_get_contents($file)), - "{$file->getPathname()} ends in ?>"); + $this->assert_false( + preg_match('/\?\>\s*$/', file_get_contents($file)), + "{$file->getPathname()} ends in ?>"); } } } @@ -36,12 +36,12 @@ class File_Structure_Test extends Unit_Test_Case { new RecursiveIteratorIterator(new RecursiveDirectoryIterator(DOCROOT))); foreach ($dir as $file) { if ($file->getFilename() == 'kohana_unit_test.php') { - // Exception: this file must be named accordingly for the test framework - continue; + // Exception: this file must be named accordingly for the test framework + continue; } $this->assert_false( - preg_match("|/views/.*?(?<!\.html)\.php$|", $file->getPathname()), - "{$file->getPathname()} should end in .html.php"); + preg_match("|/views/.*?(?<!\.html)\.php$|", $file->getPathname()), + "{$file->getPathname()} should end in .html.php"); } } @@ -52,24 +52,37 @@ class File_Structure_Test extends Unit_Test_Case { $expected = $this->_get_preamble(__FILE__); foreach ($dir as $file) { if (preg_match("/views/", $file->getPathname())) { - // The preamble for views is a single line that prevents direct script access - $lines = file($file->getPathname()); - $this->assert_equal( - "<? defined(\"SYSPATH\") or die(\"No direct script access.\"); ?>\n", - $lines[0], - "in file: {$file->getPathname()}"); + // The preamble for views is a single line that prevents direct script access + $lines = file($file->getPathname()); + $this->assert_equal( + "<? defined(\"SYSPATH\") or die(\"No direct script access.\"); ?>\n", + $lines[0], + "in file: {$file->getPathname()}"); } else if (preg_match("|\.php$|", $file->getPathname())) { - $actual = $this->_get_preamble($file->getPathname()); - if ($file->getPathName() == DOCROOT . "index.php") { - // index.php allows direct access, so modify our expectations for the first line - $index_expected = $expected; - $index_expected[0] = "<?php"; - $this->assert_equal($index_expected, $actual, "in file: {$file->getPathname()}"); - } else { - // We expect the full preamble in regular PHP files - $actual = $this->_get_preamble($file->getPathname()); - $this->assert_equal($expected, $actual, "in file: {$file->getPathname()}"); - } + $actual = $this->_get_preamble($file->getPathname()); + if ($file->getPathName() == DOCROOT . "index.php") { + // index.php allows direct access, so modify our expectations for the first line + $index_expected = $expected; + $index_expected[0] = "<?php"; + $this->assert_equal($index_expected, $actual, "in file: {$file->getPathname()}"); + } else { + // We expect the full preamble in regular PHP files + $actual = $this->_get_preamble($file->getPathname()); + $this->assert_equal($expected, $actual, "in file: {$file->getPathname()}"); + } + } + } + } + + public function no_tabs_in_our_code_test() { + $dir = new GalleryCodeFilterIterator( + new RecursiveIteratorIterator(new RecursiveDirectoryIterator(DOCROOT))); + $incorrect = array(); + foreach ($dir as $file) { + if (substr($file->getFilename(), -4) == ".php") { + $this->assert_false( + preg_match('/\t/', file_get_contents($file)), + "{$file->getPathname()} has tabs in it"); } } } @@ -80,7 +93,7 @@ class File_Structure_Test extends Unit_Test_Case { for ($i = 0; $i < count($lines); $i++) { $copy[] = rtrim($lines[$i]); if (!strncmp($lines[$i], ' */', 3)) { - return $copy; + return $copy; } } return $copy; @@ -92,12 +105,12 @@ class GalleryCodeFilterIterator extends FilterIterator { // Skip anything that we didn't write $path_name = $this->getInnerIterator()->getPathName(); return !(strstr($path_name, ".svn") || - substr($path_name, -1, 1) == "~" || - strstr($path_name, SYSPATH) !== false || - strstr($path_name, MODPATH . 'forge') !== false || - strstr($path_name, MODPATH . 'unit_test') !== false || - strstr($path_name, MODPATH . 'mptt') !== false || - strstr($path_name, DOCROOT . 'var') !== false || - strstr($path_name, DOCROOT . 'test') !== false); + substr($path_name, -1, 1) == "~" || + strstr($path_name, SYSPATH) !== false || + strstr($path_name, MODPATH . 'forge') !== false || + strstr($path_name, MODPATH . 'unit_test') !== false || + strstr($path_name, MODPATH . 'mptt') !== false || + strstr($path_name, DOCROOT . 'var') !== false || + strstr($path_name, DOCROOT . 'test') !== false); } } diff --git a/core/views/welcome.html.php b/core/views/welcome.html.php index adea7543..b7a290a0 100644 --- a/core/views/welcome.html.php +++ b/core/views/welcome.html.php @@ -64,54 +64,54 @@ <body> <div class="outer"> <center> - <img src="http://www.gallery2.org/gallery2.png"/> + <img src="http://www.gallery2.org/gallery2.png"/> </center> <div class="inner"> - <h1>Gallery3 Scaffold</h1> - <p> - This is - a <b><a href="http://www.google.com/images?q=scaffold">scaffold</a></b>: - a <i>temporary structure built to support the developers as - they create the real product</i>. - </p> + <h1>Gallery3 Scaffold</h1> + <p> + This is + a <b><a href="http://www.google.com/images?q=scaffold">scaffold</a></b>: + a <i>temporary structure built to support the developers as + they create the real product</i>. + </p> - <p> - As we flesh out Gallery 3, we'll make it possible for you to - peer inside and see the application taking shape. - Eventually, this page will go away and you'll start in the - application itself. In the meantime, here are some useful - links to get you started. - </p> + <p> + As we flesh out Gallery 3, we'll make it possible for you to + peer inside and see the application taking shape. + Eventually, this page will go away and you'll start in the + application itself. In the meantime, here are some useful + links to get you started. + </p> - <h2>System Configuration</h2> - <?= $syscheck ?> + <h2>System Configuration</h2> + <?= $syscheck ?> - <h2>Activities</h2> - <p> - <?= html::anchor("album/1", "Browse Gallery") ?> - </p> + <h2>Activities</h2> + <p> + <?= html::anchor("album/1", "Browse Gallery") ?> + </p> - <h2>Documentation</h2> - <ul> - <li> - <a href="http://docs.google.com/Doc?id=dfjxt593_184ff9jhmd8&hl=en">Gallery3: Prioritized Feature List</a> - </li> - <li> - <a href="http://docs.google.com/Doc?id=dfjxt593_185czczpm4f&hl=en">Gallery3: Secondary Features</a> - </li> - <li> - <a href="http://gallery.svn.sourceforge.net/viewvc/gallery/trunk/eval/gx/ui/HTML/index.html">Mockups</a> - </li> - <li> - <a href="http://www.nabble.com/Rough-Gallery-3-time-line-td20240153.html">Rough Timeline</a> (as of Oct 29, 2008) - </li> - <li> - <a href="http://codex.gallery2.org/Gallery3:About">Gallery3: About Page</a> - </li> - <li> - <a href="http://codex.gallery2.org/Gallery3:Coding_Standards">Gallery3: Coding Standards</a> - </li> - </ul> + <h2>Documentation</h2> + <ul> + <li> + <a href="http://docs.google.com/Doc?id=dfjxt593_184ff9jhmd8&hl=en">Gallery3: Prioritized Feature List</a> + </li> + <li> + <a href="http://docs.google.com/Doc?id=dfjxt593_185czczpm4f&hl=en">Gallery3: Secondary Features</a> + </li> + <li> + <a href="http://gallery.svn.sourceforge.net/viewvc/gallery/trunk/eval/gx/ui/HTML/index.html">Mockups</a> + </li> + <li> + <a href="http://www.nabble.com/Rough-Gallery-3-time-line-td20240153.html">Rough Timeline</a> (as of Oct 29, 2008) + </li> + <li> + <a href="http://codex.gallery2.org/Gallery3:About">Gallery3: About Page</a> + </li> + <li> + <a href="http://codex.gallery2.org/Gallery3:Coding_Standards">Gallery3: Coding Standards</a> + </li> + </ul> </div> </div> </body> diff --git a/core/views/welcome_syscheck.html.php b/core/views/welcome_syscheck.html.php index 7355e431..5f1a1945 100644 --- a/core/views/welcome_syscheck.html.php +++ b/core/views/welcome_syscheck.html.php @@ -40,8 +40,8 @@ <td><?= $module->name ?></td> <td><?= $module->version ?></td> <td> - <?= html::anchor("welcome/install/{$module->name}", "install") ?>, - <?= html::anchor("welcome/uninstall/{$module->name}", "uninstall") ?> + <?= html::anchor("welcome/install/{$module->name}", "install") ?>, + <?= html::anchor("welcome/uninstall/{$module->name}", "uninstall") ?> </td> </tr> <? endforeach; ?> diff --git a/modules/gallery_unit_test/controllers/test.php b/modules/gallery_unit_test/controllers/test.php index 06e15696..33621a07 100644 --- a/modules/gallery_unit_test/controllers/test.php +++ b/modules/gallery_unit_test/controllers/test.php @@ -42,8 +42,8 @@ class Test_Controller extends Controller { // Make this the default database for the rest of this run Database::$instances = array('default' => $db); } catch (Exception $e) { - print "{$e->getMessage()}\n"; - return; + print "{$e->getMessage()}\n"; + return; } } diff --git a/modules/gallery_unit_test/views/kohana_unit_test.php b/modules/gallery_unit_test/views/kohana_unit_test.php index e90b0f52..e255e360 100644 --- a/modules/gallery_unit_test/views/kohana_unit_test.php +++ b/modules/gallery_unit_test/views/kohana_unit_test.php @@ -15,41 +15,41 @@ foreach ($results as $class => $methods) { foreach ($methods as $method => $result) { // Hide passed tests from report if ($result === true AND $hide_passed === true) { - continue; + continue; } printf("%-56.56s", $method); if ($result === true) { - echo Kohana::lang("unit_test.passed"), "\n"; + echo Kohana::lang("unit_test.passed"), "\n"; } else if ($result instanceof Kohana_Unit_Test_Exception) { - echo Kohana::lang("unit_test.failed"), "\n"; - echo " ", $result->getMessage(), "\n"; - echo " ", $result->getFile(); - echo " ", "(" . Kohana::lang("unit_test.line") . " " . $result->getLine(), ")\n"; - if ($result->getDebug() !== null) { - echo " ", "(", gettype($result->getDebug()), ") ", - var_export($result->getDebug(), true), "\n"; - } - echo "\n"; + echo Kohana::lang("unit_test.failed"), "\n"; + echo " ", $result->getMessage(), "\n"; + echo " ", $result->getFile(); + echo " ", "(" . Kohana::lang("unit_test.line") . " " . $result->getLine(), ")\n"; + if ($result->getDebug() !== null) { + echo " ", "(", gettype($result->getDebug()), ") ", + var_export($result->getDebug(), true), "\n"; + } + echo "\n"; } else if ($result instanceof Exception) { - echo Kohana::lang("unit_test.error"), "\n"; - if ($result->getMessage()) { - echo " ", $result->getMessage(), "\n"; - } - echo " ", $result->getFile(), " (", - Kohana::lang("unit_test.line"), " ", $result->getLine(), ")\n"; - echo "\n"; + echo Kohana::lang("unit_test.error"), "\n"; + if ($result->getMessage()) { + echo " ", $result->getMessage(), "\n"; + } + echo " ", $result->getFile(), " (", + Kohana::lang("unit_test.line"), " ", $result->getLine(), ")\n"; + echo "\n"; } } } echo str_repeat("=", 100), "\n"; printf(">> %s\t%s: %.2f%%\t%s: %d\t%s: %d\t%s: %d\t%s: %d\n", - $class, - Kohana::lang("unit_test.score"), $stats[$class]["score"], - Kohana::lang("unit_test.total"), $stats[$class]["total"], - Kohana::lang("unit_test.passed"), $stats[$class]["passed"], - Kohana::lang("unit_test.failed"), $stats[$class]["failed"], - Kohana::lang("unit_test.errors"), $stats[$class]["errors"]); + $class, + Kohana::lang("unit_test.score"), $stats[$class]["score"], + Kohana::lang("unit_test.total"), $stats[$class]["total"], + Kohana::lang("unit_test.passed"), $stats[$class]["passed"], + Kohana::lang("unit_test.failed"), $stats[$class]["failed"], + Kohana::lang("unit_test.errors"), $stats[$class]["errors"]); echo str_repeat("-", 100), "\n\n\n"; } diff --git a/themes/default/css/forms.css b/themes/default/css/forms.css index d8a69853..03f6527a 100644 --- a/themes/default/css/forms.css +++ b/themes/default/css/forms.css @@ -4,43 +4,43 @@ /* Zero out padding and margin, adjust where needed later */ form, fieldset, label, input, .checkbox, textarea, select, option, form div { - margin: 0; - padding: 0; + margin: 0; + padding: 0; } fieldset { - margin: 1em 0; - padding: 1em; - border: 1px solid #999; + margin: 1em 0; + padding: 1em; + border: 1px solid #999; } legend { - font-weight: bold; - margin: 0 2% .5em 0; - padding: .2em .5em; + font-weight: bold; + margin: 0 2% .5em 0; + padding: .2em .5em; } -input.text, textarea, select, input.password { - border: 1px solid #666; - border-right: 1px solid #ccc; - border-bottom: 1px solid #ccc; +input.text, textarea, select, input.password { + border: 1px solid #666; + border-right: 1px solid #ccc; + border-bottom: 1px solid #ccc; } option { - float: none; - clear: both; - margin-right: 2em; + float: none; + clear: both; + margin-right: 2em; } -input.radio, input.checkbox { - margin-right: .5em; +input.radio, input.checkbox { + margin-right: .5em; } /* Create a bit of padding for text inputs and selects */ input.text, input.password, input.button, textarea, select { - padding: .2em; + padding: .2em; } -input.button { - margin-right: 1em; - padding: .2em .6em; +input.button { + margin-right: 1em; + padding: .2em .6em; } -.readonly { - color: #999; - background: #e7e7e7; +.readonly { + color: #999; + background: #e7e7e7; } /* standard widths */ .w12 { width: 12% } @@ -57,9 +57,9 @@ input.button { * Provide proper vertical alignment for expanded and compact forms */ -.gExpandedForm .row div, +.gExpandedForm .row div, .gCompactForm div div label { - padding-top: .5em; + padding-top: .5em; } @@ -67,47 +67,47 @@ input.button { * Expanded form layout styles */ -.gExpandedForm { overflow: hidden; } +.gExpandedForm { overflow: hidden; } .gExpandedForm .row { - padding: .3em 0; - white-space: nowrap; - overflow: hidden; - clear: both; -} -.gExpandedForm label, -.gExpandedForm .row p, -.gExpandedForm .row div, -.gExpandedForm input, -.gExpandedForm select, + padding: .3em 0; + white-space: nowrap; + overflow: hidden; + clear: both; +} +.gExpandedForm label, +.gExpandedForm .row p, +.gExpandedForm .row div, +.gExpandedForm input, +.gExpandedForm select, .gExpandedForm textarea { - float: left; + float: left; } /* change column widths for labels and inputs */ .gExpandedForm .text, textarea { width: 80%; } .gExpandedForm label, .gExpandedForm .row p { - width: 15%; - margin: .5em 1em .5em 0; - text-align: right; - white-space: normal; - overflow: hidden; + width: 15%; + margin: .5em 1em .5em 0; + text-align: right; + white-space: normal; + overflow: hidden; } .gExpandedForm .row div { - white-space: nowrap; - overflow: hidden; - clear: none; + white-space: nowrap; + overflow: hidden; + clear: none; } /* labels and form inputs inside of divs should not float */ .gExpandedForm .row div * { - float: none; - clear: none; + float: none; + clear: none; } -.expanded input.checkbox, -.expanded input.radio, -.expanded select { - margin-top: 1.5em; +.expanded input.checkbox, +.expanded input.radio, +.expanded select { + margin-top: 1.5em; } -.gExpandedForm div div input { - margin-right: 0; +.gExpandedForm div div input { + margin-right: 0; } @@ -115,51 +115,51 @@ input.button { * Compact form layout styles */ -.gCompactForm { overflow: hidden; } -.gCompactForm div, -.gCompactForm label, -.gCompactForm input, -.gCompactForm select, +.gCompactForm { overflow: hidden; } +.gCompactForm div, +.gCompactForm label, +.gCompactForm input, +.gCompactForm select, .gCompactForm textarea { - float: left; + float: left; } -.gCompactForm input.text, -.gCompactForm select, +.gCompactForm input.text, +.gCompactForm select, .gCompactForm textarea { - /* set width: auto to allow form element content - to set width otherwise 90% is a good setting */ - width: 90%; /* determines space between form elements */ + /* set width: auto to allow form element content + to set width otherwise 90% is a good setting */ + width: 90%; /* determines space between form elements */ } -/* Increase width of elements in twoper +/* Increase width of elements in twoper columns to provide better alignment */ -.gCompactForm .twoper input.text, -.gCompactForm .twoper select, +.gCompactForm .twoper input.text, +.gCompactForm .twoper select, .gCompactForm .twoper textarea { - width: 95%; + width: 95%; } .gCompactForm div { - width: 99%; - margin-bottom: 1em; /* space between rows */ - clear: both; + width: 99%; + margin-bottom: 1em; /* space between rows */ + clear: both; } /* Nested divs shouldn't clear floated elements */ /* keeps nested divs from compounding margin value */ .gCompactForm div div { - margin-bottom: 0; - clear: none; + margin-bottom: 0; + clear: none; } /* Nested div label contents should determine their own width */ .gCompactForm div div label { - width: auto; - white-space: normal; - /* unccomment to stack form inputs inside a row */ - /* clear: left; */ - margin-right: 1em; + width: auto; + white-space: normal; + /* unccomment to stack form inputs inside a row */ + /* clear: left; */ + margin-right: 1em; } /* Fix paragraph white space in Safari */ .gCompactForm div div p { - margin: 0; - padding: 0; + margin: 0; + padding: 0; } /* Compact layout - Set item width within rows */ @@ -174,18 +174,18 @@ input.button { .nineper label, .nineper div { width: 10%; } .tenper label, .tenper div { width: 8.7%; } -.oneper label, .oneper div, -.twoper label, .twoper div, -.threeper label, .threeper div, -.fourper label, .fourper div, -.fiveper label, .fiveper div, -.sixper label, .sixper div, -.sevenper label, .sevenper div, -.eightper label, .eightper div, -.nineper label, .nineper div, +.oneper label, .oneper div, +.twoper label, .twoper div, +.threeper label, .threeper div, +.fourper label, .fourper div, +.fiveper label, .fiveper div, +.sixper label, .sixper div, +.sevenper label, .sevenper div, +.eightper label, .eightper div, +.nineper label, .nineper div, .tenper label, .tenper div { - white-space: nowrap; - overflow: hidden; - border: none; - border-collapse: collapse; + white-space: nowrap; + overflow: hidden; + border: none; + border-collapse: collapse; } diff --git a/themes/default/css/styles.css b/themes/default/css/styles.css index 11a8ab62..c4189dbe 100644 --- a/themes/default/css/styles.css +++ b/themes/default/css/styles.css @@ -30,28 +30,28 @@ body, html { /* ~~~~~~~~~ text elements ~~~~~~~~~~ */ h1 { - margin-top: 0px; + margin-top: 0px; } a { - color: #6B8CB7; - text-decoration: none; + color: #6B8CB7; + text-decoration: none; } a:hover { - color: #FF3300; - text-decoration: underline; + color: #FF3300; + text-decoration: underline; } /* ~~~~~~~~~ list elements ~~~~~~~~~~ */ li { - list-style-type: none; + list-style-type: none; } /* ~~~~~~~~~ table elements ~~~~~~~~~~ */ caption { - text-align: left; + text-align: left; } th { - text-align: left; + text-align: left; } /* ~~~~~~~~~ form elements ~~~~~~~~~~ */ @@ -88,14 +88,14 @@ textarea { /* ~~~~~~~~ high level content containers ~~~~~~~~ */ #gHeader { - position: relative; + position: relative; } #gContent { border-right: 1px solid #ccc; padding: 20px; - clear: both; + clear: both; } #gSidebar { @@ -121,19 +121,19 @@ textarea { margin: 10px; } #gHeader h1 { - float: left; - margin: 20px 0 0 20px; + float: left; + margin: 20px 0 0 20px; } /* ~~~~~~~~ login menu ~~~~~~~~ */ #gLoginMenu { position: absolute; - top: 0px; - right: 13px; - border: 1px solid silver; - border-width: 0 1px 1px 1px; - padding: 5px; + top: 0px; + right: 13px; + border: 1px solid silver; + border-width: 0 1px 1px 1px; + padding: 5px; text-align: right; } #gLoginMenu form { @@ -145,17 +145,17 @@ textarea { #gLoginMenu input.text, #gLoginMenu input.password { width: 80px; - padding: 0 0 .1em 0; + padding: 0 0 .1em 0; } #gLoginMenu input.submit { - font-size: 0.9em; - font-weight: bold; + font-size: 0.9em; + font-weight: bold; } /* ~~~~~~~~ site menu ~~~~~~~~ */ #gSiteMenu { - height: 31px; + height: 31px; margin: 0; padding: 0; list-style-type: none; @@ -166,36 +166,36 @@ textarea { float: left; display: block; width: 20%; - background: #E6EBF0; + background: #E6EBF0; } #gSiteMenu li a { - color: #003366; - font-weight: bold; + color: #003366; + font-weight: bold; height: 20px; display: block; text-align: center; - padding: 7px 7px 3px 7px; - background: url('../images/bg_sitemenu.png') repeat-x; - margin-left: 1px; - border: 1px solid #336699; - border-width: 0 1px 1px 0; - text-decoration: none; - letter-spacing: .1em; + padding: 7px 7px 3px 7px; + background: url('../images/bg_sitemenu.png') repeat-x; + margin-left: 1px; + border: 1px solid #336699; + border-width: 0 1px 1px 0; + text-decoration: none; + letter-spacing: .1em; } #gSiteMenu li a:hover { - color: #FF3300; - background: url('../images/bg_sitemenu_hover.png'); + color: #FF3300; + background: url('../images/bg_sitemenu_hover.png'); } #gSiteMenu li a.active { - background: #DCE6EF; - border-color: #DCE6EF; - color: #FF3300; + background: #DCE6EF; + border-color: #DCE6EF; + color: #FF3300; } /* ~~~~~~~~~ breadcrumbs ~~~~~~~~~~ */ #gBreadcrumbs { - border-bottom: 1px solid silver; + border-bottom: 1px solid silver; margin: 0; padding: 0 0 0 14px; height: 28px; @@ -223,15 +223,15 @@ textarea { /* ~~~~~~~~~ search form ~~~~~~~~~~ */ #gSearchForm { - position: absolute; - right: 13px; - top: 103px; + position: absolute; + right: 13px; + top: 103px; } #gSearchForm input.text { - padding: 1px; + padding: 1px; } #gSearchForm input.submit { - height: 20px; + height: 20px; } /** @@ -241,77 +241,77 @@ textarea { */ .buttonlink { - border: 1px solid lightgray; - padding: 5px; + border: 1px solid lightgray; + padding: 5px; } .buttonlink:hover { - background-color: #F3F3F3; + background-color: #F3F3F3; } .understate { - color: silver; + color: silver; } /* .gBlock { - margin: 0 1em 1.5em 0; - border: 1px solid #336699; - padding: 0; + margin: 0 1em 1.5em 0; + border: 1px solid #336699; + padding: 0; } .gBlockHeader { - background-color: #E8E8E8; - padding: .3em; - height: 1.5em; - border-bottom: 1px solid #6B8CB7; - margin: 0 !important; + background-color: #E8E8E8; + padding: .3em; + height: 1.5em; + border-bottom: 1px solid #6B8CB7; + margin: 0 !important; } .gBlockHeader h2 { - color: #003366; - margin: 0; - float: left; - font-size: 1.1em; + color: #003366; + margin: 0; + float: left; + font-size: 1.1em; } .gBlockHeader .minimize { - float: right; + float: right; } .gBlockContent { - margin: .3em; + margin: .3em; } */ .gBlock { - margin: 0 1em 2em 0; - padding: 0; + margin: 0 1em 2em 0; + padding: 0; } .gBlockHeader { - background-color: #E8E8E8; - padding: .3em; - height: 1.5em; - margin: 0 !important; + background-color: #E8E8E8; + padding: .3em; + height: 1.5em; + margin: 0 !important; } .gBlockHeader h2 { - margin: 0; - float: left; - font-size: 1.1em; + margin: 0; + float: left; + font-size: 1.1em; } .gBlockHeader .minimize { - float: right; + float: right; } .gBlockContent { - margin: .2em .5em 0 .5em; + margin: .2em .5em 0 .5em; } .gBlockContent { - margin: .2em .5em 0 .5em; + margin: .2em .5em 0 .5em; } table.gBlockContent { - width: 214px; - table-layout: fixed; + width: 214px; + table-layout: fixed; } table.gBlockContent th { - padding: .3em .3em .3em 0; + padding: .3em .3em .3em 0; } table.gBlockContent td { - padding: .3em 0 .3em .3em; + padding: .3em 0 .3em .3em; } /** @@ -322,14 +322,14 @@ table.gBlockContent td { #gItem { width: 500px; - margin-left: auto; + margin-left: auto; margin-right: auto; } #gItem a.buttonlink { float: right; } #gItem img { - clear: both; + clear: both; display: block; width: 500px; height: 400px; @@ -347,10 +347,10 @@ table.gMetadata { } table.gMetadata td, table.gMetadata th { - border: 0; + border: 0; } table.gMetadata td.toggle { - text-align: right; + text-align: right; } /* ~~~~~~~~~ upload ~~~~~~~~~~ */ @@ -398,104 +398,104 @@ table.gMetadata td.toggle { /* ~~~~~~~~~ album ~~~~~~~~~~ */ #gAlbumGridHeader { - height: 40px; - position: relative; + height: 40px; + position: relative; } #gAlbumGridHeader h1 { - display: inline; + display: inline; } #gAlbumGridHeader span { - padding-left: 10px; + padding-left: 10px; } #gSlideshowLink { - position: absolute; - top: 0px; - right: 0px; + position: absolute; + top: 0px; + right: 0px; } #gAlbumGrid .gItemContainer, #gAlbumGrid .gAlbumContainer { - width: 32%; - height: 220px; - float: left; - text-align: center; - border: 1px lightgray solid; - margin: 0px 0px 10px 1.49%; - padding: 5px 0px 5px 0px; + width: 32%; + height: 220px; + float: left; + text-align: center; + border: 1px lightgray solid; + margin: 0px 0px 10px 1.49%; + padding: 5px 0px 5px 0px; } #gAlbumGrid .first { - margin: 0px 0px 10px 0px; + margin: 0px 0px 10px 0px; } .gAlbum { - background-color: #D4DAFF; + background-color: #D4DAFF; } .gAlbum h2 { - color: #000066; + color: #000066; } .gItemContainer h2, .gAlbumContainer h2 { - margin: 5px 0px 5px 0px; + margin: 5px 0px 5px 0px; } /* ~~~~~~~~~ tag cloud ~~~~~~~~~~ */ .gTagCloud ul { - text-align: justify; - padding: 0; + text-align: justify; + padding: 0; } .gTagCloud ul li { - text-align: justify; - display: inline; + text-align: justify; + display: inline; } .gTagCloud ul li a { - text-decoration: none; + text-decoration: none; } .gTagCloud ul li a.size0 { - font-size: 100%; - font-weight: 100; - color: #99CCFF; + font-size: 100%; + font-weight: 100; + color: #99CCFF; } .gTagCloud ul li a.size1 { - font-size: 110%; - font-weight: 300; - color: #6699FF; + font-size: 110%; + font-weight: 300; + color: #6699FF; } .gTagCloud ul li a.size2 { - font-size: 120%; - font-weight: 500; - color: #6699CC; + font-size: 120%; + font-weight: 500; + color: #6699CC; } .gTagCloud ul li a.size3 { - font-size: 130%; - font-weight: 700; - color: #336699; + font-size: 130%; + font-weight: 700; + color: #336699; } .gTagCloud ul li a.size4 { - font-size: 140%; - font-weight: 900; - color: #0E2B52; + font-size: 140%; + font-weight: 900; + color: #0E2B52; } .gTagCloud ul li a:hover { - color: #FF3300; - text-decoration: underline; + color: #FF3300; + text-decoration: underline; } .gTagCloud form { - margin-top: 10px; + margin-top: 10px; } /* ~~~~~~~~~ album tree ~~~~~~~~~~ */ #gAlbumTree { - border: 1px solid lightgray; - margin: 20px 0 20px 0; - padding: 5px; + border: 1px solid lightgray; + margin: 20px 0 20px 0; + padding: 5px; } #gAlbumTree #gTreeContainer { - border: 1px solid lightgray; - padding: 0 0 0 5px; + border: 1px solid lightgray; + padding: 0 0 0 5px; } @@ -510,58 +510,58 @@ table.gMetadata td.toggle { /* ~~~~~~~~~ pagination ~~~~~~~~~~ */ #gPagination { - clear: both; - padding: 10px 0px 0px 0px; - text-align: center; + clear: both; + padding: 10px 0px 0px 0px; + text-align: center; } #gPagination a, #gPagination span { - border: 1px solid lightgray; - padding: 5px; - background-repeat: no-repeat; + border: 1px solid lightgray; + padding: 5px; + background-repeat: no-repeat; } #gPagination a:hover { - background-color: #F3F3F3; + background-color: #F3F3F3; } #gPagination .first { - background-image: url('../images/first.png'); - background-position: left; - padding-left: 20px; + background-image: url('../images/first.png'); + background-position: left; + padding-left: 20px; } #gPagination .first_inactive { - background-image: url('../images/first_inactive.png'); - background-position: left; - padding-left: 20px; + background-image: url('../images/first_inactive.png'); + background-position: left; + padding-left: 20px; } #gPagination .previous { - background-image: url('../images/previous.png'); - background-position: left; - padding-left: 17px; + background-image: url('../images/previous.png'); + background-position: left; + padding-left: 17px; } #gPagination .previous_inactive { - background-image: url('../images/previous_inactive.png'); - background-position: left; - padding-left: 17px; + background-image: url('../images/previous_inactive.png'); + background-position: left; + padding-left: 17px; } #gPagination .next { - background-image: url('../images/next.png'); - background-position: right; - padding-right: 17px; + background-image: url('../images/next.png'); + background-position: right; + padding-right: 17px; } #gPagination .next_inactive { - background-image: url('../images/next_inactive.png'); - background-position: right; - padding-right: 17px; + background-image: url('../images/next_inactive.png'); + background-position: right; + padding-right: 17px; } #gPagination .last { - background-image: url('../images/last.png'); - background-position: right; - padding-right: 20px; + background-image: url('../images/last.png'); + background-position: right; + padding-right: 20px; } #gPagination .last_inactive { - background-image: url('../images/last_inactive.png'); - background-position: right; - padding-right: 20px; + background-image: url('../images/last_inactive.png'); + background-position: right; + padding-right: 20px; } diff --git a/themes/default/views/album.html.php b/themes/default/views/album.html.php index 2abb810f..dd0ad44b 100644 --- a/themes/default/views/album.html.php +++ b/themes/default/views/album.html.php @@ -5,75 +5,75 @@ <div id="yui-main"> <div id="gContent" class="yui-b"> <script type="text/javascript"> - myTooltip = new YAHOO.widget.Tooltip("myTooltip", { - context:"photo-id-1", - text:"<strong>Photo title</strong><br />taken December 24, 2007<br />Viewed 27 times<br /><br/>Tags: christmas, familiy, home, xmas", - showDelay:500 } ); + myTooltip = new YAHOO.widget.Tooltip("myTooltip", { + context:"photo-id-1", + text:"<strong>Photo title</strong><br />taken December 24, 2007<br />Viewed 27 times<br /><br/>Tags: christmas, familiy, home, xmas", + showDelay:500 } ); </script> <div id="gAlbumGrid"> - <div id="gAlbumGridHeader"> - <h1><?= $item->title ?></h1> - <span class="understate"><?= $item->description ?></span> - <a href="#" id="gSlideshowLink" class="buttonlink">Slideshow</a> - </div> + <div id="gAlbumGridHeader"> + <h1><?= $item->title ?></h1> + <span class="understate"><?= $item->description ?></span> + <a href="#" id="gSlideshowLink" class="buttonlink">Slideshow</a> + </div> - <div class="gAlbumContainer first gAlbum"> - <a href="photo.html"><img id="photo-id-1" class="photo" alt="photo" src="<?= $theme->url("images/thumbnail.jpg") ?>" /></a> - <h2>Album title</h2> - <ul class="gMetadata"> - <li>Views: 321</li> - <li>By: <a href="#">username</a></li> - </ul> - </div> + <div class="gAlbumContainer first gAlbum"> + <a href="photo.html"><img id="photo-id-1" class="photo" alt="photo" src="<?= $theme->url("images/thumbnail.jpg") ?>" /></a> + <h2>Album title</h2> + <ul class="gMetadata"> + <li>Views: 321</li> + <li>By: <a href="#">username</a></li> + </ul> + </div> - <div class="gItemContainer"> - <a href="photo.html"><img id="photo-id-1" class="photo" alt="photo" src="<?= $theme->url("images/thumbnail.jpg") ?>" /></a> - <h2>Photo title</h2> - </div> + <div class="gItemContainer"> + <a href="photo.html"><img id="photo-id-1" class="photo" alt="photo" src="<?= $theme->url("images/thumbnail.jpg") ?>" /></a> + <h2>Photo title</h2> + </div> - <div class="gItemContainer"> - <a href="photo.html"><img id="photo-id-1" class="photo" alt="photo" src="<?= $theme->url("images/thumbnail.jpg") ?>" /></a> - <h2>Photo title</h2> - </div> + <div class="gItemContainer"> + <a href="photo.html"><img id="photo-id-1" class="photo" alt="photo" src="<?= $theme->url("images/thumbnail.jpg") ?>" /></a> + <h2>Photo title</h2> + </div> - <div class="gItemContainer first"> - <a href="photo.html"><img id="photo-id-1" class="photo" alt="photo" src="<?= $theme->url("images/thumbnail.jpg") ?>" /></a> - <h2>Photo title</h2> - </div> + <div class="gItemContainer first"> + <a href="photo.html"><img id="photo-id-1" class="photo" alt="photo" src="<?= $theme->url("images/thumbnail.jpg") ?>" /></a> + <h2>Photo title</h2> + </div> - <div class="gItemContainer"> - <a href="photo.html"><img id="photo-id-1" class="photo" alt="photo" src="<?= $theme->url("images/thumbnail.jpg") ?>" /></a> - <h2>Photo title</h2> - </div> + <div class="gItemContainer"> + <a href="photo.html"><img id="photo-id-1" class="photo" alt="photo" src="<?= $theme->url("images/thumbnail.jpg") ?>" /></a> + <h2>Photo title</h2> + </div> - <div class="gItemContainer"> - <a href="photo.html"><img id="photo-id-1" class="photo" alt="photo" src="<?= $theme->url("images/thumbnail.jpg") ?>" /></a> - <h2>Photo title</h2> - </div> + <div class="gItemContainer"> + <a href="photo.html"><img id="photo-id-1" class="photo" alt="photo" src="<?= $theme->url("images/thumbnail.jpg") ?>" /></a> + <h2>Photo title</h2> + </div> - <div class="gItemContainer first"> - <a href="photo.html"><img id="photo-id-1" class="photo" alt="photo" src="<?= $theme->url("images/thumbnail.jpg") ?>" /></a> - <h2>Photo title</h2> - </div> + <div class="gItemContainer first"> + <a href="photo.html"><img id="photo-id-1" class="photo" alt="photo" src="<?= $theme->url("images/thumbnail.jpg") ?>" /></a> + <h2>Photo title</h2> + </div> - <div class="gItemContainer"> - <a href="photo.html"><img id="photo-id-1" class="photo" alt="photo" src="<?= $theme->url("images/thumbnail.jpg") ?>" /></a> - <h2>Photo title</h2> - </div> + <div class="gItemContainer"> + <a href="photo.html"><img id="photo-id-1" class="photo" alt="photo" src="<?= $theme->url("images/thumbnail.jpg") ?>" /></a> + <h2>Photo title</h2> + </div> - <div class="gItemContainer"> - <a href="photo.html"><img id="photo-id-1" class="photo" alt="photo" src="<?= $theme->url("images/thumbnail.jpg") ?>" /></a> - <h2>Photo title</h2> - </div> + <div class="gItemContainer"> + <a href="photo.html"><img id="photo-id-1" class="photo" alt="photo" src="<?= $theme->url("images/thumbnail.jpg") ?>" /></a> + <h2>Photo title</h2> + </div> - <div id="gPagination"> - Items 1-10 of 34 - <span class="first_inactive">first</span> - <span class="previous_inactive">previous</span> - <a href="#" class="next">next</a> - <a href="#" class="last">last</a> - </div> + <div id="gPagination"> + Items 1-10 of 34 + <span class="first_inactive">first</span> + <span class="previous_inactive">previous</span> + <a href="#" class="next">next</a> + <a href="#" class="last">last</a> + </div> </div> </div> diff --git a/themes/default/views/header.html.php b/themes/default/views/header.html.php index 797dcb7c..fd2df051 100644 --- a/themes/default/views/header.html.php +++ b/themes/default/views/header.html.php @@ -23,31 +23,31 @@ <body class="yui-skin-sam"> <div id="doc2" class="yui-t5 gAlbumView"> <div id="gHeader"> - <img id="gLogo" alt="<?= _("Logo") ?>" src="<?= $theme->url("images/logo.png") ?>" /> - - <h1><?= $item->title ?></h1> - - <div id="gLoginMenu"> - <a href="#"><?= _("Register") ?></a> | - <a href="#"><?= _("Login") ?> - </div> - - <ul id="gSiteMenu"> - <li><a href="index.html"><?= _("HOME") ?></a></li> - <li><a class="active" href="browse.html"><?= _("BROWSE") ?></a></li> - <li><a href="upload.html"><?= _("UPLOAD") ?></a></li> - <li><a href="upload.html"><?= _("MY GALLERY") ?></a></li> - <li><a href="#"><?= _("ADMIN") ?></a></li> - </ul> - - <ul id="gBreadcrumbs"> - <li class="root"><a href="#">Home</a></li> - <li><a href="#">Friends & Family</a></li> - <li class="active"><span>Christmas 2007</span></li> - </ul> - - <form id="gSearchForm"> - <input type="text" class="text" value="<?= _("Search Gallery ...") ?>"/> - <input type="submit" class="submit" value="search" /> - </form> - </div> + <img id="gLogo" alt="<?= _("Logo") ?>" src="<?= $theme->url("images/logo.png") ?>" /> + + <h1><?= $item->title ?></h1> + + <div id="gLoginMenu"> + <a href="#"><?= _("Register") ?></a> | + <a href="#"><?= _("Login") ?> + </div> + + <ul id="gSiteMenu"> + <li><a href="index.html"><?= _("HOME") ?></a></li> + <li><a class="active" href="browse.html"><?= _("BROWSE") ?></a></li> + <li><a href="upload.html"><?= _("UPLOAD") ?></a></li> + <li><a href="upload.html"><?= _("MY GALLERY") ?></a></li> + <li><a href="#"><?= _("ADMIN") ?></a></li> + </ul> + + <ul id="gBreadcrumbs"> + <li class="root"><a href="#">Home</a></li> + <li><a href="#">Friends & Family</a></li> + <li class="active"><span>Christmas 2007</span></li> + </ul> + + <form id="gSearchForm"> + <input type="text" class="text" value="<?= _("Search Gallery ...") ?>"/> + <input type="submit" class="submit" value="search" /> + </form> + </div> diff --git a/themes/default/views/page.html.php b/themes/default/views/page.html.php index d5be6f1f..53ea57a5 100644 --- a/themes/default/views/page.html.php +++ b/themes/default/views/page.html.php @@ -24,12 +24,12 @@ <div id="doc2" class="yui-t5 gAlbumView"> <?= $header ?> <div id="bd"> - <div id="yui-main"> - <div id="gContent" class="yui-b"> - <?= $content ?> - </div> - </div> - <?= $sidebar ?> + <div id="yui-main"> + <div id="gContent" class="yui-b"> + <?= $content ?> + </div> + </div> + <?= $sidebar ?> </div> <?= $footer ?> </div> diff --git a/themes/default/views/sidebar.html.php b/themes/default/views/sidebar.html.php index 923b4e4e..f8acc25b 100644 --- a/themes/default/views/sidebar.html.php +++ b/themes/default/views/sidebar.html.php @@ -6,23 +6,23 @@ <div id="gTreeContainer"><!-- there might be a better way to make this accessible to the JS --> <ul> - <li>Gallery - <ul> - <li>Friends & Family - <ul> - <li>Christmas 2006</li> - <li>Family Reunion</li> - <li>Christmas 2007</li> - </ul> - </li> - <li>Vactions - <ul> - <li>Cuba</li> - <li>Europe</li> - </ul> - </li> - </ul> - </li> + <li>Gallery + <ul> + <li>Friends & Family + <ul> + <li>Christmas 2006</li> + <li>Family Reunion</li> + <li>Christmas 2007</li> + </ul> + </li> + <li>Vactions + <ul> + <li>Cuba</li> + <li>Europe</li> + </ul> + </li> + </ul> + </li> </ul> </div> </div> @@ -76,24 +76,24 @@ <caption><h2>Album Info</h2></caption> <tbody> <tr> - <th>Name:</th> - <td><strong>Christmas 2007</strong></td> + <th>Name:</th> + <td><strong>Christmas 2007</strong></td> </tr> <tr> - <th>Taken:</th> - <td><span class="date" title="January 21, 2008 8:30pm">January 21, 2008</td> + <th>Taken:</th> + <td><span class="date" title="January 21, 2008 8:30pm">January 21, 2008</td> </tr> <tr> - <th>Location:</th> - <td><a href="#" title="see the location on a map">Mountain View</a></td> + <th>Location:</th> + <td><a href="#" title="see the location on a map">Mountain View</a></td> </tr> <tr> - <th>Owner:</th> - <td><a href="#">username</a></td> + <th>Owner:</th> + <td><a href="#">username</a></td> </tr> <tr> - <th>Uploaded:</th> - <td><span class="date" title="October 23, 2008 11:37am">October 23, 2008</td> + <th>Uploaded:</th> + <td><span class="date" title="October 23, 2008 11:37am">October 23, 2008</td> </tr> </tbody> </table> |