Commit Graph

45 Commits

Author SHA1 Message Date
Bharat Mediratta
10895ca529 Undo the change added in e4eedbce22
which deactivates modules on upgrade.  No idea why we did that, but it
breaks upgrading because it deactivates any module that's been
upgraded.
2010-06-05 23:04:23 -07:00
Bharat Mediratta
0350cf3cd8 Fix a comment typo. 2010-06-05 22:50:20 -07:00
Bharat Mediratta
c3c2b45280 Update the copyright to 2010. It's only 3 months into the year :-) 2010-03-03 10:15:34 -08:00
Bharat Mediratta
c050acf30a Fix lots of warnings that pop up when we're in E_STRICT mode. They're
mostly issues around uninitialized variables, calling non-static
functions in a static context, calling Session functions directly
instead of on its singleton, passing non-variables by reference, and
subclasses not using the same interface as the parent class.
2010-01-31 16:07:41 -08:00
Tim Almdal
c9ea1a64de Remove the one last remaining reference to "no_module_admin". 2010-01-24 15:40:56 -08:00
Tim Almdal
df313cac56 Change the check_environment method in the module helper and the module installers to can_activate to reflect that it is doing more than just checking the environment. 2010-01-22 12:30:17 -08:00
Tim Almdal
0da5d9e606 Internationalize all strings in admin_modules.hmtl and corrected comments. 2010-01-21 20:33:26 -08:00
Tim Almdal
d59c6ed4f1 The admin module controller allows modules to provide a check_environment method
which is called prior to installation.  The method allows the module to provide
an error message or warnings if the module can not be installed or activated
without issues.  The admin module controller also will fire a pre_deactivate
event, which allows modules to indicate issues that may arise be deactivating the
specified module.

These messages are displayed in a dialog box prior to installation in order to
allow the gallery administrator to determine the appropriate action before proceeding.

Lays the foundation for implementing a fix for ticket #937
2010-01-21 12:57:45 -08:00
Bharat Mediratta
7118f84aa9 ORM::factory() in K24 does not allow you to specify an alternate key
for lookup.  So instead of doing:
  ORM::factory("foo", array("some_key" => "some_value"))

