Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'master' of git@github.com:gallery/gallery3

  • Loading branch information...
commit 4e20e71d0375ed65d75dbdb12113f737db90b3e7 2 parents 7f48671 + 7577d02
@talmdal talmdal authored
Showing with 1,730 additions and 1,154 deletions.
  1. +1 −1  .build_number
  2. +24 −15 modules/comment/controllers/admin_manage_comments.php
  3. +28 −183 modules/comment/views/admin_manage_comments.html.php
  4. +157 −0 modules/comment/views/admin_manage_comments_queue.html.php
  5. +5 −0 modules/g2_import/controllers/admin_g2_import.php
  6. +56 −48 modules/g2_import/helpers/g2_import.php
  7. +1 −1  modules/g2_import/helpers/g2_import_event.php
  8. +6 −0 modules/g2_import/helpers/g2_import_task.php
  9. +7 −3 modules/g2_import/views/admin_g2_import.html.php
  10. +0 −1  modules/gallery/controllers/admin_theme_options.php
  11. +1 −9 modules/gallery/helpers/random.php
  12. +46 −0 modules/gallery/libraries/Gallery_View.php
  13. +0 −35 modules/gallery/libraries/MY_Pagination.php
  14. +0 −46 modules/gallery/libraries/Theme_View.php
  15. +1 −1  modules/gallery/models/item.php
  16. +1 −1  modules/gallery/tests/Albums_Controller_Test.php
  17. +1 −0  modules/gallery/tests/File_Structure_Test.php
  18. +1 −0  modules/gallery/tests/Gallery_Filters.php
  19. +1 −0  modules/gallery/tests/controller_auth_data.txt
  20. +72 −59 modules/gallery/tests/xss_data.txt
  21. +1 −1  modules/gallery/views/admin_block_welcome.html.php
  22. +47 −46 modules/gallery/views/admin_themes_buttonset.html.php
  23. +24 −6 modules/gallery_unit_test/helpers/test.php
  24. +461 −0 modules/gallery_unit_test/vendor/LoremIpsum.class.php
  25. +6 −3 modules/tag/models/tag.php
  26. +8 −0 modules/user/controllers/admin_users.php
  27. +1 −1  modules/user/views/admin_users.html.php
  28. +317 −0 themes/admin_wind/css/screen-rtl.css
  29. +10 −323 themes/admin_wind/css/screen.css
  30. +4 −0 themes/admin_wind/views/admin.html.php
  31. +0 −44 themes/admin_wind/views/pager.html.php
  32. +88 −0 themes/admin_wind/views/paginator.html.php
  33. +333 −0 themes/wind/css/screen-rtl.css
  34. +18 −327 themes/wind/css/screen.css
  35. +3 −0  themes/wind/views/page.html.php
