Commit Graph

59 Commits

Author SHA1 Message Date
Bharat Mediratta
670e0d8f85 Fix indentation. 2009-04-12 06:41:43 +00:00
Bharat Mediratta
54e07d0769 Get rid of the extra robust code we had in here to make the
scaffolding work when the Gallery wasn't installed yet.  Now we force
users through the installer.
2009-03-16 08:05:07 +00:00
Tim Almdal
2ce44b6b08 Fix the Var_Test by making sure that the cache is cleared or updated
when a variable is set or cleared.
2009-03-11 00:27:17 +00:00
Bharat Mediratta
3356091b65 Add in-request caching of vars that we've already looked up. We're
still doing too many database queries, but this cuts down some dupes.
2009-03-07 04:44:16 +00:00
Tim Almdal
acf28e47cb Create a proxy event (gallery_event) which is called when the request
is completing.
2009-03-03 18:57:16 +00:00
Tim Almdal
9b68fd46b2 Add the ability for modules to define hooks. The challenge is that
when the hooks are run, we haven't added all the installed modules to
the path, So if a module defines a hook it will never be run.

This change runs any module defined hooks as part of the gallery initialization.
2009-03-03 16:09:23 +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
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
2295d74879 Continue to replace raw sql with Database method calls. As per ticket #68 2009-02-13 06:57:16 +00:00
Bharat Mediratta
b7bfd011cb Remove extra debug call to install() 2009-01-29 02:19:52 +00:00
Bharat Mediratta
c136a2e84a Packager now does a clean reinstall of just the packages we want, then
rebuilds the install.sql and init_var.php files accordingly.
2009-01-19 05:16:55 +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
Tim Almdal
7043d17040 Since module_Core is static the methods, get_var, set_var, etc should be static 2009-01-14 00:09:33 +00:00
Bharat Mediratta
afb90768b4 Remove stray blank line, convert single to double quotes. 2009-01-11 02:06:36 +00:00
Bharat Mediratta
4312563e8b Reset module_names / modules early in load_modules() so that unit test framework can dump the loaded modules after switching databases even if the modules table doesn't exist yet 2009-01-11 01:57:41 +00:00
Bharat Mediratta
a7feeb576f Big set of changes to comments, with related changes to akismet and
user modules.

* Don't delete vars when we delete a module.  This makes
  reinstalling a module a lot easier.

* Add user::lookup() as the preferred way to load a user, so that
  other modules don't delve into the user module (that'd be a
  problem when we swap out user modules)

* Notify site admins if Akismet is not fully configured

* Bundle all server variables into the comment so that if/when we
  re-check the comment, we are not using the server info from the
  site admin's request.

* Update Akismet to grab request context data from the comment

* Pre-seed comment fields if we have a logged in user.  Update
  comment::create() API to clarify it for this.

* Delete comment::update(), that's a controller function.

* Add url to User_Model

* Add author_name() author_email() and author_url() to
  Comment_Model.  It'll return the appropriate values depending
  on whether the comment was left by a logged in user or a guest.

* Use resetForm() instead of clearForm() when we reload the
  comment form after ajax submit, this way we preserve the
  pre-seeded values.

* In the user profile page, ignore blank passwords.
2009-01-10 00:34:23 +00:00
Felix Rabinovich
b647aa0f74 Theme Administration v. 2. Doesn't distinguish between regular and admin themes yet 2009-01-09 23:31:46 +00:00
Tim Almdal
1e14594d68 Un hook the installer from load_modules, so testers can get to the scaffolding to install 2009-01-09 19:09:13 +00:00
Tim Almdal
22ee012720 Stage 1 of the installer. basically check that we can start as far as Kohana correctly 2009-01-09 18:33:48 +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
58c8b3b031 module::event now takes an unlimited number of args
added module::incr_var() ftw.
2009-01-08 02:46:09 +00:00
Bharat Mediratta
11d4c2d126 Fix a bug I introduced when I switched from module id to module name; now deleting cleans up vars and graphics rules 2008-12-26 04:49:28 +00:00
Bharat Mediratta
eb35afc987 Add module::clear_var() 2008-12-26 01:29:33 +00:00
Bharat Mediratta
2c91a7e9ce Rework log and message helpers to be parallel, but separate.
1) they now have their own matching severity constants
2) they both have convenience functions success(), info(), warning() and error()
3) they both have severity_class()
2008-12-25 23:43:44 +00:00
Bharat Mediratta
2502240ce4 Add very simple graphics toolkits.
Track a set of rules in Graphics_Rule_Model which specify how we turn
original images into thumbnails and resizes.  There's one set of rules
that applies to every image in the Gallery.