you have to do:
  ORM::factory("foo"->where("some_key", "=" "some_value")->find()
2009-12-22 13:32:02 -08:00
Bharat Mediratta
9d19e272d6 Convert some database queries. 2009-12-17 21:16:51 -08:00
Bharat Mediratta
5a7449f315 Update more database calls. 2009-12-06 19:51:25 -08:00
Bharat Mediratta
53df0df0a4 Update a few more occurrences of ORM/Database -> Database_Builder 2009-11-29 02:48:42 -08:00
Bharat Mediratta
3f63e1c521 Merge branch 'master' of git@github.com:gallery/gallery3 into bharat_dev
Conflicts:
	modules/gallery/helpers/theme.php
	modules/gallery/libraries/Admin_View.php
	modules/gallery/libraries/Theme_View.php
2009-11-29 02:45:39 -08:00
Bharat Mediratta
f3981bbaa9 Rework the theme loading code to allow themes to be treated as Gallery
modules, and have an admin subdirectory that is treated like a Kohana
module (as distinct from a Gallery module).

The main advantage of creating the separate admin subdirectory is that
we will not load an admin theme and a site theme at the same time.
We'll only load a few specialized bits of the site theme while the
admin theme is active.

Concrete examples. A site theme named "xxx":
- will receive events at themes/xxx/helpers/xxx_event.php
- will have working controllers at themes/xxx/controllers/xxx.php

If theme xxx has an admin subdir, then in admin mode it:
- will receive events at themes/xxx/admin/helpers/xxx_event.php
- will have working controllers at themes/xxx/admin/controllers/xxx.php
2009-11-28 23:25:07 -08:00
Bharat Mediratta
1fd0e14359 Convert all DB where() calls to take 3 arguments.
Convert all open_paren() calls to and_open() or or_open() as appropriate.
2009-11-26 12:09:04 -08:00
Bharat Mediratta
0121bfd585 ORM::orderby -> ORM::order_by 2009-11-25 19:26:52 -08:00
Bharat Mediratta
2e420522ec Preliminary work to cut over to Kohana 2.4
- Kohana::log() -> Kohana_Log::add()
- Kohana::config_XXX -> Kohana_Config::instance()->XXX
- Implement View::set_global in MY_View
- Updated Cache_Database_Driver to latest APIs
- ORM::$loaded -> ORM::loaded()
- Updated item::viewable() to use K2.4 parenthesization
2009-11-25 13:22:24 -08:00
Tim Almdal
79f700ef9f Change the keys of the block arrays in block manager to be a md5 hash of module_name:block_id. This allows easier lookup of blocks to remove when modules
are being deactivated. Change the module activation/deactivation to call (activate|deactivate)_blocks instead of just the sidebar blocks.  This insures
that when a module is deactivated any admin dashboard blocks are removed as well the site sideboard blocks. Fix for ticket #876.
2009-11-12 13:13:34 -08:00
Tim Almdal
514915438b Add a flag in the module.info (no_module_admin) to indicate that this module shouldn't be managed by the default module administration screen. This module will always be locked on that screen. 2009-10-27 07:57:51 -07:00
Tim Almdal
e4eedbce22 Change the upgrader so that it never deactivactes the gallery nor the current identity provider modules. Call module::deactive to truly deactivate the module. 2009-10-26 09:35:41 -07:00
Tim Almdal
b74b131e25 Change Identity adminstration to use the uninstall/install methods when changing providers. 2009-10-22 22:30:25 -07:00
Tim Almdal
89ca1590e4 When uninstalling a module call graphics:remove_rules instead of graphics remove_rule. 2009-10-22 22:30:24 -07:00
Tim Almdal
090c4d016b Merge branch 'master' into talmdal_dev
Conflicts:
	lib/gallery.common.css
	themes/admin_wind/views/admin.html.php
	themes/night_wind/views/sidebar.html.php
	themes/wind/views/sidebar.html.php
2009-10-18 09:28:48 -07:00
Tim Almdal
4949a2ce0b Optimize the get method to retrieve the module information from the loaded modules. In addition add a method "info" to return the module information contained in the module.info file 2009-10-18 09:23:59 -07:00
Tim Almdal
6d5c12e13e Move the default identity config into the users module and change the Identity constructor to look in module::get_var(gallery, identity_provider) for the current identity driver.
In addition, don't just arbitrarily lock the use module.  Only lock gallery and the module that is referenced by "user_driver_module" variable.
2009-10-18 08:00:33 -07:00
Tim Almdal
2634a683b3 Revert "Create a gallery::plugin_path which returns the appropriate path to the module or theme. This checks for the existence of an application/modules or application/themes first."
This reverts commit e1e1461a77caf5bff457927f098366497de6ffff.
2009-10-04 10:12:22 -07:00
Tim Almdal
aa0529d557 Create a gallery::plugin_path which returns the appropriate path to the module or theme. This checks for the existence of an application/modules or application/themes first. 2009-10-04 10:12:21 -07:00
Tim Almdal
81eaf1e46c Add functionality to activate sidebar blocks when the module is activated and deactivate the sidebar blocks when the module is deactivated. 2009-09-30 17:30:01 -07:00
Tim Almdal
39cd84d86c Remove a debugging log statement 2009-09-29 09:11:43 -07:00
Tim Almdal
e6f6239611 Remove the @todo and optimize the gallery_event call for 3 and 4 arguments... context menu events have 4 arguments. 2009-09-29 09:10:41 -07:00
Tim Almdal
89a67dba63 * Remove the @todo in module event and always try to call gallery_event::$function first
* Refactor gallery.php to move site_menu, admin_menu, and context_menu to gallery_event.php
* Change Theme_View and Admin_view to call module::event("site_menu|admin_menu|context_menu"...)
2009-09-29 08:50:53 -07:00
Bharat Mediratta
9fbdcf3efd Change the module installer so that you don't need to provide your own
install() function if all you're going to do is to set the version of
the module from module.info into the database.  This means that for some
simple modules, you don't need an install.php file at all.
2009-09-05 13:39:30 -07:00
Bharat Mediratta
52147cf6f8 Combine the quick menu and the thumb menu into a single menu called
the "context" menu.

This new context menu is generated using the typical event processing
system, like our other menus.  The specialized quick CSS and JS is now
gone, replaced by our generic menu handling code.  It's all rolled
together currently using the thumb_menu UI for easy packaging.  All
the CSS and JS is updated.

NOTE: the non-dialog links (rotate, album_cover) have a broken UI
because they return JSON which the quick.js code handled specially,
but we don't handle properly now.  I need to fix this.
2009-08-03 21:45:54 -07:00
Andy Staudacher
4dfb5aaf25 Fix i18n issue - accidentally called t() on translated messages. Please truncate incoming_translations after this
update to get rid of bad messages in your DB.
2009-06-30 00:22:16 -07:00
Andy Staudacher
dd30ec012b Partial fix for ticket 471 - i18n of module names in upgrader. 2009-06-29 22:48:22 -07:00
Bharat Mediratta
bfca0c7903 Refactor the install/upgrade code to be more flexible.
Add xxx_installer::upgrade($version) method so that upgrade stanzas
are separate from install stanzas.  In the old code, to do an upgrade
meant that you had to re-evolve everything from the initial install
because we'd step through each version's changes.  But what we really
want is for the initial install to start off in the perfect initial
state, and the upgrades to do the work behind the scenes.  So now the
install() function gets things set up properly the first time, and the
upgrade() function does any work to catch you up to the latest code.
See gallery_installer.php for a good example.
2009-06-23 12:00:49 -07:00
Bharat Mediratta
accce788d9 Fix a bug in set_version() where we were always forcing the value to 1. Oops! 2009-06-09 21:26:28 -07:00
Bharat Mediratta
00b528afac Cache the available module list in module::$available. 2009-06-09 20:32:37 -07:00
Bharat Mediratta
5e6c8894e2 Use a reference in available() to avoid crappy looking dereferencing. 2009-06-09 20:08:48 -07:00
Bharat Mediratta
356bac0db0 Restore calls to module::load_modules() after install/activate/deactivate/uninstall events. 2009-05-28 21:18:46 -07:00
Bharat Mediratta
d088a41747 Load the gallery module in load_modules(), but put it at the end of
the module list (to match its location in the cascading filesystem)
2009-05-28 21:00:06 -07:00
Bharat Mediratta
7fd6fcaf9b Force modules/gallery to be at the end of the module load path, so
that all other modules can override the core code.
2009-05-28 17:46:17 -07:00
Bharat Mediratta
24dce5a85d Fix up another place where we were incorrectly referencing the gallery module. 2009-05-27 21:18:09 -07:00
Bharat Mediratta
88a3d43ba9 Update all references to the core application to now point to the
gallery module.  This type of mass update is prone to some small bugs.
2009-05-27 16:17:29 -07:00
Bharat Mediratta
28b41056e3 Restructure things so that the application is now just another module.
Kohana makes this type of transition fairly straightforward in that
all controllers/helpers/etc are still located in the cascading
filesystem without any extra effort, except that I've temporarily
added a hack to force modules/gallery into the module path.

Rename what's left of "core" to be "application" so that it conforms
more closely to the Kohana standard (basically, just
application/config/config.php which is the minimal thing that you need
in the application directory)

There's still considerable work left to be done here.
2009-05-27 15:07:27 -07:00