1
0

Merge commit 'upstream/master'

This commit is contained in:
root 2010-10-05 20:05:44 +02:00
commit 6728fab4ef
45 changed files with 1306 additions and 64 deletions

View File

@ -150,15 +150,17 @@ class photoannotation_event_Core {
$view = new Theme_View("dynamic.html", "collection", "userprofiles");
//load thumbs
$item_users = ORM::factory("items_user")->where("user_id", "=", $data->user->id)->find_all();
$children_count = count($item_users);
foreach ($item_users as $item_user) {
$item_thumb = ORM::factory("item")
->viewable()
->where("type", "!=", "album")
->where("id", "=", $item_user->item_id)
->find();
$item_thumbs[] = $item_thumb;
if ($item_thumb->loaded()) {
$item_thumbs[] = $item_thumb;
}
}
$children_count = count($item_thumbs);
$page_size = module::get_var("gallery", "page_size", 9);
$page = (int) Input::instance()->get("page", "1");
$offset = ($page-1) * $page_size;

View File

@ -58,11 +58,6 @@
$jscode .= "\"url\": \"". user_profile::url($oneUser->user_id) ."\" },\n";
}
}
$display = "none";
if ($legend_users != "") {
$display = "block";
}
$legend_users = t("<span id=\"photoannotation-legend-user\" style=\"display: ". $display ."\">People on this photo: ") . $legend_users ."</span>";
foreach ($existingFaces as $oneFace) {
$oneTag = ORM::factory("tag", $oneFace->tag_id);
if ($oneTag->loaded()) {
@ -81,11 +76,6 @@
$jscode .= "\"url\": \"". $oneTag->url() ."\" },\n";
}
}
$display = "none";
if ($legend_faces != "") {
$display = "block";
}
$legend_faces = t("<span id=\"photoannotation-legend-face\" style=\"display: ". $display ."\">Faces on this photo: ") . $legend_faces ."</span>";
foreach ($existingNotes as $oneNote) {
if ($shownotes) {
$legend_notes .= "<span id=\"photoannotation-legend-note-". $oneNote->id . "\">". html::clean($oneNote->title) ."</span> ";
@ -103,12 +93,22 @@
}
$jscode = trim($jscode, ",\n");
$jscode .= " ],";
$display = "none";
if ($legend_notes != "") {
$display = "block";
}
$legend_notes = t("<span id=\"photoannotation-legend-note\" style=\"display: ". $display ."\">Notes on this photo: ") . $legend_notes ."</span>";
}
$display = "none";
if ($legend_users != "") {
$display = "block";
}
$legend_users = t("<span id=\"photoannotation-legend-user\" style=\"display: ". $display ."\">People on this photo: ") . $legend_users ."</span>";
$display = "none";
if ($legend_faces != "") {
$display = "block";
}
$legend_faces = t("<span id=\"photoannotation-legend-face\" style=\"display: ". $display ."\">Faces on this photo: ") . $legend_faces ."</span>";
$display = "none";
if ($legend_notes != "") {
$display = "block";
}
$legend_notes = t("<span id=\"photoannotation-legend-note\" style=\"display: ". $display ."\">Notes on this photo: ") . $legend_notes ."</span>";
$legend_display = $legend_users . $legend_faces . $legend_notes;
$labels_arraystring = "labels: [ '". t("Tag:") ."','". t("Note Title:") ."','". t("Description (optional)") ."','". t("Are you sure you want to delete this annotation?") ."','". t("or") ."','". t("Yes") ."','". t("No") ."','". t("Confirm deletion") ."','". t("Save") ."','". t("Cancel") ."','". t("Person:") ."','". t("No user selected") ."','". t("Select one of the following") ."','". t("An error ocurred while saving annotation") ."','". t("OK") ."','". t("An error ocurred while deleting annotation") ."','". t("View fullsize") ."' ],";
?>

View File

@ -21,7 +21,7 @@
</script>
<div class="g-tag-it-block">
<a href="<?= $item->url() ?>">
<?= $item->thumb_img(array("class" => "g-thumbnail")) ?>
<?= $item->thumb_img(array("class" => "g-thumbnail"), 180) ?>
</a>
<p id="g-tag-it-tags-container"></p>
<?= $form ?>

View File