Track the state of thumbs and resizes with a "dirty" bit.  The new
graphics helper manages the rules and can rebuild the thumbs and
resizes for any images that are considered "dirty".

Introduce the concept of an "album cover" which is an item that an
album points to.  We'll use that item as the source for the album's
thumbnail/resize.

Conflated with this change (sorry!) I also changed the Var table to
use module_name instead of module_id.  This may be marginally less
efficient, but it's much easier to follow in the database.
2008-12-23 04:14:07 +00:00
Bharat Mediratta
bdc0876fa8 Add messaging system for reporting actions back to the user. Make
module install/uninstall work and tie it into the messaging system.
2008-12-22 06:50:20 +00:00
Bharat Mediratta
f6381c534e Reinstate the dummy error handler to ensure that we work in a clean install w/ no database 2008-12-22 04:54:51 +00:00
Bharat Mediratta
74c417cab9 Lock a couple of modules 2008-12-22 04:31:04 +00:00
Bharat Mediratta
fe27bd1eb3 Change the way that we track modules.
Each module now has a "module.info" file that has information about
the module, including the core.  We can display the installed version,
and the version in the code.

Also take a first shot at a modules admin page.
2008-12-22 03:41:33 +00:00
Bharat Mediratta
7934076a3b Add phpdoc comments. 2008-12-21 21:52:49 +00:00
Bharat Mediratta
99f131d9ae Create module::load_themes() to load the correct theme after we do
routing and know whether we're going to an /admin page or a regular
one.
2008-12-20 00:50:37 +00:00
Bharat Mediratta
26f0b4e44d Clear out module list in load_modules() before trying any db operations 2008-12-17 19:04:20 +00:00
Bharat Mediratta
fa5a8fde4a Switch from cookie sessions to database sessions. We can't use cookie
sessions; it encodes all the value into the cookie which means
little/no security, transfer costs, and storage limits.
2008-12-17 18:32:08 +00:00
Bharat Mediratta
130e26983a Add initialization to the user module to put the user and group_ids
into the session, for easy access.  This cuts down the number of
queries when we're loading images through file_proxy.php
2008-12-17 17:40:45 +00:00
Bharat Mediratta
83363172b1 Don't use model_cache for get_version and set_version; that breaks the installer. 2008-12-16 05:04:42 +00:00
Bharat Mediratta
3273984582 Use model_cache::get() to reduce duplicate queries 2008-12-16 04:56:51 +00:00
Tim Almdal
b2107c3734 1) Move the deletion of the vars into module::delete helper
2) remove the watermark_add_form.html.php
2008-12-15 03:49:48 +00:00
Bharat Mediratta
e12451cf10 Refaactor module::install() and module::uninstall() out of the
scaffolding and unit test code so that we can use it consistently.
This fixes an issue where adding a module was not refreshing the
statically cached module list causing the test framework to break.
2008-12-12 08:41:48 +00:00
Bharat Mediratta
597cc0013c Make the error handler public, else it can't be called from outside
this class (which is the most likely scenario).
2008-12-12 07:55:19 +00:00
Bharat Mediratta
79226f0a8f Cache modules and module_names when we call load_modules so that we don't have to check every time 2008-12-12 07:53:54 +00:00
Bharat Mediratta
187f28a6b3 Yet another deal with bootstrapping when we've got no core install yet. 2008-12-12 07:42:26 +00:00
Bharat Mediratta
54d27238f3 Fix module::_core_installed() hack. 2008-12-12 07:09:00 +00:00
Bharat Mediratta
35067cbced Expand on our core-is-installed checking code. 2008-12-12 01:22:03 +00:00
Bharat Mediratta
0f41cab732 Guard load_modules() against the case that the database isn't installed. 2008-12-11 23:10:42 +00:00
Tim Almdal
e84a0ebe46 Change the name of the implmentation of module parameters to module vars 2008-12-11 16:06:22 +00:00
Tim Almdal
7e5935d532 Create a module parameter table. This will be useful if a module wants to store information, but is not enough to warrant a table of its own 2008-12-10 19:44:58 +00:00
Tim Almdal
8d1790a0b4 * Add a moveTo unit test
* Pass the module::event(..., $data) by reference to the handlers
2008-12-05 04:56:33 +00:00
Bharat Mediratta
9ba9f7bf27 Change the startup code to only put installed modules on the autoload
path.  This breaks a bunch of places where we had hardcoded
dependencies, so guard all of those cases.  Restructure
module::available() a bit and the way that we do install/uninstall in
the scaffolding.
2008-12-04 07:44:28 +00:00
Tim Almdal
4c2d4abb1c Remove debugging statements 2008-11-28 21:55:26 +00:00