summaryrefslogtreecommitdiff
path: root/core/views
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2008-12-24 00:20:26 +0000
committerBharat Mediratta <bharat@menalto.com>2008-12-24 00:20:26 +0000
commit672eca53371b131484d00cbe6a069092d0b7f6b3 (patch)
tree507cce76fc6dc9d022455eed9075e039fa779da2 /core/views
parentc76d730a7c07253e7cc3224a78c616ce63989f40 (diff)
Lots of deltas rolled up into a bigger change. Sorry for the mess.
1) Deleted in-place-editing. We'll be replacing this with a real edit system that groups settings together and is more coherent. 2) Tweaked the way that dialog boxes work to get the ajax stuff working again. It's imperfect and does not work properly for uploading images. This is going to get redone also, but this is a good resting point. 3) Created edit forms for albums and photos. Moved _update and _create out of Items_Controller and into the individual subclasses. 4) Created access::required which is a shorthand for: if (!access::can(...)) { access::forbidden(); } 5) Added validation rules to Items_Model 6) Converted login to use the regular modal dialog approach in the theme.
Diffstat (limited to 'core/views')
-rw-r--r--core/views/in_place_edit.html.php42
1 files changed, 0 insertions, 42 deletions
diff --git a/core/views/in_place_edit.html.php b/core/views/in_place_edit.html.php
deleted file mode 100644
index 02f41e19..00000000
--- a/core/views/in_place_edit.html.php
+++ /dev/null
@@ -1,42 +0,0 @@
-<? defined("SYSPATH") or die("No direct script access."); ?>
-<script type="text/javascript">
-// <![CDATA[
-$(document).ready(function() {
- ajax_update = function(className, id) {
- return function(value, settings) {
- var post_data = {'_method': 'put', '_return': settings.name};
- post_data[settings.name] = value;
- $.post("<?= url::site("items/__ID__") ?>".replace("__ID__", id),
- post_data,
- function(data, textStatus) {
- if (textStatus == "success") {
- $(className).html(data);
- }
- },
- "html");
- }
- }
-
- var seen_before = {};
- var editable = $("span.gInPlaceEdit");
- for (i = 0; i < editable.length; i++) {
- var matches = editable[i].className.match(/gEditField-(\d+)-(\S+)/);
- if (matches && matches.length == 3) {
- var className = "." + matches[0];
- if (!seen_before[className]) {
- $(className).editable(
- ajax_update(className, matches[1]),
- {indicator : "<?= _("Saving...") ?>",
- tooltip : "<?= _("Double-click to edit...") ?>",
- event : "dblclick",
- style : "inherit",
- name : matches[2],
- select : true}
- );
- seen_before[className] = 1;
- }
- }
- }
-});
-// ]]>
-</script>