@ -0,0 +1,96 @@
<?php defined("SYSPATH") or die("No direct script access.");
/**
* Gallery - a web based photo album viewer and editor
* Copyright (C) 2000-2010 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_Videos_Controller extends Admin_Controller {
public function index() {
$view = new Admin_View("admin.html");
$view->page_title = t("Add videos from server");
$view->content = new View("admin_videos.html");
$view->content->form = $this->_get_admin_form();
$paths = unserialize(module::get_var("videos", "authorized_paths", "a:0:{}"));
$view->content->paths = array_keys($paths);
print $view;
}
public function add_path() {
access::verify_csrf();
$form = $this->_get_admin_form();
$paths = unserialize(module::get_var("videos", "authorized_paths", "a:0:{}"));
if ($form->validate()) {
if (is_link($form->add_path->path->value)) {
$form->add_path->path->add_error("is_symlink", 1);
} else if (!is_readable($form->add_path->path->value)) {
$form->add_path->path->add_error("not_readable", 1);
} else {
$path = $form->add_path->path->value;
$paths[$path] = 1;
module::set_var("videos", "authorized_paths", serialize($paths));
message::success(t("Added path %path", array("path" => $path)));
videos::check_config($paths);
url::redirect("admin/videos");
}
}
$view = new Admin_View("admin.html");
$view->content = new View("admin_videos.html");
$view->content->form = $form;
$view->content->paths = array_keys($paths);
print $view;
}
public function remove_path() {
access::verify_csrf();
$path = Input::instance()->get("path");
$paths = unserialize(module::get_var("videos", "authorized_paths"));
if (isset($paths[$path])) {
unset($paths[$path]);
message::success(t("Removed path %path", array("path" => $path)));
module::set_var("videos", "authorized_paths", serialize($paths));
videos::check_config($paths);
}
url::redirect("admin/videos");
}
public function autocomplete() {
$directories = array();
$path_prefix = Input::instance()->get("q");
foreach (glob("{$path_prefix}*") as $file) {
if (is_dir($file) && !is_link($file)) {
$directories[] = $file;
}
}
print implode("\n", $directories);
}
private function _get_admin_form() {
$form = new Forge("admin/videos/add_path", "", "post",
array("id" => "g-server-add-admin-form", "class" => "g-short-form"));
$add_path = $form->group("add_path");
$add_path->input("path")->label(t("Path"))->rules("required")->id("g-path")
->error_messages("not_readable", t("This directory is not readable by the webserver"))
->error_messages("is_symlink", t("Symbolic links are not allowed"));
$add_path->submit("add")->value(t("Add Path"));
return $form;
}
}

View File

@ -0,0 +1,302 @@
<?php defined("SYSPATH") or die("No direct script access.");
/**
* Gallery - a web based photo album viewer and editor
* Copyright (C) 2000-2010 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 Videos_Controller extends Admin_Controller {
public function browse($id) {
$paths = unserialize(module::get_var("videos", "authorized_paths"));
foreach (array_keys($paths) as $path) {
$files[] = $path;
}
$item = ORM::factory("item", $id);
$view = new View("videos_tree_dialog.html");
$view->item = $item;
$view->tree = new View("videos_tree.html");
$view->tree->files = $files;
$view->tree->parents = array();
print $view;
}
public function children() {
$path = Input::instance()->get("path");
$tree = new View("videos_tree.html");
$tree->files = array();
$tree->parents = array();
// Make a tree with the parents back up to the authorized path, and all the children under the
// current path.
if (videos::is_valid_path($path)) {
$tree->parents[] = $path;
while (videos::is_valid_path(dirname($tree->parents[0]))) {
array_unshift($tree->parents, dirname($tree->parents[0]));
}
$glob_path = str_replace(array("{", "}", "[", "]"), array("\{", "\}", "\[", "\]"), $path);
foreach (glob("$glob_path/*") as $file) {
if (!is_readable($file)) {
continue;
}
if (!is_dir($file)) {
$ext = strtolower(pathinfo($file, PATHINFO_EXTENSION));
//if (!in_array($ext, array("gif", "jpeg", "jpg", "png", "flv", "mp4", "m4v"))) {
if (!in_array($ext, unserialize(module::get_var("videos", "allowed_extensions")))) {
continue;
}
}
$tree->files[] = $file;
}
} else {
// Missing or invalid path; print out the list of authorized path
$paths = unserialize(module::get_var("videos", "authorized_paths"));
foreach (array_keys($paths) as $path) {
$tree->files[] = $path;
}
}
print $tree;
}
/**
* Begin the task of adding files.
*/
public function start() {
access::verify_csrf();
$item = ORM::factory("item", Input::instance()->get("item_id"));
foreach (Input::instance()->post("paths") as $path) {
if (videos::is_valid_path($path)) {
$paths[] = array($path, null);
}
}
$task_def = Task_Definition::factory()
->callback("Videos_Controller::add")
->description(t("Add videos from the local server"))
->name(t("Add from server"));
$task = task::create($task_def, array("item_id" => $item->id, "queue" => $paths));
json::reply(
array("result" => "started",
"status" => (string)$task->status,
"url" => url::site("videos/run/$task->id?csrf=" . access::csrf_token())));
}
/**
* Run the task of adding files
*/
function run($task_id) {
access::verify_csrf();
$task = ORM::factory("task", $task_id);
if (!$task->loaded() || $task->owner_id != identity::active_user()->id) {
access::forbidden();
}
$task = task::run($task_id);
// Prevent the JavaScript code from breaking by forcing a period as
// decimal separator for all locales with sprintf("%F", $value).
json::reply(array("done" => (bool)$task->done,
"status" => (string)$task->status,
"percent_complete" => sprintf("%F", $task->percent_complete)));
}
/**
* This is the task code that adds photos and albums. It first examines all the target files
* and creates a set of Server_Add_File_Models, then runs through the list of models and adds
* them one at a time.
*/
static function add($task) {
$mode = $task->get("mode", "init");
$start = microtime(true);
switch ($mode) {
case "init":
$task->set("mode", "build-file-list");
$task->percent_complete = 0;
$task->status = t("Starting up");
batch::start();
break;
case "build-file-list": // 0% to 10%
// We can't fit an arbitrary number of paths in a task, so store them in a separate table.
// Don't use an iterator here because we can't get enough control over it when we're dealing
// with a deep hierarchy and we don't want to go over our time quota. The queue is in the
// form [path, parent_id] where the parent_id refers to another Server_Add_File_Model. We
// have this extra level of abstraction because we don't know its Item_Model id yet.
$queue = $task->get("queue");
$paths = unserialize(module::get_var("videos", "authorized_paths"));
while ($queue && microtime(true) - $start < 0.5) {
list($file, $parent_entry_id) = array_shift($queue);
// Ignore the staging directories as directories to be imported.
if (empty($paths[$file])) {
$entry = ORM::factory("videos_file");
$entry->task_id = $task->id;
$entry->file = $file;
$entry->parent_id = $parent_entry_id;
$entry->save();
$entry_id = $entry->id;
} else {
$entry_id = null;
}
$file = preg_quote($file);
foreach (glob("$file/*") as $child) {
if (is_dir($child)) {
$queue[] = array($child, $entry_id);
} else {
$ext = strtolower(pathinfo($child, PATHINFO_EXTENSION));
//if (in_array($ext, array("gif", "jpeg", "jpg", "png", "flv", "mp4", "m4v")) &&
if (in_array($ext, unserialize(module::get_var("videos", "allowed_extensions"))) &&
filesize($child) > 0) {
$child_entry = ORM::factory("videos_file");
$child_entry->task_id = $task->id;
$child_entry->file = $child;
$child_entry->parent_id = $entry_id;
$child_entry->save();
}
}
}
}
// We have no idea how long this can take because we have no idea how deep the tree
// hierarchy rabbit hole goes. Leave ourselves room here for 100 iterations and don't go
// over 10% in percent_complete.
$task->set("queue", $queue);
$task->percent_complete = min($task->percent_complete + 0.1, 10);
$task->status = t2(
"Found one file", "Found %count files",
ORM::factory("videos_file")->where("task_id", "=", $task->id)->count_all());
if (!$queue) {
$task->set("mode", "add-files");
$task->set(
"total_files",
ORM::factory("videos_file")->where("task_id", "=", $task->id)->count_all());
$task->percent_complete = 10;
}
break;
case "add-files": // 10% to 100%
$completed_files = $task->get("completed_files", 0);
$total_files = $task->get("total_files");
// Ordering by id ensures that we add them in the order that we created the entries, which
// will create albums first. Ignore entries which already have an Item_Model attached,
// they're done.
$entries = ORM::factory("videos_file")
->where("task_id", "=", $task->id)
->where("item_id", "IS", null)
->order_by("id", "ASC")
->limit(10)
->find_all();
if ($entries->count() == 0) {
// Out of entries, we're done.
$task->set("mode", "done");
}
$owner_id = identity::active_user()->id;
foreach ($entries as $entry) {
if (microtime(true) - $start > 0.5) {
break;
}
// Look up the parent item for this entry. By now it should exist, but if none was
// specified, then this belongs as a child of the current item.
$parent_entry = ORM::factory("videos_file", $entry->parent_id);
if (!$parent_entry->loaded()) {
$parent = ORM::factory("item", $task->get("item_id"));
} else {
$parent = ORM::factory("item", $parent_entry->item_id);
}
$name = basename($entry->file);
$title = item::convert_filename_to_title($name);
if (is_dir($entry->file)) {
$album = ORM::factory("item");
$album->type = "album";
$album->parent_id = $parent->id;
$album->name = $name;
$album->title = $title;
$album->owner_id = $owner_id;
$album->save();
$entry->item_id = $album->id;
} else {
try {
$extension = strtolower(pathinfo($name, PATHINFO_EXTENSION));
if (in_array($extension, unserialize(module::get_var("videos", "allowed_extensions")))) {
$movie = ORM::factory("item");
$movie->type = "movie";
$movie->parent_id = $parent->id;
$movie->set_data_file($entry->file);
$movie->name = $name;
$movie->title = $title;
$movie->owner_id = $owner_id;
$movie->save();
$entry->item_id = $movie->id;
$items_video = ORM::factory("items_video");
$items_video->item_id = $movie->id;
$items_video->save();
if (file_exists($entry->file . ".flv")) {
copy($entry->file . ".flv", $movie->resize_path() . ".flv");
list ($vid_width, $vid_height, $mime_type) = movie::get_file_metadata($entry->file . ".flv");
$movie->height = $vid_height;
$movie->width = $vid_width;
$movie->save();
}
} else {
// This should never happen, because we don't add stuff to the list that we can't
// process. But just in, case.. set this to a non-null value so that we skip this
// entry.
$entry->item_id = 0;
$task->log("Skipping unknown file type: $entry->file");
}
} catch (Exception $e) {
// This can happen if a photo file is invalid, like a BMP masquerading as a .jpg
$entry->item_id = 0;
$task->log("Skipping invalid file: $entry->file");
}
}
$completed_files++;
$entry->save();
}
$task->set("completed_files", $completed_files);
$task->status = t("Adding photos / albums (%completed of %total)",
array("completed" => $completed_files,
"total" => $total_files));
$task->percent_complete = $total_files ? 10 + 100 * ($completed_files / $total_files) : 100;
break;
case "done":
batch::stop();
$task->done = true;
$task->state = "success";
$task->percent_complete = 100;
db::build()
->delete("videos_files")
->where("task_id", "=", $task->id)
->execute();
message::info(t2("Successfully added one file",
"Successfully added %count files",
$task->get("completed_files")));
}
}
}

