diff options
Diffstat (limited to 'modules/gallery/views')
-rw-r--r-- | modules/gallery/views/admin_languages.html.php | 15 | ||||
-rw-r--r-- | modules/gallery/views/error.html.php | 12 | ||||
-rw-r--r-- | modules/gallery/views/error_404.html.php | 21 | ||||
-rw-r--r-- | modules/gallery/views/kohana/error.php | 4 | ||||
-rw-r--r-- | modules/gallery/views/kohana_error_page.php | 127 | ||||
-rw-r--r-- | modules/gallery/views/menu.html.php | 4 | ||||
-rw-r--r-- | modules/gallery/views/menu_ajax_link.html.php | 2 | ||||
-rw-r--r-- | modules/gallery/views/menu_dialog.html.php | 2 | ||||
-rw-r--r-- | modules/gallery/views/menu_link.html.php | 2 | ||||
-rw-r--r-- | modules/gallery/views/reauthenticate.html.php | 5 | ||||
-rw-r--r-- | modules/gallery/views/upgrader.html.php | 2 | ||||
-rw-r--r-- | modules/gallery/views/user_profile.html.php | 84 | ||||
-rw-r--r-- | modules/gallery/views/user_profile_info.html.php | 2 | ||||
-rw-r--r-- | modules/gallery/views/welcome_message.html.php | 5 |
14 files changed, 87 insertions, 200 deletions
diff --git a/modules/gallery/views/admin_languages.html.php b/modules/gallery/views/admin_languages.html.php index 07134475..d4b7b0c1 100644 --- a/modules/gallery/views/admin_languages.html.php +++ b/modules/gallery/views/admin_languages.html.php @@ -49,13 +49,14 @@ </tr> <? $i = 0 ?> <? foreach ($available_locales as $code => $display_name): ?> - <? if ($i == (count($available_locales)/2)): ?> - <table> - <tr> - <th> <?= t("Installed") ?> </th> - <th> <?= t("Language") ?> </th> - <th> <?= t("Default language") ?> </th> - </tr> + <? if ($i == (int) (count($available_locales)/2)): ?> + </table> + <table> + <tr> + <th> <?= t("Installed") ?> </th> + <th> <?= t("Language") ?> </th> + <th> <?= t("Default language") ?> </th> + </tr> <? endif ?> <tr class="<?= (isset($installed_locales[$code])) ? "g-available" : "" ?><?= ($default_locale == $code) ? " g-selected" : "" ?>"> <td> <?= form::checkbox("installed_locales[]", $code, isset($installed_locales[$code])) ?> </td> diff --git a/modules/gallery/views/error.html.php b/modules/gallery/views/error.html.php new file mode 100644 index 00000000..5d81b651 --- /dev/null +++ b/modules/gallery/views/error.html.php @@ -0,0 +1,12 @@ +<?php defined("SYSPATH") or die("No direct script access.") ?> +<div id="g-error"> + <h1> + <?= t("Dang... Something went wrong!") ?> + </h1> + <h2> + <?= t("We tried really hard, but it's broken.") ?> + </h2> + <p> + <?= t("Talk to your Gallery administrator for help fixing this!") ?> + </p> +</div>
\ No newline at end of file diff --git a/modules/gallery/views/error_404.html.php b/modules/gallery/views/error_404.html.php new file mode 100644 index 00000000..4b037a79 --- /dev/null +++ b/modules/gallery/views/error_404.html.php @@ -0,0 +1,21 @@ +<?php defined("SYSPATH") or die("No direct script access.") ?> +<div id="g-error"> + <h1> + <?= t("Dang... Page not found!") ?> + </h1> + <? if ($is_guest): ?> + <h2> + <?= t("Hey wait, you're not signed in yet!") ?> + </h2> + <p> + <?= t("Maybe the page exists, but is only visible to authorized users.") ?> + <?= t("Please sign in to find out.") ?> + </p> + <?= $login_form ?> + <? else: ?> + <p> + <?= t("Maybe the page exists, but is only visible to authorized users.") ?> + <?= t("If you think this is an error, talk to your Gallery administrator!") ?> + </p> + <? endif; ?> +</div>
\ No newline at end of file diff --git a/modules/gallery/views/kohana/error.php b/modules/gallery/views/kohana/error.php index 26628cf2..d55105a0 100644 --- a/modules/gallery/views/kohana/error.php +++ b/modules/gallery/views/kohana/error.php @@ -204,7 +204,7 @@ <pre><?= $name?></pre> </td> <td class="value"> - <pre><?= Kohana_Exception::dump($arg) ?></pre> + <pre><?= Kohana_Exception::safe_dump($arg, $name) ?></pre> </td> </tr> <? endforeach?> @@ -265,7 +265,7 @@ </code> </td> <td class="value"> - <pre><?= Kohana_Exception::dump($value) ?></pre> + <pre><?= Kohana_Exception::safe_dump($value, $key) ?></pre> </td> </tr> <? endforeach?> diff --git a/modules/gallery/views/kohana_error_page.php b/modules/gallery/views/kohana_error_page.php deleted file mode 100644 index b9fdcc19..00000000 --- a/modules/gallery/views/kohana_error_page.php +++ /dev/null @@ -1,127 +0,0 @@ -<?php defined("SYSPATH") or die("No direct script access.") ?> -<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> - <head> - <style type="text/css"> - body { - background: #fff; - font-size: 14px; - line-height: 130%; - } - - div.big_box { - padding: 10px; - background: #eee; - border: solid 1px #ccc; - font-family: sans-serif; - color: #111; - width: 42em; - margin: 20px auto; - } - - div#framework_error { - text-align: center; - } - - div#error_details { - text-align: left; - } - - code { - font-family: monospace; - font-size: 12px; - margin: 20px; - color: #333; - white-space: pre-wrap; - white-space: -moz-pre-wrap; - word-wrap: break-word; - } - - h3 { - font-family: sans-serif; - margin: 2px 0px 0px 0px; - padding: 8px 0px 0px 0px; - border-top: 1px solid #ddd; - } - - p { - padding: 0px; - margin: 0px 0px 10px 0px; - } - - li, pre { - padding: 0px; - margin: 0px; - } - </style> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> - <title><?= t("Something went wrong!") ?></title> - </head> - <body> - <? try { $user = identity::active_user(); } catch (Exception $e) { } ?> - <? $admin = php_sapi_name() == "cli" || isset($user) && $user->admin ?> - <div class="big_box" id="framework_error"> - <h1> - <?= t("Dang... Something went wrong!") ?> - </h1> - <h2> - <?= t("We tried really hard, but it's broken.") ?> - </h2> - <? if (!$admin): ?> - <p> - <?= t("Talk to your Gallery administrator for help fixing this!") ?> - </p> - <? endif ?> - </div> - <? if ($admin): ?> - <div class="big_box" id="error_details"> - <h2> - <?= t("Hey wait, you're an admin! We can tell you stuff.") ?> - </h2> - <script type="text/javascript"> - var show_details = function() { - document.getElementById("stuff").style.display = "block"; - document.getElementById("toggle").style.display = "none"; - } - </script> - <a id="toggle" href="#" onclick="javascript:show_details(); return false;"> - <b><?= t("Ok.. tell me stuff!") ?></b> - </a> - <div id="stuff" style="display: none"> - <? if (!empty($line) and !empty($file)): ?> - <div id="summary"> - <h3> - <?= t("Help!") ?> - </h3> - <p> - <?= t("If this stuff doesn't make any sense to you, <a href=\"%url\">ask for help in the Gallery forums</a>!", array("url" => "http://gallery.menalto.com/forum/96")) ?> - </p> - <h3> - <?= t("So here's the error:") ?> - </h3> - - <code class="block"><?= $message ?></code> - <p> - <?= t("File: <b>%file</b>, line: <b>%line</b>", array("file" => $file, "line" => $line)) ?> - </p> - </div> - <? endif ?> - - <? $trace = $PHP_ERROR ? array_slice(debug_backtrace(), 1) : $exception->getTrace(); ?> - <? $trace = Kohana::backtrace($trace); ?> - <? if (!empty($trace)): ?> - <div id="stack_trace"> - <h3> - <?= t("And here's how we got there:") ?> - </h3> - <?= $trace ?> - <? endif ?> - </div> - </div> - <? else: ?> - <? $trace = $PHP_ERROR ? array_slice(debug_backtrace(), 1) : $exception->getTraceAsString(); ?> - <? if (!empty($trace)): ?> - <? Kohana_Log::add("error", print_r($trace, 1)); ?> - <? endif ?> - <? endif ?> - </body> -</html> diff --git a/modules/gallery/views/menu.html.php b/modules/gallery/views/menu.html.php index cb49bcdf..17a249dd 100644 --- a/modules/gallery/views/menu.html.php +++ b/modules/gallery/views/menu.html.php @@ -1,7 +1,7 @@ <?php defined("SYSPATH") or die("No direct script access.") ?> -<? if ($menu->elements): // Don't show the menu if it has no choices ?> +<? if (!$menu->is_empty()): // Don't show the menu if it has no choices ?> <? if ($menu->is_root): ?> -<ul <?= isset($menu->css_id) ? "id='$menu->css_id'" : "" ?> class="<?= $menu->css_class ?>"> +<ul <?= $menu->css_id ? "id='$menu->css_id'" : "" ?> class="<?= $menu->css_class ?>"> <? foreach ($menu->elements as $element): ?> <?= $element->render() ?> <? endforeach ?> diff --git a/modules/gallery/views/menu_ajax_link.html.php b/modules/gallery/views/menu_ajax_link.html.php index 00a394bc..06cd6f92 100644 --- a/modules/gallery/views/menu_ajax_link.html.php +++ b/modules/gallery/views/menu_ajax_link.html.php @@ -1,6 +1,6 @@ <?php defined("SYSPATH") or die("No direct script access.") ?> <li> - <a id="<?= $menu->css_id ?>" + <a <?= $menu->css_id ? "id='{$menu->css_id}'" : "" ?> class="g-ajax-link <?= $menu->css_class ?>" href="<?= $menu->url ?>" title="<?= $menu->label->for_html_attr() ?>" diff --git a/modules/gallery/views/menu_dialog.html.php b/modules/gallery/views/menu_dialog.html.php index 99b1b013..b44080c3 100644 --- a/modules/gallery/views/menu_dialog.html.php +++ b/modules/gallery/views/menu_dialog.html.php @@ -1,6 +1,6 @@ <?php defined("SYSPATH") or die("No direct script access.") ?> <li> - <a id="<?= $menu->css_id ?>" + <a <?= $menu->css_id ? "id='{$menu->css_id}'" : "" ?> class="g-dialog-link <?= $menu->css_class ?>" href="<?= $menu->url ?>" title="<?= $menu->label->for_html_attr() ?>"> diff --git a/modules/gallery/views/menu_link.html.php b/modules/gallery/views/menu_link.html.php index 8e4cdb95..a36d2754 100644 --- a/modules/gallery/views/menu_link.html.php +++ b/modules/gallery/views/menu_link.html.php @@ -1,6 +1,6 @@ <?php defined("SYSPATH") or die("No direct script access.") ?> <li> - <a id="<?= $menu->css_id ?>" + <a <?= $menu->css_id ? "id='{$menu->css_id}'" : "" ?> class="g-menu-link <?= $menu->css_class ?>" href="<?= $menu->url ?>" title="<?= $menu->label->for_html_attr() ?>"> diff --git a/modules/gallery/views/reauthenticate.html.php b/modules/gallery/views/reauthenticate.html.php index 8611d0f7..9a6696fb 100644 --- a/modules/gallery/views/reauthenticate.html.php +++ b/modules/gallery/views/reauthenticate.html.php @@ -7,4 +7,9 @@ <?= t("You are currently logged in as %user_name.", array("user_name" => $user_name)) ?> </p> <?= $form ?> + <script type="text/javascript"> + $("#g-reauthenticate-form").ready(function() { + $("#g-password").focus(); + }); + </script> </div>
\ No newline at end of file diff --git a/modules/gallery/views/upgrader.html.php b/modules/gallery/views/upgrader.html.php index 55731440..c7a96cb5 100644 --- a/modules/gallery/views/upgrader.html.php +++ b/modules/gallery/views/upgrader.html.php @@ -112,7 +112,7 @@ <? else: // can_upgrade ?> <h1> <?= t("Who are you?") ?> </h1> <p> - <?= t("You're not logged in as an administrator, so we have to verify you to make sure it's ok for you to do an upgrade. To prove you can run an upgrade, create a file called <b>%name</b> in your <b>%tmp_dir_path</b> directory.", + <?= t("You're not logged in as an administrator, so we have to verify you to make sure it's ok for you to do an upgrade. To prove you can run an upgrade, create a file called <b> %name </b> in your <b>%tmp_dir_path</b> directory.", array("name" => "$upgrade_token", "tmp_dir_path" => "gallery3/var/tmp")) ?> </p> diff --git a/modules/gallery/views/user_profile.html.php b/modules/gallery/views/user_profile.html.php index 1c3e4ea2..257bd7ca 100644 --- a/modules/gallery/views/user_profile.html.php +++ b/modules/gallery/views/user_profile.html.php @@ -1,28 +1,5 @@ <?php defined("SYSPATH") or die("No direct script access.") ?> -<style> - #g-user-profile div { - margin-top: 1em; - } - - #g-user-profile fieldset { - border: 1px solid #CCCCCC; - padding: 0 1em 0.8em; - } - - #g-user-profile fieldset label { - font-weight: bold; - } - - #g-user-profile fieldset div { - padding-left: 1em; - } - - #g-user-profile td { - border: none; - padding: 0; - } -</style> -<script> +<script type="text/javascript"> $(document).ready(function() { $("#g-profile-return").click(function(event) { history.go(-1); @@ -31,45 +8,40 @@ }); </script> <div id="g-user-profile"> - <h1> - <a href="#"> - <img src="<?= $user->avatar_url(40, $theme->url("images/avatar.jpg", true)) ?>" - alt="<?= html::clean_attribute($user->display_name()) ?>" - class="g-avatar" width="40" height="40" /> - </a> - <?= t("%name Profile", array("name" => $user->display_name())) ?> - </h1> - <? foreach ($info_parts as $info): ?> - <div> - <fieldset> - <label><?= html::purify($info->title) ?></label> - <div> - <?= $info->view ?> - </div> - </fieldset> - </div> - <? endforeach ?> - <div id="g-profile-buttons" class="ui-helper-clearfix g-right"> - <? if (!$user->guest && $not_current && !empty($user->email)): ?> - <a class="g-button ui-icon-right ui-state-default ui-corner-all g-dialog-link" - href="<?= url::site("user_profile/contact/{$user->id}") ?>"> - <?= t("Contact") ?> + <div class="ui-helper-clearfix"> + <a id="g-profile-return" class="g-button g-right ui-state-default ui-corner-all" href="#"> + <?= t("Return") ?> </a> - <? endif ?> <? if ($editable): ?> - <a class="g-button ui-icon-right ui-state-default ui-corner-all g-dialog-link" href="<?= url::site("form/edit/users/{$user->id}") ?>"> - <?= t("Edit") ?> + <a class="g-button g-right ui-state-default ui-corner-all g-dialog-link" href="<?= url::site("users/form_change_email/{$user->id}") ?>"> + <?= t("Change email") ?> </a> - <a class="g-button ui-icon-right ui-state-default ui-corner-all g-dialog-link" href="<?= url::site("users/form_change_password/{$user->id}") ?>"> + <a class="g-button g-right ui-state-default ui-corner-all g-dialog-link" href="<?= url::site("users/form_change_password/{$user->id}") ?>"> <?= t("Change password") ?> </a> - <a class="g-button ui-icon-right ui-state-default ui-corner-all g-dialog-link" href="<?= url::site("users/form_change_email/{$user->id}") ?>"> - <?= t("Change email") ?> + <a class="g-button g-right ui-state-default ui-corner-all g-dialog-link" href="<?= url::site("form/edit/users/{$user->id}") ?>"> + <?= t("Edit") ?> </a> <? endif ?> - - <a id="g-profile-return" class="g-button ui-icon-right ui-state-default ui-corner-all" href="#"> - <?= t("Return") ?> + <? if ($contactable): ?> + <a class="g-button g-right ui-state-default ui-corner-all g-dialog-link" + href="<?= url::site("user_profile/contact/{$user->id}") ?>"> + <?= t("Contact") ?> </a> + <? endif ?> </div> + <h1> + <img src="<?= $user->avatar_url(40, $theme->url("images/avatar.jpg", true)) ?>" + alt="<?= html::clean_attribute($user->display_name()) ?>" + class="g-avatar g-left" width="40" height="40" /> + <?= t("User profile: %name", array("name" => $user->display_name())) ?> + </h1> + <? foreach ($info_parts as $info): ?> + <div class="g-block"> + <h2><?= html::purify($info->title) ?></h2> + <div class="g-block-content"> + <?= $info->view ?> + </div> + </div> + <? endforeach ?> </div> diff --git a/modules/gallery/views/user_profile_info.html.php b/modules/gallery/views/user_profile_info.html.php index 58e134bb..e559abda 100644 --- a/modules/gallery/views/user_profile_info.html.php +++ b/modules/gallery/views/user_profile_info.html.php @@ -2,7 +2,7 @@ <table> <? foreach ($user_profile_data as $label => $value): ?> <tr> - <td><?= html::clean($label) ?></td> + <th><?= html::clean($label) ?></th> <td><?= html::purify($value) ?></td> </tr> <? endforeach ?> diff --git a/modules/gallery/views/welcome_message.html.php b/modules/gallery/views/welcome_message.html.php index caeeff66..4d6ed726 100644 --- a/modules/gallery/views/welcome_message.html.php +++ b/modules/gallery/views/welcome_message.html.php @@ -15,12 +15,15 @@ </p> <p> - <a href="<?= url::site("user_profile/show/{$user->id}") ?>" + <a href="<?= url::site("admin/users/edit_user_form/{$user->id}") ?>" title="<?= t("Edit your profile")->for_html_attr() ?>" id="g-after-install-change-password-link" class="g-button ui-state-default ui-corners-all"> <?= t("Change password and email now") ?> </a> + <script type="text/javascript"> + $("#g-after-install-change-password-link").gallery_dialog(); + </script> </p> <p> |