Commit Graph

68 Commits

Author SHA1 Message Date
Bharat Mediratta
99b7cdeee1 Fix a copy/paste typo. 2009-05-10 00:13:39 +00:00
Bharat Mediratta
d1a9138925 Don't try to use mb_detect_encoding if the module isn't loaded. Not sure if this is a great solution, but it'll probably cut down on a big class of errors opportunistically 2009-05-08 19:16:48 +00:00
Bharat Mediratta
13f8a0dd7b Detect input encodings from EXIF/IPTC data and convert to utf-8 as
appropriate.  This allows us to switch the exif value column back to
varchar and improves the way that we deal with non-utf8 data in our
embedded EXIF/IPTC data.
2009-05-05 03:30:49 +00:00
Bharat Mediratta
fde7073886 Strip trailing nulls off of some tags. 2009-04-05 04:08:24 +00:00
Bharat Mediratta
c81ee12411 Don't allow empty tag names 2009-03-17 20:57:51 +00:00
Bharat Mediratta
8786ee3ffb Initialize $tags properly 2009-03-17 05:25:38 +00:00
Bharat Mediratta
2dba075e8a Fix typo: tag_block -> tag_theme
Overlooked when I renamed this class.
2009-03-17 00:37:39 +00:00
Bharat Mediratta
6a2e8ec1cc Set $item and $tag in the Theme_View so that calls like $theme->item()
which fall through to calling &View::__get() have an lvalue to return,
else you can't return them by reference.

Also, don't show sidebar blocks for pages that don't have an item so
that the rss and tag modules don't break the search page.
2009-03-16 11:17:27 +00:00
Tim Almdal
c04ff8e02f Change the pattern to identify tables that need prefix substitution to
mirror the drupal pattern of using braces {}.
2009-02-28 06:37:28 +00:00
Tim Almdal
ad56995baf Correct a type and missed a table name 2009-02-28 03:34:03 +00:00
Tim Almdal
bd15853708 This implements table prefix for all the queries in core, user, exif,
tag, search, comment and notification modules (Ticket #68)
2009-02-27 21:07:18 +00:00
Tim Almdal
2b1f68a654 Continue the journey of replacing raw sql with ORM or Database method
calls (Ticket #68)
2009-02-27 00:19:12 +00:00
Bharat Mediratta
11226bdd3a Simplify delete into guaranteed 3 queries. 2009-02-10 04:34:34 +00:00
Tim Almdal
f97dedf3e4 Fix for Trac Ticket #30 2009-02-02 16:37:09 +00:00
Tim Almdal
7ef2dae070 There doesn't seem to be a photo_created event anymore so change it to
item_created and check for a type of photo before trying to extract tags.
2009-01-31 17:38:20 +00:00
Tim Almdal
a8233ed979 Undo the adding underscores to the id on forge generated forms 2009-01-25 06:28:04 +00:00
Tim Almdal
cbff78daa8 Supply a form id on all forms. This id can be used by modules other
than the originating module to provide additional functionality to the form.
2009-01-24 17:26:47 +00:00
Bharat Mediratta
3d1ea2904d Rename theme callback helpers from xxx_block to xxx_theme to make room
for us to rename the dashboard helper to be a block helper since
sidebar blocks are not just in the dashboard.
2009-01-18 05:01:00 +00:00
Andy Staudacher
e4a9b19bf9 Changing t() placeholder syntax from {{replace_me}} to %replace_me. 2009-01-15 10:02:41 +00:00
Bharat Mediratta
f3ba69c1d6 Make sure that helper functions are all static. Add new
File_Structure_Test to make sure we don't regress.

According to the PHP docs, the "public" keyword is implied on static
functions, so remove it.  Also, require private static functions to
start with an _.

http://php.net/manual/en/language.oop5.visibility.php
2009-01-14 04:12:02 +00:00
Bharat Mediratta
bc421a615a Implement deleting dashboard blocks.
* Refactor blocks so that they have a separate id vs css_id.  This way
  we can have a unique identifier for each visual block.

* Store blocks with a random id as their unique identifier

* Add Admin_Dashboard::remove_block() and modify
  themes/admin_default/views/block.html.php to call it when you click the
  remove box.
2009-01-12 08:26:38 +00:00
Bharat Mediratta
ae73ef3d57 Updated for new Form_Submit API.
OLD:
  $form->submit("Foo")  -->  <input type="submit" value="Foo">

New:
  $form->submit("foo_button")->("Foo") --> <input type="submit" name="foo_button" value="Foo">

Mostly we don't care what the button is so we leave the name blank.
2009-01-12 07:50:04 +00:00
Andy Staudacher
a631fe29f3 i18n refactoring: Rename all _() (reserved by gettext) calls to t().
- And refactor printf to our string interpolation / pluralization syntax
- Also, a slight change to the translations_incomings table, using binary(16) instead of char(32) as message key.
2009-01-08 17:13:06 +00:00
Bharat Mediratta
fa1ccbd86d Fix up all the various little forms to have submit buttons, fieldset legends, etc etc. 2009-01-06 09:22:29 +00:00
Bharat Mediratta
3381f1d01a Put up an error if you try to reuse an existing tag name 2009-01-04 22:58:18 +00:00
Bharat Mediratta
92ceef27da Allow renaming of tags using a modal dialog. Put up a confirmation
dialog for deleting tags.  Remove the 4 character restriction on tags
(it was getting ignored by the add form anyway since it was mistakenly
referred to as tag_name there).
2009-01-04 08:44:06 +00:00
Bharat Mediratta
2c27469412 Simple admin tags interface. 2009-01-04 01:55:59 +00:00
Bharat Mediratta
d36996fb14 Remove unnecessary comments. 2009-01-04 00:39:54 +00:00
Bharat Mediratta
f29aad03a6 Make some columns smaller so that multi-column keys don't exceed 1024
bytes on some systems.
2008-12-30 01:37:09 +00:00
Bharat Mediratta
3c0be5156b url::site is implicit in Forge actions, don't specify it a 2nd time 2008-12-29 18:38:40 +00:00
Bharat Mediratta
fdc0f83024 Big round of normalization of the way that our controllers
communicate.  Almost all controllers now use JSON to speak to the
theme when we're dealing with form processing.  This means tht we only
send the form back and forth, but we use a JSON protocol to tell the
browser success/error status as well as the location of any newly
created resources, or where the browser should redirect the user.

Lots of small changes:
1) Admin -> Edit Profile is gone.  Instead I fixed the "Modify Profile" link
   in the top right corner to be a modal dialog

2) We use json_encode everywhere.  No more Atom/XML for now.  We can bring those
   back later, though.  For now there's a lot of code duplication but that'll be
   easy to clean up.