View File

@ -0,0 +1,38 @@
#g-server-add button {
margin-bottom: .5em;
}
#g-server-add-tree {
cursor: pointer;
padding-left: 4px;
width: 95%;
}
#g-server-add-tree li {
padding: 0;
float: none;
}
#g-server-add-tree span.selected {
background: #ddd;
}
#g-server-add-tree {
border: 1px solid #ccc;
height: 20em;
overflow: auto;
margin-bottom: .5em;
padding: .5em;
}
#g-server-add ul ul li {
padding-left: 1.2em;
}
#g-server-add-paths li .ui-icon {
margin-top: .4em;
}
#g-server-add-admin-form .textbox {
width: 400px;
}

View File

@ -0,0 +1,49 @@
<?php defined("SYSPATH") or die("No direct script access.");
/**
* Gallery - a web based photo album viewer and editor
* Copyright (C) 2000-2010 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 videos_Core {
static function check_config($paths=null) {
if ($paths === null) {
$paths = unserialize(module::get_var("videos", "authorized_paths"));
}
if (empty($paths)) {
site_status::warning(
t("Videos needs configuration. <a href=\"%url\">Configure it now!</a>",
array("url" => html::mark_clean(url::site("admin/videos")))),
"videos_configuration");
} else {
site_status::clear("videos_configuration");
}
}
static function is_valid_path($path) {
if (!is_readable($path) || is_link($path)) {
return false;
}
$authorized_paths = unserialize(module::get_var("videos", "authorized_paths"));
foreach (array_keys($authorized_paths) as $valid_path) {
if (strpos($path, $valid_path) === 0) {
return true;
}
}
return false;
}
}

View File

@ -0,0 +1,84 @@
<?php defined("SYSPATH") or die("No direct script access.");
/**
* Gallery - a web based photo album viewer and editor
* Copyright (C) 2000-2010 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 videos_event_Core {
static function admin_menu($menu, $theme) {
$menu->get("settings_menu")
->append(Menu::factory("link")
->id("videos")
->label(t("Videos"))
->url(url::site("admin/videos")));
}
static function site_menu($menu, $theme) {
$item = $theme->item();
$paths = unserialize(module::get_var("videos", "authorized_paths"));
if ($item && identity::active_user()->admin && $item->is_album() && !empty($paths) &&
is_writable($item->is_album() ? $item->file_path() : $item->parent()->file_path())) {
$menu->get("add_menu")
->append(Menu::factory("dialog")
->id("videos")
->label(t("Add videos"))
->url(url::site("videos/browse/$item->id")));
}
}
static function item_before_delete($item) {
// If deleting a video, make sure the resize is deleted as well, if it exists.
if ($item->is_movie()) {
$items_video = ORM::factory("items_video")
->where("item_id", "=", $item->id)
->find();
if ($items_video->loaded() && file_exists($item->resize_path() . ".flv")) {
@unlink($item->resize_path() . ".flv");
}
}
}
static function item_updated($old, $new) {
// When updating a video, check and see if the file name is being changed.
// If so, check for and modify any corresponding resized video
if ($old->is_movie()) {
if ($old->file_path() != $new->file_path()) {
$items_video = ORM::factory("items_video")
->where("item_id", "=", $old->id)
->find();
if ($items_video->loaded() && file_exists($old->resize_path() . ".flv")) {
@rename($old->resize_path() . ".flv", $new->resize_path() . ".flv");
}
}
}
}
static function item_moved($item, $old_parent) {
// When moving an video, also move the flash resize, if it exists.
if ($item->is_movie()) {
$items_video = ORM::factory("items_video")
->where("item_id", "=", $item->id)
->find();
$old_resize_path = $old_parent->resize_path() . "/" . $item->name . ".flv";
if ($items_video->loaded() && file_exists($old_resize_path)) {
@rename($old_resize_path, $item->resize_path() . ".flv");
}
}
}
}

View File

@ -0,0 +1,52 @@
<?php defined("SYSPATH") or die("No direct script access.");
/**
* Gallery - a web based photo album viewer and editor
* Copyright (C) 2000-2010 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 videos_installer {
static function install() {
$db = Database::instance();
$db->query("CREATE TABLE {videos_files} (
`id` int(9) NOT NULL auto_increment,
`file` varchar(255) NOT NULL,
`item_id` int(9),
`parent_id` int(9),
`task_id` int(9) NOT NULL,
PRIMARY KEY (`id`))
DEFAULT CHARSET=utf8;");
$db->query("CREATE TABLE {items_videos} (
`id` int(9) NOT NULL auto_increment,
`item_id` int(9) NOT NULL,
PRIMARY KEY (`id`),
KEY (`item_id`, `id`))
DEFAULT CHARSET=utf8;");
module::set_var("videos", "allowed_extensions", serialize(array("avi", "mpg", "mpeg", "mov", "wmv", "asf", "mts")));
module::set_version("videos", 1);
videos::check_config();
}
static function deactivate() {
site_status::clear("videos_configuration");
}
static function uninstall() {
$db = Database::instance();
$db->query("DROP TABLE IF EXISTS {videos_files};");
$db->query("DROP TABLE IF EXISTS {items_videos};");
module::delete("videos");
}
}

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-2010 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 videos_theme_Core {
static function head($theme) {
if (identity::active_user()->admin) {
$theme->css("videos.css");
$theme->script("videos.js");
}
$item = $theme->item();
if ($item && $item->is_movie()) {
$items_video = ORM::factory("items_video")
->where("item_id", "=", $item->id)
->find();
if ($items_video->loaded()) {
$view = new View("videos_display_js.html");
//$view->embed_code = addslashes($embedded_video->embed_code);
return $view;
}
}
}
static function admin_head($theme) {
$head = array();
if (strpos(Router::$current_uri, "admin/videos") !== false) {
$theme->css("videos.css");
$theme->css("jquery.autocomplete.css");
$base = url::site("__ARGS__");
$csrf = access::csrf_token();
$head[] = "<script type=\"text/javascript\"> var base_url = \"$base\"; var csrf = \"$csrf\";</script>";
$theme->script("jquery.autocomplete.js");
$theme->script("admin_videos.js");
}
return implode("\n", $head);
}
}

View File

@ -0,0 +1,8 @@
/**
* Set up autocomplete on the server path list
*
*/
$("document").ready(function() {
$("#g-path").autocomplete(
base_url.replace("__ARGS__", "admin/videos/autocomplete"), {max: 256});
});

