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 {
|
} else {
|
||||||
// Generate an array of all non-album items in the current album
|
// Generate an array of all non-album items in the current album
|
||||||
// and any sub albums.
|
// and any sub albums.
|
||||||
$children = ORM::factory("item", $input->post("item_id"))
|
$item = ORM::factory("item", $input->post("item_id"));
|
||||||
->where("type", "!=", "album")
|
$children = $item->descendants();
|
||||||
->descendants();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Loop through each item in the album and make sure the user has
|
// Loop through each item in the album and make sure the user has
|
||||||
// access to view and edit it.
|
// access to view and edit it.
|
||||||
foreach ($children as $child) {
|
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
|
// Assuming the user can view/edit the current item, loop
|
||||||
// through each tag that was submitted and apply it to
|
// 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:") . " ";
|
$results .= t("Tags:") . " ";
|
||||||
$anchors = array();
|
$anchors = array();
|
||||||
foreach ($tags as $tag) {
|
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>";
|
$results .= join(", ", $anchors) . "</li>";
|
||||||
}
|
}
|
||||||
|
@ -43,7 +43,7 @@
|
|||||||
<? $not_first = 0; ?>
|
<? $not_first = 0; ?>
|
||||||
<? foreach ($tags as $tag): ?>
|
<? foreach ($tags as $tag): ?>
|
||||||
<?= ($not_first++) ? "," : "" ?>
|
<?= ($not_first++) ? "," : "" ?>
|
||||||
<a href="<?= url::site("tags/{$tag->name}") ?>"><?= html::clean($tag->name) ?></a>
|
<a href="<?= $tag->url() ?>"><?= html::clean($tag->name) ?></a>
|
||||||
<? endforeach ?>
|
<? endforeach ?>
|
||||||
</li>
|
</li>
|
||||||
<? endif ?>
|
<? endif ?>
|
||||||
|
@ -20,7 +20,6 @@
|
|||||||
class tagfaces_Controller extends Controller {
|
class tagfaces_Controller extends Controller {
|
||||||
public function drawfaces($id) {
|
public function drawfaces($id) {
|
||||||
// Generate the page that allows the user to draw boxes over a photo.
|
// Generate the page that allows the user to draw boxes over a photo.
|
||||||
|
|
||||||
// Make sure user has access to view and edit the photo.
|
// Make sure user has access to view and edit the photo.
|
||||||
$item = ORM::factory("item", $id);
|
$item = ORM::factory("item", $id);
|
||||||
access::required("view", $item);
|
access::required("view", $item);
|
||||||
@ -48,29 +47,44 @@ class tagfaces_Controller extends Controller {
|
|||||||
access::verify_csrf();
|
access::verify_csrf();
|
||||||
|
|
||||||
// Convert submitted data to local variables.
|
// Convert submitted data to local variables.
|
||||||
|
// Figure out which tagged faces and notes to delete.
|
||||||
$tag_data = Input::instance()->post("facesList");
|
$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");
|
$item_data = Input::instance()->post("item_id");
|
||||||
|
|
||||||
// If the user didn't select a tag, display and error and abort.
|
// If the user didn't select a tag or note, display and error and abort.
|
||||||
if (count($tag_data) == 0) {
|
if ((count($tag_data) == 0) && (count($note_data) == 0)) {
|
||||||
message::error(t("Please select a tag."));
|
message::error(t("Please select a tag or note to delete."));
|
||||||
url::redirect("tagfaces/drawfaces/$item_data");
|
url::redirect("tagfaces/drawfaces/$item_data");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Delete the face(s) from the database.
|
// Delete the face(s) from the database.
|
||||||
foreach ($tag_data as $one_tag) {
|
foreach ($tag_data as $one_tag) {
|
||||||
ORM::factory("items_face")
|
db::build()->delete("items_faces")->where("id", "=", $one_tag)->execute();
|
||||||
->where("id", "=", $one_tag)
|
|
||||||
->delete_all();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 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) {
|
if (count($tag_data) == 1) {
|
||||||
message::success(t("One face deleted."));
|
message::success(t("One face deleted."));
|
||||||
} else {
|
} elseif (count($tag_data) > 1) {
|
||||||
message::success(count($tag_data) . t(" faces deleted."));
|
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");
|
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:"));
|
->label(t("Select a tag or enter in a title:"));
|
||||||
|
|
||||||
$tags_group->dropdown('tagsList')
|
$tags_group->dropdown('tagsList')
|
||||||
->label(t("Select a tag:"))
|
->label(t("Tag:"))
|
||||||
|
->id('tagsList')
|
||||||
->options($array_tags);
|
->options($array_tags);
|
||||||
|
|
||||||
$tags_group->input("face_title")
|
$tags_group->input("face_title")
|
||||||
->label(t("Title"));
|
->id('face_title')
|
||||||
|
->label(t("Note Title:"));
|
||||||
|
|
||||||
$tags_description = $form->group("TagsDescription")
|
$tags_description = $form->group("TagsDescription")
|
||||||
->label(t("Description (optional):"));
|
->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.
|
// Generate input boxes to hold the coordinates of the face.
|
||||||
$coordinates_group = $form->group("FaceCoordinates")
|
$coordinates_group = $form->group("FaceCoordinates")
|
||||||
->label(t("Coordinates:"));
|
->label(t("Coordinates:"));
|
||||||
$coordinates_group->input("x1")
|
$coordinates_group->input('x1')
|
||||||
->id('x1')
|
->id('x1')
|
||||||
->label(t("X1"));
|
->label(t("X1"));
|
||||||
$coordinates_group->input("y1")
|
$coordinates_group->input("y1")
|
||||||
@ -206,7 +223,7 @@ class tagfaces_Controller extends Controller {
|
|||||||
->label(t("Y2"));
|
->label(t("Y2"));
|
||||||
|
|
||||||
// Add the id# of the photo and a save button to the form.
|
// 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"));
|
$form->submit("SaveFace")->value(t("Save face"));
|
||||||
|
|
||||||
// Return the newly generated form.
|
// Return the newly generated form.
|
||||||
@ -216,7 +233,6 @@ class tagfaces_Controller extends Controller {
|
|||||||
private function _get_delfaces_form($id) {
|
private function _get_delfaces_form($id) {
|
||||||
// Generate a form to allow the user to remove face data
|
// Generate a form to allow the user to remove face data
|
||||||
// from a photo.
|
// from a photo.
|
||||||
|
|
||||||
// Make a new Form.
|
// Make a new Form.
|
||||||
$form = new Forge("tagfaces/delface", "", "post",
|
$form = new Forge("tagfaces/delface", "", "post",
|
||||||
array("id" => "g-tag-del-faces-form"));
|
array("id" => "g-tag-del-faces-form"));
|
||||||
@ -238,14 +254,44 @@ class tagfaces_Controller extends Controller {
|
|||||||
// Add a checklist to the form.
|
// Add a checklist to the form.
|
||||||
$tags_group = $form->group("ExistingFaces")
|
$tags_group = $form->group("ExistingFaces")
|
||||||
->label(t("Tags with faces:"));
|
->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")
|
$tags_group->checklist("facesList")
|
||||||
->options($array_faces)
|
->options($array_faces)
|
||||||
->label(t("Select the tag(s) that correspond(s) to the face(s) you wish to delete:"));
|
->label(t("Select the tag(s) that correspond(s) to the face(s) you wish to delete:"));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add the id# of the photo and a delete button to the form.
|
// Create an array of all the notes associated with this photo.
|
||||||
$form->hidden("item_id")->value($id);
|
$existing_notes = ORM::factory("items_note")
|
||||||
$form->submit("DeleteFace")->value(t("Delete face(s)"));
|
->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.
|
||||||
|
$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 the newly generated form.
|
||||||
return $form;
|
return $form;
|
||||||
|
@ -58,18 +58,14 @@ class tagfaces_event_Core {
|
|||||||
->where("item_id", "=", $item->id)
|
->where("item_id", "=", $item->id)
|
||||||
->find_all();
|
->find_all();
|
||||||
if (count($existingFaces) > 0) {
|
if (count($existingFaces) > 0) {
|
||||||
ORM::factory("items_face")
|
db::build()->delete("items_faces")->where("item_id", "=", $item->id)->execute();
|
||||||
->where("item_id", "=", $item->id)
|
|
||||||
->delete_all();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$existingNotes = ORM::factory("items_note")
|
$existingNotes = ORM::factory("items_note")
|
||||||
->where("item_id", "=", $item->id)
|
->where("item_id", "=", $item->id)
|
||||||
->find_all();
|
->find_all();
|
||||||
if (count($existingNotes) > 0) {
|
if (count($existingNotes) > 0) {
|
||||||
ORM::factory("items_note")
|
db::build()->delete("items_notes")->where("item_id", "=", $item->id)->execute();
|
||||||
->where("item_id", "=", $item->id)
|
|
||||||
->delete_all();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -115,18 +115,11 @@ li {
|
|||||||
|
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<div id="g-delete-faces">
|
<div id="g-delete-faces">
|
||||||
<h2><?= t("Delete Faces") ?></h2>
|
<h2><?= t("Delete Existing Faces and Notes") ?></h2>
|
||||||
<p><?=t("The following tags already have faces associated with them."); ?></p>
|
|
||||||
<?= $delete_form ?>
|
<?= $delete_form ?>
|
||||||
</div>
|
</div>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<br/>
|
<br/>
|
||||||
|
|
||||||
<div id="g-exit-faces">
|
<div id="g-exit-faces">
|
||||||
|
@ -42,7 +42,7 @@
|
|||||||
|
|
||||||
divface.style.display = 'block';
|
divface.style.display = 'block';
|
||||||
divface.style.left = (photoimg.offsetLeft + x1) + 'px';
|
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.width=(x2-x1) + 'px';
|
||||||
divface.style.height=(y2-y1) + 'px';
|
divface.style.height=(y2-y1) + 'px';
|
||||||
if (str_url == '') {
|
if (str_url == '') {
|
||||||
|
@ -68,10 +68,8 @@ class Admin_TagsMap_Controller extends Admin_Controller {
|
|||||||
|
|
||||||
// If the tag no longer exists then delete the record.
|
// If the tag no longer exists then delete the record.
|
||||||
if (count($oneTag) == 0) {
|
if (count($oneTag) == 0) {
|
||||||
// Delete the record.
|
// Delete the record.
|
||||||
ORM::factory("tags_gps")
|
db::build()->delete("tags_gpses")->where("tag_id", "=", $oneGPS->tag_id)->execute();
|
||||||
->where("tag_id", "=", $oneGPS->tag_id)
|
|
||||||
->delete_all();
|
|
||||||
$int_deleted_records++;
|
$int_deleted_records++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -100,9 +98,7 @@ class Admin_TagsMap_Controller extends Admin_Controller {
|
|||||||
// Delete the GSP data associated with a tag.
|
// Delete the GSP data associated with a tag.
|
||||||
|
|
||||||
// Delete the record.
|
// Delete the record.
|
||||||
ORM::factory("tags_gps")
|
db::build()->delete("tags_gpses")->where("tag_id", "=", $tag_id)->execute();
|
||||||
->where("tag_id", "=", $tag_id)
|
|
||||||
->delete_all();
|
|
||||||
|
|
||||||
// Redirect back to the main screen and display a "success" message.
|
// Redirect back to the main screen and display a "success" message.
|
||||||
message::success(t("Your Settings Have Been Saved."));
|
message::success(t("Your Settings Have Been Saved."));
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
<?php defined("SYSPATH") or die("No direct script access.") ?>
|
<?php defined("SYSPATH") or die("No direct script access.") ?>
|
||||||
|
|
||||||
<? if ($map_fullsize == true) { ?>
|
<? if ($map_fullsize == true) { ?>
|
||||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||||
<head>
|
<head>
|
||||||
@ -43,12 +44,13 @@
|
|||||||
// Create markers for each tag with GPS coordinates.
|
// Create markers for each tag with GPS coordinates.
|
||||||
<? $counter = 0; ?>
|
<? $counter = 0; ?>
|
||||||
<? foreach ($tags_gps as $oneGPS): ?>
|
<? foreach ($tags_gps as $oneGPS): ?>
|
||||||
|
<? $one_tag = ORM::factory("tag", $oneGPS->tag_id); ?>
|
||||||
var myGeographicCoordinates<?=$counter; ?> = new GLatLng(<?= $oneGPS->latitude ?>,
|
var myGeographicCoordinates<?=$counter; ?> = new GLatLng(<?= $oneGPS->latitude ?>,
|
||||||
<?= $oneGPS->longitude ?>);
|
<?= $oneGPS->longitude ?>);
|
||||||
map.addOverlay(createMarker(myGeographicCoordinates<?=$counter; ?>,
|
map.addOverlay(createMarker(myGeographicCoordinates<?=$counter; ?>,
|
||||||
"<?= $oneGPS->description ?>",
|
"<?= $oneGPS->description; ?>",
|
||||||
"<?= url::site("tags/$oneGPS->tag_id")?>",
|
"<?= $one_tag->url(); ?>",
|
||||||
"<?= ORM::factory("tag", $oneGPS->tag_id)->name ?>"
|
"<?= html::clean($one_tag->name); ?>"
|
||||||
));
|
));
|
||||||
<? $counter++; ?>
|
<? $counter++; ?>
|
||||||
<? endforeach ?>
|
<? endforeach ?>
|
||||||
|
Reference in New Issue
Block a user