1
0

Merge branch 'master' of git@github.com:gallery/gallery3-contrib into talmdal

This commit is contained in:
Tim Almdal 2009-10-08 13:47:39 -07:00
commit 291ae111e6
174 changed files with 9690 additions and 184 deletions

1
last_commit.txt Executable file
View File

@ -0,0 +1 @@
Removed preload

View File

@ -0,0 +1,154 @@
<?php defined("SYSPATH") or die("No direct script access.");
/**
* Gallery - a web based photo album viewer and editor
* Copyright (C) 2000-2009 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 Admin_Postage_Bands_Controller extends Controller
{
/**
* the index page of the user homes admin
*/
public function index()
{
$view = new Admin_View("admin.html");
$view->content = new View("admin_postage_bands.html");
$view->content->postage_bands = ORM::factory("postage_band")->orderby("name")->find_all();
print $view;
}
public function add_postage_band_form() {
print postage_band::get_add_form_admin();
}
public function add_postage_band() {
access::verify_csrf();
$form = postage_band::get_add_form_admin();
$valid = $form->validate();
$name = $form->add_postage->inputs["name"]->value;
$postage = ORM::factory("postage_band")->where("name", $name)->find();
if ($postage->loaded) {
$form->add_postage->inputs["name"]->add_error("in_use", 1);
$valid = false;
}
if ($valid) {
$postage = postage_band::create(
$name,
$form->add_postage->flat_rate->value,
$form->add_postage->per_item->value
);
$postage->save();
message::success(t("Created postage band %postage_name", array(
"postage_name" => html::clean($postage->name))));
print json_encode(array("result" => "success"));
} else {
print json_encode(array("result" => "error",
"form" => $form->__toString()));
}
}
public function delete_postage_band_form($id) {
$postage = ORM::factory("postage_band", $id);
if (!$postage->loaded) {
kohana::show_404();
}
print postage_band::get_delete_form_admin($postage);
}
public function delete_postage_band($id) {
access::verify_csrf();
if ($id == user::active()->id || $id == user::guest()->id) {
access::forbidden();
}
$postage = ORM::factory("postage_band", $id);
if (!$postage->loaded) {
kohana::show_404();
}
$form = postage_band::get_delete_form_admin($postage);
if($form->validate()) {
$name = $postage->name;
$postage->delete();
} else {
print json_encode(array("result" => "error",
"form" => $form->__toString()));
}
$message = t("Deleted user %postage_band", array("postage_band" => html::clean($name)));
log::success("user", $message);
message::success($message);
print json_encode(array("result" => "success"));
}
public function edit_postage_band($id) {
access::verify_csrf();
$postage = ORM::factory("postage_band", $id);
if (!$postage->loaded) {
kohana::show_404();
}
$form = postage_band::get_edit_form_admin($postage);
$valid = $form->validate();
if ($valid) {
$new_name = $form->edit_postage->inputs["name"]->value;
if ($new_name != $postage->name &&
ORM::factory("postage_band")
->where("name", $new_name)
->where("id !=", $postage->id)
->find()
->loaded) {
$form->edit_postage->inputs["name"]->add_error("in_use", 1);
$valid = false;
} else {
$postage->name = $new_name;
}
}
if ($valid) {
$postage->flat_rate = $form->edit_postage->flat_rate->value;
$postage->per_item = $form->edit_postage->per_item->value;
$postage->save();
message::success(t("Changed postage band %postage_name",
array("postage_name" => html::clean($postage->name))));
print json_encode(array("result" => "success"));
} else {
print json_encode(array("result" => "error",
"form" => $form->__toString()));
}
}
public function edit_postage_band_form($id) {
$postage = ORM::factory("postage_band", $id);
if (!$postage->loaded) {
kohana::show_404();
}
$form = postage_band::get_edit_form_admin($postage);
print $form;
}
}

View File