125
modules/videos/js/videos.js Normal file
View File

@ -0,0 +1,125 @@
(function($) {
$.widget("ui.gallery_server_add", {
_init: function() {
var self = this;
$("#g-server-add-add-button", this.element).click(function(event) {
event.preventDefault();
$(".g-progress-bar", this.element).
progressbar().
progressbar("value", 0);
$("#g-server-add-progress", this.element).slideDown("fast", function() { self.start_add(); });
});
$("#g-server-add-pause-button", this.element).click(function(event) {
self.pause = true;
$("#g-server-add-pause-button", this.element).hide();
$("#g-server-add-continue-button", this.element).show();
});
$("#g-server-add-continue-button", this.element).click(function(event) {
self.pause = false;
$("#g-server-add-pause-button", this.element).show();
$("#g-server-add-continue-button", this.element).hide();
self.run_add();
});
$("#g-server-add-close-button", this.element).click(function(event) {
$("#g-dialog").dialog("close");
window.location.reload();
});
$("#g-server-add-tree span.g-directory", this.element).dblclick(function(event) {
self.open_dir(event);
});
$("#g-server-add-tree span.g-file, #g-server-add-tree span.g-directory", this.element).click(function(event) {
self.select_file(event);
});
$("#g-server-add-tree span.g-directory", this.element).dblclick(function(event) {
self.open_dir(event);
});
$("#g-dialog").bind("dialogclose", function(event, ui) {
window.location.reload();
});
},
taskURL: null,
pause: false,
start_add: function() {
var self = this;
var paths = [];
$.each($("span.selected", self.element), function () {
paths.push($(this).attr("ref"));
});
$("#g-server-add-add-button", this.element).hide();
$("#g-server-add-pause-button", this.element).show();
$.ajax({
url: START_URL,
type: "POST",
async: false,
data: { "paths[]": paths },
dataType: "json",
success: function(data, textStatus) {
$("#g-status").html(data.status);
$(".g-progress-bar", self.element).progressbar("value", data.percent_complete);
self.taskURL = data.url;
setTimeout(function() { self.run_add(); }, 25);
}
});
return false;
},
run_add: function () {
var self = this;
$.ajax({
url: self.taskURL,
async: false,
dataType: "json",
success: function(data, textStatus) {
$("#g-status").html(data.status);
$(".g-progress-bar", self.element).progressbar("value", data.percent_complete);
if (data.done) {
$("#g-server-add-progress", this.element).slideUp();
$("#g-server-add-add-button", this.element).show();
$("#g-server-add-pause-button", this.element).hide();
$("#g-server-add-continue-button", this.element).hide();
} else {
if (!self.pause) {
setTimeout(function() { self.run_add(); }, 25);
}
}
}
});
},
/**
* Load a new directory
*/
open_dir: function(event) {
var self = this;
var path = $(event.target).attr("ref");
$.ajax({
url: GET_CHILDREN_URL.replace("__PATH__", path),
success: function(data, textStatus) {
$("#g-server-add-tree", self.element).html(data);
$("#g-server-add-tree span.g-directory", self.element).dblclick(function(event) {
self.open_dir(event);
});
$("#g-server-add-tree span.g-file, #g-server-add-tree span.g-directory", this.element).click(function(event) {
self.select_file(event);
});
}
});
},
/**
* Manage file selection state.
*/
select_file: function (event) {
$(event.target).toggleClass("selected");
if ($("#g-server-add span.selected").length) {
$("#g-server-add-add-button").enable(true).removeClass("ui-state-disabled");
} else {
$("#g-server-add-add-button").enable(false).addClass("ui-state-disabled");
}
}
});
})(jQuery);

View File

@ -0,0 +1,22 @@
<?php defined("SYSPATH") or die("No direct script access.");
/**
* Gallery - a web based photo album viewer and editor
* Copyright (C) 2000-2010 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 Items_video_Model extends ORM {
}

View File

@ -0,0 +1,21 @@
<?php defined("SYSPATH") or die("No direct script access.");
/**
* Gallery - a web based photo album viewer and editor
* Copyright (C) 2000-2010 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 Videos_File_Model extends ORM {
}

View File

@ -0,0 +1,3 @@
name = "Videos"
description = "Allows authorized users to load videos directly from your web server"
version = 1

View File

@ -0,0 +1,21 @@
<?php defined("SYSPATH") or die("No direct script access.") ?>
<div class="g-block">
<h1> <?= t("Add videos from server administration") ?> </h1>
<div class="g-block-content">
<?= $form ?>
<h2><?= t("Authorized paths") ?></h2>
<ul id="g-server-add-paths">
<? if (empty($paths)): ?>
<li class="g-module-status g-info"><?= t("No authorized image source paths defined yet") ?></li>
<? endif ?>
<? foreach ($paths as $id => $path): ?>
<li>
<?= html::clean($path) ?>
<a href="<?= url::site("admin/videos/remove_path?path=" . urlencode($path) . "&amp;csrf=$csrf") ?>"
id="icon_<?= $id ?>"
class="g-remove-dir g-button"><span class="ui-icon ui-icon-trash"><?= t("delete") ?></span></a>
</li>
<? endforeach ?>
</ul>
</div>
</div>

View File

@ -0,0 +1,33 @@
<?php defined("SYSPATH") or die("No direct script access.") ?>
<?
$items_video = ORM::factory("items_video")
->where("item_id", "=", $item->id)
->find();
if ($items_video->loaded() && file_exists($item->resize_path() . ".flv")) {
print html::anchor(str_replace("?m=", ".flv?m=", $item->resize_url(true)), "", $attrs);
} else {
print html::anchor($item->file_url(true), "", $attrs);
}
?>
<script type="text/javascript">
flowplayer(
"<?= $attrs["id"] ?>",
{
src: "<?= url::abs_file("lib/flowplayer.swf") ?>",
wmode: "transparent",
provider: "pseudostreaming"
},
{
plugins: {
pseudostreaming: {
url: "<?= url::abs_file("lib/flowplayer.pseudostreaming.swf") ?>"
},
controls: {
autoHide: 'always',
hideDelay: 2000
}
}
}
)
</script>

View File

@ -0,0 +1,28 @@
<?php defined("SYSPATH") or die("No direct script access.")
/**
* Gallery - a web based photo album viewer and editor
* Copyright (C) 2000-2010 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.
*/
?>
<? if (!file_exists($item->resize_path() . ".flv")) { ?>
<script type="text/javascript">
$(document).ready(function() {
$("#g-movie").replaceWith("<center><a href=\"<?= $item->file_url(true) ?>\">Click Here to Download Video.</a></center>");
});
</script>
<? } ?>