3) REST_Controller is no longer abstract.   All methods its subclasses should create
   throw exceptions, which means that subclasses don't have to implement stubs for
   those methods.

4) New pattern: helper method get_add_form calls take an Item_Model,
   not an id since we have to load the Item_Model in the controller
   anyway to check permissions.

5) User/Groups REST resources are separate from User/Group in the site
   admin.  They do different things, we should avoid confusing overlap.
2008-12-25 05:12:46 +00:00
Bharat Mediratta
c67234974d Refactor site admin menu into a theme function and build the menus in
the various modules.  In the process, rename xxx_menu::site_navigation() to just
xxx_menu::site().  And add xxx_menu::admin().

The menus are the same as before, but I changed the HTML to be
consistent with the way that we do it in the regular site, and this
broke the superfish styles.  I don't know how to fix this.. help me
Chad!
2008-12-18 07:32:34 +00:00
Chad Kieffer
9fa566a1c9 Added label to add tag form input 2008-12-17 01:19:13 +00:00
Tim Almdal
fc3fd3321d Add a permissions check to determine if the active user has edit permission on the item in order to display the tag add form 2008-12-13 07:49:27 +00:00
Chad Kieffer
26a512c352 Grouped inline form styles. No longer using gInline class in favor of specific form IDs that can be styled differently depending on which container they appear. Added gDescription class, dropped gUnderState for semantics. CSS cleanup. 2008-12-01 01:55:50 +00:00
Chad Kieffer
6c2869f822 Changed CSS organization, removed form section. Moved generic form CSS up to top of sheet and specific form styles to be adjacent to related content. This should ensure inheritance works generic down to specific. Removed #gAddTags in favor of #gTags form. 2008-11-29 21:30:30 +00:00
Bharat Mediratta
9b9bdce821 Fix another bug caused by moving this from tag to tag_event 2008-11-29 09:53:38 +00:00
Bharat Mediratta
1b78f33444 Fix a bug where we were listening to the wrong event. 2008-11-29 09:49:51 +00:00
Bharat Mediratta
8b6ed6c477 Create module::event() which runs Gallery events. It works by
convention.  To respond to the "photo_created" event in the gmaps
module, you create modules/gmaps/helpers/gmaps_event.php containing
class gmaps_event which has function photo_created.

Renamed all events from gallery.foo.bar to foo_bar
Updated tag module to use new convention.
2008-11-28 19:37:01 +00:00
Bharat Mediratta
1b1d385294 Check for APP13 before using it 2008-11-28 18:41:11 +00:00
Tim Almdal
a7f6efa2f2 When an image is uploaded (i.e. created) the tag module will now extract any iptc keywords and add them as image tags. 2008-11-28 18:04:59 +00:00
Bharat Mediratta
5672fbea1e Rename tag_block_cloud.html.php to tag_cloud.html.php 2008-11-28 07:05:11 +00:00
Tim Almdal
3ad9b6174a Add event plumbing to allow the tag module to be notified when a photo is created. Eventually this will be used to parse the image meta data and extract tags; 2008-11-28 00:19:08 +00:00
Bharat Mediratta
d909fc1070 Make tags look a little better. 2008-11-27 10:25:50 +00:00
Bharat Mediratta
c95c17b133 Centralize logging around installing/uninstalling modules. 2008-11-27 09:45:26 +00:00
Bharat Mediratta
3992dad486 Move form generation off into tag::get_add_form(). We can't use a controller to generate the form (it's incompatible with our REST model where controllers print stuff) 2008-11-27 06:25:21 +00:00
Bharat Mediratta
72d16756b1 Refactor cloud generation into a helper so that we can call it from
Tags_Controller::_index().  This enables our Ajax code to reload the
tags block after we submit a new tag, so update the JS to do that
properly.
2008-11-27 05:37:20 +00:00
Bharat Mediratta
5447b83210 Clean up REST pattern in tags:
1) Generate the form in Tags_Controller::_form_add()
2) Process the form submit in Tags_Controller::_create()
3) Create the tag properly

This required me to limit our scope to adding one tag at a time, which
I think is fine if we're doing Ajax style tag addition.
2008-11-27 05:00:50 +00:00
Tim Almdal
b4b72b284b We are now submitting the ajax tag add form to the server correctly and rehooking the ajaxForm 2008-11-27 01:48:01 +00:00
Tim Almdal
d881c91e0c Trying to add tags, but it doesn't work yet. For some reason that i can't figure out, the form never validates and I never get into the true branch of the if. I'm taking a break for awhile. 2008-11-27 00:26:04 +00:00