diff options
author | Tim Almdal <tnalmdal@shaw.ca> | 2008-12-12 01:46:43 +0000 |
---|---|---|
committer | Tim Almdal <tnalmdal@shaw.ca> | 2008-12-12 01:46:43 +0000 |
commit | b202816324c3a6bf515a8d938c33e882106f26da (patch) | |
tree | 0bbe5fc57440cb7446c84e3e2167185d85c527bf /modules | |
parent | 35067cbced6dadbc4cb7e7a45334485320eb473b (diff) |
Remove the attempt at a local import module
Diffstat (limited to 'modules')
-rw-r--r-- | modules/local_import/controllers/local_import.php | 34 | ||||
-rw-r--r-- | modules/local_import/controllers/local_import_admin.php | 56 | ||||
-rw-r--r-- | modules/local_import/css/local_import.css | 70 | ||||
-rw-r--r-- | modules/local_import/helpers/local_import.php | 49 | ||||
-rw-r--r-- | modules/local_import/helpers/local_import_block.php | 30 | ||||
-rw-r--r-- | modules/local_import/helpers/local_import_installer.php | 41 | ||||
-rw-r--r-- | modules/local_import/images/bin_closed.png | bin | 363 -> 0 bytes | |||
-rw-r--r-- | modules/local_import/js/local_import.js | 67 | ||||
-rw-r--r-- | modules/local_import/views/local_import_admin.html.php | 12 | ||||
-rw-r--r-- | modules/local_import/views/local_import_dir_list.html.php | 9 |
10 files changed, 0 insertions, 368 deletions
diff --git a/modules/local_import/controllers/local_import.php b/modules/local_import/controllers/local_import.php deleted file mode 100644 index 2738afef..00000000 --- a/modules/local_import/controllers/local_import.php +++ /dev/null @@ -1,34 +0,0 @@ -<?php defined("SYSPATH") or die("No direct script access."); -/** - * Gallery - a web based photo album viewer and editor - * Copyright (C) 2000-2008 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 Local_Import_Controller extends Controller { - public function form_add() { -// $form = local_import::get_admin_form(); -// $paths = unserialize(module::get_var("local_import", "authorized_paths")); -// if ($form->validate()) { -// $paths[$form->path->value] = 1; -// module::set_var("local_import", "authorized_paths", serialize($paths)); -// } -// $view = new View("local_import_dir_list.html"); -// $view->paths = array_keys($paths); -// -// print $view; - print "<p>Hi There</p"; - } -}
\ No newline at end of file diff --git a/modules/local_import/controllers/local_import_admin.php b/modules/local_import/controllers/local_import_admin.php deleted file mode 100644 index 18733c22..00000000 --- a/modules/local_import/controllers/local_import_admin.php +++ /dev/null @@ -1,56 +0,0 @@ -<?php defined("SYSPATH") or die("No direct script access."); -/** - * Gallery - a web based photo album viewer and editor - * Copyright (C) 2000-2008 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 Local_Import_Admin_Controller extends Controller { - public function add_path() { - $form = local_import::get_admin_form(); - $paths = unserialize(module::get_var("local_import", "authorized_paths")); - if ($form->validate()) { - $paths[$form->path->value] = 1; - module::set_var("local_import", "authorized_paths", serialize($paths)); - } - $view = new View("local_import_dir_list.html"); - $view->paths = array_keys($paths); - - print $view; - } - - public function remove() { - $path = $this->input->post("path"); - $paths = unserialize(module::get_var("local_import", "authorized_paths")); - unset($paths[$path]); - module::set_var("local_import", "authorized_paths", serialize($paths)); - - $view = new View("local_import_dir_list.html"); - $view->paths = array_keys($paths); - - print $view; - } - - public function autocomplete() { - $files = array(); - - $path_prefix = $this->input->get("q"); - foreach (glob("{$path_prefix}*") as $file) { - $files[] = $file; - } - - print implode("\n", $files); - } -}
\ No newline at end of file diff --git a/modules/local_import/css/local_import.css b/modules/local_import/css/local_import.css deleted file mode 100644 index 16f6e68d..00000000 --- a/modules/local_import/css/local_import.css +++ /dev/null @@ -1,70 +0,0 @@ -@CHARSET "UTF-8"; -.ui-autocomplete-results { - padding: 0px; - border: 1px solid black; - background-color: white; - overflow: hidden; - z-index: 99999; -} - -.ui-autocomplete-results ul { - width: 100%; - list-style-position: outside; - list-style: none; - padding: 0; - margin: 0; -} - -.ui-autocomplete-results li { - margin: 0px; - padding: 2px 5px; - cursor: default; - display: block; - /* - if width will be 100% horizontal scrollbar will apear - when scroll mode will be used - */ - /*width: 100%;*/ - font: menu; - font-size: 12px; - /* - it is very important, if line-height not setted or setted - in relative units scroll will be broken in firefox - */ - line-height: 16px; - overflow: hidden; -} - -.ui-autocomplete-loading { - background: white url('../images/spinner.gif') right center no-repeat; -} - -.ui-autocomplete-odd { - background-color: #eee; -} - -.ui-autocomplete-over { - background-color: #0A246A; - color: white; -} - -#gLocalImportAdmin { - margin:auto; - text-align: left; -} - -#gRemoveDir { - background-image: url(../images/bin_closed.png); - background-repeat: no-repeat; - padding-left: 20px; - padding-bottom: 5px; -} - -#gLocalImportAdmin #path { - width: 80%; -} - -#gLocalImportAdmin form li { - display: inline; -} - diff --git a/modules/local_import/helpers/local_import.php b/modules/local_import/helpers/local_import.php deleted file mode 100644 index 045201c7..00000000 --- a/modules/local_import/helpers/local_import.php +++ /dev/null @@ -1,49 +0,0 @@ -<?php defined("SYSPATH") or die("No direct script access."); -/** - * Gallery - a web based photo album viewer and editor - * Copyright (C) 2000-2008 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 local_import { - public static function get_admin_page() { -// @todo check for admin permission -// if (!$user->admin) { -// throw new Exception("@todo ACCESS DENIED"); -// } - - $template = new View("local_import_admin.html"); - - $paths = unserialize(module::get_var("local_import", "authorized_paths")); - if (!empty($paths)) { - $template->dir_list = new View("local_import_dir_list.html"); - $template->dir_list->paths = array_keys($paths); - } else { - $template->dir_list = ""; - } - - $template->add_form = self::get_admin_form()->render(); - - return $template; - } - - public static function get_admin_form() { - $form = new Forge("admin/local_import/add_path", "", "post", array("id" => "gLocalImportAdminForm")); - $form->input("path")->label(true); - $form->submit(_("Add")); - - return $form; - } -} diff --git a/modules/local_import/helpers/local_import_block.php b/modules/local_import/helpers/local_import_block.php deleted file mode 100644 index c337af41..00000000 --- a/modules/local_import/helpers/local_import_block.php +++ /dev/null @@ -1,30 +0,0 @@ -<?php defined("SYSPATH") or die("No direct script access."); -/** - * Gallery - a web based photo album viewer and editor - * Copyright (C) 2000-2008 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 local_import_block_Core { - public static function head($theme) { - $head[] = html::script("modules/local_import/js/local_import.js"); - - $url = url::file("modules/local_import/css/local_import.css"); - $head[] = "<link rel=\"stylesheet\" type=\"text/css\" href=\"$url\" " . - "media=\"screen,print,projection\" />"; - - return implode("\n", $head); - } -} diff --git a/modules/local_import/helpers/local_import_installer.php b/modules/local_import/helpers/local_import_installer.php deleted file mode 100644 index 72f42c97..00000000 --- a/modules/local_import/helpers/local_import_installer.php +++ /dev/null @@ -1,41 +0,0 @@ -<?php defined("SYSPATH") or die("No direct script access."); -/** - * Gallery - a web based photo album viewer and editor - * Copyright (C) 2000-2008 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 local_import_installer { - public static function install() { - $db = Database::instance(); - $version = module::get_version("local_import"); - if ($version == 0) { -// access::register_permission("local_import"); - - module::set_version("local_import", 1); - module::set_var("local_import", "authorized_paths", serialize(array())); - } - } - - public static function uninstall() { -// access::delete_permission("local_import"); - $module = module::get("local_import"); - - $db = Database::instance(); - $db->query("DELETE FROM `vars` WHERE `module_id` = {$module->id};"); - - module::delete("local_import"); - } -} diff --git a/modules/local_import/images/bin_closed.png b/modules/local_import/images/bin_closed.png Binary files differdeleted file mode 100644 index afe22ba9..00000000 --- a/modules/local_import/images/bin_closed.png +++ /dev/null diff --git a/modules/local_import/js/local_import.js b/modules/local_import/js/local_import.js deleted file mode 100644 index 3ad01ce8..00000000 --- a/modules/local_import/js/local_import.js +++ /dev/null @@ -1,67 +0,0 @@ -/** - * Set up autocomplete on the server path list - * - */ -$("document").ready(function() { - var previous_search = ""; - $("#gLocalImportAdmin input").autocomplete({ - url: base_url + "admin/local_import/autocomplete", - mustMatch: true, - }); - ajaxify_form({ - form: "#gLocalImportAdmin form", - url: "admin/local_import/", - returnCode: 200, - callback: function(xhr, statusText) { - $("#gImportLocalDirList").html(xhr.responseText); - setDroppable("#gImportLocalDirList #gRemoveDir"); - setDraggable("#gImportLocalDirList li"); - } - }); - - setDroppable("#gImportLocalDirList #gRemoveDir"); - setDraggable("#gImportLocalDirList li"); -}); - -function setDraggable(selector) { - $(selector).draggable({ - helper: 'clone', -// containment: "#gImportLocalDirList", - opacity: .6, - revert: "invalid" - }); -} - -function setDroppable(selector) { - $(selector).droppable({ - accept: "#gImportLocalDirList li", - drop: function(ev, ui) { - var element = ui.draggable[0]; - - if (confirm("Do you really want to remove " + element.textContent)) { - $.ajax({ - data: "path=" + element.textContent, - url: base_url + "admin/local_import/remove", - success: function(data, textStatus) { - $("#gImportLocalDirList").html(data); - setDroppable("#gImportLocalDirList #gRemoveDir"); - setDraggable("#gImportLocalDirList li"); - }, - error: function(xhr, textStatus, errorThrown) { - alert("Text Status: " + textStatus + " Http Error Code: " + xhr.status); - }, - type: "POST" - }); - } - } - }); -} - -function ajaxify_form(options) { - $(options.form).ajaxForm({ - complete:function(xhr, statusText) { - options.callback(xhr, statusText); - $(options.form).clearForm(); - } - }); -} diff --git a/modules/local_import/views/local_import_admin.html.php b/modules/local_import/views/local_import_admin.html.php deleted file mode 100644 index 464ab6ec..00000000 --- a/modules/local_import/views/local_import_admin.html.php +++ /dev/null @@ -1,12 +0,0 @@ -<? defined("SYSPATH") or die("No direct script access."); ?> -<script> - var base_url = "<?= url::base(true) ?>"; -</script> -<div id="gLocalImportAdmin"> - <div id="gImportLocalDirList"> - <?= $dir_list ?> - </div> - <div> - <?= $add_form ?> - </div> -</div> diff --git a/modules/local_import/views/local_import_dir_list.html.php b/modules/local_import/views/local_import_dir_list.html.php deleted file mode 100644 index e2baefeb..00000000 --- a/modules/local_import/views/local_import_dir_list.html.php +++ /dev/null @@ -1,9 +0,0 @@ -<? defined("SYSPATH") or die("No direct script access."); ?> -<? if (!empty($paths)): ?> -<span id="gRemoveDir">Remove</span> -<ul id="gPathList"> - <? foreach ($paths as $id => $path): ?> - <li id="<?= $id ?>"><?= $path ?></li> - <? endforeach ?> -</ul> -<? endif ?> |