View File

@ -0,0 +1,37 @@
<?php defined("SYSPATH") or die("No direct script access.") ?>
<li class="ui-icon-left">
<span class="ui-icon ui-icon-folder-open"></span>
<span class="g-directory" ref="">
<?= t("All") ?>
</span>
<ul>
<? foreach ($parents as $dir): ?>
<li class="ui-icon-left">
<span class="ui-icon ui-icon-folder-open"></span>
<span class="g-directory" ref="<?= html::clean_attribute($dir) ?>">
<?= html::clean(basename($dir)) ?>
</span>
<ul>
<? endforeach ?>
<? foreach ($files as $file): ?>
<li class="ui-icon-left">
<span class="ui-icon <?= is_dir($file) ? "ui-icon-folder-collapsed" : "ui-icon-document" ?>"></span>
<span class="<?= is_dir($file) ? "g-directory" : "g-file" ?>"
ref="<?= html::clean_attribute($file) ?>" >
<?= html::clean(basename($file)) ?>
</span>
</li>
<? endforeach ?>
<? if (!$files): ?>
<li> <i> <?= t("empty") ?> </i> </li>
<? endif ?>
<? foreach ($parents as $dir): ?>
</ul>
</li>
<? endforeach ?>
</ul>
</li>

View File

@ -0,0 +1,52 @@
<?php defined("SYSPATH") or die("No direct script access.") ?>
<script type="text/javascript">
var GET_CHILDREN_URL = "<?= url::site("videos/children?path=__PATH__") ?>";
var START_URL = "<?= url::site("videos/start?item_id={$item->id}&csrf=$csrf") ?>";
</script>
<div id="g-server-add">
<h1 style="display: none;"><?= t("Add Videos to '%title'", array("title" => html::purify($item->title))) ?></h1>
<p id="g-description"><?= t("Videos will be added to album:") ?></p>
<ul class="g-breadcrumbs">
<? $i = 0 ?>
<? foreach ($item->parents() as $parent): ?>
<li<? if ($i == 0) print " class=\"g-first\"" ?>> <?= html::purify($parent->title) ?> </li>
<? $i++ ?>
<? endforeach ?>
<li class="g-active"> <?= html::purify($item->title) ?> </li>
</ul>
<ul id="g-server-add-tree" class="g-checkbox-tree">
<?= $tree ?>
</ul>
<div id="g-server-add-progress" style="display: none">
<div class="g-progress-bar"></div>
<div id="g-status"></div>
</div>
<span>
<button id="g-server-add-add-button" class="ui-state-default ui-state-disabled ui-corner-all"
disabled="disabled">
<?= t("Add") ?>
</button>
<button id="g-server-add-pause-button" class="ui-state-default ui-corner-all" style="display:none">
<?= t("Pause") ?>
</button>
<button id="g-server-add-continue-button" class="ui-state-default ui-corner-all" style="display:none">
<?= t("Continue") ?>
</button>
<button id="g-server-add-close-button" class="ui-state-default ui-corner-all">
<?= t("Close") ?>
</button>
</span>
<script type="text/javascript">
$("#g-server-add").ready(function() {
$("#g-server-add").gallery_server_add();
});
</script>
</div>

View File