View
2  .build_number
@@ -3,4 +3,4 @@
; process. You don't need to edit it. In fact..
;
; DO NOT EDIT THIS FILE BY HAND!
-build_number=128
+build_number=144
View
39 modules/comment/controllers/admin_manage_comments.php
@@ -28,8 +28,10 @@ public function index() {
->where("updated", "<", db::expr("UNIX_TIMESTAMP() - 86400 * 7"))
->execute();
- // Redirect to the appropriate queue
- url::redirect("admin/manage_comments/queue/unpublished");
+ $view = new Admin_View("admin.html");
+ $view->content = new View("admin_manage_comments.html");
+ $view->content->menu = $this->_menu($this->_counts());
+ print $view;
}
public function menu_labels() {
@@ -43,25 +45,32 @@ public function menu_labels() {
public function queue($state) {
$page = max(Input::instance()->get("page"), 1);
- $view = new Admin_View("admin.html");
- $view->page_title = t("Manage comments");
- $view->content = new View("admin_manage_comments.html");
- $view->content->counts = $this->_counts();
- $view->content->menu = $this->_menu($view->content->counts);
- $view->content->state = $state;
- $view->content->comments = ORM::factory("comment")
+ $view = new Gallery_View("admin_manage_comments_queue.html");
+ $view->counts = $this->_counts();
+ $view->menu = $this->_menu($view->counts);
+ $view->state = $state;
+ $view->comments = ORM::factory("comment")
->order_by("created", "DESC")
->order_by("id", "DESC")
->where("state", "=", $state)
->limit(self::$items_per_page)
->offset(($page - 1) * self::$items_per_page)
->find_all();
- $view->content->pager = new Pagination();
- $view->content->pager->initialize(
- array("query_string" => "page",
- "total_items" => $view->content->counts->$state,
- "items_per_page" => self::$items_per_page,
- "style" => "classic"));
+
+ // This view is not themed so we can't use $theme->url() in the view and have to
+ // reproduce Gallery_View::url() logic here.
+ $atn = theme::$admin_theme_name;
+ $view->fallback_avatar_url = url::abs_file("themes/$atn/images/avatar.jpg");
+
+ $view->page = $page;
+ $view->page_type = "collection";
+ $view->page_subtype = "admin_comments";
+ $view->page_size = self::$items_per_page;
+ $view->children_count = $this->_counts()->$state;
+ $view->max_pages = ceil($view->children_count / $view->page_size);
+
+ // Also we want to use $theme->paginator() so we need a dummy theme
+ $view->theme = $view;
print $view;
}
View
211 modules/comment/views/admin_manage_comments.html.php
@@ -2,200 +2,45 @@
<script type="text/javascript">
var set_state_url =
<?= html::js_string(url::site("admin/manage_comments/set_state/__ID__/__STATE__?csrf=$csrf")) ?>;
- function set_state(state, id) {
- $.get(set_state_url.replace("__STATE__", state).replace("__ID__", id),
+ var set_state = function(state, id) {
+ $("#g-comment-" + id).fadeOut("fast", function() {
+ $.get(set_state_url.replace("__STATE__", state).replace("__ID__", id),
{},
- function() {
- $("#g-comment-" + id).slideUp();
- update_menu();
- });
+ update_menu);
+ });
}
- var delete_url =
- <?= html::js_string(url::site("admin/manage_comments/delete/__ID__?csrf=$csrf")) ?>;
-
- function del(id) {
- $.get(delete_url.replace("__ID__", id),
- {},
- function() {
- $("#g-comment-" + id).slideUp();
- update_menu();
- });
- }
-
- function update_menu() {
+ var update_menu = function() {
$.get(<?= html::js_string(url::site("admin/manage_comments/menu_labels")) ?>, {},
function(data) {
for (var i = 0; i < data.length; i++) {
- $("#g-admin-comments-menu li:eq(" + i + ") a").html(data[i]);
+ $("#g-admin-comments ul li:eq(" + i + ") a").html(data[i]);
}
},
"json");
}
-</script>
-
-<div id="g-admin-comments" class="g-block">
- <h1> <?= t("Manage comments") ?> </h1>
- <div class="g-block-content">
- <!-- @todo: Highlight active menu option -->
- <div id="g-admin-comments-menu" class="ui-helper-clearfix">
- <?= $menu->render() ?>
- </div>
-
- <!-- @todo: Remove after setting active option? -->
- <h2>
- <? if ($state == "published"): ?>
- <?= t("Approved comments") ?>
- <? elseif ($state == "unpublished"): ?>
- <?= t("Comments awaiting moderation") ?>
- <? elseif ($state == "spam"): ?>
- <?= t("Spam comments") ?>
- <? elseif ($state == "deleted"): ?>
- <?= t("Recently deleted comments") ?>
- <? endif ?>
- </h2>
-
- <? if ($state == "spam"): ?>
- <div>
- <? $spam_caught = module::get_var("comment", "spam_caught") ?>
- <? if ($spam_caught > 0): ?>
- <p>
- <?= t2("Gallery has caught %count spam for you since you installed spam filtering.",
- "Gallery has caught %count spam for you since you installed spam filtering.",
- $spam_caught) ?>
- </p>
- <? endif ?>
- <p>
- <? if ($counts->spam): ?>
- <?= t2("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.",
- "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.",
- $counts->spam) ?>
- </p>
- <p>
- <a href="<?= url::site("admin/manage_comments/delete_all_spam?csrf=$csrf") ?>">
- <?= t("Delete all spam") ?>
- </a>
- <? else: ?>
- <?= t("Your spam queue is empty!") ?>
- <? endif ?>
- </p>
- </div>
- <? endif ?>
-
- <? if ($state == "deleted"): ?>
- <div>
- <p>
- <?= t("These are messages that have been recently deleted. They will be permanently erased automatically after 7 days.") ?>
- </p>
- </div>
- <? endif ?>
-
- <table id="g-admin-comments-list">
- <tr>
- <th>
- <?= t("Author") ?>
- </th>
- <th>
- <?= t("Comment") ?>
- </th>
- <th>
- <?= t("Actions") ?>
- </th>
- </tr>
- <? foreach ($comments as $comment): ?>
- <tr id="g-comment-<?= $comment->id ?>" class="<?= text::alternate("g-odd", "g-even") ?>">
- <td>
- <a href="#">
- <img src="<?= $comment->author()->avatar_url(40, $theme->url("images/avatar.jpg", true)) ?>"
- class="g-avatar"
- alt="<?= html::clean_attribute($comment->author_name()) ?>"
- width="40"
- height="40" />
- </a>
- <p><a href="mailto:<?= html::clean_attribute($comment->author_email()) ?>"
- title="<?= html::clean_attribute($comment->author_email()) ?>"> <?= html::clean($comment->author_name()) ?> </a></p>
- </td>
- <td>
- <div class="g-right">
- <? $item = $comment->item() ?>
- <div class="g-item g-photo">
- <a href="<?= $item->url() ?>">
- <? if ($item->has_thumb()): ?>
- <img src="<?= $item->thumb_url() ?>"
- alt="<?= html::purify($item->title)->for_html_attr() ?>"
- <?= photo::img_dimensions($item->thumb_width, $item->thumb_height, 75) ?>
- />
- <? else: ?>
- <?= t("No thumbnail") ?>
- <? endif ?>
- </a>
- </div>
- </div>
- <p><?= gallery::date($comment->created) ?></p>
- <?= nl2br(html::purify($comment->text)) ?>
- </td>
- <td>
- <ul class="g-buttonset-vertical">
- <? if ($comment->state != "unpublished"): ?>
- <li>
- <a href="javascript:set_state('unpublished',<?=$comment->id?>)"
- class="g-button ui-state-default ui-icon-left">
- <span class="ui-icon ui-icon-check"></span>
- <?= t("Unapprove") ?>
- </a>
- </li>
- <? endif ?>
- <? if ($comment->state != "published"): ?>
- <li>
- <a href="javascript:set_state('published',<?=$comment->id?>)"
- class="g-button ui-state-default ui-icon-left">
- <span class="ui-icon ui-icon-check"></span>
- <?= t("Approve") ?>
- </a>
- </li>
- <? endif ?>
- <? if ($comment->state != "spam"): ?>
- <li>
- <a href="javascript:set_state('spam',<?=$comment->id?>)"
- class="g-button ui-state-default ui-icon-left">
- <span class="ui-icon ui-icon-cancel"></span>
- <?= t("Spam") ?>
- </a>
- </li>
- <? endif ?>
- <!--
- <li>
- <a href="javascript:reply(<?=$comment->id?>)"
- class="g-button ui-state-default ui-icon-left">
- <span class="ui-icon ui-icon-arrowreturnthick-1-w"></span>
- <?= t("Reply") ?>
- </a>
- </li>
- <li>
- <a href="javascript:Edit(<?=$comment->id?>)"
- class="g-button ui-state-default ui-icon-left">
- <span class="ui-icon ui-icon-pencil"></span>
- <?= t("Edit") ?>
- </a>
- </li>
- -->
- <li>
- <a href="javascript:set_state('deleted',<?=$comment->id?>)"
- class="g-button ui-state-default ui-icon-left">
- <span class="ui-icon ui-icon-trash"></span>
- <?= t("Delete") ?>
- </a>
- </li>
- </ul>
- </td>
- </tr>
- <? endforeach ?>
- </table>
+ // Paginator clicks load their href in the active tab panel
+ var fix_links = function() {
+ $(".g-paginator a, a#g-delete-all-spam").click(function(event) {
+ event.stopPropagation();
+ $.scrollTo(0, 800, { easing: "swing" });
+ $(this).parents(".ui-tabs-panel").load(
+ $(this).attr("href"),
+ function() {
+ fix_links();
+ });
+ return false;
+ });
+ }
- <div class="g-paginator">
- <?= $pager ?>
- </div>
+ $(document).ready(function() {
+ $("#g-admin-comments").tabs({
+ show: fix_links,
+ });
+ });
+</script>
- </div>
+<div id="g-admin-comments" class="g-block">
+ <?= $menu->render() ?>
</div>
View
157 modules/comment/views/admin_manage_comments_queue.html.php
@@ -0,0 +1,157 @@
+<?php defined("SYSPATH") or die("No direct script access.") ?>
+<div class="g-block-content">
+ <? if ($state == "spam"): ?>
+ <div>
+ <? $spam_caught = module::get_var("comment", "spam_caught") ?>
+ <? if ($spam_caught > 0): ?>
+ <p>
+ <?= t2("Gallery has caught %count spam for you since you installed spam filtering.",
+ "Gallery has caught %count spam for you since you installed spam filtering.",
+ $spam_caught) ?>
+ </p>
+ <? endif ?>
+ <p>
+ <? if ($counts->spam): ?>
+ <?= t2("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.",
+ "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.",
+ $counts->spam) ?>
+ </p>
+ <p>
+ <a id="g-delete-all-spam"
+ href="<?= url::site("admin/manage_comments/delete_all_spam?csrf=$csrf") ?>">
+ <?= t("Delete all spam") ?>
+ </a>
+ <? else: ?>
+ <?= t("Your spam queue is empty!") ?>
+ <? endif ?>
+ </p>
+ </div>
+ <? endif ?>
+
+ <? if ($state == "deleted"): ?>
+ <div>
+ <p>
+ <?= t("These are messages that have been recently deleted. They will be permanently erased automatically after 7 days.") ?>
+ </p>
+ </div>
+ <? endif ?>
+
+ <div class="g-paginator">
+ <?= $theme->paginator() ?>
+ </div>
+ <table id="g-admin-comments-list">
+ <tr>
+ <th>
+ <?= t("Author") ?>
+ </th>
+ <th>
+ <?= t("Comment") ?>
+ </th>
+ <th>
+ <?= t("Actions") ?>
+ </th>
+ </tr>
+ <? foreach ($comments as $comment): ?>
+ <tr id="g-comment-<?= $comment->id ?>" class="<?= text::alternate("g-odd", "g-even") ?>">
+ <td>
+ <a href="#">
+ <img src="<?= $comment->author()->avatar_url(40, $fallback_avatar_url) ?>"
+ class="g-avatar"
+ alt="<?= html::clean_attribute($comment->author_name()) ?>"
+ width="40"
+ height="40" />
+ </a>
+ <p>
+ <a href="mailto:<?= html::clean_attribute($comment->author_email()) ?>"
+ title="<?= html::clean_attribute($comment->author_email()) ?>">
+ <?= html::clean($comment->author_name()) ?>
+ </a>
+ </p>
+ </td>
+ <td>
+ <div class="g-right">
+ <? $item = $comment->item() ?>
+ <div class="g-item g-photo">
+ <a href="<?= $item->url() ?>">
+ <? if ($item->has_thumb()): ?>
+ <img src="<?= $item->thumb_url() ?>"
+ alt="<?= html::purify($item->title)->for_html_attr() ?>"
+ <?= photo::img_dimensions($item->thumb_width, $item->thumb_height, 75) ?>
+ />
+ <? else: ?>
+ <?= t("No thumbnail") ?>
+ <? endif ?>
+ </a>
+ </div>
+ </div>
+ <p><?= gallery::date($comment->created) ?></p>
+ <?= nl2br(html::purify($comment->text)) ?>
+ </td>
+ <td>
+ <ul class="g-buttonset-vertical">
+ <? if ($comment->state != "unpublished" && $comment->state != "deleted"): ?>
+ <li>
+ <a href="javascript:set_state('unpublished',<?=$comment->id?>)"
+ class="g-button ui-state-default ui-icon-left">
+ <span class="ui-icon ui-icon-check"></span>
+ <?= t("Unapprove") ?>
+ </a>
+ </li>
+ <? endif ?>
+ <? if ($comment->state != "published"): ?>
+ <li>
+ <a href="javascript:set_state('published',<?=$comment->id?>)"
+ class="g-button ui-state-default ui-icon-left">
+ <span class="ui-icon ui-icon-check"></span>
+ <? if ($state == "deleted"): ?>
+ <?= t("Undelete") ?>
+ <? else: ?>
+ <?= t("Approve") ?>
+ <? endif ?>
+ </a>
+ </li>
+ <? endif ?>
+ <? if ($comment->state != "spam"): ?>
+ <li>
+ <a href="javascript:set_state('spam',<?=$comment->id?>)"
+ class="g-button ui-state-default ui-icon-left">
+ <span class="ui-icon ui-icon-cancel"></span>
+ <?= t("Spam") ?>
+ </a>
+ </li>
+ <? endif ?>
+ <!--
+ <li>
+ <a href="javascript:reply(<?=$comment->id?>)"
+ class="g-button ui-state-default ui-icon-left">
+ <span class="ui-icon ui-icon-arrowreturnthick-1-w"></span>
+ <?= t("Reply") ?>
+ </a>
+ </li>
+ <li>
+ <a href="javascript:Edit(<?=$comment->id?>)"
+ class="g-button ui-state-default ui-icon-left">
+ <span class="ui-icon ui-icon-pencil"></span>
+ <?= t("Edit") ?>
+ </a>
+ </li>
+ -->
+ <? if ($comment->state != "deleted"): ?>
+ <li>
+ <a href="javascript:set_state('deleted',<?=$comment->id?>)"
+ class="g-button ui-state-default ui-icon-left">
+ <span class="ui-icon ui-icon-trash"></span>
+ <?= t("Delete") ?>
+ </a>
+ </li>
+ <? endif ?>
+ </ul>
+ </td>
+ </tr>
+ <? endforeach ?>
+ </table>
+
+ <div class="g-paginator">
+ <?= $theme->paginator() ?>
+ </div>
+</div>
View
5 modules/g2_import/controllers/admin_g2_import.php
@@ -100,6 +100,11 @@ public function autocomplete() {
foreach (glob("{$path_prefix}*") as $file) {
if (is_dir($file) && !is_link($file)) {
$directories[] = $file;
+
+ // If we find an embed.php, include it as well
+ if (file_exists("$file/embed.php")) {
+ $directories[] = "$file/embed.php";
+ }
}
}
View
104 modules/g2_import/helpers/g2_import.php
@@ -448,49 +448,8 @@ static function import_album(&$queue) {
$album = ORM::factory("item");
$album->type = "album";
$album->parent_id = self::map($g2_album->getParentId());
- $album->name = $g2_album->getPathComponent();
- $album->title = self::_decode_html_special_chars($g2_album->getTitle());
- $album->title or $album->title = $album->name;
- $album->description = self::_decode_html_special_chars(self::extract_description($g2_album));
- $album->owner_id = self::map($g2_album->getOwnerId());
- try {
- $album->view_count = (int) g2(GalleryCoreApi::fetchItemViewCount($g2_album_id));
- } catch (Exception $e) {
- // @todo log
- $album->view_count = 0;
- }
- $album->created = $g2_album->getCreationTimestamp();
-
- $order_map = array(
- "originationTimestamp" => "captured",
- "creationTimestamp" => "created",
- "description" => "description",
- "modificationTimestamp" => "updated",
- "orderWeight" => "weight",
- "pathComponent" => "name",
- "summary" => "description",
- "title" => "title",
- "viewCount" => "view_count");
- $direction_map = array(
- 1 => "ASC",
- ORDER_ASCENDING => "ASC",
- ORDER_DESCENDING => "DESC");
- // Only consider G2's first sort order
- $g2_order = explode("|", $g2_album->getOrderBy() . "");
- $g2_order = $g2_order[0];
- if (empty($g2_order)) {
- $g2_order = g2(GalleryCoreApi::getPluginParameter('module', 'core', 'default.orderBy'));
- }
- $g2_order_direction = explode("|", $g2_album->getOrderDirection() . "");
- $g2_order_direction = $g2_order_direction[0];
- if (empty($g2_order_direction)) {
- $g2_order_direction =
- g2(GalleryCoreApi::getPluginParameter('module', 'core', 'default.orderDirection'));
- }
- if (array_key_exists($g2_order, $order_map)) {
- $album->sort_column = $order_map[$g2_order];
- $album->sort_order = $direction_map[$g2_order_direction];
- }
+
+ g2_import::set_album_values($album, $g2_album);
try {
$album->save();
@@ -513,17 +472,66 @@ static function import_album(&$queue) {
}
/**
+ * Transfer over all the values from a G2 album to a G3 album.
+ */
+ static function set_album_values($album, $g2_album) {
+ $album->name = $g2_album->getPathComponent();
+ $album->title = self::_decode_html_special_chars($g2_album->getTitle());
+ $album->title or $album->title = $album->name;
+ $album->description = self::_decode_html_special_chars(self::extract_description($g2_album));
+ $album->owner_id = self::map($g2_album->getOwnerId());
+ try {
+ $album->view_count = (int) g2(GalleryCoreApi::fetchItemViewCount($g2_album_id));
+ } catch (Exception $e) {
+ // @todo log
+ $album->view_count = 0;
+ }
+ $album->created = $g2_album->getCreationTimestamp();
+
+ $order_map = array(
+ "originationTimestamp" => "captured",
+ "creationTimestamp" => "created",
+ "description" => "description",
+ "modificationTimestamp" => "updated",
+ "orderWeight" => "weight",
+ "pathComponent" => "name",
+ "summary" => "description",
+ "title" => "title",
+ "viewCount" => "view_count");
+ $direction_map = array(
+ 1 => "ASC",
+ ORDER_ASCENDING => "ASC",
+ ORDER_DESCENDING => "DESC");
+ // G2 sorts can either be <sort> or <presort>|<sort>. Right now we can't
+ // map presorts so ignore them.
+ $g2_order = explode("|", $g2_album->getOrderBy() . "");
+ $g2_order = end($g2_order);
+ if (empty($g2_order)) {
+ $g2_order = g2(GalleryCoreApi::getPluginParameter('module', 'core', 'default.orderBy'));
+ }
+ $g2_order_direction = explode("|", $g2_album->getOrderDirection() . "");
+ $g2_order_direction = $g2_order_direction[0];
+ if (empty($g2_order_direction)) {
+ $g2_order_direction =
+ g2(GalleryCoreApi::getPluginParameter('module', 'core', 'default.orderDirection'));
+ }
+ if (array_key_exists($g2_order, $order_map)) {
+ $album->sort_column = $order_map[$g2_order];
+ $album->sort_order = $direction_map[$g2_order_direction];
+ }
+ }
+
+ /**
* Set the highlight properly for a single album
*/
static function set_album_highlight(&$queue) {
// Dequeue the current album and enqueue its children
list($g2_album_id, $children) = each($queue);
- if (empty($children)) {
- return;
- }
unset($queue[$g2_album_id]);
- foreach ($children as $key => $value) {
- $queue[$key] = $value;
+ if (!empty($children)) {
+ foreach ($children as $key => $value) {
+ $queue[$key] = $value;
+ }
}
$messages = array();
View
2  modules/g2_import/helpers/g2_import_event.php
@@ -34,7 +34,7 @@ static function admin_menu($menu, $theme) {
->get("settings_menu")
->append(Menu::factory("link")
->id("g2_import")
- ->label(t("Gallery 2 Import"))
+ ->label(t("Gallery 2 import"))
->url(url::site("admin/g2_import")));
}
}
View
6 modules/g2_import/helpers/g2_import_task.php
@@ -127,6 +127,12 @@ static function import($task) {
$g2_root_id = g2(GalleryCoreApi::getDefaultAlbumId());
$tree = g2(GalleryCoreApi::fetchAlbumTree());
$task->set("queue", $queue = array($g2_root_id => $tree));
+
+ // Update the root album to reflect the Gallery2 root album.
+ $root_album = item::root();
+ g2_import::set_album_values(
+ $root_album, g2(GalleryCoreApi::loadEntitiesById($g2_root_id)));
+ $root_album->save();
}
$log_message = g2_import::import_album($queue);
if ($log_message) {
View
10 modules/g2_import/views/admin_g2_import.html.php
@@ -30,9 +30,13 @@
.tabs("select", 1)
<? endif ?>
;
+
+ // Show the tabs after the page has loaded to prevent Firefox from rendering the
+ // unstyled page and then flashing.
+ $("#g-admin-g2-import-tabs").show();
});
</script>
- <div id="g-admin-g2-import-tabs" class="g-block-content">
+ <div id="g-admin-g2-import-tabs" class="g-block-content" style="display: none">
<ul>
<li>
<a href="#g-admin-g2-import-configure"><?= t("1. Configure Gallery2 path") ?></a>
@@ -112,8 +116,8 @@
</p>
<? endif ?>
</div>
- <div id="g-admin-g2-import-notes">
- <ul class="enumeration">
+ <div id="g-admin-g2-import-notes" class="g-text">
+ <ul>
<li>
<?= t("Gallery 3 does not support per-user / per-item permissions. <b>Review permissions!</b>") ?>
</li>
View
1  modules/gallery/controllers/admin_theme_options.php
@@ -108,7 +108,6 @@ private function _get_edit_form_admin() {
module::event("theme_edit_form", $form);
- $group = $form->group("buttons");
$group->submit("")->value(t("Save"));
return $form;
}
View
10 modules/gallery/helpers/random.php
@@ -19,7 +19,7 @@
*/
class random_Core {
/**
- * Return a random 32 bit hash value.
+ * Return a random 32 byte hash value.
* @param string extra entropy data
*/
static function hash($entropy="") {
@@ -27,14 +27,6 @@ static function hash($entropy="") {
}
/**
- * Return a random hexadecimal string of the given length.
- * @param int the desired length of the string
- */
- static function string($length) {
- return substr(random::hash(), 0, $length);
- }
-
- /**
* Return a random floating point number between 0 and 1
*/
static function percent() {
View
46 modules/gallery/libraries/Gallery_View.php
@@ -31,6 +31,52 @@ public function url($path, $absolute_url=false) {
}
/**
+ * Set up the data and render a pager.
+ *
+ * See themes/wind/views/pager.html for documentation on the variables generated here.
+ */
+ public function paginator() {
+ $v = new View("paginator.html");
+ $v->page_type = $this->page_type;
+ $v->page_subtype = $this->page_subtype;
+ $v->first_page_url = null;
+ $v->previous_page_url = null;
+ $v->next_page_url = null;
+ $v->last_page_url = null;
+
+ if ($this->page_type == "collection") {
+ $v->page = $this->page;
+ $v->max_pages = $this->max_pages;
+ $v->total = $this->children_count;
+
+ if ($this->page != 1) {
+ $v->first_page_url = url::site(url::merge(array("page" => 1)));
+ $v->previous_page_url = url::site(url::merge(array("page" => $this->page - 1)));
+ }
+
+ if ($this->page != $this->max_pages) {
+ $v->next_page_url = url::site(url::merge(array("page" => $this->page + 1)));
+ $v->last_page_url = url::site(url::merge(array("page" => $this->max_pages)));
+ }
+
+ $v->first_visible_position = ($this->page - 1) * $this->page_size + 1;
+ $v->last_visible_position = min($this->page * $this->page_size, $v->total);
+ } else if ($this->page_type == "item") {
+ $v->position = $this->position;
+ $v->total = $this->sibling_count;
+ if ($this->previous_item) {
+ $v->previous_page_url = $this->previous_item->url();
+ }
+
+ if ($this->next_item) {
+ $v->next_page_url = $this->next_item->url();
+ }
+ }
+
+ return $v;
+ }
+
+ /**
* Begin gather up scripts or css files so that they can be combined into a single request.
*
* @param $types a comma separated list of types to combine, eg "script,css"
View
35 modules/gallery/libraries/MY_Pagination.php
@@ -1,35 +0,0 @@
-<?php defined("SYSPATH") or die("No direct script access.");
-/**
- * Gallery - a web based photo album viewer and editor
- * Copyright (C) 2000-2011 Bharat Mediratta
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or (at
- * your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
- */
-class Pagination extends Pagination_Core {
- public function render($style=NULL) {
- // Hide single page pagination
- if ($this->auto_hide === TRUE AND $this->total_pages <= 1) {
- return "";
- }
-
- if ($style === NULL) {
- // Use default style
- $style = $this->style;
- }
-
- // Return rendered pagination view
- return View::factory("pager.html", get_object_vars($this))->render();
- }
-}
View
46 modules/gallery/libraries/Theme_View.php
@@ -139,52 +139,6 @@ public function context_menu($item, $thumbnail_css_selector) {
}
/**
- * Set up the data and render a pager.
- *
- * See themes/wind/views/pager.html for documentation on the variables generated here.
- */
- public function paginator() {
- $v = new View("paginator.html");
- $v->page_type = $this->page_type;
- $v->page_subtype = $this->page_subtype;
- $v->first_page_url = null;
- $v->previous_page_url = null;
- $v->next_page_url = null;
- $v->last_page_url = null;
-
- if ($this->page_type == "collection") {
- $v->page = $this->page;
- $v->max_pages = $this->max_pages;
- $v->total = $this->children_count;
-
- if ($this->page != 1) {
- $v->first_page_url = url::site(url::merge(array("page" => 1)));
- $v->previous_page_url = url::site(url::merge(array("page" => $this->page - 1)));
- }
-
- if ($this->page != $this->max_pages) {
- $v->next_page_url = url::site(url::merge(array("page" => $this->page + 1)));
- $v->last_page_url = url::site(url::merge(array("page" => $this->max_pages)));
- }
-
- $v->first_visible_position = ($this->page - 1) * $this->page_size + 1;
- $v->last_visible_position = min($this->page * $this->page_size, $v->total);
- } else if ($this->page_type == "item") {
- $v->position = $this->position;
- $v->total = $this->sibling_count;
- if ($this->previous_item) {
- $v->previous_page_url = $this->previous_item->url();
- }
-
- if ($this->next_item) {
- $v->next_page_url = $this->next_item->url();
- }
- }
-
- return $v;
- }
-
- /**
* Print out any site wide status information.
*/
public function site_status() {
View
2  modules/gallery/models/item.php
@@ -336,7 +336,7 @@ public function save() {
// Make an url friendly slug from the name, if necessary
if (empty($this->slug)) {
- $this->slug = item::convert_filename_to_slug($this->name);
+ $this->slug = item::convert_filename_to_slug(pathinfo($this->name, PATHINFO_FILENAME));
// If the filename is all invalid characters, then the slug may be empty here. Pick a
// random value.
View
2  modules/gallery/tests/Albums_Controller_Test.php
@@ -31,7 +31,7 @@ public function change_album_test() {
$album = test::random_album();
// Randomize to avoid conflicts.
- $new_name = "new_name_" . random::string(6);
+ $new_name = "new_name_" . test::random_string(6);
$_POST["name"] = $new_name;
$_POST["title"] = "new title";
View
1  modules/gallery/tests/File_Structure_Test.php
@@ -101,6 +101,7 @@ private function _check_php_preamble($path, &$errors) {
$expected_4 = array("<?php defined('SYSPATH') or die('No direct script access.');\n");
} else if (strpos($path, MODPATH . "forge") === 0 ||
strpos($path, MODPATH . "exif/lib") === 0 ||
+ strpos($path, MODPATH . "gallery_unit_test/vendor") === 0 ||
strpos($path, MODPATH . "gallery/lib/HTMLPurifier") === 0 ||
$path == MODPATH . "user/lib/PasswordHash.php" ||
$path == DOCROOT . "var/database.php") {
View
1  modules/gallery/tests/Gallery_Filters.php
@@ -38,6 +38,7 @@ public function accept() {
strpos($path_name, MODPATH . "forge") !== false ||
strpos($path_name, MODPATH . "gallery/views/kohana_error_page.php") !== false ||
strpos($path_name, MODPATH . "gallery/views/kohana_profiler.php") !== false ||
+ strpos($path_name, MODPATH . "gallery_unit_test/vendor") !== false ||
strpos($path_name, MODPATH . "gallery_unit_test/views/kohana_error_page.php") !== false ||
strpos($path_name, MODPATH . "gallery_unit_test/views/kohana_unit_test_cli.php") !== false ||
strpos($path_name, MODPATH . "unit_test") !== false ||
View
1  modules/gallery/tests/controller_auth_data.txt
@@ -1,6 +1,7 @@
modules/comment/controllers/admin_manage_comments.php queue DIRTY_CSRF
modules/comment/helpers/comment_rss.php feed DIRTY_AUTH
modules/digibug/controllers/digibug.php print_proxy DIRTY_CSRF|DIRTY_AUTH
+modules/g2_import/controllers/admin_g2_import.php autocomplete DIRTY_CSRF
modules/g2_import/controllers/g2.php map DIRTY_CSRF
modules/gallery/controllers/admin.php __call DIRTY_AUTH
modules/gallery/controllers/albums.php index DIRTY_AUTH
View
131 modules/gallery/tests/xss_data.txt
@@ -42,7 +42,8 @@ modules/digibug/views/digibug_form.html.php 4 DIRTY form::
modules/digibug/views/digibug_form.html.php 6 DIRTY form::hidden($key,$value)
modules/exif/views/exif_dialog.html.php 14 DIRTY $details[$i]["caption"]
modules/exif/views/exif_dialog.html.php 21 DIRTY $details[$i]["caption"]
-modules/g2_import/views/admin_g2_import.html.php 9 DIRTY $form
+modules/g2_import/views/admin_g2_import.html.php 7 DIRTY_JS url::site("__ARGS__")
+modules/g2_import/views/admin_g2_import.html.php 52 DIRTY $form
modules/gallery/views/admin_advanced_settings.html.php 21 DIRTY_ATTR text::alternate("g-odd","g-even")
modules/gallery/views/admin_advanced_settings.html.php 22 DIRTY $var->module_name
modules/gallery/views/admin_block_log_entries.html.php 4 DIRTY_ATTR log::severity_class($entry->severity)
@@ -77,30 +78,35 @@ modules/gallery/views/admin_languages.html.php 62 DIRTY form::
modules/gallery/views/admin_languages.html.php 63 DIRTY $display_name
modules/gallery/views/admin_languages.html.php 65 DIRTY form::radio("default_locale",$code,($default_locale==$code),((isset($installed_locales[$code]))?'':'disabled="disabled"'))
modules/gallery/views/admin_languages.html.php 113 DIRTY $share_translations_form
-modules/gallery/views/admin_maintenance.html.php 40 DIRTY_ATTR text::alternate("g-odd","g-even")
-modules/gallery/views/admin_maintenance.html.php 40 DIRTY_ATTR log::severity_class($task->severity)
-modules/gallery/views/admin_maintenance.html.php 41 DIRTY_ATTR log::severity_class($task->severity)
-modules/gallery/views/admin_maintenance.html.php 42 DIRTY $task->name
-modules/gallery/views/admin_maintenance.html.php 45 DIRTY $task->description
-modules/gallery/views/admin_maintenance.html.php 86 DIRTY_ATTR text::alternate("g-odd","g-even")
-modules/gallery/views/admin_maintenance.html.php 86 DIRTY_ATTR $task->state=="stalled"?"g-warning":""
-modules/gallery/views/admin_maintenance.html.php 87 DIRTY_ATTR $task->state=="stalled"?"g-warning":""
-modules/gallery/views/admin_maintenance.html.php 88 DIRTY gallery::date_time($task->updated)
-modules/gallery/views/admin_maintenance.html.php 91 DIRTY $task->name
-modules/gallery/views/admin_maintenance.html.php 106 DIRTY $task->status
-modules/gallery/views/admin_maintenance.html.php 162 DIRTY_ATTR text::alternate("g-odd","g-even")
-modules/gallery/views/admin_maintenance.html.php 162 DIRTY_ATTR $task->state=="success"?"g-success":"g-error"
-modules/gallery/views/admin_maintenance.html.php 163 DIRTY_ATTR $task->state=="success"?"g-success":"g-error"
-modules/gallery/views/admin_maintenance.html.php 164 DIRTY gallery::date_time($task->updated)
-modules/gallery/views/admin_maintenance.html.php 167 DIRTY $task->name
-modules/gallery/views/admin_maintenance.html.php 179 DIRTY $task->status
+modules/gallery/views/admin_maintenance.html.php 42 DIRTY_ATTR text::alternate("g-odd","g-even")
+modules/gallery/views/admin_maintenance.html.php 42 DIRTY_ATTR log::severity_class($task->severity)
+modules/gallery/views/admin_maintenance.html.php 43 DIRTY_ATTR log::severity_class($task->severity)
+modules/gallery/views/admin_maintenance.html.php 44 DIRTY $task->name
+modules/gallery/views/admin_maintenance.html.php 47 DIRTY $task->description
+modules/gallery/views/admin_maintenance.html.php 88 DIRTY_ATTR text::alternate("g-odd","g-even")
+modules/gallery/views/admin_maintenance.html.php 88 DIRTY_ATTR $task->state=="stalled"?"g-warning":""
+modules/gallery/views/admin_maintenance.html.php 89 DIRTY_ATTR $task->state=="stalled"?"g-warning":""
+modules/gallery/views/admin_maintenance.html.php 90 DIRTY gallery::date_time($task->updated)
+modules/gallery/views/admin_maintenance.html.php 93 DIRTY $task->name
+modules/gallery/views/admin_maintenance.html.php 108 DIRTY $task->status
+modules/gallery/views/admin_maintenance.html.php 164 DIRTY_ATTR text::alternate("g-odd","g-even")
+modules/gallery/views/admin_maintenance.html.php 164 DIRTY_ATTR $task->state=="success"?"g-success":"g-error"
+modules/gallery/views/admin_maintenance.html.php 165 DIRTY_ATTR $task->state=="success"?"g-success":"g-error"
+modules/gallery/views/admin_maintenance.html.php 166 DIRTY gallery::date_time($task->updated)
+modules/gallery/views/admin_maintenance.html.php 169 DIRTY $task->name
+modules/gallery/views/admin_maintenance.html.php 181 DIRTY $task->status
modules/gallery/views/admin_maintenance_show_log.html.php 8 DIRTY_JS url::site("admin/maintenance/save_log/$task->id?csrf=$csrf")
modules/gallery/views/admin_maintenance_show_log.html.php 13 DIRTY $task->name
modules/gallery/views/admin_maintenance_task.html.php 75 DIRTY $task->name
modules/gallery/views/admin_modules.html.php 51 DIRTY access::csrf_form_field()
-modules/gallery/views/admin_modules.html.php 60 DIRTY_ATTR text::alternate("g-odd","g-even")
-modules/gallery/views/admin_modules.html.php 63 DIRTY form::checkbox($data,'1',module::is_active($module_name))
-modules/gallery/views/admin_modules.html.php 65 DIRTY $module_info->version
+modules/gallery/views/admin_modules.html.php 61 DIRTY_ATTR text::alternate("g-odd","g-even")
+modules/gallery/views/admin_modules.html.php 64 DIRTY form::checkbox($data,'1',module::is_active($module_name))
+modules/gallery/views/admin_modules.html.php 66 DIRTY $module_info->version
+modules/gallery/views/admin_modules.html.php 74 DIRTY_JS $module_info->author_url
+modules/gallery/views/admin_modules.html.php 81 DIRTY_ATTR $module_info->author_name
+modules/gallery/views/admin_modules.html.php 85 DIRTY $module_info->author_name
+modules/gallery/views/admin_modules.html.php 93 DIRTY_JS $module_info->info_url
+modules/gallery/views/admin_modules.html.php 106 DIRTY_JS $module_info->discuss_url
modules/gallery/views/admin_modules_confirm.html.php 11 DIRTY_ATTR $css_class
modules/gallery/views/admin_modules_confirm.html.php 11 DIRTY $message
modules/gallery/views/admin_modules_confirm.html.php 16 DIRTY access::csrf_form_field()
@@ -114,12 +120,17 @@ modules/gallery/views/admin_themes.html.php 3 DIRTY_JS url::s
modules/gallery/views/admin_themes.html.php 5 DIRTY_JS $csrf
modules/gallery/views/admin_themes.html.php 22 DIRTY $themes[$site]->name
modules/gallery/views/admin_themes.html.php 24 DIRTY $themes[$site]->description
-modules/gallery/views/admin_themes.html.php 38 DIRTY $info->name
-modules/gallery/views/admin_themes.html.php 40 DIRTY $info->description
-modules/gallery/views/admin_themes.html.php 60 DIRTY $themes[$admin]->name
-modules/gallery/views/admin_themes.html.php 62 DIRTY $themes[$admin]->description
-modules/gallery/views/admin_themes.html.php 76 DIRTY $info->name
-modules/gallery/views/admin_themes.html.php 78 DIRTY $info->description
+modules/gallery/views/admin_themes.html.php 39 DIRTY $info->name
+modules/gallery/views/admin_themes.html.php 41 DIRTY $info->description
+modules/gallery/views/admin_themes.html.php 62 DIRTY $themes[$admin]->name
+modules/gallery/views/admin_themes.html.php 64 DIRTY $themes[$admin]->description
+modules/gallery/views/admin_themes.html.php 79 DIRTY $info->name
+modules/gallery/views/admin_themes.html.php 81 DIRTY $info->description
+modules/gallery/views/admin_themes_buttonset.html.php 7 DIRTY_JS $info['author_url']
+modules/gallery/views/admin_themes_buttonset.html.php 14 DIRTY_ATTR $info['author_name']
+modules/gallery/views/admin_themes_buttonset.html.php 18 DIRTY $info['author_name']
+modules/gallery/views/admin_themes_buttonset.html.php 26 DIRTY_JS $info['info_url']
+modules/gallery/views/admin_themes_buttonset.html.php 39 DIRTY_JS $info['discuss_url']
modules/gallery/views/admin_themes_preview.html.php 8 DIRTY_ATTR $url
modules/gallery/views/error_404.html.php 14 DIRTY $login_form
modules/gallery/views/error_admin.html.php 178 DIRTY @gallery_block::get("platform_info")
@@ -174,7 +185,8 @@ modules/gallery/views/form_uploadify.html.php 28 DIRTY_JS url::f
modules/gallery/views/form_uploadify.html.php 29 DIRTY_JS url::site("uploader/add_photo/{$album->id}")
modules/gallery/views/form_uploadify.html.php 33 DIRTY_JS url::file("lib/uploadify/cancel.png")
modules/gallery/views/form_uploadify.html.php 34 DIRTY_JS $simultaneous_upload_limit
-modules/gallery/views/form_uploadify.html.php 160 DIRTY_ATTR request::protocol()
+modules/gallery/views/form_uploadify.html.php 35 DIRTY_JS $size_limit_bytes
+modules/gallery/views/form_uploadify.html.php 162 DIRTY_ATTR request::protocol()
modules/gallery/views/in_place_edit.html.php 2 DIRTY form::open($action,array("method"=>"post","id"=>"g-in-place-edit-form","class"=>"g-short-form"))
modules/gallery/views/in_place_edit.html.php 3 DIRTY access::csrf_form_field()
modules/gallery/views/in_place_edit.html.php 6 DIRTY form::input("input",$form["input"]," class=\"textbox\"")
@@ -248,7 +260,7 @@ modules/gallery/views/permissions_form.html.php 80 DIRTY_JS $permi
modules/gallery/views/permissions_form.html.php 80 DIRTY_JS $item->id
modules/gallery/views/quick_delete_confirm.html.php 11 DIRTY $form
modules/gallery/views/reauthenticate.html.php 9 DIRTY $form
-modules/gallery/views/upgrade_checker_block.html.php 17 DIRTY $new_version
+modules/gallery/views/upgrade_checker_block.html.php 19 DIRTY $new_version
modules/gallery/views/upgrader.html.php 76 DIRTY_ATTR $done?"muted":""
modules/gallery/views/upgrader.html.php 94 DIRTY_ATTR $done?"muted":""
modules/gallery/views/upgrader.html.php 102 DIRTY_ATTR $module->version==$module->code_version?"current":"upgradeable"
@@ -330,8 +342,9 @@ modules/search/views/search.html.php 27 DIRTY_ATTR $ite
modules/search/views/search.html.php 28 DIRTY_JS $item->url()
modules/search/views/search.html.php 29 DIRTY $item->thumb_img()
modules/search/views/search.html.php 40 DIRTY $theme->paginator()
-modules/server_add/views/admin_server_add.html.php 5 DIRTY $form
-modules/server_add/views/admin_server_add.html.php 15 DIRTY_ATTR $id
+modules/server_add/views/admin_server_add.html.php 8 DIRTY_JS url::site("__ARGS__")
+modules/server_add/views/admin_server_add.html.php 19 DIRTY $form
+modules/server_add/views/admin_server_add.html.php 30 DIRTY_ATTR $id
modules/server_add/views/server_add_tree.html.php 20 DIRTY_ATTR is_dir($file)?"ui-icon-folder-collapsed":"ui-icon-document"
modules/server_add/views/server_add_tree.html.php 21 DIRTY_ATTR is_dir($file)?"g-directory":"g-file"
modules/server_add/views/server_add_tree_dialog.html.php 3 DIRTY_JS url::site("server_add/children?path=__PATH__")
@@ -365,21 +378,21 @@ modules/watermark/views/admin_watermarks.html.php 20 DIRTY_ATTR $wid
modules/watermark/views/admin_watermarks.html.php 20 DIRTY_ATTR $height
modules/watermark/views/admin_watermarks.html.php 20 DIRTY_ATTR $url
themes/admin_wind/views/admin.html.php 4 DIRTY $theme->html_attributes()
-themes/admin_wind/views/admin.html.php 31 DIRTY $theme->admin_head()
-themes/admin_wind/views/admin.html.php 40 DIRTY_JS $theme->url()
-themes/admin_wind/views/admin.html.php 45 DIRTY $theme->get_combined("script")
-themes/admin_wind/views/admin.html.php 48 DIRTY $theme->get_combined("css")
-themes/admin_wind/views/admin.html.php 52 DIRTY $theme->admin_page_top()
-themes/admin_wind/views/admin.html.php 60 DIRTY $theme->admin_header_top()
-themes/admin_wind/views/admin.html.php 61 DIRTY_JS item::root()->url()
-themes/admin_wind/views/admin.html.php 64 DIRTY $theme->user_menu()
-themes/admin_wind/views/admin.html.php 67 DIRTY $theme->admin_menu()
-themes/admin_wind/views/admin.html.php 70 DIRTY $theme->admin_header_bottom()
-themes/admin_wind/views/admin.html.php 77 DIRTY $content
-themes/admin_wind/views/admin.html.php 83 DIRTY $sidebar
-themes/admin_wind/views/admin.html.php 88 DIRTY $theme->admin_footer()
-themes/admin_wind/views/admin.html.php 91 DIRTY $theme->admin_credits()
-themes/admin_wind/views/admin.html.php 96 DIRTY $theme->admin_page_bottom()
+themes/admin_wind/views/admin.html.php 33 DIRTY $theme->admin_head()
+themes/admin_wind/views/admin.html.php 42 DIRTY_JS $theme->url()
+themes/admin_wind/views/admin.html.php 47 DIRTY $theme->get_combined("css")
+themes/admin_wind/views/admin.html.php 50 DIRTY $theme->get_combined("script")
+themes/admin_wind/views/admin.html.php 54 DIRTY $theme->admin_page_top()
+themes/admin_wind/views/admin.html.php 62 DIRTY $theme->admin_header_top()
+themes/admin_wind/views/admin.html.php 63 DIRTY_JS item::root()->url()
+themes/admin_wind/views/admin.html.php 66 DIRTY $theme->user_menu()
+themes/admin_wind/views/admin.html.php 69 DIRTY $theme->admin_menu()
+themes/admin_wind/views/admin.html.php 72 DIRTY $theme->admin_header_bottom()
+themes/admin_wind/views/admin.html.php 79 DIRTY $content
+themes/admin_wind/views/admin.html.php 85 DIRTY $sidebar
+themes/admin_wind/views/admin.html.php 90 DIRTY $theme->admin_footer()
+themes/admin_wind/views/admin.html.php 93 DIRTY $theme->admin_credits()
+themes/admin_wind/views/admin.html.php 98 DIRTY $theme->admin_page_bottom()
themes/admin_wind/views/block.html.php 3 DIRTY_ATTR $anchor
themes/admin_wind/views/block.html.php 5 DIRTY $id
themes/admin_wind/views/block.html.php 5 DIRTY_ATTR $css_id
@@ -414,19 +427,19 @@ themes/wind/views/page.html.php 4 DIRTY $theme
themes/wind/views/page.html.php 10 DIRTY $page_title
themes/wind/views/page.html.php 13 DIRTY $theme->item()->title
themes/wind/views/page.html.php 17 DIRTY item::root()->title
-themes/wind/views/page.html.php 31 DIRTY $new_width
-themes/wind/views/page.html.php 32 DIRTY $new_height
-themes/wind/views/page.html.php 33 DIRTY $thumb_proportion
-themes/wind/views/page.html.php 70 DIRTY_JS $theme->url()
-themes/wind/views/page.html.php 75 DIRTY $theme->get_combined("script")
-themes/wind/views/page.html.php 78 DIRTY $theme->get_combined("css")
-themes/wind/views/page.html.php 88 DIRTY $header_text
-themes/wind/views/page.html.php 90 DIRTY_JS item::root()->url()
-themes/wind/views/page.html.php 94 DIRTY $theme->user_menu()
-themes/wind/views/page.html.php 115 DIRTY_JS $parent->url($parent->id==$theme->item()->parent_id?"show={$theme->item()->id}":null)
-themes/wind/views/page.html.php 136 DIRTY $content
-themes/wind/views/page.html.php 142 DIRTY newView("sidebar.html")
-themes/wind/views/page.html.php 149 DIRTY $footer_text
+themes/wind/views/page.html.php 32 DIRTY $new_width
+themes/wind/views/page.html.php 33 DIRTY $new_height
+themes/wind/views/page.html.php 34 DIRTY $thumb_proportion
+themes/wind/views/page.html.php 71 DIRTY_JS $theme->url()
+themes/wind/views/page.html.php 76 DIRTY $theme->get_combined("css")
+themes/wind/views/page.html.php 79 DIRTY $theme->get_combined("script")
+themes/wind/views/page.html.php 89 DIRTY $header_text
+themes/wind/views/page.html.php 91 DIRTY_JS item::root()->url()
+themes/wind/views/page.html.php 95 DIRTY $theme->user_menu()
+themes/wind/views/page.html.php 116 DIRTY_JS $parent->url($parent->id==$theme->item()->parent_id?"show={$theme->item()->id}":null)
+themes/wind/views/page.html.php 137 DIRTY $content
+themes/wind/views/page.html.php 143 DIRTY newView("sidebar.html")
+themes/wind/views/page.html.php 150 DIRTY $footer_text
themes/wind/views/paginator.html.php 33 DIRTY_JS $first_page_url
themes/wind/views/paginator.html.php 42 DIRTY_JS $previous_page_url
themes/wind/views/paginator.html.php 70 DIRTY_JS $next_page_url
View
2  modules/gallery/views/admin_block_welcome.html.php
@@ -2,7 +2,7 @@
<p>
<?= t("This is your administration dashboard and it provides a quick overview of status messages, recent updates, and frequently used options. Add or remove blocks and rearrange them to tailor to your needs. The admin menu provides quick access to all of Gallery 3's options and settings. Here are a few of the most used options to get you started.") ?>
</p>
-<ul>
+<ul class="g-text">
<li>
<?= t("General Settings - choose your <a href=\"%graphics_url\">graphics</a> and <a href=\"%language_url\">language</a> settings.",
array("graphics_url" => html::mark_clean(url::site("admin/graphics")),
View
93 modules/gallery/views/admin_themes_buttonset.html.php
@@ -1,47 +1,48 @@
- <ul class="g-buttonset">
- <li>
- <a target="_blank"
- <? if (isset($info['author_url'])): ?>
- class="ui-state-default ui-icon ui-icon-person ui-corner-left"
- href="<?= $info['author_url'] ?>"
- <? else: ?>
- class="ui-state-disabled ui-icon ui-icon-person ui-corner-left"
- href="#"
- <? endif ?>
+<?php defined("SYSPATH") or die("No direct script access.") ?>
+<ul class="g-buttonset">
+ <li>
+ <a target="_blank"
+ <? if (isset($info['author_url'])): ?>
+ class="ui-state-default ui-icon ui-icon-person ui-corner-left"
+ href="<?= $info['author_url'] ?>"
+ <? else: ?>
+ class="ui-state-disabled ui-icon ui-icon-person ui-corner-left"
+ href="#"
+ <? endif ?>
- <? if (isset($info['author_name'])): ?>
- title="<?= $info['author_name'] ?>"
- <? endif ?>
- >
- <? if (isset($info['author_name'])): ?>
- <?= $info['author_name'] ?>
- <? endif ?>
- </a>
- </li>
- <li>
- <a target="_blank"
- <? if (isset($info['info_url'])): ?>
- class="ui-state-default ui-icon ui-icon-info"
- href="<?= $info['info_url'] ?>"
- <? else: ?>
- class="ui-state-disabled ui-icon ui-icon-info"
- href="#"
- <? endif ?>
- >
- <?= t("info") ?>
- </a>
- </li>
- <li>
- <a target="_blank"
- <? if (isset($info['discuss_url'])): ?>
- class="ui-state-default ui-icon ui-icon-comment ui-corner-right"
- href="<?= $info['discuss_url'] ?>"
- <? else: ?>
- class="ui-state-disabled ui-icon ui-icon-comment ui-corner-right"
- href="#"
- <? endif ?>
- >
- <?= t("discuss") ?>
- </a>
- </li>
- </ul>
+ <? if (isset($info['author_name'])): ?>
+ title="<?= $info['author_name'] ?>"
+ <? endif ?>
+ >
+ <? if (isset($info['author_name'])): ?>
+ <?= $info['author_name'] ?>
+ <? endif ?>
+ </a>
+ </li>
+ <li>
+ <a target="_blank"
+ <? if (isset($info['info_url'])): ?>
+ class="ui-state-default ui-icon ui-icon-info"
+ href="<?= $info['info_url'] ?>"
+ <? else: ?>
+ class="ui-state-disabled ui-icon ui-icon-info"
+ href="#"
+ <? endif ?>
+ >
+ <?= t("info") ?>
+ </a>
+ </li>
+ <li>
+ <a target="_blank"
+ <? if (isset($info['discuss_url'])): ?>
+ class="ui-state-default ui-icon ui-icon-comment ui-corner-right"
+ href="<?= $info['discuss_url'] ?>"
+ <? else: ?>
+ class="ui-state-disabled ui-icon ui-icon-comment ui-corner-right"
+ href="#"
+ <? endif ?>
+ >
+ <?= t("discuss") ?>
+ </a>
+ </li>
+</ul>
View
30 modules/gallery_unit_test/helpers/test.php
@@ -19,7 +19,7 @@
*/
class test_Core {
static function random_album_unsaved($parent=null) {
- $rand = random::string(6);
+ $rand = test::random_string(6);
$album = ORM::factory("item");
$album->type = "album";
@@ -34,7 +34,7 @@ static function random_album($parent=null) {
}
static function random_photo_unsaved($parent=null) {
- $rand = random::string(6);
+ $rand = test::random_string(6);
$photo = ORM::factory("item");
$photo->type = "photo";
$photo->parent_id = $parent ? $parent->id : 1;
@@ -49,16 +49,16 @@ static function random_photo($parent=null) {
}
static function random_user($password="password") {
- $rand = "name_" . random::string(6);
+ $rand = "name_" . test::random_string(6);
return identity::create_user($rand, $rand, $password, "$rand@rand.com");
}
static function random_group() {
- return identity::create_group(random::string(6));
+ return identity::create_group(test::random_string(6));
}
static function random_name($item=null) {
- $rand = "name_" . random::string(6);
+ $rand = "name_" . test::random_string(6);
if ($item && $item->is_photo()) {
$rand .= ".jpg";
}
@@ -77,7 +77,7 @@ static function call_and_capture($callback) {
static function random_tag() {
$tag = ORM::factory("tag");
- $tag->name = random::string(6);
+ $tag->name = test::lorem_ipsum(rand(2, 4));
// Reload so that ORM coerces all fields into strings.
return $tag->save()->reload();
@@ -88,4 +88,22 @@ static function diff($a, $b) {
fwrite(fopen($b_name = tempnam("/tmp", "test"), "w"), $b);
return `diff $a_name $b_name`;
}
+
+ static function random_string($length) {
+ $buf = "";
+ do {
+ $buf .= random::hash();
+ } while (strlen($buf) < $length);
+ return substr($buf, 0, $length);
+ }
+
+ static function lorem_ipsum($num) {
+ static $lorem_ipsum = null;
+ if (!$lorem_ipsum) {
+ require_once(MODPATH . "gallery_unit_test/vendor/LoremIpsum.class.php");
+ $lorem_ipsum = new LoremIpsumGenerator();
+ }
+ // skip past initial 'lorem ipsum'
+ return substr($lorem_ipsum->getContent($num + 2, "txt"), 13);
+ }
}
View
461 modules/gallery_unit_test/vendor/LoremIpsum.class.php
@@ -0,0 +1,461 @@
+<?php defined("SYSPATH") or die("No direct script access.");
+class LoremIpsumGenerator {
+ /**
+ * Copyright (c) 2009, Mathew Tinsley (tinsley@tinsology.net)
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of the organization nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY MATHEW TINSLEY ''AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+ private $words, $wordsPerParagraph, $wordsPerSentence;
+
+ function __construct($wordsPer = 100)
+ {
+ $this->wordsPerParagraph = $wordsPer;
+ $this->wordsPerSentence = 24.460;
+ $this->words = array(
+ 'lorem',
+ 'ipsum',
+ 'dolor',
+ 'sit',
+ 'amet',
+ 'consectetur',
+ 'adipiscing',
+ 'elit',
+ 'curabitur',
+ 'vel',
+ 'hendrerit',
+ 'libero',
+ 'eleifend',
+ 'blandit',
+ 'nunc',
+ 'ornare',
+ 'odio',
+ 'ut',
+ 'orci',
+ 'gravida',
+ 'imperdiet',
+ 'nullam',
+ 'purus',
+ 'lacinia',
+ 'a',
+ 'pretium',
+ 'quis',
+ 'congue',
+ 'praesent',
+ 'sagittis',
+ 'laoreet',
+ 'auctor',
+ 'mauris',
+ 'non',
+ 'velit',
+ 'eros',
+ 'dictum',
+ 'proin',
+ 'accumsan',
+ 'sapien',
+ 'nec',
+ 'massa',
+ 'volutpat',
+ 'venenatis',
+ 'sed',
+ 'eu',
+ 'molestie',
+ 'lacus',
+ 'quisque',
+ 'porttitor',
+ 'ligula',
+ 'dui',
+ 'mollis',
+ 'tempus',
+ 'at',
+ 'magna',
+ 'vestibulum',
+ 'turpis',
+ 'ac',
+ 'diam',
+ 'tincidunt',
+ 'id',
+ 'condimentum',
+ 'enim',
+ 'sodales',
+ 'in',
+ 'hac',
+ 'habitasse',
+ 'platea',
+ 'dictumst',
+ 'aenean',
+ 'neque',
+ 'fusce',
+ 'augue',
+ 'leo',
+ 'eget',
+ 'semper',
+ 'mattis',
+ 'tortor',
+ 'scelerisque',
+ 'nulla',
+ 'interdum',
+ 'tellus',
+ 'malesuada',
+ 'rhoncus',
+ 'porta',
+ 'sem',
+ 'aliquet',
+ 'et',
+ 'nam',
+ 'suspendisse',
+ 'potenti',
+ 'vivamus',
+ 'luctus',
+ 'fringilla',
+ 'erat',
+ 'donec',
+ 'justo',
+ 'vehicula',
+ 'ultricies',
+ 'varius',
+ 'ante',
+ 'primis',
+ 'faucibus',
+ 'ultrices',
+ 'posuere',
+ 'cubilia',
+ 'curae',
+ 'etiam',
+ 'cursus',
+ 'aliquam',
+ 'quam',
+ 'dapibus',
+ 'nisl',
+ 'feugiat',
+ 'egestas',
+ 'class',
+ 'aptent',
+ 'taciti',
+ 'sociosqu',
+ 'ad',
+ 'litora',
+ 'torquent',
+ 'per',
+ 'conubia',
+ 'nostra',
+ 'inceptos',
+ 'himenaeos',
+ 'phasellus',
+ 'nibh',
+ 'pulvinar',
+ 'vitae',
+ 'urna',
+ 'iaculis',
+ 'lobortis',
+ 'nisi',
+ 'viverra',
+ 'arcu',
+ 'morbi',
+ 'pellentesque',
+ 'metus',
+ 'commodo',
+ 'ut',
+ 'facilisis',
+ 'felis',
+ 'tristique',
+ 'ullamcorper',
+ 'placerat',
+ 'aenean',
+ 'convallis',
+ 'sollicitudin',
+ 'integer',
+ 'rutrum',
+ 'duis',
+ 'est',
+ 'etiam',
+ 'bibendum',
+ 'donec',
+ 'pharetra',
+ 'vulputate',
+ 'maecenas',
+ 'mi',
+ 'fermentum',
+ 'consequat',
+ 'suscipit',
+ 'aliquam',
+ 'habitant',
+ 'senectus',
+ 'netus',
+ 'fames',
+ 'quisque',
+ 'euismod',
+ 'curabitur',
+ 'lectus',
+ 'elementum',
+ 'tempor',
+ 'risus',
+ 'cras' );
+ }
+
+ function getContent($count, $format = 'html', $loremipsum = true)
+ {
+ $format = strtolower($format);
+
+ if($count <= 0)
+ return '';
+
+ switch($format)
+ {
+ case 'txt':
+ return $this->getText($count, $loremipsum);
+ case 'plain':
+ return $this->getPlain($count, $loremipsum);
+ default:
+ return $this->getHTML($count, $loremipsum);
+ }
+ }
+
+ private function getWords(&$arr, $count, $loremipsum)
+ {
+ $i = 0;
+ if($loremipsum)
+ {
+ $i = 2;
+ $arr[0] = 'lorem';
+ $arr[1] = 'ipsum';
+ }
+
+ for($i; $i < $count; $i++)
+ {
+ $index = array_rand($this->words);
+ $word = $this->words[$index];
+ //echo $index . '=>' . $word . '<br />';
+
+ if($i > 0 && $arr[$i - 1] == $word)
+ $i--;
+ else
+ $arr[$i] = $word;
+ }
+ }
+
+ private function getPlain($count, $loremipsum, $returnStr = true)
+ {
+ $words = array();
+ $this->getWords($words, $count, $loremipsum);
+ //print_r($words);
+
+ $delta = $count;
+ $curr = 0;
+ $sentences = array();
+ while($delta > 0)
+ {
+ $senSize = $this->gaussianSentence();
+ //echo $curr . '<br />';
+ if(($delta - $senSize) < 4)
+ $senSize = $delta;
+
+ $delta -= $senSize;
+
+ $sentence = array();
+ for($i = $curr; $i < ($curr + $senSize); $i++)
+ $sentence[] = $words[$i];
+
+ $this->punctuate($sentence);
+ $curr = $curr + $senSize;
+ $sentences[] = $sentence;
+ }
+
+ if($returnStr)
+ {
+ $output = '';
+ foreach($sentences as $s)
+ foreach($s as $w)
+ $output .= $w . ' ';
+
+ return $output;
+ }
+ else
+ return $sentences;
+ }
+
+ private function getText($count, $loremipsum)
+ {
+ $sentences = $this->getPlain($count, $loremipsum, false);
+ $paragraphs = $this->getParagraphArr($sentences);
+
+ $paragraphStr = array();
+ foreach($paragraphs as $p)
+ {
+ $paragraphStr[] = $this->paragraphToString($p);
+ }
+
+ $paragraphStr[0] = "\t" . $paragraphStr[0];
+ return implode("\n\n\t", $paragraphStr);
+ }
+
+ private function getParagraphArr($sentences)
+ {
+ $wordsPer = $this->wordsPerParagraph;
+ $sentenceAvg = $this->wordsPerSentence;
+ $total = count($sentences);
+
+ $paragraphs = array();
+ $pCount = 0;
+ $currCount = 0;
+ $curr = array();
+
+ for($i = 0; $i < $total; $i++)
+ {
+ $s = $sentences[$i];
+ $currCount += count($s);
+ $curr[] = $s;
+ if($currCount >= ($wordsPer - round($sentenceAvg / 2.00)) || $i == $total - 1)
+ {
+ $currCount = 0;
+ $paragraphs[] = $curr;
+ $curr = array();
+ //print_r($paragraphs);
+ }
+ //print_r($paragraphs);
+ }
+
+ return $paragraphs;
+ }
+
+ private function getHTML($count, $loremipsum)
+ {
+ $sentences = $this->getPlain($count, $loremipsum, false);
+ $paragraphs = $this->getParagraphArr($sentences);
+ //print_r($paragraphs);
+
+ $paragraphStr = array();
+ foreach($paragraphs as $p)
+ {
+ $paragraphStr[] = "<p>\n" . $this->paragraphToString($p, true) . '</p>';
+ }
+
+ //add new lines for the sake of clean code
+ return implode("\n", $paragraphStr);
+ }
+
+ private function paragraphToString($paragraph, $htmlCleanCode = false)
+ {
+ $paragraphStr = '';
+ foreach($paragraph as $sentence)
+ {
+ foreach($sentence as $word)
+ $paragraphStr .= $word . ' ';
+
+ if($htmlCleanCode)
+ $paragraphStr .= "\n";
+ }
+ return $paragraphStr;
+ }
+
+ /*
+ * Inserts commas and periods in the given
+ * word array.
+ */
+ private function punctuate(& $sentence)
+ {
+ $count = count($sentence);
+ $sentence[$count - 1] = $sentence[$count - 1] . '.';
+
+ if($count < 4)
+ return $sentence;
+
+ $commas = $this->numberOfCommas($count);
+
+ for($i = 1; $i <= $commas; $i++)
+ {
+ $index = (int) round($i * $count / ($commas + 1));
+
+ if($index < ($count - 1) && $index > 0)
+ {
+ $sentence[$index] = $sentence[$index] . ',';
+ }
+ }
+ }
+
+ /*
+ * Determines the number of commas for a
+ * sentence of the given length. Average and
+ * standard deviation are determined superficially
+ */
+ private function numberOfCommas($len)
+ {
+ $avg = (float) log($len, 6);
+ $stdDev = (float) $avg / 6.000;
+
+ return (int) round($this->gauss_ms($avg, $stdDev));
+ }
+
+ /*
+ * Returns a number on a gaussian distribution
+ * based on the average word length of an english
+ * sentence.
+ * Statistics Source:
+ * http://hearle.nahoo.net/Academic/Maths/Sentence.html
+ * Average: 24.46
+ * Standard Deviation: 5.08
+ */
+ private function gaussianSentence()
+ {
+ $avg = (float) 24.460;
+ $stdDev = (float) 5.080;
+
+ return (int) round($this->gauss_ms($avg, $stdDev));
+ }
+
+ /*
+ * The following three functions are used to
+ * compute numbers with a guassian distrobution
+ * Source:
+ * http://us.php.net/manual/en/function.rand.php#53784
+ */
+ private function gauss()
+ { // N(0,1)
+ // returns random number with normal distribution:
+ // mean=0
+ // std dev=1
+
+ // auxilary vars
+ $x=$this->random_0_1();
+ $y=$this->random_0_1();
+
+ // two independent variables with normal distribution N(0,1)
+ $u=sqrt(-2*log($x))*cos(2*pi()*$y);
+ $v=sqrt(-2*log($x))*sin(2*pi()*$y);
+
+ // i will return only one, couse only one needed
+ return $u;
+ }
+
+ private function gauss_ms($m=0.0,$s=1.0)
+ {
+ return $this->gauss()*$s+$m;
+ }
+
+ private function random_0_1()
+ {
+ return (float)rand()/(float)getrandmax();
+ }
+
+}
View
9 modules/tag/models/tag.php
@@ -75,8 +75,12 @@ public function save() {
->where("id", "!=", $this->id)
->find();
if ($duplicate_tag->loaded()) {
- // If so, tag its items with this tag so as to merge it.
- foreach ($duplicate_tag->items() as $item) {
+ // If so, tag its items with this tag so as to merge it
+ $duplicate_tag_items = ORM::factory("item")
+ ->join("items_tags", "items.id", "items_tags.item_id")
+ ->where("items_tags.tag_id", "=", $duplicate_tag->id)
+ ->find_all();
+ foreach ($duplicate_tag_items as $item) {
$this->add($item);
}
@@ -84,7 +88,6 @@ public function save() {
$duplicate_tag->delete();
}
- // Figure out what items have changed in this tag for our item_related_update event below
if (isset($this->object_relations["items"])) {
$added = array_diff($this->changed_relations["items"], $this->object_relations["items"]);
$removed = array_diff($this->object_relations["items"], $this->changed_relations["items"]);
View
8 modules/user/controllers/admin_users.php
@@ -21,6 +21,8 @@ class Admin_Users_Controller extends Admin_Controller {
public function index() {
$view = new Admin_View("admin.html");
$view->page_title = t("Users and groups");
+ $view->page_type = "collection";
+ $view->page_subtype = "admin_users";
$view->content = new View("admin_users.html");
// @todo: add this as a config option
@@ -29,6 +31,12 @@ public function index() {
$builder = db::build();
$user_count = $builder->from("users")->count_records();
+ // Pagination info
+ $view->page = $page;
+ $view->page_size = $page_size;
+ $view->children_count = $user_count;
+ $view->max_pages = ceil($view->children_count / $view->page_size);
+
$view->content->pager = new Pagination();
$view->content->pager->initialize(
array("query_string" => "page",
View
2  modules/user/views/admin_users.html.php
@@ -110,7 +110,7 @@ class="g-button ui-state-disabled ui-corner-all ui-icon-left">
</table>
<div class="g-paginator">
- <?= $pager ?>
+ <?= $theme->paginator() ?>
</div>
</div>
View
317 themes/admin_wind/css/screen-rtl.css
@@ -0,0 +1,317 @@
+/**
+ * Gallery 3 Admin Wind Theme Right-to-Left Screen Styles
+ */
+
+.rtl {
+ direction: rtl;
+}
+
+.rtl #g-header,
+.rtl #g-content,
+.rtl #g-sidebar,
+.rtl #g-footer,
+.rtl caption,
+.rtl th,
+.rtl #g-dialog,
+.rtl .g-context-menu li a,
+.rtl .g-message-box li,
+.rtl #g-site-status li {
+ text-align: right;
+}
+
+.rtl .g-text-right {
+ text-align: left;
+}
+
+/* Lists ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
+
+.g-text li,
+.g-text li {
+ margin-right: 1em;
+}
+
+/* Messages ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
+
+.rtl .g-error,
+.rtl .g-info,
+.rtl .g-success,
+.rtl .g-warning,
+.rtl #g-add-photos-status .g-success,
+.rtl #g-add-photos-status .g-error {
+ background-position: center right;
+ padding-right: 30px !important;
+}
+
+.rtl form li.g-error,
+.rtl form li.g-info,
+.rtl form li.g-success,
+.rtl form li.g-warning {
+ padding-right: 0 !important;
+}
+
+.rtl .g-left,
+.rtl .g-inline li,
+.rtl #g-content #g-album-grid .g-item,
+.rtl .sf-menu li,
+.rtl .g-breadcrumbs li,
+.rtl .g-paginator li,
+.rtl .g-buttonset li,
+.rtl .ui-icon-left .ui-icon,
+.rtl .g-short-form li,
+.rtl form ul ul li,
+.rtl input[type="submit"],
+.rtl input[type="reset"],
+.rtl input.checkbox,
+.rtl input[type=checkbox],
+.rtl input.radio,
+.rtl input[type=radio] {
+ float: right;
+}
+
+.rtl .g-right,
+.rtl .ui-icon-right .ui-icon {
+ float: left;
+}
+
+.rtl .g-inline li {
+ margin-right: 1em;
+}
+
+.rtl .g-inline li.g-first {
+ margin-right: 0;
+}
+
+.rtl .g-breadcrumbs li {
+ background: transparent url('../images/ico-separator-rtl.gif') no-repeat scroll right center;
+ padding: 1em 18px 1em 8px;
+}
+
+.rtl .g-breadcrumbs .g-first {
+ background: none;
+ padding-right: 0;
+}
+
+.rtl input.checkbox {
+ margin-left: .4em;
+}
+
+.rtl #g-add-comment {
+ right: inherit;
+ left: 0;
+}
+
+.rtl .ui-icon-left .ui-icon {
+ margin-left: .2em;
+}
+
+.rtl .ui-icon-right .ui-icon {
+ margin-right: .2em;
+}
+
+/* RTL Corner radius ~~~~~~~~~~~~~~~~~~~~~~ */
+
+.rtl .g-buttonset .ui-corner-tl {
+ -moz-border-radius-topleft: 0;
+ -webkit-border-top-left-radius: 0;
+ border-top-left-radius: 0;
+ -moz-border-radius-topright: 5px !important;
+ -webkit-border-top-right-radius: 5px !important;
+ border-top-right-radius: 5px !important;
+}
+
+.rtl .g-buttonset .ui-corner-tr {
+ -moz-border-radius-topright: 0;
+ -webkit-border-top-right-radius: 0;
+ border-top-right-radius: 0;
+ -moz-border-radius-topleft: 5px !important;
+ -webkit-border-top-left-radius: 5px !important;
+ border-top-left-radius: 5px !important;
+}
+
+.rtl .g-buttonset .ui-corner-bl {
+ -moz-border-radius-bottomleft: 0;
+ -webkit-border-bottom-left-radius: 0;
+ border-bottom-left-radius: 0;
+ -moz-border-radius-bottomright: 5px !important;
+ -webkit-border-bottom-right-radius: 5px !important;
+ border-bottom-right-radius: 5px !important;
+}
+
+.rtl .g-buttonset .ui-corner-br {
+ -moz-border-radius-bottomright: 0;
+ -webkit-border-bottom-right-radius: 0;
+ border-bottom-right-radius: 0;
+ -moz-border-radius-bottomleft: 5px !important;
+ -webkit-border-bottom-left-radius: 5px !important;
+ border-bottom-left-radius: 5px !important;
+}
+
+.rtl .g-buttonset .ui-corner-right,
+.rtl .ui-progressbar .ui-corner-right {
+ -moz-border-radius-topright: 0;
+ -webkit-border-top-right-radius: 0;
+ border-top-right-radius</