Merge branch 'master' of git://github.com/rWatcher/gallery3-contrib
This commit is contained in:
commit
1c8710c72e
@ -39,15 +39,13 @@ class BatchTag_Controller extends Controller {
|
||||
} else {
|
||||
// Generate an array of all non-album items in the current album
|
||||
// and any sub albums.
|
||||
$children = ORM::factory("item", $input->post("item_id"))
|
||||
->where("type", "!=", "album")
|
||||
->descendants();
|
||||
$item = ORM::factory("item", $input->post("item_id"));
|
||||
$children = $item->descendants();
|
||||
}
|
||||
|
||||
// Loop through each item in the album and make sure the user has
|
||||
// access to view and edit it.
|
||||
foreach ($children as $child) {
|
||||
if (access::can("view", $child) && access::can("edit", $child)) {
|
||||
if (access::can("view", $child) && access::can("edit", $child) && !$child->is_album()) {
|
||||
|
||||
// Assuming the user can view/edit the current item, loop
|
||||
// through each tag that was submitted and apply it to
|
||||
|
34
modules/batchtag/helpers/batchtag_event.php
Normal file
34
modules/batchtag/helpers/batchtag_event.php
Normal 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 batchtag_event_Core {
|
||||
static function module_change($changes) {
|
||||
// See if the Tags module is installed,
|
||||
// tell the user to install it if it isn't.
|
||||
if (!module::is_active("tag") || in_array("tag", $changes->deactivate)) {
|
||||
site_status::warning(
|
||||
t("The BatchTag module requires the Tags module. " .
|
||||
"<a href=\"%url\">Activate the Tags module now</a>",
|
||||
array("url" => url::site("admin/modules"))),
|
||||
"batchtag_needs_tag");
|
||||
} else {
|
||||
site_status::clear("batchtag_needs_tag");
|
||||
}
|
||||
}
|
||||
}
|
34
modules/batchtag/helpers/batchtag_installer.php
Normal file
34
modules/batchtag/helpers/batchtag_installer.php
Normal 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 batchtag_installer {
|
||||
static function install() {
|
||||
// Set the module's version number.
|
||||
module::set_version("batchtag", 1);
|
||||
}
|
||||
|
||||
static function deactivate() {
|
||||
// Clear the require tags message when metadescription is deactivated.
|
||||
site_status::clear("batchtag_needs_tag");
|
||||
}
|
||||
|
||||
static function uninstall() {
|
||||
module::delete("batchtag");
|
||||
}
|
||||
}
|
70
modules/export_facebook/controllers/export_facebook.php
Normal file
70
modules/export_facebook/controllers/export_facebook.php
Normal 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.
|
||||
*/
|
||||
class export_facebook_Controller extends Controller {
|
||||
public function export_fb($a) {
|
||||
if ($_GET['a'] == "albums") {
|
||||
// Generate an array of albums in the items table,
|
||||
// skip id=1 as its the root album.
|
||||
$albums = ORM::factory("item")
|
||||
->where("type", "=", "album")
|
||||
->where("id", "!=", "1")
|
||||
->viewable()
|
||||
->find_all();
|
||||
|
||||
// Loop through each album and output the necessary information.
|
||||
foreach ($albums as $album) {
|
||||
$album_contents = ORM::factory("item")
|
||||
->where("parent_id", "=", $album->id)
|
||||
->where("type", "=", "photo")
|
||||
->viewable()
|
||||
->find_all();
|
||||
|
||||
print ($album->level-2) . "\t" . $album->id . "\t" . $album->name . "\t" . count($album_contents) . "\n";
|
||||
}
|
||||
|
||||
} else if ($_GET['a'] == "photos") {
|
||||
// Generate an array of photo's in the specified album.
|
||||
$photos = ORM::factory("item")
|
||||
->where("type", "=", "photo")
|
||||
->where("parent_id", "=", $_GET['id'])
|
||||
->viewable()
|
||||
->find_all();
|
||||
|
||||
// Loop through each photo, generate a list of tags (if available) and then output the necessary information.
|
||||
foreach ($photos as $photo) {
|
||||
$photo_keywords = "";
|
||||
if (module::is_active("tag")) {
|
||||
$photo_tags = ORM::factory("tag")
|
||||
->join("items_tags", "tags.id", "items_tags.tag_id")
|
||||
->where("items_tags.item_id", "=", $photo->id)
|
||||
->find_all();
|
||||
foreach ($photo_tags as $tag) {
|
||||
$photo_keywords = $photo_keywords . $tag->name . ", ";
|
||||
}
|
||||
// Cut off the ", " from the end of the string.
|
||||
if ($photo_keywords != "") {
|
||||
$photo_keywords = substr($photo_keywords, 0, -2);
|
||||
}
|
||||
}
|
||||
print $photo->id . "\t" . $photo->title . "\t" . stristr($photo->resize_url(false),"/var/") . "\t" . stristr($photo->thumb_url(false), "/var/") . "\t\t" . $photo->description . "\t" . $photo_keywords . "\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
3
modules/export_facebook/module.info
Normal file
3
modules/export_facebook/module.info
Normal file
@ -0,0 +1,3 @@
|
||||
name = "export_facebook"
|
||||
description = "Export Photos from Gallery 3 to Facebook."
|
||||
version = 1
|
34
modules/metadescription/helpers/metadescription_event.php
Normal file
34
modules/metadescription/helpers/metadescription_event.php
Normal 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 metadescription_event_Core {
|
||||
static function module_change($changes) {
|
||||
// See if the Tags module is installed,
|
||||
// tell the user to install it if it isn't.
|
||||
if (!module::is_active("tag") || in_array("tag", $changes->deactivate)) {
|
||||
site_status::warning(
|
||||
t("The MetaDescription module requires the Tags module. " .
|
||||
"<a href=\"%url\">Activate the Tags module now</a>",
|
||||
array("url" => url::site("admin/modules"))),
|
||||
"metadescription_needs_tag");
|
||||
} else {
|
||||
site_status::clear("metadescription_needs_tag");
|
||||
}
|
||||
}
|
||||
}
|
@ -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 metadescription_installer {
|
||||
static function install() {
|
||||
// Set the module's version number.
|
||||
module::set_version("metadescription", 1);
|
||||
}
|
||||
|
||||
static function deactivate() {
|
||||
// Clear the require tags message when metadescription is deactivated.
|
||||
site_status::clear("metadescription_needs_tag");
|
||||
}
|
||||
|
||||
static function uninstall() {
|
||||
module::delete("metadescription");
|
||||
}
|
||||
}
|
@ -37,7 +37,7 @@ class rwinfo_theme_Core {
|
||||
$results .= t("Tags:") . " ";
|
||||
$anchors = array();
|
||||
foreach ($tags as $tag) {
|
||||
$anchors[] = "<a href=" . url::site("tags/{$tag->id}") . ">" . html::clean($tag->name) . "</a>";
|
||||
$anchors[] = "<a href=" . $tag->url() . ">" . html::clean($tag->name) . "</a>";
|
||||
}
|
||||
$results .= join(", ", $anchors) . "</li>";
|
||||
}
|
||||
|
@ -43,7 +43,7 @@
|
||||
<? $not_first = 0; ?>
|
||||
<? foreach ($tags as $tag): ?>
|
||||
<?= ($not_first++) ? "," : "" ?>
|
||||
<a href="<?= url::site("tags/{$tag->name}") ?>"><?= html::clean($tag->name) ?></a>
|
||||
<a href="<?= $tag->url() ?>"><?= html::clean($tag->name) ?></a>
|
||||
<? endforeach ?>
|
||||
</li>
|
||||
<? endif ?>
|
||||
|
@ -20,7 +20,6 @@
|
||||
class tagfaces_Controller extends Controller {
|
||||
public function drawfaces($id) {
|
||||
// Generate the page that allows the user to draw boxes over a photo.
|
||||
|
||||
// Make sure user has access to view and edit the photo.
|
||||
$item = ORM::factory("item", $id);
|
||||
access::required("view", $item);
|
||||
@ -48,29 +47,44 @@ class tagfaces_Controller extends Controller {
|
||||
access::verify_csrf();
|
||||
|
||||
// Convert submitted data to local variables.
|
||||
// Figure out which tagged faces and notes to delete.
|
||||
$tag_data = Input::instance()->post("facesList");
|
||||
$note_data = Input::instance()->post("notesList");
|
||||
// Figure out the item id, in order to reload the correct face tagging page.
|
||||
$item_data = Input::instance()->post("item_id");
|
||||
|
||||
// If the user didn't select a tag, display and error and abort.
|
||||
if (count($tag_data) == 0) {
|
||||
message::error(t("Please select a tag."));
|
||||
// If the user didn't select a tag or note, display and error and abort.
|
||||
if ((count($tag_data) == 0) && (count($note_data) == 0)) {
|
||||
message::error(t("Please select a tag or note to delete."));
|
||||
url::redirect("tagfaces/drawfaces/$item_data");
|
||||
return;
|
||||
}
|
||||
|
||||
// Delete the face(s) from the database.
|
||||
foreach ($tag_data as $one_tag) {
|
||||
ORM::factory("items_face")
|
||||
->where("id", "=", $one_tag)
|
||||
->delete_all();
|
||||
db::build()->delete("items_faces")->where("id", "=", $one_tag)->execute();
|
||||
}
|
||||
|
||||
// Display a success message.
|
||||
// Delete the notes(s) from the database.
|
||||
foreach ($note_data as $one_note) {
|
||||
db::build()->delete("items_notes")->where("id", "=", $one_note)->execute();
|
||||
}
|
||||
|
||||
// Display a success message for deleted faces.
|
||||
if (count($tag_data) == 1) {
|
||||
message::success(t("One face deleted."));
|
||||
} else {
|
||||
} elseif (count($tag_data) > 1) {
|
||||
message::success(count($tag_data) . t(" faces deleted."));
|
||||
}
|
||||
|
||||
// Display a success message for deleted notes.
|
||||
if (count($note_data) == 1) {
|
||||
message::success(t("One note deleted."));
|
||||
} elseif (count($note_data) > 1) {
|
||||
message::success(count($note_data) . t(" notes deleted."));
|
||||
}
|
||||
|
||||
// Re-load the face tagging page.
|
||||
url::redirect("tagfaces/drawfaces/$item_data");
|
||||
}
|
||||
|
||||
@ -179,20 +193,23 @@ class tagfaces_Controller extends Controller {
|
||||
->label(t("Select a tag or enter in a title:"));
|
||||
|
||||
$tags_group->dropdown('tagsList')
|
||||
->label(t("Select a tag:"))
|
||||
->label(t("Tag:"))
|
||||
->id('tagsList')
|
||||
->options($array_tags);
|
||||
|
||||
$tags_group->input("face_title")
|
||||
->label(t("Title"));
|
||||
->id('face_title')
|
||||
->label(t("Note Title:"));
|
||||
|
||||
$tags_description = $form->group("TagsDescription")
|
||||
->label(t("Description (optional):"));
|
||||
$tags_description->input("face_description");
|
||||
$tags_description->input("face_description")
|
||||
->id('face_description');
|
||||
|
||||
// Generate input boxes to hold the coordinates of the face.
|
||||
$coordinates_group = $form->group("FaceCoordinates")
|
||||
->label(t("Coordinates:"));
|
||||
$coordinates_group->input("x1")
|
||||
$coordinates_group->input('x1')
|
||||
->id('x1')
|
||||
->label(t("X1"));
|
||||
$coordinates_group->input("y1")
|
||||
@ -206,7 +223,7 @@ class tagfaces_Controller extends Controller {
|
||||
->label(t("Y2"));
|
||||
|
||||
// Add the id# of the photo and a save button to the form.
|
||||
$form->hidden("item_id")->value($id);
|
||||
$coordinates_group->hidden("item_id")->value($id);
|
||||
$form->submit("SaveFace")->value(t("Save face"));
|
||||
|
||||
// Return the newly generated form.
|
||||
@ -216,7 +233,6 @@ class tagfaces_Controller extends Controller {
|
||||
private function _get_delfaces_form($id) {
|
||||
// Generate a form to allow the user to remove face data
|
||||
// from a photo.
|
||||
|
||||
// Make a new Form.
|
||||
$form = new Forge("tagfaces/delface", "", "post",
|
||||
array("id" => "g-tag-del-faces-form"));
|
||||
@ -238,14 +254,44 @@ class tagfaces_Controller extends Controller {
|
||||
// Add a checklist to the form.
|
||||
$tags_group = $form->group("ExistingFaces")
|
||||
->label(t("Tags with faces:"));
|
||||
// Add the id# of the photo and a delete button to the form.
|
||||
$tags_group->hidden("item_id")->value($id);
|
||||
|
||||
$tags_group->checklist("facesList")
|
||||
->options($array_faces)
|
||||
->label(t("Select the tag(s) that correspond(s) to the face(s) you wish to delete:"));
|
||||
}
|
||||
|
||||
// Create an array of all the notes associated with this photo.
|
||||
$existing_notes = ORM::factory("items_note")
|
||||
->where("item_id", "=", $id)
|
||||
->find_all();
|
||||
|
||||
// turn the $existing_notes array into an array that can be used
|
||||
// for a checklist.
|
||||
$array_notes = "";
|
||||
foreach ($existing_notes as $oneNote) {
|
||||
$array_notes[$oneNote->id] = array($oneNote->title, false);
|
||||
}
|
||||
|
||||
if ($array_notes) {
|
||||
// Add a checklist to the form.
|
||||
$notes_group = $form->group("ExistingNotes")
|
||||
->label(t("Notes:"));
|
||||
// Add the id# of the photo and a delete button to the form.
|
||||
$form->hidden("item_id")->value($id);
|
||||
$form->submit("DeleteFace")->value(t("Delete face(s)"));
|
||||
$notes_group->hidden("item_id")->value($id);
|
||||
|
||||
$notes_group->checklist("notesList")
|
||||
->options($array_notes)
|
||||
->label(t("Select the notes you wish to delete:"));
|
||||
}
|
||||
|
||||
// Hide the delete button when there's nothing to delete.
|
||||
if (($array_notes) || ($array_faces)) {
|
||||
$form->submit("DeleteFace")->value(t("Delete face(s) / note(s)"));
|
||||
} else {
|
||||
$form->group("NoFacesNotes")->label(t("There is nothing to delete for this photo."));
|
||||
}
|
||||
|
||||
// Return the newly generated form.
|
||||
return $form;
|
||||
|
@ -58,18 +58,14 @@ class tagfaces_event_Core {
|
||||
->where("item_id", "=", $item->id)
|
||||
->find_all();
|
||||
if (count($existingFaces) > 0) {
|
||||
ORM::factory("items_face")
|
||||
->where("item_id", "=", $item->id)
|
||||
->delete_all();
|
||||
db::build()->delete("items_faces")->where("item_id", "=", $item->id)->execute();
|
||||
}
|
||||
|
||||
$existingNotes = ORM::factory("items_note")
|
||||
->where("item_id", "=", $item->id)
|
||||
->find_all();
|
||||
if (count($existingNotes) > 0) {
|
||||
ORM::factory("items_note")
|
||||
->where("item_id", "=", $item->id)
|
||||
->delete_all();
|
||||
db::build()->delete("items_notes")->where("item_id", "=", $item->id)->execute();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -115,18 +115,11 @@ li {
|
||||
|
||||
<fieldset>
|
||||
<div id="g-delete-faces">
|
||||
<h2><?= t("Delete Faces") ?></h2>
|
||||
<p><?=t("The following tags already have faces associated with them."); ?></p>
|
||||
<h2><?= t("Delete Existing Faces and Notes") ?></h2>
|
||||
<?= $delete_form ?>
|
||||
</div>
|
||||
</fieldset>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<br/>
|
||||
|
||||
<div id="g-exit-faces">
|
||||
|
@ -42,7 +42,7 @@
|
||||
|
||||
divface.style.display = 'block';
|
||||
divface.style.left = (photoimg.offsetLeft + x1) + 'px';
|
||||
divface.style.top = (photodiv.offsetTop + y1) + 'px';
|
||||
divface.style.top = (photodiv.offsetTop + 24 + y1) + 'px';
|
||||
divface.style.width=(x2-x1) + 'px';
|
||||
divface.style.height=(y2-y1) + 'px';
|
||||
if (str_url == '') {
|
||||
|
@ -69,9 +69,7 @@ class Admin_TagsMap_Controller extends Admin_Controller {
|
||||
// If the tag no longer exists then delete the record.
|
||||
if (count($oneTag) == 0) {
|
||||
// Delete the record.
|
||||
ORM::factory("tags_gps")
|
||||
->where("tag_id", "=", $oneGPS->tag_id)
|
||||
->delete_all();
|
||||
db::build()->delete("tags_gpses")->where("tag_id", "=", $oneGPS->tag_id)->execute();
|
||||
$int_deleted_records++;
|
||||
}
|
||||
}
|
||||
@ -100,9 +98,7 @@ class Admin_TagsMap_Controller extends Admin_Controller {
|
||||
// Delete the GSP data associated with a tag.
|
||||
|
||||
// Delete the record.
|
||||
ORM::factory("tags_gps")
|
||||
->where("tag_id", "=", $tag_id)
|
||||
->delete_all();
|
||||
db::build()->delete("tags_gpses")->where("tag_id", "=", $tag_id)->execute();
|
||||
|
||||
// Redirect back to the main screen and display a "success" message.
|
||||
message::success(t("Your Settings Have Been Saved."));
|
||||
|
@ -1,4 +1,5 @@
|
||||
<?php defined("SYSPATH") or die("No direct script access.") ?>
|
||||
|
||||
<? if ($map_fullsize == true) { ?>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head>
|
||||
@ -43,12 +44,13 @@
|
||||
// Create markers for each tag with GPS coordinates.
|
||||
<? $counter = 0; ?>
|
||||
<? foreach ($tags_gps as $oneGPS): ?>
|
||||
<? $one_tag = ORM::factory("tag", $oneGPS->tag_id); ?>
|
||||
var myGeographicCoordinates<?=$counter; ?> = new GLatLng(<?= $oneGPS->latitude ?>,
|
||||
<?= $oneGPS->longitude ?>);
|
||||
map.addOverlay(createMarker(myGeographicCoordinates<?=$counter; ?>,
|
||||
"<?= $oneGPS->description ?>",
|
||||
"<?= url::site("tags/$oneGPS->tag_id")?>",
|
||||
"<?= ORM::factory("tag", $oneGPS->tag_id)->name ?>"
|
||||
"<?= $oneGPS->description; ?>",
|
||||
"<?= $one_tag->url(); ?>",
|
||||
"<?= html::clean($one_tag->name); ?>"
|
||||
));
|
||||
<? $counter++; ?>
|
||||
<? endforeach ?>
|
||||
|
Reference in New Issue
Block a user