@ -26,11 +26,12 @@
/* ~browny~ */
body, html {
background-color: #5a3007;
font-family: 'Lucida Grande', 'Lucida Sans', Arial, sans-serif;
font-family: 'Century gothic', Verdana, 'Lucida Grande', 'Lucida Sans', Arial, sans-serif;
}
p {
margin-bottom: 1em;
text-shadow: 0px 1px 1px #F7F5F0;
}
em {
@ -39,6 +40,7 @@ em {
h1, h2, h3, h4, h5, strong, th {
font-weight: bold;
text-shadow: 1px 1px 0px #fff;
}
h1 {
@ -65,6 +67,17 @@ h3 {
font-size: 1.2em;
}
select,
input,
button,
textarea {
font: 99% 'Century gothic', Verdana, Arial, Helvetica, Clean, sans-serif;
}
#l10n-client h2 {
text-shadow: none;
}
/* Links ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
/* ~browny~ */
@ -334,6 +347,7 @@ th {
.g-block-content {
margin-top: 1em;
text-shadow: 0px 1px 0px #fff;
}
#g-content .g-block {
@ -387,6 +401,10 @@ th {
background-image: none;
}
#g-maintenance-mode ul.g-message-block {
margin-top: .5em;
}
.g-success td {
background-color: transparent;
background-image: none;
@ -702,18 +720,18 @@ li.g-error select {
.g-denied,
tr.g-error td.g-error,
#g-add-photos-status .g-error {
background: #f6cbca url('images/ico-error.png') no-repeat .4em 50%;
background: #f6cbca url('../images/ico-error.png') no-repeat .4em 50%;
color: #f00;
}
.g-info {
background: #e8e8e8 url('images/ico-info.png') no-repeat .4em 50%;
background: #e8e8e8 url('../images/ico-info.png') no-repeat .4em 50%;
}
.g-success,
.g-allowed,
#g-add-photos-status .g-success {
background: #d9efc2 url('images/ico-success.png') no-repeat .4em 50%;
background: #d9efc2 url('../images/ico-success.png') no-repeat .4em 50%;
}
tr.g-success {
@ -721,12 +739,12 @@ tr.g-success {
}
tr.g-success td.g-success {
background-image: url('images/ico-success.png');
background-image: url('../images/ico-success.png');
}
.g-warning,
tr.g-warning td.g-warning {
background: #fcf9ce url('images/ico-warning.png') no-repeat .4em 50%;
background: #fcf9ce url('../images/ico-warning.png') no-repeat .4em 50%;
}
form .g-error {
@ -769,11 +787,11 @@ form .g-error {
.g-loading-large,
.g-dialog-loading-large {
background: #e8e8e8 url('images/loading-large.gif') no-repeat center center !important;
background: #e8e8e8 url('../images/loading-large.gif') no-repeat center center !important;
}
.g-loading-small {
background: #e8e8e8 url('images/loading-small.gif') no-repeat center center !important;
background: #e8e8e8 url('../images/loading-small.gif') no-repeat center center !important;
}
/** *******************************************************************
@ -848,6 +866,7 @@ form .g-error {
display: inline-block;
margin: 0 4px 0 0;
padding: .2em .4em;
text-shadow: 0px 1px 1px #fff;
}
.g-button,
@ -944,7 +963,7 @@ div#g-action-status {
}
.g-breadcrumbs li {
background: transparent url('images/ico-separator.gif') no-repeat scroll left center;
background: transparent url('../images/ico-separator.gif') no-repeat scroll left center;
float: left;
padding: 1em 8px 1em 18px;
}
@ -1048,6 +1067,7 @@ ul.sf-menu li li li.sfHover ul {
/* ~browny~ */
.sf-menu li {
background: #d3b07e url('../images/ui-bg_highlight-soft_45_d3b07e_1x100.png') 50% 50% repeat-x;
text-shadow: 0px 1px 1px #fff;
}
/* ~browny~ */
@ -1076,6 +1096,18 @@ ul.sf-menu li li li.sfHover ul {
padding: .2em .4em;
}
.ui-dialog-content {
text-shadow: 0px 1px 1px #fff;
}
.ui-widget {
font-family: 'Century gothic', Verdana, 'Lucida Grande', 'Lucida Sans', Arial, sans-serif;
}
.ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button {
font-family: 'Century gothic', Verdana, 'Lucida Grande', 'Lucida Sans', Arial, sans-serif;
}
/** *******************************************************************
* 10) Right to left styles
*********************************************************************/
@ -1151,7 +1183,7 @@ ul.sf-menu li li li.sfHover ul {
}
.rtl .g-breadcrumbs li {
background: transparent url('images/ico-separator-rtl.gif') no-repeat scroll right center;
background: transparent url('../images/ico-separator-rtl.gif') no-repeat scroll right center;
padding: 1em 18px 1em 8px;
}
@ -1261,7 +1293,7 @@ ul.sf-menu li li li.sfHover ul {
.rtl .sf-sub-indicator {
left: .75em !important;
right: auto;
background: url('superfish/images/arrows-ffffff-rtl.png') no-repeat -10px -100px; /* 8-bit indexed alpha png. IE6 gets solid image only */
background: url('../../../lib/superfish/images/arrows-ffffff-rtl.png') no-repeat -10px -100px; /* 8-bit indexed alpha png. IE6 gets solid image only */
}
.rtl a > .sf-sub-indicator { /* give all except IE6 the correct values */
top: .8em;
@ -1307,7 +1339,7 @@ ul.sf-menu li li li.sfHover ul {
/*** shadows for all but IE6 ***/
.rtl .sf-shadow ul {
background: url('superfish/images/shadow.png') no-repeat bottom left;
background: url('../../../lib/superfish/images/shadow.png') no-repeat bottom left;
padding: 0 0 9px 8px;
border-top-right-radius: 0;
border-bottom-left-radius: 0;

View File

@ -12,8 +12,8 @@
/* Component containers
----------------------------------*/
.ui-widget { font-family: Geeza Pro, Lucida Grande, Lucida Sans, Arial, sans-serif; font-size: 1.1em; }
.ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Geeza Pro, Lucida Grande, Lucida Sans, Arial, sans-serif; font-size: 1em; }
.ui-widget { font-family: Lucida Grande, Lucida Sans, Arial, sans-serif; font-size: 1.1em; }
.ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Lucida Grande, Lucida Sans, Arial, sans-serif; font-size: 1em; }
.ui-widget-content { border: 1px solid #9e7247; background: #f6f3ef url(images/ui-bg_inset-hard_100_f6f3ef_1x100.png) 50% bottom repeat-x; color: #222222; }
.ui-widget-content a { color: #222222; }
.ui-widget-header { border: 1px solid #4e2e0e; background: #714213 url(images/ui-bg_gloss-wave_55_714213_500x100.png) 50% 50% repeat-x; color: #ffffff; font-weight: bold; }
@ -232,15 +232,15 @@
----------------------------------*/
/* Corner radius */
.ui-corner-tl { -moz-border-radius-topleft: 5px; -webkit-border-top-left-radius: 5px; }
.ui-corner-tr { -moz-border-radius-topright: 5px; -webkit-border-top-right-radius: 5px; }
.ui-corner-bl { -moz-border-radius-bottomleft: 5px; -webkit-border-bottom-left-radius: 5px; }
.ui-corner-br { -moz-border-radius-bottomright: 5px; -webkit-border-bottom-right-radius: 5px; }
.ui-corner-top { -moz-border-radius-topleft: 5px; -webkit-border-top-left-radius: 5px; -moz-border-radius-topright: 5px; -webkit-border-top-right-radius: 5px; }
.ui-corner-bottom { -moz-border-radius-bottomleft: 5px; -webkit-border-bottom-left-radius: 5px; -moz-border-radius-bottomright: 5px; -webkit-border-bottom-right-radius: 5px; }
.ui-corner-right { -moz-border-radius-topright: 5px; -webkit-border-top-right-radius: 5px; -moz-border-radius-bottomright: 5px; -webkit-border-bottom-right-radius: 5px; }
.ui-corner-left { -moz-border-radius-topleft: 5px; -webkit-border-top-left-radius: 5px; -moz-border-radius-bottomleft: 5px; -webkit-border-bottom-left-radius: 5px; }
.ui-corner-all { -moz-border-radius: 5px; -webkit-border-radius: 5px; }
.ui-corner-tl { -moz-border-radius-topleft: 5px; -webkit-border-top-left-radius: 5px; border-top-left-radius: 5px; }
.ui-corner-tr { -moz-border-radius-topright: 5px; -webkit-border-top-right-radius: 5px; border-top-right-radius: 5px; }
.ui-corner-bl { -moz-border-radius-bottomleft: 5px; -webkit-border-bottom-left-radius: 5px; border-bottom-left-radius: 5px; }
.ui-corner-br { -moz-border-radius-bottomright: 5px; -webkit-border-bottom-right-radius: 5px; border-bottom-right-radius: 5px; }
.ui-corner-top { -moz-border-radius-topleft: 5px; -webkit-border-top-left-radius: 5px; border-top-left-radius: 5px; -moz-border-radius-topright: 5px; -webkit-border-top-right-radius: 5px; border-top-right-radius: 5px; }
.ui-corner-bottom { -moz-border-radius-bottomleft: 5px; -webkit-border-bottom-left-radius: 5px; border-bottom-left-radius: 5px; -moz-border-radius-bottomright: 5px; -webkit-border-bottom-right-radius: 5px; border-bottom-right-radius: 5px; }
.ui-corner-right { -moz-border-radius-topright: 5px; -webkit-border-top-right-radius: 5px; border-top-right-radius: 5px; -moz-border-radius-bottomright: 5px; -webkit-border-bottom-right-radius: 5px; border-bottom-right-radius: 5px; }
.ui-corner-left { -moz-border-radius-topleft: 5px; -webkit-border-top-left-radius: 5px; border-top-left-radius: 5px; -moz-border-radius-bottomleft: 5px; -webkit-border-bottom-left-radius: 5px; border-bottom-left-radius: 5px; }
.ui-corner-all { -moz-border-radius: 5px; -webkit-border-radius: 5px; border-radius: 5px; }
/* Overlays */
.ui-widget-overlay { background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); }

Binary file not shown.

After

Width:  |  Height:  |  Size: 701 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 804 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 106 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 106 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 666 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 673 B

View File

@ -24,11 +24,12 @@
/* ~browny~ */
body, html {
background-color: #5a3007;
font-family: 'Lucida Grande', 'Lucida Sans', Arial, sans-serif;
font-family: 'Century gothic', Verdana, 'Lucida Grande', 'Lucida Sans', Arial, sans-serif;
}
p {
margin-bottom: 1em;
text-shadow: 0px 1px 1px #F7F5F0;
}
em {
@ -37,6 +38,7 @@ em {
h1, h2, h3, h4, h5, strong, th {
font-weight: bold;
text-shadow: 1px 1px 0px #fff;
}
h1 {
@ -76,12 +78,27 @@ h3 {
font-size: .8em;
}
#g-footer h3 {
text-shadow: 1px 1px 1px #F7F5F0;
}
#g-album-grid .g-item,
#g-item #g-photo,
#g-item #g-movie {
font-size: .7em;
}
select,
input,
button,
textarea {
font: 99% 'Century gothic', Verdana, Arial, Helvetica, Clean, sans-serif;
}
#l10n-client h2 {
text-shadow: none;
}
/* Links ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
/* ~browny~ */
@ -854,6 +871,7 @@ form .g-error {
.g-block {
clear: both;
margin-bottom: 2.5em;
overflow: hidden;
}
.g-block-content {
@ -883,6 +901,7 @@ ul.sf-menu li li li.sfHover ul {
/* ~browny~ */
.sf-menu li {
background: #d3b07e url('../images/ui-bg_highlight-soft_45_d3b07e_1x100.png') 50% 50% repeat-x;
text-shadow: 0px 1px 1px #fff;
}
/* ~browny~ */
@ -903,17 +922,30 @@ ul.sf-menu li li li.sfHover ul {
/* jQuery UI Dialog ~~~~~~~~~~~~~~~~~~~~~~ */
.ui-widget {
font-family: 'Century gothic', Verdana, 'Lucida Grande', 'Lucida Sans', Arial, sans-serif;
}
.ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button {
font-family: 'Century gothic', Verdana, 'Lucida Grande', 'Lucida Sans', Arial, sans-serif;
}
.ui-widget-overlay {
background: #000;
opacity: .7;
}
.ui-dialog-content {
text-shadow: 0px 1px 1px #fff;
}
/* Buttons ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
.g-button {
display: inline-block;
margin: 0 4px 0 0;
padding: .2em .4em;
text-shadow: 0px 1px 1px #fff;
}
.g-button,
@ -1082,7 +1114,7 @@ div#g-action-status {
}
/** *******************************************************************
* 8) Right to left language styles
* 10) Right to left language styles
*********************************************************************/
.rtl {
direction: rtl;
@ -1402,7 +1434,7 @@ div#g-action-status {
}
/** *******************************************************************
* 9) More Browny (Extra overrides for better Browny look)
* 11) More Browny (Extra overrides for better Browny look)
*********************************************************************/
/* ~browny~ */
@ -1416,11 +1448,6 @@ div#g-action-status {
background-color: #fcf9ce !important;
}
#g-user-profile th,
#g-user-profile td {
border: 1px dotted #ccc !important;
}
/* /modules/gallery/css/l10n_client.css ~~ */
#l10n-client .labels {
@ -1444,9 +1471,96 @@ div#g-action-status {
/* User Profile ~~~~~~~~~~~~~~~~~~~~~~~~~~ */
.g-avatar g-left {
width: 80px !important;
height: 80px !important;
#g-user-profile h1 {
color: #5A3007;
margin: 1.25em 0em 2em 4.4em;
}
#g-user-profile .g-avatar {
float: left;
position: absolute;
left: 0em;
top: 1.3em;
width: 90px !important;
height: 90px !important;
margin: 0em 0em 0em .6em;
}
#g-user-profile .g-block h2 {
background-color: #F5EFE6;
margin-bottom: .5em;
padding-left: .8em;
}
#g-user-profile .g-block-content h2 {
background-color: transparent;
margin-bottom: inherit;
}
#g-user-profile #g-comment-detail .g-author {
font-family: Cursive, Serif;
}
#g-user-profile #g-comment-detail .g-author a {
float: left;
position: relative;
top: -0.3em;
left: 0em;
margin-right: .6em;
}
#g-user-profile #g-comment-detail div {
margin-left: 5em;
line-height: 150%;
}
#g-user-profile #g-comment-detail ul li {
border: .1em dotted #D4BE9B;
padding: .8em .5em;
margin-bottom: .5em;
}
.rtl #g-user-profile .g-block h2 {
padding-right: .8em;
padding-left: auto;
}
.rtl #g-user-profile .g-avatar {
float: right;
right: 0em;
left: auto;
margin: 0em .6em 0em 0em;
}
.rtl #g-user-profile #g-comment-detail .g-author a {
float: right;
right: 0em;
left: auto;
margin-left: .6em;
margin-right: 0em;
}
.rtl #g-user-profile #g-comment-detail div {
margin-right: 5em;
margin-left: 0em;
}
.rtl #g-user-profile h1 {
margin: 1.25em 4.4em 2em 0em;
}
/* Comments ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
#g-content #g-comments .g-avatar {
float: left;
margin-right: .4em;
margin-left: 0;
}
.rtl #g-content #g-comments .g-avatar {
float: right;
margin-left: .4em;
margin-right: 0;
}
/* Organize ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */

View File

@ -12,8 +12,8 @@
/* Component containers
----------------------------------*/
.ui-widget { font-family: Geeza Pro, Tahoma, Lucida Grande, Lucida Sans, Arial, sans-serif; font-size: 1.1em; }
.ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Geeza Pro, Tahoma, Lucida Grande, Lucida Sans, Arial, sans-serif; font-size: 1em; }
.ui-widget { font-family: Lucida Grande, Lucida Sans, Arial, sans-serif; font-size: 1.1em; }
.ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Lucida Grande, Lucida Sans, Arial, sans-serif; font-size: 1em; }
.ui-widget-content { border: 1px solid #9e7247; background: #f6f3ef url(images/ui-bg_inset-hard_100_f6f3ef_1x100.png) 50% bottom repeat-x; color: #222222; }
.ui-widget-content a { color: #222222; }
.ui-widget-header { border: 1px solid #4e2e0e; background: #714213 url(images/ui-bg_gloss-wave_55_714213_500x100.png) 50% 50% repeat-x; color: #ffffff; font-weight: bold; }
@ -232,15 +232,15 @@
----------------------------------*/
/* Corner radius */
.ui-corner-tl { -moz-border-radius-topleft: 5px; -webkit-border-top-left-radius: 5px; }
.ui-corner-tr { -moz-border-radius-topright: 5px; -webkit-border-top-right-radius: 5px; }
.ui-corner-bl { -moz-border-radius-bottomleft: 5px; -webkit-border-bottom-left-radius: 5px; }
.ui-corner-br { -moz-border-radius-bottomright: 5px; -webkit-border-bottom-right-radius: 5px; }
.ui-corner-top { -moz-border-radius-topleft: 5px; -webkit-border-top-left-radius: 5px; -moz-border-radius-topright: 5px; -webkit-border-top-right-radius: 5px; }
.ui-corner-bottom { -moz-border-radius-bottomleft: 5px; -webkit-border-bottom-left-radius: 5px; -moz-border-radius-bottomright: 5px; -webkit-border-bottom-right-radius: 5px; }
.ui-corner-right { -moz-border-radius-topright: 5px; -webkit-border-top-right-radius: 5px; -moz-border-radius-bottomright: 5px; -webkit-border-bottom-right-radius: 5px; }
.ui-corner-left { -moz-border-radius-topleft: 5px; -webkit-border-top-left-radius: 5px; -moz-border-radius-bottomleft: 5px; -webkit-border-bottom-left-radius: 5px; }
.ui-corner-all { -moz-border-radius: 5px; -webkit-border-radius: 5px; }
.ui-corner-tl { -moz-border-radius-topleft: 5px; -webkit-border-top-left-radius: 5px; border-top-left-radius: 5px; }
.ui-corner-tr { -moz-border-radius-topright: 5px; -webkit-border-top-right-radius: 5px; border-top-right-radius: 5px; }
.ui-corner-bl { -moz-border-radius-bottomleft: 5px; -webkit-border-bottom-left-radius: 5px; border-bottom-left-radius: 5px; }
.ui-corner-br { -moz-border-radius-bottomright: 5px; -webkit-border-bottom-right-radius: 5px; border-bottom-right-radius: 5px; }
.ui-corner-top { -moz-border-radius-topleft: 5px; -webkit-border-top-left-radius: 5px; border-top-left-radius: -moz-border-radius-topright: 5px; -webkit-border-top-right-radius: 5px; border-top-right-radius: 5px; }
.ui-corner-bottom { -moz-border-radius-bottomleft: 5px; -webkit-border-bottom-left-radius: 5px; border-bottom-left-radius: 5px; -moz-border-radius-bottomright: 5px; -webkit-border-bottom-right-radius: 5px; border-bottom-right-radius: 5px; }
.ui-corner-right { -moz-border-radius-topright: 5px; -webkit-border-top-right-radius: 5px; border-top-right-radius: 5px; -moz-border-radius-bottomright: 5px; -webkit-border-bottom-right-radius: 5px; border-bottom-right-radius: 5px; }
.ui-corner-left { -moz-border-radius-topleft: 5px; -webkit-border-top-left-radius: 5px; border-top-left-radius: 5px; -moz-border-radius-bottomleft: 5px; -webkit-border-bottom-left-radius: 5px; border-bottom-left-radius: 5px; }
.ui-corner-all { -moz-border-radius: 5px; -webkit-border-radius: 5px; border-radius: 5px; }
/* Overlays */
.ui-widget-overlay { background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); }

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: 749 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 106 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 106 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 476 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 666 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 673 B

View File

@ -80,7 +80,7 @@
<?= $header_text ?>
<? else: ?>
<a id="g-logo" class="g-left" href="<?= item::root()->url() ?>" title="<?= t("go back to the Gallery home")->for_html_attr() ?>">
<img alt="<?= t("Gallery logo: Your photos on your web site")->for_html_attr() ?>" src="<?= url::file("themes/browny_wind/images/logo.png") ?>" />
<img alt="<?= t("Gallery logo: Your photos on your web site")->for_html_attr() ?>" src="<?= $theme->url("images/logo.png") ?>" />
</a>
<? endif ?>
<?= $theme->user_menu() ?>

View File

@ -0,0 +1,47 @@
<?php defined("SYSPATH") or die("No direct script access.") ?>
<script type="text/javascript">
$(document).ready(function() {
$("#g-profile-return").click(function(event) {
history.go(-1);
return false;
})
});
</script>
<div id="g-user-profile">
<div class="ui-helper-clearfix">
<a id="g-profile-return" class="g-button g-right ui-state-default ui-corner-all" href="#">
<?= t("Return") ?>
</a>
<? if ($editable): ?>
<a class="g-button g-right ui-state-default ui-corner-all g-dialog-link" href="<?= url::site("users/form_change_email/{$user->id}") ?>">
<?= t("Change email") ?>
</a>
<a class="g-button g-right ui-state-default ui-corner-all g-dialog-link" href="<?= url::site("users/form_change_password/{$user->id}") ?>">
<?= t("Change password") ?>
</a>
<a class="g-button g-right ui-state-default ui-corner-all g-dialog-link" href="<?= url::site("form/edit/users/{$user->id}") ?>">
<?= t("Edit") ?>
</a>
<? endif ?>
<? if ($contactable): ?>
<a class="g-button g-right ui-state-default ui-corner-all g-dialog-link"
href="<?= url::site("user_profile/contact/{$user->id}") ?>">
<?= t("Contact") ?>
</a>
<? endif ?>
</div>
<h1>
<img src="<?= $user->avatar_url(90, $theme->url("images/avatar.jpg", true)) ?>"
alt="<?= html::clean_attribute($user->display_name()) ?>"
class="g-avatar g-left" width="90" height="90" />
<?= t("User profile: %name", array("name" => $user->display_name())) ?>
</h1>
<? foreach ($info_parts as $info): ?>
<div class="g-block">
<h2><?= html::purify($info->title) ?></h2>
<div class="g-block-content">
<?= $info->view ?>
</div>
</div>
<? endforeach ?>
</div>

View File

@ -0,0 +1,21 @@
<?php defined("SYSPATH") or die("No direct script access.") ?>
<div id="g-comment-detail">
<ul>
<? foreach ($comments as $comment): ?>
<li id="g-comment-<?= $comment->id ?>">
<p class="g-author">
<a href="<?= $comment->item()->url() ?>">
<?= $comment->item()->thumb_img(array(), 70) ?>
</a>
<?= t("<i><strong>on</strong> %date <strong>for</strong> %title</i> ",
array("date" => gallery::date_time($comment->created),
"title" => $comment->item()->title)); ?>
</p>
<hr />
<div>
<?= nl2br(html::purify($comment->text)) ?>
</div>
</li>
<? endforeach ?>
</ul>
</div>