@ -51,7 +51,11 @@ class Admin_Product_Lines_Controller extends Controller
if ($valid) {
$product = product::create(
$name, $form->add_product->cost->value, $form->add_product->description->value);
$name,
$form->add_product->cost->value,
$form->add_product->description->value,
$form->add_product->postage_band->value
);
$product->save();
message::success(t("Created product %product_name", array(
@ -83,7 +87,7 @@ class Admin_Product_Lines_Controller extends Controller
kohana::show_404();
}
$form = user::get_delete_form_admin($product);
$form = product::get_delete_form_admin($product);
if($form->validate()) {
$name = $product->name;
$product->delete();
@ -126,6 +130,7 @@ class Admin_Product_Lines_Controller extends Controller
if ($valid) {
$product->cost = $form->edit_product->cost->value;
$product->description = $form->edit_product->description->value;
$product->postage_band_id = $form->edit_product->postage_band->value;
$product->save();
message::success(t("Changed product %product_name",

View File

@ -31,7 +31,7 @@ class Basket_Controller extends Controller {
print $template;
}
private function getCheckoutForm(){
private function getCheckoutForm(){
$form = new Forge("basket/confirm", "", "post", array("id" => "checkout", "name" =>"checkout"));
$group = $form->group("contact")->label(t("Contact Details"));
$group->input("fullname")->label(t("Name"))->id("fullname");
@ -110,6 +110,8 @@ class Basket_Controller extends Controller {
$basket = Session_Basket::get();
//$admin_address = basket::getEmailAddress();
$postage = $basket->postage_cost();
$product_cost = $basket->cost();
$admin_email = "Order for :
".$basket->name."
@ -121,7 +123,9 @@ class Basket_Controller extends Controller {
".$basket->email."
".$basket->phone."
Placed at ".date("d F Y - H:i" ,time())."
Total Owed ".$basket->cost()." in ".basket::getCurrency()."
Cost of Ordered Products = ".$product_cost."
Postage and Packaging Costs + ".$postage."
Total Owed ".($product_cost+$postage)." Total in ".basket::getCurrency()."
Items Ordered:

View File

@ -42,9 +42,9 @@ class basket_Core {
static $format= array(
"AUD" => "$",
"CAD" => "$",
"EUR" => "<EFBFBD>",
"GBP" => "<EFBFBD>",
"JPY" => "<EFBFBD>",
"EUR" => "&euro;",
"GBP" => "&pound;",
"JPY" => "&yen;",
"USD" => "$",
"NZD" => "$",
"CHF" => "",
@ -114,7 +114,7 @@ class basket_Core {
}
static function formatMoney($money){
return self::$format[self::getCurrency()].number_format($money);
return self::$format[self::getCurrency()].number_format($money,2);
}
static function setEmailAddress($email){
@ -141,6 +141,12 @@ class basket_Core {
<input type=\"hidden\" name=\"currency_code\" value=\"".self::getCurrency()."\">
<input type=\"hidden\" name=\"business\" value=\"".self::getPaypalAccount()."\"/>";
$postage = $session_basket->postage_cost();
if ($postage > 0) {
$form = $form."
<input type=\"hidden\" name=\"shipping_1\" value=\"".$postage."\">";
}
$id = 1;
foreach ($session_basket->contents as $key => $basket_item){
$form = $form."
@ -149,6 +155,7 @@ class basket_Core {
<input type=\"hidden\" name=\"quantity_$id\" value=\"$basket_item->quantity\"/>";
$id++;
}
$form = $form."</form>";
return $form;

View File

@ -38,6 +38,11 @@ class basket_event_Core{
->id("product_line")
->label(t("Product Lines"))
->url(url::site("admin/product_lines")));
$basket_menu->append(
Menu::factory("link")
->id("postage_bands")
->label(t("Postage Bands"))
->url(url::site("admin/postage_bands")));
}

View File

@ -17,14 +17,18 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
*/
class basket_installer {
static function install() {
class basket_installer
{
static function install(){
$db = Database::instance();
$db->query("CREATE TABLE IF NOT EXISTS {products} (
`id` int(9) NOT NULL auto_increment,
`name` TEXT NOT NULL,
`cost` INTEGER(9) default 0,
`cost` DECIMAL(10,2) default 0,
`description` varchar(1024),
`postage_band_id` int(9) default 1,
PRIMARY KEY (`id`))
DEFAULT CHARSET=utf8;");
@ -40,21 +44,57 @@ class basket_installer {
`product_override_id` int(9) NOT NULL,
`product_id` int(9) NOT NULL,
`include` BOOLEAN default false,
`cost` INTEGER(9) default -1,
`cost` DECIMAL(10,2) default -1,
PRIMARY KEY (`id`))
ENGINE=InnoDB DEFAULT CHARSET=utf8;");
$db->query("CREATE TABLE IF NOT EXISTS {postage_bands} (
`id` int(9) NOT NULL auto_increment,
`name` TEXT NOT NULL,
`flat_rate` DECIMAL(10,2) default 0,
`per_item` DECIMAL(10,2) default 0,
PRIMARY KEY (`id`))
DEFAULT CHARSET=utf8;");
product::create("4x6",5,"4\"x6\" print");
product::create("8x10",25,"8\"x10\" print");
product::create("8x12",30,"8\"x12\" print");
postage_band::create("No Postage",0,0);
product::create("4x6",5,"4\"x6\" print",1);
product::create("8x10",25,"8\"x10\" print",1);
product::create("8x12",30,"8\"x12\" print",1);
module::set_version("basket", 2);
module::set_version("basket", 1);
}
static function uninstall() {
static function upgrade($version) {
$db = Database::instance();
if ($version == 1) {
// fix for allowing decimel place in money
$db->query("ALTER TABLE {products} CHANGE COLUMN `cost` `cost` DECIMAL(10,2) default 0;");
$db->query("ALTER TABLE {item_products} CHANGE COLUMN `cost` `cost` DECIMAL(10,2) default -1;");
// postage bands
$db->query("ALTER TABLE {products} ADD COLUMN `postage_band_id` int(9) default 1");
$db->query("CREATE TABLE IF NOT EXISTS {postage_bands} (
`id` int(9) NOT NULL auto_increment,
`name` TEXT NOT NULL,
`flat_rate` DECIMAL(10,2) default 0,
`per_item` DECIMAL(10,2) default 0,
PRIMARY KEY (`id`))
ENGINE=InnoDB DEFAULT CHARSET=utf8;");
postage_band::create("No Postage",0,0);
module::set_version("basket", $version = 2);
}
}
static function uninstall(){
$db = Database::instance();
$db->query("DROP TABLE IF EXISTS {products}");
$db->query("DROP TABLE IF EXISTS {product_overrides}");
$db->query("DROP TABLE IF EXISTS {item_products}");
$db->query("DROP TABLE IF EXISTS {postage_bands}");
}
}

View File

@ -0,0 +1,99 @@
<?php defined("SYSPATH") or die("No direct script access.");
/**
* Gallery - a web based photo album viewer and editor
* Copyright (C) 2000-2009 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 postage_band_Core {
static function get_add_form_admin() {
$form = new Forge("admin/postage_bands/add_postage_band", "", "post", array("id" => "gAddPostageForm"));
$group = $form->group("add_postage")->label(t("Add Postage Band"));
$group->input("name")->label(t("Name"))->id("gPostageName")
->error_messages("in_use", t("There is already a postage band with that name"));
$group->input("flat_rate")->label(t("Flat Rate"))->id("gFlatRate");
$group->input("per_item")->label(t("Per Item"))->id("gPetItem");
$group->submit("")->value(t("Add Postage Band"));
$postage = ORM::factory("postage_band");
$form->add_rules_from($postage);
return $form;
}
static function get_edit_form_admin($postage) {
$form = new Forge("admin/postage_bands/edit_postage_band/$postage->id", "", "post",
array("id" => "gEditPostageForm"));
$group = $form->group("edit_postage")->label(t("Edit Postage Band"));
$group->input("name")->label(t("Name"))->id("gPostageName")->value($postage->name);
$group->inputs["name"]->error_messages(
"in_use", t("There is already a postage band with that name"));
$group->input("flat_rate")->label(t("Flat Rate"))->id("gFlatRate")->value($postage->flat_rate);
$group->input("per_item")->label(t("Per Item"))->id("gPetItem")->
value($postage->per_item);
$group->submit("")->value(t("Modify Postage Band"));
$form->add_rules_from($postage);
return $form;
}
static function get_delete_form_admin($postage) {
$form = new Forge("admin/postage_bands/delete_postage_band/$postage->id", "", "post",
array("id" => "gDeletePostageForm"));
$group = $form->group("delete_postage")->label(
t("Are you sure you want to delete postage band %name?", array("name" => $postage->name)));
$group->submit("")->value(t("Delete postage band %name", array("name" => $postage->name)));
return $form;
}
/**
* Create a new postage band
*
* @param string $name
* @param string $full_name
* @param string $password
* @return User_Model
*/
static function create($name, $flatrate, $peritemcost) {
$postage = ORM::factory("postage_band")->where("name", $name)->find();
if ($postage->loaded) {
throw new Exception("@todo postage already EXISTS $name");
}
$postage->name = $name;
$postage->flat_rate = $flatrate;
$postage->per_item = $peritemcost;
$postage->save();
return $postage;
}
/**
* returns the array of postage bands
* @return an array of postage bands
*/
static function getPostageArray(){
$postagea = array();
$postages = ORM::factory("postage_band")->find_all();
foreach ($postages as $postage){
$show = true;
$postagea[$postage->id] = $postage->name;
}
return $postagea;
}
}

View File

@ -24,8 +24,11 @@ class product_Core {
$group = $form->group("add_product")->label(t("Add Product"));
$group->input("name")->label(t("Name"))->id("g-product-name")
->error_messages("in_use", t("There is already a product with that name"));
$group->input("cost")->label(t("Cost"))->id("g-cost");
$group->input("cost")->label(t("Cost"))->id("gCost");
$group->input("description")->label(t("Description"))->id("g-description");
$group->dropdown("postage_band")
->label(t("Postage Band"))
->options(postage_band::getPostageArray());
$group->submit("")->value(t("Add Product"));
$product = ORM::factory("product");
$form->add_rules_from($product);
@ -42,6 +45,10 @@ class product_Core {
$group->input("cost")->label(t("Cost"))->id("g-cost")->value($product->cost);
$group->input("description")->label(t("Description"))->id("g-description")->
value($product->description);
$group->dropdown("postage_band")
->label(t("Postage Band"))
->options(postage_band::getPostageArray())
->selected($product->postage_band_id);
$group->submit("")->value(t("Modify Product"));
$form->add_rules_from($product);
@ -66,7 +73,7 @@ class product_Core {
* @param string $password
* @return User_Model
*/
static function create($name, $cost, $description) {
static function create($name, $cost, $description, $postage_band) {
$product = ORM::factory("product")->where("name", $name)->find();
if ($product->loaded) {
throw new Exception("@todo USER_ALREADY_EXISTS $name");
@ -75,7 +82,7 @@ class product_Core {
$product->name = $name;
$product->cost = $cost;
$product->description = $description;
$product->postage_band_id = $postage_band;
$product->save();
return $product;
}

View File

@ -64,6 +64,11 @@ class basket_item
return $prod->description;
}
public function getProduct(){
$prod = ORM::factory("product", $this->product);
return $prod;
}
public function getCode(){
$photo = ORM::factory("item", $this->item);
$prod = ORM::factory("product", $this->product);
@ -122,6 +127,32 @@ class Session_Basket_Core {
unset($this->contents[$key]);
}
public function postage_cost(){
$postage_cost = 0;
$postage_bands = array();
$postage_quantities = array();
if (isset($this->contents)){
// create array of postage bands
foreach ($this->contents as $product => $basket_item){
$postage_band = $basket_item->getProduct()->postage_band;
if (isset($postage_bands[$postage_band->id]))
{
$postage_quantities[$postage_band->id] += $basket_item->quantity;
}
else
{
$postage_quantities[$postage_band->id] = $basket_item->quantity;
$postage_bands[$postage_band->id] = $postage_band;
}
}
foreach ($postage_bands as $id => $postage_band){
$postage_cost += $postage_band->flat_rate + ($postage_band->per_item * $postage_quantities[$id]);
}
}
return $postage_cost;
}
public function cost(){
$cost = 0;
if (isset($this->contents)){

View File

@ -0,0 +1,26 @@
<?php defined("SYSPATH") or die("No direct script access.");
/**
* Gallery - a web based photo album viewer and editor
* Copyright (C) 2000-2009 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 Postage_Band_Model extends ORM {
var $rules = array(
"name" => "length[1,32]");
protected $has_many=array('products');
}

View File

@ -21,4 +21,6 @@ class Product_Model extends ORM {
var $rules = array(
"name" => "length[1,32]",
"description" => "length[0,255]");
protected $belongs_to=array('postage_band');
}

View File

@ -1,3 +1,3 @@
name = "Shopping Basket"
description = "Provides a simple shopping basket and checkout with paypal integration"
version = 1
version = 2

View File

@ -0,0 +1,70 @@
<?php defined("SYSPATH") or die("No direct script access.")
/**
* Gallery - a web based photo album viewer and editor
* Copyright (C) 2000-2009 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.
*/
?>
<div class="gBlock">
<a href="<?= url::site("admin/postage_bands/add_postage_band_form") ?>"
class="gDialogLink gButtonLink right ui-icon-left ui-state-default ui-corner-all"
title="<?= t("Create a new Postage Band") ?>">
<span class="ui-icon ui-icon-circle-plus"></span>
<?= t("Add a new Postage Band") ?>
</a>
<h2>
<?= t("Postage Bands") ?>
</h2>
<div class="gBlockContent">
<table id="gPostageAdminList">
<tr>
<th><?= t("Name") ?></th>
<th><?= t("Flat Rate") ?></th>
<th><?= t("Per Item") ?></th>
<th><?= t("Actions") ?></th>
</tr>
<? foreach ($postage_bands as $i => $postage_band): ?>
<tr id="gProduct-<?= $postage_band->id ?>" class="<?= text::alternate("gOddRow", "gEvenRow") ?>">
<td id="product-<?= $postage_band->id ?>" class="core-info ">
<?= html::clean($postage_band->name) ?>
</td>
<td>
<?= basket::formatMoney($postage_band->flat_rate) ?>
</td>
<td>
<?= basket::formatMoney($postage_band->per_item) ?>
</td>
<td class="gActions">
<a href="<?= url::site("admin/postage_bands/edit_postage_band_form/$postage_band->id") ?>"
open_text="<?= t("close") ?>"
class="gPanelLink gButtonLink ui-state-default ui-corner-all ui-icon-left">
<span class="ui-icon ui-icon-pencil"></span><span class="gButtonText"><?= t("edit") ?></span></a>
<a href="<?= url::site("admin/postage_bands/delete_postage_band_form/$postage_band->id") ?>"
class="gDialogLink gButtonLink ui-state-default ui-corner-all ui-icon-left">
<span class="ui-icon ui-icon-trash"></span><?= t("delete") ?></a>
</td>
</tr>
<? endforeach ?>
</table>
</div>
</div>

View File

@ -37,6 +37,7 @@
<th><?= t("Name") ?></th>
<th><?= t("Cost") ?></th>
<th><?= t("Description") ?></th>
<th><?= t("Postage Band") ?></th>
<th><?= t("Actions") ?></th>
</tr>
@ -51,6 +52,11 @@
<td>
<?= html::clean($product->description) ?>
</td>
<td>
<?= html::clean($product->postage_band->name) ?>
</td>
<td class="g-actions">
<a href="<?= url::site("admin/product_lines/edit_product_form/$product->id") ?>"
open_text="<?= t("close") ?>"

View File

@ -51,8 +51,14 @@ function so(){document.confirm.submit();}
</td>
</tr>
<? endforeach ?>
<? $postage = $basket->postage_cost();?>
<? if ($postage > 0):?>
<tr id="" class="<?= text::alternate("g-odd", "g-even") ?>">
<td></td><td></td><td>Total Cost</td><td><?= html::clean($basket->cost())?></td>
<td></td><td></td><td>Postage and Packaging</td><td><?= html::clean(basket::formatMoney($postage))?></td><td></td>
</tr>
<? endif;?>
<tr id="" class="<?= text::alternate("g-odd", "g-even") ?>">
<td></td><td></td><td>Total Cost</td><td><?= html::clean(basket::formatMoney($basket->cost() + $postage))?></td>
</tr>
</table>
</div>

View File

@ -88,8 +88,14 @@
</td>
</tr>
<? endforeach ?>
<? $postage = $basket->postage_cost();?>
<? if ($postage > 0):?>
<tr id="" class="<?= text::alternate("g-odd", "g-even") ?>">
<td></td><td></td><td>Total Cost</td><td><?= html::clean(basket::formatMoney($total))?></td><td></td>
<td></td><td></td><td>Postage and Packaging</td><td><?= html::clean(basket::formatMoney($postage))?></td><td></td>
</tr>
<? endif;?>
<tr id="" class="<?= text::alternate("g-odd", "g-even") ?>">
<td></td><td></td><td>Total Cost</td><td><?= html::clean(basket::formatMoney($total + $postage))?></td><td></td>
</tr>
</table>

View File

@ -24,11 +24,23 @@ class BatchTag_Controller extends Controller {
// Prevent Cross Site Request Forgery
access::verify_csrf();
// Generate an array of all non-album items in the current album.
$children = ORM::factory("item")
->where("parent_id", $this->input->post("item_id"))
->where("type !=", "album")
->find_all();
// Figure out if the contents of sub-albums should also be tagged
$str_tag_subitems = Input::instance()->post("tag_subitems");
$children = "";
if ($str_tag_subitems == false) {
// Generate an array of all non-album items in the current album.
$children = ORM::factory("item")
->where("parent_id", $this->input->post("item_id"))
->where("type !=", "album")
->find_all();
} else {
// Generate an array of all non-album items in the current album
// and any sub albums.
$children = ORM::factory("item", $this->input->post("item_id"))
->where("type !=", "album")
->descendants();
}
// Loop through each item in the album and make sure the user has
// access to view and edit it.

View File

@ -17,20 +17,22 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
*/
class batchtag_theme_Core {
static function sidebar_blocks($theme) {
// Display form for tagging in the album sidebar.
// Make sure the current page belongs to an item.
if (!$theme->item()) {
return;
}
$item = $theme->item();
// Only display the form in albums that the user has edit permission in.
if ($item->is_album() && access::can("edit", $item)) {
class batchtag_block_Core {
static function get_site_list() {
return array("batch_tag" => t("Batch Tag"));
}
static function get($block_id, $theme) {
$block = "";
// Only display on album pages that the user can edit.
$item = $theme->item();
if (!$item->is_album() || !access::can("edit", $item)) {
return;
}
switch ($block_id) {
case "batch_tag":
// Make a new sidebar block.
$block = new Block();
$block->css_id = "g-batch-tag";
@ -43,12 +45,17 @@ class batchtag_theme_Core {
$label = t("Tag everything in this album:");
$group = $form->group("add_tag")->label("Add Tag");
$group->input("name")->label($label)->rules("required|length[1,64]");
$group->checkbox("tag_subitems")
->label(t("Include sub-albums?"))
->value(true)
->checked(false);
$group->hidden("item_id")->value($item->id);
$group->submit("")->value(t("Add Tag"));
$block->content->form = $form;
$block->content->batch_tag_form = $form;
// Display the block.
return $block;
}
break;
}
return $block;
}
}
}

View File

@ -1,3 +1,3 @@
name = BatchTag
description = Automatically apply a tag to the entire contents of an album.
name = "BatchTag"
description = "Automatically apply a tag to the entire contents of an album."
version = 1

View File

@ -1,2 +1,2 @@
<?php defined("SYSPATH") or die("No direct script access.") ?>
<?= $form ?>
<?= $batch_tag_form ?>

View File

@ -0,0 +1,78 @@
<?php defined("SYSPATH") or die("No direct script access.");
/**
* Gallery - a web based photo album viewer and editor
* Copyright (C) 2000-2009 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 contactowner_block_Core {
static function get_site_list() {
return array("contact_owner" => t("Contact Owner"));
}
static function get($block_id, $theme) {
$block = "";
switch ($block_id) {
case "contact_owner":
// Create a new block to display the links in.
$block = new Block();
$block->css_id = "g-contact-owner";
$block->title = t("Contact");
$block->content = new View("contactowner_block.html");
// if $displayBlock is true, this block will be displayed,
// if there aren't any links to put in the block for whatever reason
// then $displayBlock will rename set to false and the
// block will not be displayed.
$displayBlock = false;
if ($theme->item()) {
// Locate the record for the user that created the current item.
// Their name will be displayed as part of the contact link.
$userDetails = ORM::factory("user")
->where("id", $theme->item->owner_id)
->find_all();
// Figure out if the contact item owner email link should be displayed.
// only display it if the current owner has an email address and
// the option for allowing item owners to be contacted is set to true.
if ((count($userDetails) > 0) && ($userDetails[0]->email != "") &&
(module::get_var("contactowner", "contact_user_link") == true)) {
$block->content->userLink = "<a href=\"" . url::site("contactowner/emailid/" .
$theme->item->owner_id) . "\">" . t("Contact") . " " .
$userDetails[0]->name . "</a>";
$displayBlock = true;
}
}
// Figure out if the contact site owner link should be displayed.
if (module::get_var("contactowner", "contact_owner_link")) {
$block->content->ownerLink = "<a href=\"" . url::site("contactowner/emailowner") .
"\">" . t(module::get_var("contactowner", "contact_button_text")) . "</a>";
$displayBlock = true;
}
break;
}
if ($displayBlock) {
return $block;
} else {
return "";
}
}
}

View File

@ -1,70 +0,0 @@
<?php defined("SYSPATH") or die("No direct script access.");
/**
* Gallery - a web based photo album viewer and editor
* Copyright (C) 2000-2009 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 contactowner_theme_Core {
static function sidebar_blocks($theme) {
// Display links in the Gallery sidebar to allow a
// visitor to send an email.
// Make sure the current page belongs to an item.
if (!$theme->item()) {
return;
}
// Locate the record for the user that created the current item.
// Their name will be displayed as part of the contact link.
$userDetails = ORM::factory("user")
->where("id", $theme->item->owner_id)
->find_all();
// Create a new block to display the links in.
$block = new Block();
$block->css_id = "g-contact-owner";
$block->title = t("Contact:");
$block->content = new View("contactowner_block.html");
// if $displayBlock is true, this block will be displayed,
// if there aren't any links to put in the block for whatever reason
// then $displayBlock will rename set to false and the
// block will not be displayed.
$displayBlock = false;
// Figure out if the contact item owner email link should be displayed.
// only display it if the current owner has an email address and
// the option for allowing item owners to be contacted is set to true.
if ((count($userDetails) > 0) && ($userDetails[0]->email != "") &&
(module::get_var("contactowner", "contact_user_link") == true)) {
$block->content->userLink = "<a href=\"" . url::site("contactowner/emailid/" .
$theme->item->owner_id) . "\">" . t("Contact") . " " . $userDetails[0]->name . "</a>";
$displayBlock = true;
}
// Figure out if the contact site owner link should be displayed.
if (module::get_var("contactowner", "contact_owner_link")) {
$block->content->ownerLink = "<a href=\"" . url::site("contactowner/emailowner") .
"\">" . t(module::get_var("contactowner", "contact_button_text")) . "</a>";
$displayBlock = true;
}
if ($displayBlock) {
return $block;
}
}
}

View File

@ -1,3 +1,3 @@
name = ContactOwner
description = Allows visitors to send the website owner an email.
name = "ContactOwner"
description = "Allows visitors to send the website owner an email."
version = 1

View File

@ -0,0 +1,54 @@
<?php defined("SYSPATH") or die("No direct script access.");
/**
* Gallery - a web based photo album viewer and editor
* Copyright (C) 2000-2009 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 displaytags_block_Core {
static function get_site_list() {
return array("display_tags" => t("Display Tags"));
}
static function get($block_id, $theme) {
$block = "";
// Make sure the current page belongs to an item.
if (!$theme->item()) {
return;
}
switch ($block_id) {
case "display_tags":
// Create an array of all the tags for the current item.
$tagsItem = ORM::factory("tag")
->join("items_tags", "tags.id", "items_tags.tag_id")
->where("items_tags.item_id", $theme->item->id)
->find_all();
// If the current item has at least one tag, display it/them.
if (count($tagsItem) > 0) {
$block = new Block();
$block->css_id = "g-display-tags";
$block->title = t("Tags");
$block->content = new View("displaytags_block.html");
$block->content->tags = $tagsItem;
}
break;
}
return $block;
}
}

View File

@ -1,3 +1,3 @@
name = DisplayTags
description = Display all tags for the current photo/album.
name = "DisplayTags"
description = "Display all tags for the current photo/album."
version = 1

View File

@ -19,11 +19,9 @@
*/
class downloadfullsize_theme {
static function head($theme) {
if (!$theme->item()) {
return;
if ($theme->item && access::can("view_full", $theme->item)) {
$theme->css("downloadfullsize_menu.css");
}
return new View("downloadfullsize_header_block.html");
}
static function sidebar_blocks($theme) {

View File

@ -1,3 +1,3 @@
name = DownloadFullsize
description = Displays a link to download the fullsize version of the current photo.
name = "DownloadFullsize"
description = "Displays a link to download the fullsize version of the current photo."
version = 1

View File

@ -1,3 +0,0 @@
<?php defined("SYSPATH") or die("No direct script access.") ?>
<link rel="stylesheet" type="text/css" href="<?= url::file("modules/downloadfullsize/css/downloadfullsize_menu.css") ?>" />

View File

@ -0,0 +1,3 @@
select {
display: inline;
}

View File

@ -21,10 +21,7 @@ class editcreation_event_Core {
static function item_edit_form($item, $form) {
// Add a couple of drop-down boxes to allow the user to edit the date
// that $item was created on.
// Inject some css to make everything look right.
print ("<style>\nselect {\ndisplay: inline;\n}\n</style>\n");
// Add the datecreated element to the form.
$form->edit_item->dateselect("datecreated")
->label(t("Created"))

View File

@ -1,4 +1,5 @@
<?php defined("SYSPATH") or die("No direct script access.");/**
<?php defined("SYSPATH") or die("No direct script access.");
/**
* Gallery - a web based photo album viewer and editor
* Copyright (C) 2000-2009 Bharat Mediratta
*
@ -16,26 +17,15 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
*/
class displaytags_theme {
static function sidebar_blocks($theme) {
class editcreation_theme_Core {
static function head($theme) {
if (!$theme->item()) {
return;
}
// Create an array of all the tags for the current item.
$tagsItem = ORM::factory("tag")
->join("items_tags", "tags.id", "items_tags.tag_id")
->where("items_tags.item_id", $theme->item->id)
->find_all();
// If the current item has at least one tag, display it/them.
if (count($tagsItem) > 0) {
$block = new Block();
$block->css_id = "g-display-tags";
$block->title = t("Tags");
$block->content = new View("displaytags_block.html");
$block->content->tags = $tagsItem;
return $block;
$item = $theme->item();
if ( $item && access::can("edit", $item) ) {
$theme->css("editcreation.css");
}
}
}
}

View File

@ -0,0 +1,55 @@
<?php defined("SYSPATH") or die("No direct script access.");
/**
* Gallery - a web based photo album viewer and editor
* Copyright (C) 2000-2009 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 embedlinks_block_Core {
static function get_site_list() {
return array("embed_links_dialog" => t("Embed Links Dialog"), "embed_links_album" => t("Embed Links Album"));
}
static function get($block_id, $theme) {
$block = "";
switch ($block_id) {
case "embed_links_dialog":
// If displaying links in a dialog box is enabled then
// insert buttons into the bottom of the side bar
// to open up the dialog window.
if (module::get_var("embedlinks", "DialogLinks") && $theme->item()) {
$block = new Block();
$block->css_id = "g-embed-links-sidebar";
$block->title = t("Link To This Page");
$block->content = new View("embedlinks_sidebar.html");
}
break;
case "embed_links_album":
// If the current item is an album and if "In Page" links are enabled then
// display links to the current album in the theme sidebar.
if ($theme->item()->is_album() && module::get_var("embedlinks", "InPageLinks")) {
$block = new Block();
$block->css_id = "g-embed-links-album-sidebar";
$block->title = t("Links");
$block->content = new View("embedlinks_album_block.html");
}
break;
}
return $block;
}
}

View File

@ -18,31 +18,6 @@
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
*/
class embedlinks_theme_Core {
static function sidebar_blocks($theme) {
// If the current item is an album and if "In Page" links are enabled then
// display links to the current album in the theme sidebar.
if ($theme->item()->is_album() && module::get_var("embedlinks", "InPageLinks")) {
$block = new Block();
$block->css_id = "g-metadata";
$block->title = t("Links");
$block->content = new View("embedlinks_album_block.html");
return $block;
}
}
static function sidebar_bottom($theme) {
// If displaying links in a dialog box is enabled then
// insert buttons into the bottom of the side bar
// to open up the dialog window.
if (module::get_var("embedlinks", "DialogLinks")) {
$block = new Block();
$block->css_id = "g-metadata";
$block->title = t("Link To This Page:");
$block->content = new View("embedlinks_sidebar.html");
return $block;
}
}
static function photo_bottom($theme) {
// If the current item is a photo and displaying "In Page" links
// is enabled, then insert HTML/BBCode links into the bottom

View File

@ -1,3 +1,3 @@
name = EmbedLinks
description = Display BBCode and HTML code to embed links to albums/images into other web pages.
name = "EmbedLinks"
description = "Display BBCode and HTML code to embed links to albums/images into other web pages."
version = 1

View File

@ -5,7 +5,7 @@ input[type="text"] {
}
</style>
<h1 style="display: none;"><?= t("HTML Code") ?></h1>
<div id="g-embed-linksHTMLData">
<div id="g-embed-links-html-data">
<? $counter = 0; ?>
<? for ($i = 0; $i < count($titles); $i++): ?>
<table class="g-links-html" >

View File

@ -7,7 +7,7 @@ input[type="text"] {
<? if (module::get_var("embedlinks", "HTMLCode")) { ?>
<h3 align="center"><?= t("HTML Links")?></h3>
<table class="g-embed-link">
<table class="g-embed-links">
<tbody>
<tr>
<th colspan="2"><?= t("Link To This Page:") ?></th>

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="com.google.appengine.eclipse.core.GAE_CONTAINER"/>
<classpathentry kind="con" path="com.google.gwt.eclipse.core.GWT_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="lib" path="C:/Users/User/code/gwt-dnd/gwt-dnd-2.6.5.jar"/>
<classpathentry kind="lib" path="C:/Users/User/code/gwt-dnd/gwt-dnd-2.6.5-javadoc.jar"/>
<classpathentry kind="lib" path="C:/Users/User/code/gwt-gears/gwt-gears.jar"/>
<classpathentry kind="output" path="war/WEB-INF/classes"/>
</classpath>

View File

@ -0,0 +1,40 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>gwtorganise</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.google.gwt.eclipse.core.gwtProjectValidator</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.google.appengine.eclipse.core.enhancerbuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.google.appengine.eclipse.core.projectValidator</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.google.gdt.eclipse.core.webAppProjectValidator</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>com.google.appengine.eclipse.core.gaeNature</nature>
<nature>com.google.gwt.eclipse.core.gwtNature</nature>
<nature>com.google.gdt.eclipse.core.webAppNature</nature>
</natures>
</projectDescription>

View File

@ -0,0 +1,3 @@
#Sun Aug 30 20:30:24 NZST 2009
eclipse.preferences.version=1
filesCopiedToWebInfLib=appengine-api-1.0-sdk-1.2.2.jar|datanucleus-appengine-1.0.2.final.jar|datanucleus-core-1.1.4-gae.jar|datanucleus-jpa-1.1.4.jar|geronimo-jpa_3.0_spec-1.1.1.jar|geronimo-jta_1.1_spec-1.1.1.jar|jdo2-api-2.3-ea.jar

View File

@ -0,0 +1,4 @@
#Thu Sep 24 11:47:04 NZST 2009
eclipse.preferences.version=1
filesCopiedToWebInfLib=gwt-servlet.jar
gwtCompileSettings=PGd3dC1jb21waWxlLXNldHRpbmdzPjxsb2ctbGV2ZWw+SU5GTzwvbG9nLWxldmVsPjxvdXRwdXQtc3R5bGU+T0JGVVNDQVRFRDwvb3V0cHV0LXN0eWxlPjxleHRyYS1hcmdzPjwhW0NEQVRBW11dPjwvZXh0cmEtYXJncz48dm0tYXJncz48IVtDREFUQVstWG14NTEybV1dPjwvdm0tYXJncz48L2d3dC1jb21waWxlLXNldHRpbmdzPg\=\=

View File

@ -0,0 +1,26 @@
<?php defined("SYSPATH") or die("No direct script access.");
/**
* Gallery - a web based photo album viewer and editor
* Copyright (C) 2000-2009 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 Admin_GWTOrganise_Controller extends Controller {
public function index() {
$view = new Admin_View("admin.html");
$view->content = new View("gwtorganise_view.html");
print $view;
}
}

View File

@ -0,0 +1,257 @@
<?php defined("SYSPATH") or die("No direct script access.");
/**
* Gallery - a web based photo album viewer and editor
* Copyright (C) 2000-2009 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 Json_Album_Controller extends Controller {
private function child_json_encode($child){
return array(
'id' => $child->id,
'title' => $child->title,
'type' => $child->type,
'thumb' => $child->thumb_url(),
'resize' => $child->resize_url(),
'sort' => $child->sort_column);
}
private function child_elements($item_id, $where = array()) {
$item = ORM::factory("item", $item_id);
access::required("view", $item);
$children = $item->children(null, 0, $where);
$encoded = array();
foreach ($children as $id => $child){
$encoded[$id] = self::child_json_encode($child);
}
return json_encode($encoded);
}
function is_admin() {
if (user::active()->admin) {
print json_encode(array("result" => "success", "csrf" => access::csrf_token()));
return;
}
print json_encode(array("result" => "failure"));
}
function albums($item_id) {
print $this->child_elements($item_id,array("type" => "album"));
}
function children($item_id){
print $this->child_elements($item_id);
}
function item($item_id){
$item = ORM::factory("item", $item_id);
access::required("view", $item);
print json_encode(self::child_json_encode($item));
}
function move_to($target_album_id) {
access::verify_csrf();
$target_album = ORM::factory("item", $target_album_id);
$js = json_decode($_REQUEST["sourceids"]);
$i = 0;
foreach ($js as $source_id) {
$source = ORM::factory("item", $source_id);
if (!$source->contains($target_album)) {
item::move($source, $target_album);
}
$i++;
}
print json_encode(array("result" => "success"));
}
function rearrange($target_id, $before_or_after) {
access::verify_csrf();
$target = ORM::factory("item", $target_id);
$album = $target->parent();
access::required("view", $album);
access::required("edit", $album);
$source_ids = json_decode($_REQUEST["sourceids"]);
if ($album->sort_column != "weight") {
$i = 0;
foreach ($album->children() as $child) {
// Do this directly in the database to avoid sending notifications
Database::Instance()->update("items", array("weight" => ++$i), array("id" => $child->id));
}
$album->sort_column = "weight";
$album->sort_order = "ASC";
$album->save();
$target->reload();
}
// Find the insertion point
$target_weight = $target->weight;
if ($before_or_after == "after") {
$target_weight++;
}
// Make a hole
$count = count($source_ids);
Database::Instance()->query(
"UPDATE {items} " .
"SET `weight` = `weight` + $count " .
"WHERE `weight` >= $target_weight AND `parent_id` = {$album->id}");
// Insert source items into the hole
foreach ($source_ids as $source_id) {
Database::Instance()->update(
"items", array("weight" => $target_weight++), array("id" => $source_id));
}
module::event("album_rearrange", $album);
print json_encode(array("result" => "success"));
}
public function start() {
batch::start();
}
public function add_photo($id) {
access::verify_csrf();
$album = ORM::factory("item", $id);
access::required("view", $album);
access::required("add", $album);
try {
$name = $_REQUEST["filename"];
$body = @file_get_contents('php://input');
//$stream = http_get_request_body();
$directory = Kohana::config('upload.directory', TRUE);
// Make sure the directory ends with a slash
$directory = str_replace('\\','/',$directory);
$directory = rtrim($directory, '/').'/';
if ( ! is_dir($directory) AND Kohana::config('upload.create_directories') === TRUE)
{
// Create the upload directory
mkdir($directory, 0777, TRUE);
}
if ( ! is_writable($directory))
throw new Kohana_Exception('upload.not_writable', $directory);
$temp_filename = $directory.$name;
$file = fopen($temp_filename,'w');
fwrite($file,$body);
fclose($file);
$title = item::convert_filename_to_title($name);
$path_info = @pathinfo($temp_filename);
if (array_key_exists("extension", $path_info) &&
in_array(strtolower($path_info["extension"]), array("flv", "mp4"))) {
$item = movie::create($album, $temp_filename, $name, $title);
log::success("content", t("Added a movie"),
html::anchor("movies/$item->id", t("view movie")));
} else {
$item = photo::create($album, $temp_filename, $name, $title);
log::success("content", t("Added a photo"),
html::anchor("photos/$item->id", t("view photo")));
}
} catch (Exception $e) {
Kohana::log("alert", $e->__toString());
if (file_exists($temp_filename)) {
unlink($temp_filename);
}
header("HTTP/1.1 500 Internal Server Error");
print "ERROR: " . $e->getMessage();
return;
}
unlink($temp_filename);
print json_encode(self::child_json_encode($item));
}
public function make_album_cover($id) {
access::verify_csrf();
$item = model_cache::get("item", $id);
access::required("view", $item);
access::required("view", $item->parent());
access::required("edit", $item->parent());
item::make_album_cover($item);
print json_encode(array("result" => "success"));
}
public function rotate($id, $dir) {
access::verify_csrf();
$item = model_cache::get("item", $id);
access::required("view", $item);
access::required("edit", $item);
$degrees = 0;
switch($dir) {
case "ccw":
$degrees = -90;
break;
case "cw":
$degrees = 90;
break;
}
if ($degrees) {
graphics::rotate($item->file_path(), $item->file_path(), array("degrees" => $degrees));
list($item->width, $item->height) = getimagesize($item->file_path());
$item->resize_dirty= 1;
$item->thumb_dirty= 1;
$item->save();
graphics::generate($item);
$parent = $item->parent();
if ($parent->album_cover_item_id == $item->id) {
copy($item->thumb_path(), $parent->thumb_path());
$parent->thumb_width = $item->thumb_width;
$parent->thumb_height = $item->thumb_height;
$parent->save();
}
}
print json_encode(self::child_json_encode($item));
}
}

View File

@ -0,0 +1,34 @@
<?php defined("SYSPATH") or die("No direct script access.");
/**
* Gallery - a web based photo album viewer and editor
* Copyright (C) 2000-2009 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 gwtorganise_event_Core{
/**
* adds the shopping basket administration controls to the admin menu
*/
static function admin_menu($menu, $theme){
$menu->add_after("users_groups",
Menu::factory("link")
->id("gwtorganise")
->label(t("GWT Organise"))
->url(url::site("admin/gwtorganise")));
}
}

View File

@ -0,0 +1,31 @@
<?php defined("SYSPATH") or die("No direct script access.");
/**
* Gallery - a web based photo album viewer and editor
* Copyright (C) 2000-2009 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 gwtorganise_installer
{
static function install(){
module::set_version("gwtorganise", 1);
}
static function activate() {
}
static function deactivate(){
}
}

View File

@ -0,0 +1,3 @@
name = "GWT Organise"
description = "An alternative to organise and simple uploader making use of funky google technology."
version = 1

View File

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<jdoconfig xmlns="http://java.sun.com/xml/ns/jdo/jdoconfig"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://java.sun.com/xml/ns/jdo/jdoconfig">
<persistence-manager-factory name="transactions-optional">
<property name="javax.jdo.PersistenceManagerFactoryClass"
value="org.datanucleus.store.appengine.jdo.DatastoreJDOPersistenceManagerFactory"/>
<property name="javax.jdo.option.ConnectionURL" value="appengine"/>
<property name="javax.jdo.option.NontransactionalRead" value="true"/>
<property name="javax.jdo.option.NontransactionalWrite" value="true"/>
<property name="javax.jdo.option.RetainValues" value="true"/>
<property name="datanucleus.appengine.autoCreateDatastoreTxns" value="true"/>
</persistence-manager-factory>
</jdoconfig>

View File

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 1.7.0//EN" "http://google-web-toolkit.googlecode.com/svn/tags/1.7.0/distro-source/core/src/gwt-module.dtd">
<module rename-to='g3viewer'>
<!-- Inherit the core Web Toolkit stuff. -->
<inherits name='com.google.gwt.user.User'/><inherits name="com.google.gwt.http.HTTP" /><inherits
name="com.google.gwt.json.JSON" /><inherits name="com.google.gwt.user.theme.standard.Standard" />
<entry-point class='com.gloopics.g3viewer.client.G3Viewer'/><inherits
name="com.allen_sauer.gwt.dnd.gwt-dnd" /><inherits name="com.google.gwt.gears.Gears" />
<replace-with class="com.gloopics.g3viewer.client.NoGears">
<when-type-is class="com.gloopics.g3viewer.client.G3Viewer"/>
<when-property-is name="gears.installed" value="false"/>
</replace-with>
</module>

View File

@ -0,0 +1,481 @@
package com.gloopics.g3viewer.client;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Set;
import com.google.gwt.event.logical.shared.CloseEvent;
import com.google.gwt.event.logical.shared.CloseHandler;
import com.google.gwt.gears.client.Factory;
import com.google.gwt.gears.client.desktop.Desktop;
import com.google.gwt.gears.client.desktop.File;
import com.google.gwt.gears.client.desktop.OpenFilesHandler;
import com.google.gwt.json.client.JSONArray;
import com.google.gwt.json.client.JSONNumber;
import com.google.gwt.json.client.JSONObject;
import com.google.gwt.json.client.JSONString;
import com.google.gwt.json.client.JSONValue;
import com.google.gwt.user.client.Command;
import com.google.gwt.user.client.DOM;
import com.google.gwt.user.client.Event;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.MenuBar;
import com.google.gwt.user.client.ui.MenuItem;
import com.google.gwt.user.client.ui.PopupPanel;
import com.google.gwt.user.client.ui.TreeItem;
/**
* encapsulates an album
* @author User
*
*/
public class Album extends TreeItem {
private final int m_ID;
private String m_Title;
private final G3Viewer m_Container;
private final View m_View;
private final Label m_Label;
private String m_Sort;
private final List<Item> m_Items = new ArrayList<Item>();
private final Map<Integer, Item> m_IDtoItem = new HashMap<Integer, Item>();
private final Map<Integer, Album> m_IDtoAlbum = new HashMap<Integer, Album>();
private final LinkedList<UploadFile> m_UploadQueue = new LinkedList<UploadFile>();
private boolean m_Running = false;
private final AlbumTreeDropController m_DropController;
public Album(JSONObject jsonObject, G3Viewer a_Container)
{
m_ID = (int)((JSONNumber)jsonObject.get("id")).doubleValue();
m_Title = ((JSONString)jsonObject.get("title")).stringValue();
m_Sort = ((JSONString)jsonObject.get("sort")).stringValue();
m_Container = a_Container;
m_View = a_Container.getView();
m_DropController = new AlbumTreeDropController(this);
m_Label = initComponents();
}
public Album(G3Viewer a_Container)
{
m_ID = 1;
m_Title = "Root";
m_Container = a_Container;
m_View = a_Container.getView();
m_Sort = "Unknown";
m_DropController = new AlbumTreeDropController(this);
m_Label = initComponents();
refresh();
}
public void updateValues(JSONValue a_Jso){
JSONObject jso = a_Jso.isObject();
if (jso != null){
m_Title = ((JSONString)jso.get("title")).stringValue();
String oldSort = m_Sort;
m_Sort = ((JSONString)jso.get("sort")).stringValue();
if (!oldSort.equals(m_Sort)){
if (m_View.getCurrentAlbum() == this)
{
select();
}
}
m_Label.setText(m_Title);
}
}
public void refresh(){
m_Container.doJSONRequest(G3Viewer.VIEW_ITEM_URL + getId(),
new HttpSuccessHandler() {
@Override
public void success(JSONValue aValue) {
updateValues(aValue);
}
},false);
}
public void showPopupMenu(Event event){
m_Label.addStyleName("popped");
final PopupPanel popupPanel = new PopupPanel(true);
popupPanel.setAnimationEnabled(true);
MenuBar popupMenuBar = new MenuBar(true);
MenuItem editItem = new MenuItem("Edit Album", true, new Command() {
@Override
public void execute() {
m_Container.doDialog("index.php/form/edit/albums/" + m_ID, new HttpDialogHandler() {
@Override
public void success(String aResult) {
refresh();
}
});
popupPanel.hide();
}
});
MenuItem uploadPhotos = new MenuItem("Upload Photos", true, new Command() {
@Override
public void execute() {
uploadFiles();
popupPanel.hide();
}
});
MenuItem addAlbum = new MenuItem("Add Album", true, new Command() {
@Override
public void execute() {
m_Container.doDialog("index.php/form/add/albums/" + m_ID + "?type=album", new HttpDialogHandler() {
@Override
public void success(String aResult) {
expand();
m_View.getCurrentAlbum().select();
}
});
popupPanel.hide();
}
});
MenuItem userPermissions = new MenuItem("User Permissions", true, new Command() {
@Override
public void execute() {
m_Container.doDialog("index.php/permissions/browse/" + m_ID , new HttpDialogHandler() {
@Override
public void success(String aResult) {
}
});
popupPanel.hide();
}
});
popupPanel.setStyleName("popup");
editItem.addStyleName("popup-item");
addAlbum.addStyleName("popup-item");
uploadPhotos.addStyleName("popup-item");
userPermissions.addStyleName("popup-item");
popupMenuBar.addItem(uploadPhotos);
popupMenuBar.addItem(editItem);
popupMenuBar.addItem(addAlbum);
popupMenuBar.addItem(userPermissions);
popupMenuBar.setVisible(true);
popupPanel.add(popupMenuBar);
int x = DOM.eventGetClientX(event);
int y = DOM.eventGetClientY(event);
popupPanel.setPopupPosition(x, y);
popupPanel.addCloseHandler(new CloseHandler<PopupPanel>() {
@Override
public void onClose(CloseEvent<PopupPanel> event) {
m_Label.removeStyleName("popped");
}
});
popupPanel.show();
}
private Label initComponents()
{
Label toReturn = new Label(m_Title);
toReturn.addStyleName("Tree-Album");
setWidget(toReturn);
m_Container.getDragController().registerDropController(m_DropController);
expand();
return toReturn;
}
public int getId()
{
return m_ID;
}
/*
* Adds the albums in the json response
* TreeItem.
*/
private void addAlbums(JSONValue jsonValue)
{
JSONArray jsonArray = (JSONArray)jsonValue;
Set<Integer> allAlbums = new HashSet<Integer>(m_IDtoAlbum.keySet());
for (int i = 0; i < jsonArray.size(); ++i)
{
JSONObject jso = (JSONObject)jsonArray.get(i);
int id = (int)((JSONNumber)jso.get("id")).doubleValue();
if (m_IDtoAlbum.containsKey(id))
{
m_IDtoAlbum.get(id).updateValues(jso);
}
else
{
Album album = new Album(jso, m_Container);
m_IDtoAlbum.put(id, album);
addItem(album);
}
allAlbums.remove(id);
}
for (Integer id : allAlbums){
Album a = m_IDtoAlbum.remove(id);
a.cleanup();
removeItem(a);
}
}
public void cleanup()
{
m_Container.getDragController().unregisterDropController(m_DropController);
for (int i = 0; i < getChildCount(); i++){
((Album) getChild(i)).cleanup();
}
}
/**
* moves the given array of ids to this album
*/
public void moveTo(JSONArray a_Ids){
Loading.getInstance().loading();
m_Container.doJSONRequest(G3Viewer.MOVE_TO_ALBUM_URL + getId() + "?sourceids=" + a_Ids.toString(),
new HttpSuccessHandler() {
@Override
public void success(JSONValue aValue) {
expand();
m_View.getCurrentAlbum().expand();
m_View.getCurrentAlbum().select();
}
},true);
}
/**
* rearranges the albums
*/
public void rearrangeTo(JSONArray a_Ids, Item m_CompareTo, boolean m_Before){
Loading.getInstance().loading();
String bora = m_Before?"before":"after";
m_Container.doJSONRequest(G3Viewer.REARRANGE_URL + m_CompareTo.getID() + "/" + bora
+ "?sourceids=" + a_Ids.toString(),
new HttpSuccessHandler() {
@Override
public void success(JSONValue aValue) {
m_View.getCurrentAlbum().select();
}
},true);
}
/**
* returns the album with the given id
*/
public void selectSubAlbum(int a_Id){
for (int i = 0; i < getChildCount(); i++)
{
Album ab = ((Album) getChild(i));
if (ab.m_ID == a_Id)
{
ab.select();
m_Container.getTree().ensureSelected(ab);
}
}
}
/*
* Fetch the requested URL.
*/
public void expand() {
m_Container.doJSONRequest(G3Viewer.VIEW_ALBUM_URL + getId(),
new HttpSuccessHandler() {
@Override
public void success(JSONValue aValue) {
addAlbums(aValue);
}
},false);
}
public void select() {
Loading.getInstance().loading();
m_Container.doJSONRequest(G3Viewer.VIEW_CHILDREN_URL + getId(),
new HttpSuccessHandler() {
@Override
public void success(JSONValue aValue) {
viewAlbum(aValue);
}
},false);
}
/*
* view Album contents
*/
private void viewAlbum(JSONValue a_Value){
JSONArray jsonArray = (JSONArray)a_Value;
Item item = null;
int id;
JSONObject jso;
m_Items.clear();
for (int i = 0; i < jsonArray.size(); ++i)
{
jso = (JSONObject)jsonArray.get(i);
id = (int)((JSONNumber)jso.get("id")).doubleValue();
if (m_IDtoItem.containsKey(id)){
item = m_IDtoItem.get(id);
item.updateValues(jso);
}
else
{
item =new Item(this, jso, m_Container);
m_IDtoItem.put(id, item);
if (item.isAlbum()){
linkAlbum(item);
}
}
m_Items.add(item);
}
m_View.setAlbum(this);
addPendingDownloads();
}
public List<Item> getItems()
{
return m_Items;
}
public void linkAlbum(Item a_Item){
// link album
int id = a_Item.getID();
Album child;
for (int j = 0 ; j < getChildCount(); j++){
child = (Album) getChild(j);
if (child.m_ID == id){
a_Item.setLinkedAlbum(child);
j = getChildCount();
}
}
}
public boolean isManualSort(){
return m_Sort.equalsIgnoreCase("weight");
}
public void uploadFiles() {
Desktop desktop = Factory.getInstance().createDesktop();
desktop.openFiles(new OpenFilesHandler() {
public void onOpenFiles(OpenFilesEvent event) {
File[] files = event.getFiles();
UploadFile uf;
for (File file : files){
uf = new UploadFile(Album.this, file);
m_View.addToView(uf);
m_UploadQueue.addLast(uf);
}
if (!m_Running){
m_Running = true;
next();
}
}
}, false);
}
public void addPendingDownloads()
{
for (UploadFile uf: m_UploadQueue)
{
m_View.addToView(uf);
}
}
public void finishedUpload(UploadFile uf, JSONValue a_Return)
{
m_UploadQueue.remove(uf);
next();
JSONObject jo = a_Return.isObject();
if (jo != null){
Item item = new Item(this,jo,m_Container);
m_IDtoItem.put(item.getID(), item);
m_Items.add(item);
if (m_View.getCurrentAlbum() == this){
m_View.replaceInView(uf, item);
}
}
else
{
if (m_View.getCurrentAlbum() == this){
m_View.removeFromView(uf);
}
}
}
private void next()
{
if (m_UploadQueue.size() > 0)
{
UploadFile uf = m_UploadQueue.getFirst();
uf.startUpload();
}
else
{
m_Running = false;
}
}
}

View File

@ -0,0 +1,73 @@
package com.gloopics.g3viewer.client;
import com.allen_sauer.gwt.dnd.client.DragContext;
import com.allen_sauer.gwt.dnd.client.VetoDragException;
import com.allen_sauer.gwt.dnd.client.drop.DropController;
import com.google.gwt.json.client.JSONArray;
import com.google.gwt.json.client.JSONNumber;
import com.google.gwt.user.client.ui.Widget;
public class AlbumItemDropContainer implements DropController{
/**
* the tree
*/
private final Album m_Album;
private final Item m_Item;
public AlbumItemDropContainer(Item a_Item, Album a_Album){
m_Album = a_Album;
m_Item = a_Item;
}
@Override
public Widget getDropTarget() {
// TODO Auto-generated method stub
return m_Item;
}
@Override
public void onDrop(DragContext context) {
JSONArray jsa = new JSONArray();
int i = 0;
for (Widget widget : context.selectedWidgets){
if (widget instanceof Item){
jsa.set(i, new JSONNumber(((Item)widget).getID()));
i++;
}
}
m_Album.moveTo(jsa);
// context.
// TODO Auto-generated method stub
}
@Override
public void onEnter(DragContext context) {
m_Item.addStyleName("drop-target");
//m_Album.g
// TODO Auto-generated method stub
}
@Override
public void onLeave(DragContext context) {
// TODO Auto-generated method stub
m_Item.removeStyleName("drop-target");
}
@Override
public void onMove(DragContext context) {
// m_Album.
// TODO Auto-generated method stub
}
@Override
public void onPreviewDrop(DragContext context) throws VetoDragException {
// TODO Auto-generated method stub
}
}

View File

@ -0,0 +1,101 @@
package com.gloopics.g3viewer.client;
import com.google.gwt.event.logical.shared.SelectionEvent;
import com.google.gwt.event.logical.shared.SelectionHandler;
import com.google.gwt.user.client.DOM;
import com.google.gwt.user.client.Event;
import com.google.gwt.user.client.ui.Tree;
import com.google.gwt.user.client.ui.TreeItem;
public class AlbumTree extends Tree{
private final G3Viewer m_Container;
public AlbumTree(G3Viewer a_Container){
super();
sinkEvents(Event.ONMOUSEUP | Event.ONMOUSEDOWN | Event.ONCONTEXTMENU);
m_Container = a_Container;
addSelectionHandler(new SelectionHandler<TreeItem>() {
@Override
public void onSelection(SelectionEvent<TreeItem> event) {
((Album) event.getSelectedItem()).select();
}
});
}
public void fetchTree()
{
// fetch top album
Album tree = new Album(m_Container);
addItem(tree);
setSelectedItem(tree);
}
public void onBrowserEvent(Event event) {
switch (DOM.eventGetType(event)) {
case Event.ONMOUSEUP:
if (DOM.eventGetButton(event) == Event.BUTTON_RIGHT) {
event.preventDefault();
break;
}
else
{
super.onBrowserEvent(event);
}
break;
case Event.ONMOUSEDOWN:
if (DOM.eventGetButton(event) == Event.BUTTON_RIGHT) {
event.preventDefault();
break;
}
else
{
super.onBrowserEvent(event);
}
break;
case Event.ONCONTEXTMENU:
event.preventDefault();
popupMenu(event);
//GWT.log("Event.ONCONTEXTMENU", null);
break;
default:
super.onBrowserEvent(event);
}//end switch
}
public void refresh()
{
((Album)getSelectedItem()).select();
}
public void ensureSelected(Album album)
{
setSelectedItem(album);
ensureSelectedItemVisible();
}
/* do popup
*/
public void popupMenu(Event event){
((Album)getSelectedItem()).showPopupMenu(event);
}
}

View File

@ -0,0 +1,72 @@
package com.gloopics.g3viewer.client;
import com.allen_sauer.gwt.dnd.client.DragContext;
import com.allen_sauer.gwt.dnd.client.VetoDragException;
import com.allen_sauer.gwt.dnd.client.drop.DropController;
import com.google.gwt.json.client.JSONArray;
import com.google.gwt.json.client.JSONNumber;
import com.google.gwt.user.client.ui.Widget;
public class AlbumTreeDropController implements DropController{
/**
* the tree
*/
private final Album m_Album;
public AlbumTreeDropController(Album a_Album){
m_Album = a_Album;
}
@Override
public Widget getDropTarget() {
// TODO Auto-generated method stub
return m_Album.getWidget();
}
@Override
public void onDrop(DragContext context) {
JSONArray jsa = new JSONArray();
int i = 0;
for (Widget widget : context.selectedWidgets){
if (widget instanceof Item){
jsa.set(i, new JSONNumber(((Item)widget).getID()));
i++;
}
}
m_Album.moveTo(jsa);
// context.
// TODO Auto-generated method stub
}
@Override
public void onEnter(DragContext context) {
m_Album.getWidget().addStyleName("drop-target");
//m_Album.g
// TODO Auto-generated method stub
}
@Override
public void onLeave(DragContext context) {
// TODO Auto-generated method stub
m_Album.getWidget().removeStyleName("drop-target");
}
@Override
public void onMove(DragContext context) {
// m_Album.
// TODO Auto-generated method stub
}
@Override
public void onPreviewDrop(DragContext context) throws VetoDragException {
// TODO Auto-generated method stub
}
}

View File

@ -0,0 +1,85 @@
package com.gloopics.g3viewer.client;
import com.allen_sauer.gwt.dnd.client.DragContext;
import com.allen_sauer.gwt.dnd.client.VetoDragException;
import com.allen_sauer.gwt.dnd.client.drop.DropController;
import com.google.gwt.json.client.JSONArray;
import com.google.gwt.json.client.JSONNumber;
import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.Widget;
public class DropZoneController implements DropController{
/**
* the album
*/
private final Album m_Album;
/**
* the album
*/
private final HTML m_DropZone;
/**
* compare to
*/
private final Item m_CompareTo;
/**
* before
*/
private final boolean m_Before;
public DropZoneController(Album a_Album, HTML a_DropZone, Item a_CompareTo, boolean a_Before){
m_Album = a_Album;
m_DropZone = a_DropZone;
m_CompareTo = a_CompareTo;
m_Before = a_Before;
}
@Override
public Widget getDropTarget() {
// TODO Auto-generated method stub
return m_DropZone;
}
@Override
public void onDrop(DragContext context) {
JSONArray jsa = new JSONArray();
int i = 0;
for (Widget widget : context.selectedWidgets){
if (widget instanceof Item){
jsa.set(i, new JSONNumber(((Item)widget).getID()));
i++;
}
}
m_Album.rearrangeTo(jsa, m_CompareTo, m_Before);
}
@Override
public void onEnter(DragContext context) {
m_DropZone.addStyleName("drop-target");
}
@Override
public void onLeave(DragContext context) {
// TODO Auto-generated method stub
m_DropZone.removeStyleName("drop-target");
}
@Override
public void onMove(DragContext context) {
}
@Override
public void onPreviewDrop(DragContext context) throws VetoDragException {
}
}

View File

@ -0,0 +1,363 @@
/*
* Copyright 2007 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
package com.gloopics.g3viewer.client;
import com.allen_sauer.gwt.dnd.client.PickupDragController;
import com.google.gwt.dom.client.Document;
import com.google.gwt.dom.client.InputElement;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.http.client.RequestBuilder;
import com.google.gwt.http.client.RequestException;
import com.google.gwt.json.client.JSONObject;
import com.google.gwt.json.client.JSONString;
import com.google.gwt.json.client.JSONValue;
import com.google.gwt.user.client.DOM;
import com.google.gwt.user.client.Event;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.DialogBox;
import com.google.gwt.user.client.ui.DockPanel;
import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.HorizontalSplitPanel;
import com.google.gwt.user.client.ui.RootPanel;
import com.google.gwt.user.client.ui.SimplePanel;
/**
* Class that acts as a client to a JSON service. Currently, this client just
* requests a text which contains a JSON encoding of a search result set from
* yahoo. We use a text file to demonstrate how the pieces work without tripping
* on cross-site scripting issues.
*
* If you would like to make this a more dynamic example, you can associate a
* servlet with this example and simply have it hit the yahoo service and return
* the results.
*/
public class G3Viewer {
private static String m_CSRF = null;
private static class ErrorDialog extends DialogBox
{
public ErrorDialog(String error) {
// Set the dialog box's caption.
setText("Error");
DockPanel dp = new DockPanel();
dp.addStyleName("error");
dp.add(new HTML(error), DockPanel.CENTER);
// DialogBox is a SimplePanel, so you have to set its widget property to
// whatever you want its contents to be.
Button ok = new Button("OK");
ok.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
ErrorDialog.this.hide();
}
});
dp.add(ok, DockPanel.NORTH);
setWidget(dp);
}
}
/*
* BASE url
*/
private static String BASE_URL =
((InputElement)Document.get().getElementById
("baseurl")).getValue();
/*
* url to view album
*/
public static final String VIEW_ALBUM_URL = BASE_URL + "index.php/json_album/albums/";
/*
* url to view album
*/
public static final String MOVE_TO_ALBUM_URL = BASE_URL + "index.php/json_album/move_to/";
/*
* url to view album
*/
public static final String VIEW_CHILDREN_URL = BASE_URL + "index.php/json_album/children/";
/*
* Load Item
*/
public static final String VIEW_ITEM_URL = BASE_URL + "index.php/json_album/item/";
/**
* upload url
*/
public static final String UPLOAD_URL = BASE_URL + "index.php/json_album/add_photo/";
/**
* upload url
*/
public static final String REARRANGE_URL = BASE_URL + "index.php/json_album/rearrange/";
/**
* upload url
*/
public static final String IS_ADMIN_URL = BASE_URL + "index.php/json_album/is_admin/";
/**
* upload url
*/
public static final String MAKE_ALBUM_COVER_URL = BASE_URL + "index.php/json_album/make_album_cover/";
/**
* rotate url
*/
public static final String ROTATE_URL = BASE_URL + "index.php/json_album/rotate/";
/*
* tree
*/
private final AlbumTree m_Tree;
/**
* the only image dialog box
*/
private final ImageDialogBox m_ImageDialogBox = new ImageDialogBox();
/**
* the only dialog box
*/
private final HttpDialogBox m_HttpDialogBox= new HttpDialogBox();
private class SimplePanelEx extends SimplePanel
{
public SimplePanelEx()
{
super();
sinkEvents(Event.ONMOUSEUP | Event.ONMOUSEDOWN | Event.ONCONTEXTMENU);
}
public void onBrowserEvent(Event event) {
switch (DOM.eventGetType(event)) {
case Event.ONMOUSEUP:
if (DOM.eventGetButton(event) == Event.BUTTON_RIGHT) {
event.preventDefault();
break;
}
else
{
super.onBrowserEvent(event);
}
break;
case Event.ONMOUSEDOWN:
if (DOM.eventGetButton(event) == Event.BUTTON_RIGHT) {
event.preventDefault();
break;
}
else
{
super.onBrowserEvent(event);
}
break;
case Event.ONCONTEXTMENU:
event.preventDefault();
m_Tree.popupMenu(event);
//GWT.log("Event.ONCONTEXTMENU", null);
break;
default:
super.onBrowserEvent(event);
}//end switch
}
}
/**
* central split panel
*/
private final HorizontalSplitPanel m_SplitPanel = new HorizontalSplitPanel();
/**
* Grid View
*/
private final View m_View = new View(this);
/**
* the drag controller
*/
private final PickupDragController m_DragController;
/**
* constructor
*/
public G3Viewer(){
m_DragController = new PickupDragController(RootPanel.get(),false);
m_DragController.setBehaviorMultipleSelection(true);
m_DragController.setBehaviorDragStartSensitivity(5);
m_DragController.setBehaviorDragProxy(true);
m_Tree = new AlbumTree(this);
checkAdmin();
}
public static String getCSRF()
{
return m_CSRF;
}
private void checkAdmin(){
doJSONRequest(IS_ADMIN_URL, new HttpSuccessHandler() {
@Override
public void success(JSONValue aValue) {
JSONObject jso = aValue.isObject();
if (jso != null){
JSONString jss = jso.get("result").isString();
if (jss != null){
if (jss.stringValue().equals("success"))
{
m_CSRF = (jso.get("csrf").isString()).stringValue();
m_Tree.fetchTree();
return;
}
}
}
doDialog("index.php/login/ajax", new HttpDialogHandler() {
@Override
public void success(String aResult) {
// recheck admin
checkAdmin();
}
});
}
},false);
}
/**
* Entry point for this simple application. Currently, we build the
* application's form and wait for events.
*/
public void onModuleLoad() {
initializeMainForm();
}
public static void displayError(String errorType, String errorMessage) {
new ErrorDialog(errorType + "\n" + errorMessage).show();
}
/**
* returns the drag controller
*/
public PickupDragController getDragController(){
return m_DragController;
}
public AlbumTree getTree(){
return m_Tree;
}
public View getView(){
return m_View;
}
public void doDialog(String a_Url, HttpDialogHandler a_Handler)
{
m_HttpDialogBox.doDialog(BASE_URL + a_Url, a_Handler);
}
public void showImage(String a_Url)
{
m_ImageDialogBox.doDialog( a_Url);
}
public void doJSONRequest(final String a_URL, final HttpSuccessHandler a_Handler, final boolean a_hasParams){
try {
String url;
if (m_CSRF != null)
{
url = a_URL + (a_hasParams?"&csrf=":"?csrf=") + m_CSRF;
}
else
{
url = a_URL;
}
RequestBuilder requestBuilder = new RequestBuilder(
RequestBuilder.GET, url);
requestBuilder.setCallback(new JSONResponseTextHandler(
new JSONResponseCallback() {
@Override
public void onResponse(JSONValue aValue) {
a_Handler.success(aValue);
}
@Override
public void onError(Throwable aThrowable) {
displayError("Unexpected Error",
aThrowable.toString() + " - " + a_URL);
}}
));
requestBuilder.send();
} catch (RequestException ex) {
displayError("Request Exception", ex.toString() + " - " + a_URL);
}
}
/**
* Initialize the main form's layout and content.
*/
private void initializeMainForm() {
m_View.addStyleName("view");
m_Tree.setVisible(true);
m_SplitPanel.setSplitPosition("20%");
m_SplitPanel.setLeftWidget(m_Tree);
m_SplitPanel.setRightWidget(m_View);
SimplePanel sp = new SimplePanelEx();
sp.add(m_SplitPanel);
RootPanel.get("main").add(sp);
}
}

View File

@ -0,0 +1,169 @@
package com.gloopics.g3viewer.client;
import com.google.gwt.dom.client.Element;
import com.google.gwt.dom.client.NodeList;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.http.client.Request;
import com.google.gwt.http.client.RequestBuilder;
import com.google.gwt.http.client.RequestCallback;
import com.google.gwt.http.client.RequestException;
import com.google.gwt.http.client.RequestTimeoutException;
import com.google.gwt.http.client.Response;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.DialogBox;
import com.google.gwt.user.client.ui.DockPanel;
import com.google.gwt.user.client.ui.FlowPanel;
import com.google.gwt.user.client.ui.FormPanel;
import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.FormPanel.SubmitCompleteEvent;
import com.google.gwt.user.client.ui.FormPanel.SubmitCompleteHandler;
public class HttpDialogBox extends DialogBox{
private FormPanel m_FormPanel = null;
private HttpDialogHandler m_Callback;
private final HTML m_Dialog;
public HttpDialogBox(){
m_Dialog = new HTML("Empty");
initComponents();
}
public void initComponents(){
setModal(true);
addStyleName("dialog");
setAnimationEnabled(true);
setText("Dialog");
Button close = new Button("Cancel", new ClickHandler() {
public void onClick(ClickEvent event) {
HttpDialogBox.this.hide();
Loading.getInstance().endLoading();
}
});
Button ok = new Button("ok", new ClickHandler() {
public void onClick(ClickEvent event) {
if (m_FormPanel!=null)
{
m_FormPanel.submit();
}
else
{
}
HttpDialogBox.this.hide();
Loading.getInstance().loading();
}
});
FlowPanel fp = new FlowPanel();
fp.add(ok);
fp.add(close);
fp.addStyleName("dButtons");
DockPanel dp = new DockPanel();
dp.add(m_Dialog , DockPanel.CENTER);
dp.add(fp, DockPanel.SOUTH);
dp.addStyleName("dContents");
add(dp);
}
private class RequestCallbackImpl implements RequestCallback {
private static final int STATUS_CODE_OK = 200;
private final String m_URL;
public RequestCallbackImpl(String a_URL){
m_URL = a_URL;
}
public void onError(Request request, Throwable exception) {
if (exception instanceof RequestTimeoutException) {
// handle a request timeout
} else {
// handle other request errors
}
showDialog("Could not get " + m_URL + " Exception thrown " + exception.toString());
}
public void onResponseReceived(Request request, Response response) {
if (STATUS_CODE_OK == response.getStatusCode()) {
showDialog(response.getText());
} else {
showDialog(m_URL + response.getText());
// handle non-OK response from the server
}
}
}
private void showDialog(String a_Text){
m_Dialog.setHTML(a_Text);
// hide all submits
NodeList<Element> inputs = this.getElement().getElementsByTagName("input");
Element input;
for (int i = 0; i < inputs.getLength(); i++){
input = inputs.getItem(i);
if (input.getAttribute("type").equals("submit"))
{
input.setAttribute("style", "display:none");
}
}
Loading.getInstance().hideAnimation();
show();
// find forms if it exists
NodeList<Element> forms = this.getElement().getElementsByTagName("form");
if (forms.getLength() > 0)
{
Element element = this.getElement().getElementsByTagName("form").getItem(0);
setText(element.getElementsByTagName("legend").getItem(0).getInnerText());
m_FormPanel = FormPanel.wrap(element, true);
m_FormPanel.addSubmitCompleteHandler(new SubmitCompleteHandler() {
@Override
public void onSubmitComplete(SubmitCompleteEvent event) {
m_Callback.success(event.getResults());
Loading.getInstance().endLoading();
}
});
}
else
{
setText(this.getElement().getElementsByTagName("legend").getItem(0).getInnerText());
}
setPopupPosition(Window.getClientWidth() / 2 - this.getOffsetWidth() / 2,
Window.getClientHeight() / 2 - this.getOffsetHeight() / 2);
}
public void doDialog(String url, HttpDialogHandler a_Callback){
m_Callback = a_Callback;
Loading.getInstance().loading();
RequestBuilder builder = new RequestBuilder(RequestBuilder.GET, url);
try {
builder.sendRequest(null, new RequestCallbackImpl(url));
} catch (RequestException e) {
showDialog("Could not call " + url + " Exception thrown " + e.toString());
}
}
}

View File

@ -0,0 +1,7 @@
package com.gloopics.g3viewer.client;
public interface HttpDialogHandler {
public void success(String a_Result);
}

View File

@ -0,0 +1,7 @@
package com.gloopics.g3viewer.client;
import com.google.gwt.json.client.JSONValue;
public interface HttpSuccessHandler {
public void success(JSONValue a_Value);
}

View File

@ -0,0 +1,94 @@
package com.gloopics.g3viewer.client;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.event.dom.client.ErrorEvent;
import com.google.gwt.event.dom.client.ErrorHandler;
import com.google.gwt.event.dom.client.LoadEvent;
import com.google.gwt.event.dom.client.LoadHandler;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.Image;
import com.google.gwt.user.client.ui.PopupPanel;
import com.google.gwt.user.client.ui.RootPanel;
import com.google.gwt.user.client.ui.SimplePanel;
public class ImageDialogBox extends PopupPanel{
private Image m_Image = null;
public ImageDialogBox(){
initComponents();
}
private void initComponents()
{
setModal(true);
addStyleName("dialog");
setAnimationEnabled(true);
addDomHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
ImageDialogBox.this.hide();
Loading.getInstance().endLoading();
}
} ,ClickEvent.getType());
}
public void doDialog(String a_Image){
Loading.getInstance().loading();
if (m_Image != null){
m_Image.removeFromParent();
}
m_Image = new Image();
final SimplePanel sp = new SimplePanel();
m_Image.addLoadHandler(new LoadHandler() {
@Override
public void onLoad(LoadEvent event) {
sp.removeFromParent();
Loading.getInstance().hideAnimation();
add(m_Image);
show();
setPopupPosition(Window.getClientWidth() / 2 - getOffsetWidth() / 2,
Window.getClientHeight() / 2 - getOffsetHeight() / 2);
}
});
m_Image.addErrorHandler(new ErrorHandler() {
@Override
public void onError(ErrorEvent event) {
sp.removeFromParent();
G3Viewer.displayError("Error Loading Image", "It could be that the resized version of the image has not been built correctly.");
Loading.getInstance().endLoading();
}
});
sp.setSize("0px", "0px");
sp.setStylePrimaryName("hideme");
sp.setWidget(m_Image);
RootPanel.get().add(sp);
m_Image.setUrl(a_Image);
}
}

View File

@ -0,0 +1,338 @@
package com.gloopics.g3viewer.client;
import com.google.gwt.event.dom.client.ContextMenuEvent;
import com.google.gwt.event.dom.client.ContextMenuHandler;
import com.google.gwt.event.dom.client.DoubleClickEvent;
import com.google.gwt.event.dom.client.DoubleClickHandler;
import com.google.gwt.event.dom.client.HasAllMouseHandlers;
import com.google.gwt.event.dom.client.MouseDownEvent;
import com.google.gwt.event.dom.client.MouseDownHandler;
import com.google.gwt.event.dom.client.MouseMoveEvent;
import com.google.gwt.event.dom.client.MouseMoveHandler;
import com.google.gwt.event.dom.client.MouseOutEvent;
import com.google.gwt.event.dom.client.MouseOutHandler;
import com.google.gwt.event.dom.client.MouseOverEvent;
import com.google.gwt.event.dom.client.MouseOverHandler;
import com.google.gwt.event.dom.client.MouseUpEvent;
import com.google.gwt.event.dom.client.MouseUpHandler;
import com.google.gwt.event.dom.client.MouseWheelEvent;
import com.google.gwt.event.dom.client.MouseWheelHandler;
import com.google.gwt.event.logical.shared.CloseEvent;
import com.google.gwt.event.logical.shared.CloseHandler;
import com.google.gwt.event.shared.HandlerRegistration;
import com.google.gwt.json.client.JSONNumber;
import com.google.gwt.json.client.JSONObject;
import com.google.gwt.json.client.JSONString;
import com.google.gwt.json.client.JSONValue;
import com.google.gwt.user.client.Command;
import com.google.gwt.user.client.DOM;
import com.google.gwt.user.client.Event;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.FlowPanel;
import com.google.gwt.user.client.ui.Image;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.MenuBar;
import com.google.gwt.user.client.ui.MenuItem;
import com.google.gwt.user.client.ui.PopupPanel;
public class Item extends Composite implements HasAllMouseHandlers{
private final int m_ID;
private String m_Title;
private String m_Thumb;
private String m_Resized;
private final String m_Type;
private final Album m_Parent;
private Album m_LinkedAlbum = null;
private final G3Viewer m_Container;
private final boolean m_IsAlbum;
private final boolean m_IsPhoto;
private final View m_View;
private AlbumItemDropContainer m_DropContainer = null;
private final Image m_ThumbImage;
private final Label m_TitleLabel;
public Item(Album a_Parent, JSONObject a_Value, G3Viewer a_Container){
m_Container = a_Container;
m_View = a_Container.getView();
m_Parent = a_Parent;
m_ID = (int)((JSONNumber)a_Value.get("id")).doubleValue();
m_Title = ((JSONString)a_Value.get("title")).stringValue();
m_Thumb = ((JSONString)a_Value.get("thumb")).stringValue();
m_Type = ((JSONString)a_Value.get("type")).stringValue();
m_Resized = ((JSONString)a_Value.get("resize")).stringValue();
m_IsAlbum = m_Type.equals("album");
m_IsPhoto = m_Type.equals("photo");
FlowPanel dp = new FlowPanel();
m_ThumbImage = new Image(m_Thumb);
dp.add(m_ThumbImage);
m_TitleLabel = new Label(m_Title);
dp.add(m_TitleLabel);
initWidget(dp);
this.setStylePrimaryName("item");
this.addStyleName("i" + m_Type);
addDomHandler(new ContextMenuHandler() {
@Override
public void onContextMenu(ContextMenuEvent event) {
showPopupMenu(event);
event.stopPropagation();
event.preventDefault();
}
}, ContextMenuEvent.getType());
addDomHandler(new DoubleClickHandler() {
@Override
public void onDoubleClick(DoubleClickEvent event) {
if (isAlbum()){
m_Parent.selectSubAlbum(m_ID);
}
else if (isPhoto()){
m_Container.showImage(m_Resized);
}
}
},DoubleClickEvent.getType());
a_Container.getDragController().makeDraggable(this);
}
public void showing(){
if (isAlbum() && m_LinkedAlbum != null){
m_DropContainer = new AlbumItemDropContainer(this, m_LinkedAlbum);
m_Container.getDragController().registerDropController(
m_DropContainer);
}
}
public void hidding(){
if (m_DropContainer != null){
m_Container.getDragController().unregisterDropController(m_DropContainer);
}
}
public void updateValues(JSONValue aValue){
JSONObject jso = aValue.isObject();
if (jso != null) {
m_Title = ((JSONString)jso.get("title")).stringValue();
m_Thumb = ((JSONString)jso.get("thumb")).stringValue();
m_Resized = ((JSONString)jso.get("resize")).stringValue();
if (m_LinkedAlbum != null){
m_LinkedAlbum.updateValues(jso);
}
m_TitleLabel.setText(m_Title);
m_ThumbImage.setUrl(m_Thumb);
}
}
private void updateImages(JSONValue a_Value){
JSONObject jso = a_Value.isObject();
if (jso != null) {
m_Thumb = ((JSONString)jso.get("thumb")).stringValue();
m_ThumbImage.setUrl(m_Thumb);
m_Resized = ((JSONString)jso.get("resize")).stringValue();
}
}
public void refresh(){
m_Container.doJSONRequest(G3Viewer.VIEW_ITEM_URL + getID(),
new HttpSuccessHandler() {
@Override
public void success(JSONValue aValue) {
updateValues(aValue);
}
},false);
}
public void setLinkedAlbum(Album a_Album){
m_LinkedAlbum = a_Album;
}
public void showPopupMenu(ContextMenuEvent event){
this.addStyleName("popped");
final PopupPanel popupPanel = new PopupPanel(true);
popupPanel.setAnimationEnabled(true);
popupPanel.setStyleName("popup");
MenuBar popupMenuBar = new MenuBar(true);
MenuItem deleteItem = new MenuItem("Delete " + m_Type, true, new Command() {
@Override
public void execute() {
m_Container.doDialog("index.php/quick/form_delete/" + m_ID, new HttpDialogHandler() {
public void success(String aResult) {
m_View.removeFromView(Item.this);
if (m_LinkedAlbum != null){
m_LinkedAlbum.remove();
}
}
});
popupPanel.hide();
}
});
deleteItem.addStyleName("popup-item");
popupMenuBar.addItem(deleteItem);
MenuItem editItem = new MenuItem("Edit " + m_Type, true, new Command() {
@Override
public void execute() {
m_Container.doDialog("index.php/form/edit/" + m_Type + "s/" + m_ID,
new HttpDialogHandler() {
public void success(String aResult) {
refresh();
}
});
popupPanel.hide();
}
});
editItem.addStyleName("popup-item");
popupMenuBar.addItem(editItem);
MenuItem albumCover = new MenuItem("Make Album Cover", true, new Command() {
@Override
public void execute() {
m_Container.doJSONRequest(G3Viewer.MAKE_ALBUM_COVER_URL + m_ID, new HttpSuccessHandler() {
public void success(JSONValue aValue) {
// nothing to do
}
},false);
popupPanel.hide();
}
});
albumCover.addStyleName("popup-item");
popupMenuBar.addItem(albumCover);
if (isPhoto())
{
MenuItem rotateCW = new MenuItem("Rotate Clockwise", true, new Command() {
@Override
public void execute() {
m_ThumbImage.setUrl(Loading.URL);
m_Container.doJSONRequest(G3Viewer.ROTATE_URL + m_ID + "/cw", new HttpSuccessHandler() {
public void success(JSONValue aValue) {
updateImages(aValue);
}
},false);
popupPanel.hide();
}
});
rotateCW.addStyleName("popup-item");
popupMenuBar.addItem(rotateCW);
MenuItem rotateCCW = new MenuItem("Rotate Couter-Clockwise", true, new Command() {
@Override
public void execute() {
m_ThumbImage.setUrl(Loading.URL);
m_Container.doJSONRequest(G3Viewer.ROTATE_URL + m_ID + "/ccw", new HttpSuccessHandler() {
public void success(JSONValue aValue) {
updateImages(aValue);
}
},false);
popupPanel.hide();
}
});
rotateCCW.addStyleName("popup-item");
popupMenuBar.addItem(rotateCCW);
}
popupMenuBar.setVisible(true);
popupPanel.add(popupMenuBar);
int x = DOM.eventGetClientX((Event)event.getNativeEvent());
int y = DOM.eventGetClientY((Event)event.getNativeEvent());
popupPanel.setPopupPosition(x, y);
popupPanel.addCloseHandler(new CloseHandler<PopupPanel>() {
@Override
public void onClose(CloseEvent<PopupPanel> event) {
Item.this.removeStyleName("popped");
}
});
popupPanel.show();
}
public boolean isAlbum(){
return m_IsAlbum;
}
public boolean isPhoto(){
return m_IsPhoto;
}
public int getID()
{
return m_ID;
}
@Override
public HandlerRegistration addMouseDownHandler(MouseDownHandler handler) {
return addDomHandler(handler, MouseDownEvent.getType());
}
@Override
public HandlerRegistration addMouseUpHandler(MouseUpHandler handler) {
return addDomHandler(handler, MouseUpEvent.getType());
}
@Override
public HandlerRegistration addMouseOutHandler(MouseOutHandler handler) {
return addDomHandler(handler, MouseOutEvent.getType());
}
@Override
public HandlerRegistration addMouseOverHandler(MouseOverHandler handler) {
return addDomHandler(handler, MouseOverEvent.getType());
}
@Override
public HandlerRegistration addMouseMoveHandler(MouseMoveHandler handler) {
return addDomHandler(handler, MouseMoveEvent.getType());
}
@Override
public HandlerRegistration addMouseWheelHandler(MouseWheelHandler handler) {
return addDomHandler(handler, MouseWheelEvent.getType());
}
}

View File

@ -0,0 +1,9 @@
package com.gloopics.g3viewer.client;
import com.google.gwt.json.client.JSONValue;
public interface JSONResponseCallback {
void onError(Throwable a_Throwable);
void onResponse(JSONValue a_Value);
}

View File

@ -0,0 +1,34 @@
package com.gloopics.g3viewer.client;
import com.google.gwt.http.client.Request;
import com.google.gwt.http.client.RequestCallback;
import com.google.gwt.http.client.Response;
import com.google.gwt.json.client.JSONException;
import com.google.gwt.json.client.JSONParser;
import com.google.gwt.json.client.JSONValue;
public class JSONResponseTextHandler implements RequestCallback
{
private final JSONResponseCallback m_Callback;
public JSONResponseTextHandler(JSONResponseCallback a_Callback){
m_Callback = a_Callback;
}
public void onError(Request request, Throwable exception) {
m_Callback.onError(exception);
}
public void onResponseReceived(Request request, Response response) {
//response.
String responseText = response.getText();
try {
JSONValue jsonValue = JSONParser.parse(responseText);
m_Callback.onResponse(jsonValue);
} catch (JSONException e) {
m_Callback.onError(new Throwable(response.getText(), e));
}catch (Exception e) {
m_Callback.onError(new Throwable(response.getText() + e.toString(), e));
}
}
}

View File

@ -0,0 +1,54 @@
package com.gloopics.g3viewer.client;
import com.google.gwt.user.client.ui.Image;
import com.google.gwt.user.client.ui.AbsolutePanel;
import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.RootPanel;
public class Loading extends AbsolutePanel{
private static final Loading INSTANCE = new Loading();
public static final String URL = "images/loading.gif";
/**
* the image widget
*/
private Image m_Image = new Image("images/loading.gif");
private Loading(){
HTML back = new HTML();
back.addStyleName("loading");
add(back, 0, 0);
Image.prefetch(URL);
}
/**
* get instance
*/
public static Loading getInstance(){
return INSTANCE;
}
public void loading(){
int width = RootPanel.get().getOffsetWidth();
int height = RootPanel.get().getOffsetHeight();
height = height / 2 - 25;
width = width / 2 - 25;
add(m_Image);
this.setWidgetPosition(m_Image, width, height);
RootPanel.get().add(this);
}
public void endLoading(){
if (m_Image.isAttached()){
remove(m_Image);
}
RootPanel.get().remove(this);
}
public void hideAnimation(){
remove(m_Image);
}
}

View File

@ -0,0 +1,13 @@
package com.gloopics.g3viewer.client;
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.RootPanel;
public class NoGears implements EntryPoint {
public void onModuleLoad() {
RootPanel rootPanel = RootPanel.get("main");
rootPanel.add(new HTML(
"<font color=\"red\">This application requires Google Gears. To install please visit <a href=\"http://gears.google.com/\">gears.google.com</a> and follow the installation instructions.</font>"));
}
}

View File

@ -0,0 +1,94 @@
package com.gloopics.g3viewer.client;
import com.google.gwt.user.client.ui.AbsolutePanel;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.SimplePanel;
import com.google.gwt.gears.client.Factory;
import com.google.gwt.gears.client.desktop.File;
import com.google.gwt.gears.client.httprequest.HttpRequest;
import com.google.gwt.gears.client.httprequest.ProgressEvent;
import com.google.gwt.gears.client.httprequest.ProgressHandler;
import com.google.gwt.gears.client.httprequest.RequestCallback;
import com.google.gwt.json.client.JSONParser;
import com.google.gwt.json.client.JSONValue;
public class UploadFile extends AbsolutePanel{
private class ProgressBar extends SimplePanel{
private final SimplePanel m_ProgressInner;
public ProgressBar(){
addStyleName("progressBar");
m_ProgressInner = new SimplePanel();
m_ProgressInner.addStyleName("progessInner");
add(m_ProgressInner);
}
public void setProgress(int a_Percent){
m_ProgressInner.setWidth( a_Percent + "%");
}
}
private final File m_LocalFile;
private final String m_Name;
private final Album m_Parent;
//private final Label m_PendingLabel = new Label("Upload Pending");
private final ProgressBar m_ProgressBar = new ProgressBar();
public UploadFile(Album a_Parent, File a_File){
m_Parent = a_Parent;
m_LocalFile = a_File;
m_Name = a_File.getName();
Label name = new Label(m_Name);
name.addStyleName("label");
add(name,5,20);
add(m_ProgressBar,0,80);
setStylePrimaryName("item");
addStyleName("iUpload");
}
public void startUpload(){
HttpRequest request = Factory.getInstance().createHttpRequest();
request.open("POST", G3Viewer.UPLOAD_URL + m_Parent.getId() + "?filename="
+ m_Name + "&csrf=" + G3Viewer.getCSRF());
//request.setRequestHeader("Content-Type", "image/jpg");
//request.setRequestHeader("Content-Type", "image/jpg");
request.getUpload().setProgressHandler(new ProgressHandler() {
@Override
public void onProgress(ProgressEvent event) {
double pcnt = ((double) event.getLoaded() / event.getTotal());
m_ProgressBar.setProgress((int) Math.floor(pcnt * 100));
}
});
request.setCallback(new RequestCallback() {
@Override
public void onResponseReceived(HttpRequest request) {
if (request.getStatus() != 200)
{
G3Viewer.displayError("Upload Error", request.getResponseText() + request.getStatus() + request.getStatusText());
}
try{
JSONValue jv = JSONParser.parse(request.getResponseText());
m_Parent.finishedUpload(UploadFile.this, jv);
} catch (Exception e)
{
G3Viewer.displayError("Exception on Upload", e.toString() + " " + request.getResponseText());
}
}
});
request.send(m_LocalFile.getBlob());
}
}

View File

@ -0,0 +1,98 @@
package com.gloopics.g3viewer.client;
import java.util.ArrayList;
import java.util.List;
import com.google.gwt.user.client.ui.FlowPanel;
import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.Widget;
public class View extends FlowPanel{
/**
* the current album being viewed
*/
private Album m_Album;
/**
* the list of drop zones
*/
private final List<DropZoneController> m_DropZones
= new ArrayList<DropZoneController>();
private final G3Viewer m_Container;
public View(G3Viewer a_Container){
m_Container = a_Container;
}
private void clearView(){
if (m_DropZones.size() > 0){
for (DropZoneController dropController : m_DropZones){
m_Container.getDragController().unregisterDropController(dropController);
}
m_DropZones.clear();
}
for (Widget widget : getChildren()){
if (widget instanceof Item){
((Item)widget).hidding();
}
}
clear();
}
public void setAlbum(Album a_Album){
clearView();
m_Album = a_Album;
Item last = null;
for (Item item : a_Album.getItems())
{
if (a_Album.isManualSort()){
addDropZone(a_Album, item, true);
}
addToView(item);
item.showing();
last = item;
}
if (a_Album.isManualSort() && (last != null)){
addDropZone(a_Album, last, false);
}
Loading.getInstance().endLoading();
}
private void addDropZone(Album a_Parent,Item a_CompareTo, boolean a_Before){
HTML drop = new HTML();
drop.addStyleName("DropZone");
DropZoneController dzp = new DropZoneController(a_Parent, drop, a_CompareTo, a_Before);
m_Container.getDragController().registerDropController(dzp);
m_DropZones.add(dzp);
addToView(drop);
}
public void addToView(Widget a_Widget){
add(a_Widget);
}
public void replaceInView(UploadFile a_Remove, Item a_Insert){
int index = getWidgetIndex(a_Remove);
insert(a_Insert, index);
remove(a_Remove);
}
public void removeFromView(Widget a_Widget){
remove(a_Widget);
}
public Album getCurrentAlbum(){
return m_Album;
}
}

View File

@ -0,0 +1,24 @@
# A default log4j configuration for log4j users.
#
# To use this configuration, deploy it into your application's WEB-INF/classes
# directory. You are also encouraged to edit it as you like.
# Configure the console as our one appender
log4j.appender.A1=org.apache.log4j.ConsoleAppender
log4j.appender.A1.layout=org.apache.log4j.PatternLayout
log4j.appender.A1.layout.ConversionPattern=%d{HH:mm:ss,SSS} %-5p [%c] - %m%n
# tighten logging on the DataNucleus Categories
log4j.category.DataNucleus.JDO=WARN, A1
log4j.category.DataNucleus.Persistence=WARN, A1
log4j.category.DataNucleus.Cache=WARN, A1
log4j.category.DataNucleus.MetaData=WARN, A1
log4j.category.DataNucleus.General=WARN, A1
log4j.category.DataNucleus.Utility=WARN, A1
log4j.category.DataNucleus.Transaction=WARN, A1
log4j.category.DataNucleus.Datastore=WARN, A1
log4j.category.DataNucleus.ClassLoading=WARN, A1
log4j.category.DataNucleus.Plugin=WARN, A1
log4j.category.DataNucleus.ValueGeneration=WARN, A1
log4j.category.DataNucleus.Enhancer=WARN, A1
log4j.category.DataNucleus.SchemaTool=WARN, A1

View File

@ -0,0 +1,6 @@
<? $base = url::base(false, "http");
$url = "$base/modules/gwtorganise/war/index.php?url=$base";
?>
<iframe src="<?=$url?>" style="width:100%; height:500px; border:8px solid #d2e1f6; margin:0; padding:0;">
</iframe>

View File

@ -0,0 +1,40 @@
* {padding:0; margin:0;}
#main {position:relative; width:100%; height:100%}
.error {width:300px; height:200px;}
.item {width:100px; height: 100px; padding:3px; border: 2px solid #FFF; overflow: hidden; float:left; text-align:center; position:relative;margin:3px;}
.item img{max-width:96px; max-height:76px; *width:96px; *height:76px; border:2px solid #AAA;}
.item h3{font-size:10px; font-weight:normal; position:absolute; bottom:5px; left:0px; width:100%; text-align:center; padding:0; margin:0;}
.ialbum {background-color: #e3effb; border: 2px solid #91c0ef; }
.popped {background-color: #e3effb;}
.view {padding:3px;}
.DropZone {height: 100px; width:6px; margin: 0 -3px 0 -3px; padding: 0; float:left; text-align:center; position:relative;}
.loading{position:absolute; top:0px; left:0px; width:100%; height: 100%; background-color:#888; opacity: 0.3; filter: alpha(opacity = 30);}
.gwt-TreeItem-selected .Tree-Album {background-color: #333; color: #FFF;}
.Tree-Album {padding: 1px;}
.Tree-Album:hover{text-decoration:underline;}
.drop-target{background-color: #91c0ef; color: #000;}
.popup {padding: 2px; border: 1px solid #91c0ef;background-color:#FFF}
.dialog fieldset{ border: none; padding: 0px; margin: 0px;}
.dialog legend{ display: none;}
.dialog ul {padding:0; margin:0;}
.dialog ul ul li {float:left;}
.dialog li {list-style: none; padding:0;margin:0;}
.dialog form input[type="password"], .dialog form input[type="text"], .dialog form textarea .dialog form select {border: 1px solid #000; padding: 0.2em; display:block; clear: both;}
.dialog form input[type="password"], .dialog form input[type="text"], .dialog form textarea {width: 100%}
.dialog form textarea {height: 12em;}
.label {width:90px; text-align:center;}
.progressBar {border: 1px solid #cccccc; width: 100px; height: 10px;}
.progessInner {background: #34628c;width: 0px;height: 10px;}
.dContents {padding: 2px 5px 2px 5px;}
.dButtons {text-align: right}
.hideme {overflow:hidden; width:0; height:0; margin:0; padding:0;}

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<appengine-web-app xmlns="http://appengine.google.com/ns/1.0">
<application></application>
<version>1</version>
<!-- Configure java.util.logging -->
<system-properties>
<property name="java.util.logging.config.file" value="WEB-INF/logging.properties"/>
</system-properties>
</appengine-web-app>

View File

@ -0,0 +1,28 @@
# A default java.util.logging configuration.
# (All App Engine logging is through java.util.logging by default).
#
# To use this configuration, copy it into your application's WEB-INF
# folder and add the following to your appengine-web.xml:
#
# <system-properties>
# <property name="java.util.logging.config.file" value="WEB-INF/logging.properties"/>
# </system-properties>
#
# Set the default logging level for all loggers to WARNING
.level = WARNING
# Set the default logging level for ORM, specifically, to WARNING
DataNucleus.JDO.level=WARNING
DataNucleus.Persistence.level=WARNING
DataNucleus.Cache.level=WARNING
DataNucleus.MetaData.level=WARNING
DataNucleus.General.level=WARNING
DataNucleus.Utility.level=WARNING
DataNucleus.Transaction.level=WARNING
DataNucleus.Datastore.level=WARNING
DataNucleus.ClassLoading.level=WARNING
DataNucleus.Plugin.level=WARNING
DataNucleus.ValueGeneration.level=WARNING
DataNucleus.Enhancer.level=WARNING
DataNucleus.SchemaTool.level=WARNING

View File

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<!-- Servlets -->
<servlet>
<servlet-name>greetServlet</servlet-name>
<servlet-class>com.gloopics.g3viewer.server.GreetingServiceImpl</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>greetServlet</servlet-name>
<url-pattern>/g3viewer/greet</url-pattern>
</servlet-mapping>
<!-- Default page to serve -->
<welcome-file-list>
<welcome-file>G3viewer.html</welcome-file>
</welcome-file-list>
</web-app>

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

@ -0,0 +1,3 @@
<?
$url = $_REQUEST['url'];
?><html><head><meta http-equiv="content-type" content="text/html; charset=UTF-8"><link type="text/css" rel="stylesheet" href="G3viewer.css"><title>Gallery Administration</title><script type="text/javascript" language="javascript" src="g3viewer/g3viewer.nocache.js"></script></head><body><input type="hidden" id="baseurl" value="<?= $url ?>"/><div id="main"></div></body></html>

View File

@ -69,6 +69,7 @@ class keeporiginal_event_Core {
// When updating an item, check and see if the file name is being changed.
// If so, check for and modify any corresponding file/folder in
// VARPATH/original/ as well.
if ($old->is_photo() || $old->is_album()) {
if ($old->file_path() != $new->file_path()) {
$old_original = VARPATH . "original/" . str_replace(VARPATH . "albums/", "", $old->file_path());
@ -84,12 +85,26 @@ class keeporiginal_event_Core {
// When moving an item, check and see if a corresponding file exists
// in VARPATH/original/. If so, move that item to a similar directory
// in original as well.
if ($item->is_photo() || $item->is_album()) {
$old_item_path = $old_parent->file_path() . "/" . $item->name;
if ($item->file_path() != $old_item_path) {
$old_original = VARPATH . "original/" . str_replace(VARPATH . "albums/", "", $old_item_path);
$new_original = VARPATH . "original/" . str_replace(VARPATH . "albums/", "", $item->file_path());
if (file_exists($old_original)) {
// Make sure the new folder exists, create it if it doesn't.
$individual_dirs = split("[/\]", "original/" . str_replace(VARPATH . "albums/", "", $item->file_path()));
$new_img_path = VARPATH;
for($i = 0; $i < count($individual_dirs)-1; $i++) {
$new_img_path = $new_img_path . "/" . $individual_dirs[$i];
if(!file_exists($new_img_path)) {
@mkdir($new_img_path);
}
}
// Move the file to its new location.
@rename($old_original, $new_original);
}
}

View File

@ -0,0 +1,37 @@
/**
* Fix display in IE 6, 7
*/
#gBanner,
.gBreadcrumbs,
#gAlbumGrid,
#gPager,
#gViewMenu {
zoom: 1;
}
#gBanner {
z-index: 2;
}
input.submit {
clear: none !important;
display: inline !important;
}
#gAddTagForm input.textbox {
width: 110px;
}
#gDialog a.gCancel {
display: inline-block !important;
float: none !important;
}
.gPager .txtright {
width: 29%;
}
.gPager .ui-icon-right {
width: 60px;
}

673
themes/3nids/3nids/css/jquery.fancybox.css vendored Executable file
View File

@ -0,0 +1,673 @@
html, body {
height: 100%;
}
div#fancy_overlay {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: black;
display: none;
z-index: 30;
}
* html div#fancy_overlay {
position: absolute;
height: expression(document.body.scrollHeight > document.body.offsetHeight ? document.body.scrollHeight : document.body.offsetHeight + 'px');
}
div#fancy_wrap {
text-align: middle;
}
div#fancy_loading {
position: absolute;
height: 40px;
width: 40px;
cursor: pointer;
display: none;
overflow: hidden;
background: transparent;
z-index: 100;
}
div#fancy_loading div {
position: absolute;
top: 0;
left: 0;
width: 40px;
height: 480px;
background: transparent url('../images/fancy_progress.png') no-repeat;
}
div#fancy_loading_overlay {
position: absolute;
background-color: #FFF;
z-index: 30;
}
div#fancy_loading_icon {
position: absolute;
background: url('../images/fancy_loading.gif') no-repeat;
z-index: 35;
width: 16px;
height: 16px;
}
div#fancy_outer {
position: absolute;
top: 0;
left: 0;
z-index: 90;
padding: 18px 18px 20px 0px;
margin: 0;
overflow: hidden;
background: transparent;
display: none;
}
div#fancy_inner {
position: relative;
width:100%;
height:100%;
border: 1px solid #BBB;
background: #FFF;
}
div#fancy_content {
margin: 0;
z-index: 100;
position: absolute;
}
div#fancy_div {
background: #000;
color: #FFF;
height: 100%;
width: 100%;
z-index: 100;
}
img#fancy_img {
position: absolute;
top: 0;
left: 0;
border:0;
padding: 0;
margin: 0;
z-index: 100;
width: 100%;
height: 100%;
}
div#fancy_close {
position: absolute;
top: -12px;
right: -15px;
height: 30px;
width: 30px;
background: url('../images/fancy_closebox.png') top left no-repeat;
cursor: pointer;
z-index: 181;
display: none;
}
#fancy_frame {
position: relative;
width: 100%;
height: 100%;
display: none;
}
#fancy_ajax {
width: 100%;
height: 100%;
overflow: auto;
}
a#fancy_left, a#fancy_right {
position: absolute;
bottom: 0px;
height: 100%;
width: 35%;
cursor: pointer;
z-index: 111;
display: none;
background-image: url(data:image/gif;base64,AAAA);
outline: none;
}
a#fancy_left {
left: 0px;
}
a#fancy_right {
right: 0px;
}
span.fancy_ico {
position: absolute;
top: 50%;
margin-top: -15px;
width: 30px;
height: 30px;
z-index: 112;
cursor: pointer;
display: block;
}
span#fancy_left_ico {
left: -9999px;
background: transparent url('../images/fancy_left.png') no-repeat;
}
span#fancy_right_ico {
right: -9999px;
background: transparent url('../images/fancy_right.png') no-repeat;
}
a#fancy_left:hover {
visibility: visible;
}
a#fancy_right:hover {
visibility: visible;
}
a#fancy_left:hover span {
left: 20px;
}
a#fancy_right:hover span {
right: 20px;
}
.fancy_bigIframe {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: transparent;
}
div#fancy_bg {
position: absolute;
top: 0; left: 0;
width: 100%;
height: 100%;
z-index: 70;
border: 0;
padding: 0;
margin: 0;
}
div.fancy_bg {
position: absolute;
display: block;
z-index: 70;
border: 0;
padding: 0;
margin: 0;
}
div.fancy_bg_n {
top: -18px;
width: 100%;
height: 18px;
background: transparent url('../images/fancy_shadow_n.png') repeat-x;
}
div.fancy_bg_ne {
top: -18px;
right: -13px;
width: 13px;
height: 18px;
background: transparent url('../images/fancy_shadow_ne.png') no-repeat;
}
div.fancy_bg_e {
right: -13px;
height: 100%;
width: 13px;
background: transparent url('../images/fancy_shadow_e.png') repeat-y;
}
div.fancy_bg_se {
bottom: -18px;
right: -13px;
width: 13px;
height: 18px;
background: transparent url('../images/fancy_shadow_se.png') no-repeat;
}
div.fancy_bg_s {
bottom: -18px;
width: 100%;
height: 18px;
background: transparent url('../images/fancy_shadow_s.png') repeat-x;
}
div.fancy_bg_sw {
bottom: -18px;
left: -13px;
width: 13px;
height: 18px;
background: transparent url('../images/fancy_shadow_sw.png') no-repeat;
}
div.fancy_bg_w {
left: -13px;
height: 100%;
width: 13px;
background: transparent url('../images/fancy_shadow_w.png') repeat-y;
}
div.fancy_bg_nw {
top: -18px;
left: -13px;
width: 13px;
height: 18px;
background: transparent url('../images/fancy_shadow_nw.png') no-repeat;
}
div#fancy_title {
position: absolute;
bottom: -20px;
left: 0;
z-index: 100;
display: none;
}
div#fancy_title div {
color: #FFF;
font: bold 10px Arial;
padding-bottom: 3px;
}
div#fancy_title table {
margin: 0 auto;
}
div#fancy_title table td {
padding: 0;
vertical-align: middle;
}
td#fancy_title_left {
height: 32px;
width: 15px;
background: transparent url('../images/fancy_title_left.png') repeat-x;
}
td#fancy_title_main {
height: 32px;
background: transparent url('../images/fancy_title_main.png') repeat-x;
}
td#fancy_title_right {
height: 32px;
width: 15px;
background: transparent url('../images/fancy_title_right.png') repeat-x;
}
div#fancy_modules {
position: absolute;
bottom: -20px;
right: 0px;
z-index: 100;
display: none;
}
div#fancy_modules div {
color: #FFF;
font: bold 10px Arial;
padding-bottom: 3px;
}
div#fancy_modules table {
margin: 0 auto;
}
div#fancy_modules table td {
padding: 0;
vertical-align: middle;
}
td#fancy_modules_left {
border-color: #333333;
height: 32px;
width: 15px;
background: transparent url('../images/fancy_title_left.png') repeat-x;
}
td#fancy_modules_main {
border-color: #333333;
height: 32px;
background: transparent url('../images/fancy_title_main.png') repeat-x;
}
td#fancy_modules_right {
border-color: #333333;
height: 32px;
width: 15px;
background: transparent url('../images/fancy_title_right.png') repeat-x;
}
/* ************************************************* */
/* ************************************************* */
/* ************************************************* */
/* ************************************************* */
div#mod_overlay {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: black;
display: none;
z-index: 1030;
}
* html div#mod_overlay {
position: absolute;
height: expression(document.body.scrollHeight > document.body.offsetHeight ? document.body.scrollHeight : document.body.offsetHeight + 'px');
}
div#mod_wrap {
text-align: middle;
}
div#mod_loading {
position: absolute;
height: 40px;
width: 40px;
cursor: pointer;
display: none;
overflow: hidden;
background: transparent;
z-index: 10100;
}
div#mod_loading div {
position: absolute;
top: 0;
left: 0;
width: 40px;
height: 480px;
background: transparent url('../images/fancy_progress.png') no-repeat;
}
div#mod_loading_overlay {
position: absolute;
background-color: #FFF;
z-index: 1030;
}
div#mod_loading_icon {
position: absolute;
background: url('../images/fancy_loading.gif') no-repeat;
z-index: 1035;
width: 16px;
height: 16px;
}
div#mod_outer {
position: absolute;
top: 0;
left: 0;
z-index: 1090;
padding: 18px 18px 20px 0px;
margin: 0;
overflow: hidden;
background: transparent;
display: none;
}
div#mod_inner {
position: relative;
width:100%;
height:100%;
border: 1px solid #BBB;
background: #FFF;
}
div#mod_content {
margin: 0;
z-index: 10100;
position: absolute;
}
div#mod_div {
background: #000;
color: #FFF;
height: 100%;
width: 100%;
z-index: 10100;
}
img#mod_img {
position: absolute;
top: 0;
left: 0;
border:0;
padding: 0;
margin: 0;
z-index: 10100;
width: 100%;
height: 100%;
}
div#mod_close {
position: absolute;
top: -12px;
right: -15px;
height: 30px;
width: 30px;
background: url('../images/fancy_closebox.png') top left no-repeat;
cursor: pointer;
z-index: 10181;
display: none;
}
#mod_frame {
position: relative;
width: 100%;
height: 100%;
display: none;
}
#mod_ajax {
width: 100%;
height: 100%;
overflow: auto;
}
a#mod_left, a#mod_right {
position: absolute;
bottom: 0px;
height: 100%;
width: 35%;
cursor: pointer;
z-index: 10111;
display: none;
background-image: url(data:image/gif;base64,AAAA);
outline: none;
}
a#mod_left {
left: 0px;
}
a#mod_right {
right: 0px;
}
span.mod_ico {
position: absolute;
top: 50%;
margin-top: -15px;
width: 30px;
height: 30px;
z-index: 10112;
cursor: pointer;
display: block;
}
span#mod_left_ico {
left: -9999px;
background: transparent url('../images/fancy_left.png') no-repeat;
}
span#mod_right_ico {
right: -9999px;
background: transparent url('../images/fancy_right.png') no-repeat;
}
a#mod_left:hover {
visibility: visible;
}
a#mod_right:hover {
visibility: visible;
}
a#mod_left:hover span {
left: 20px;
}
a#mod_right:hover span {
right: 20px;
}
.mod_bigIframe {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: transparent;
}
div#mod_bg {
position: absolute;
top: 0; left: 0;
width: 100%;
height: 100%;
z-index: 1070;
border: 0;
padding: 0;
margin: 0;
}
div.mod_bg {
position: absolute;
display: block;
z-index: 1070;
border: 0;
padding: 0;
margin: 0;
}
div.mod_bg_n {
top: -18px;
width: 100%;
height: 18px;
background: transparent url('../images/fancy_shadow_n.png') repeat-x;
}
div.mod_bg_ne {
top: -18px;
right: -13px;
width: 13px;
height: 18px;
background: transparent url('../images/fancy_shadow_ne.png') no-repeat;
}
div.mod_bg_e {
right: -13px;
height: 100%;
width: 13px;
background: transparent url('../images/fancy_shadow_e.png') repeat-y;
}
div.mod_bg_se {
bottom: -18px;
right: -13px;
width: 13px;
height: 18px;
background: transparent url('../images/fancy_shadow_se.png') no-repeat;
}
div.mod_bg_s {
bottom: -18px;
width: 100%;
height: 18px;
background: transparent url('../images/fancy_shadow_s.png') repeat-x;
}
div.mod_bg_sw {
bottom: -18px;
left: -13px;
width: 13px;
height: 18px;
background: transparent url('../images/fancy_shadow_sw.png') no-repeat;
}
div.mod_bg_w {
left: -13px;
height: 100%;
width: 13px;
background: transparent url('../images/fancy_shadow_w.png') repeat-y;
}
div.mod_bg_nw {
top: -18px;
left: -13px;
width: 13px;
height: 18px;
background: transparent url('../images/fancy_shadow_nw.png') no-repeat;
}
div#mod_title {
position: absolute;
bottom: -20px;
left: 0;
z-index: 10100;
display: none;
}
div#mod_title div {
color: #FFF;
font: bold 10px Arial;
padding-bottom: 3px;
}
div#mod_title table {
margin: 0 auto;
}
div#mod_title table td {
padding: 0;
vertical-align: middle;
}
td#mod_title_left {
height: 32px;
width: 15px;
background: transparent url('../images/fancy_title_left.png') repeat-x;
}
td#mod_title_main {
height: 32px;
background: transparent url('../images/fancy_title_main.png') repeat-x;
}
td#mod_title_right {
height: 32px;
width: 15px;
background: transparent url('../images/fancy_title_right.png') repeat-x;
}

1204
themes/3nids/3nids/css/screen.css Executable file

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 146 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 129 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 245 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 207 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 136 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 239 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 221 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 140 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 556 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 149 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 559 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 604 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 916 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 715 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 701 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 786 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 778 B

Some files were not shown because too many files have changed in this diff Show More