* did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
*/
-require_once dirname(__FILE__) . '/lib/base.php';
+require_once dirname(__FILE__) . '/lib/Application.php';
+Horde_Registry::appInit('ansel');
Horde::addScriptFile('prototype.js', 'horde');
$layout = new Horde_Block_Layout_View(
* did not receive this file, see http://www.fsf.org/copyleft/gpl.html
*/
-require_once dirname(__FILE__) . '/lib/base.php';
+require_once dirname(__FILE__) . '/lib/Application.php';
+Horde_Registry::appInit('ansel');
// Instantiate the blocks objects.
$blocks = Horde_Block_Collection::singleton('myphotos', array('ansel'));
* @author Jan Zagar <jan.zagar@siol.net>
*/
-require_once dirname(__FILE__) . '/lib/base.php';
+require_once dirname(__FILE__) . '/lib/Application.php';
+Horde_Registry::appInit('ansel');
$vars = Horde_Variables::getDefaultVariables();
$gallery = $ansel_storage->getGallery($vars->get('gallery'));
*
* @author Michael J. Rubinsky <mrubinsk@horde.org>
*/
-require_once dirname(__FILE__) . '/lib/base.php';
+
+require_once dirname(__FILE__) . '/lib/Application.php';
+Horde_Registry::appInit('ansel');
$images = Horde_Util::getFormData('image', array());
$actionID = Horde_Util::getFormData('actionID');
*
* @author Duck <duck@obala.net>
*/
-require_once dirname(__FILE__) . '/../lib/base.php';
+
+require_once dirname(__FILE__) . '/../lib/Application.php';
+Horde_Registry::appInit('ansel');
$faces = Ansel_Faces::factory();
$face_id = Horde_Util::getFormData('face');
$form->renderActive(null, null, null, 'post');
-require $registry->get('templates', 'horde') . '/common-footer.inc';
\ No newline at end of file
+require $registry->get('templates', 'horde') . '/common-footer.inc';
*
* @author Duck <duck@obala.net>
*/
-require_once dirname(__FILE__) . '/../lib/base.php';
+
+require_once dirname(__FILE__) . '/../lib/Application.php';
+Horde_Registry::appInit('ansel');
$image_id = (int)Horde_Util::getFormData('image');
$face_id = (int)Horde_Util::getFormData('face');
*
* @author Duck <duck@obala.net>
*/
-require_once dirname(__FILE__) . '/../lib/base.php';
+
+require_once dirname(__FILE__) . '/../lib/Application.php';
+Horde_Registry::appInit('ansel');
$image_id = (int)Horde_Util::getFormData('image');
$face_id = (int)Horde_Util::getFormData('face');
*
* @author Duck <duck@obala.net>
*/
-require_once dirname(__FILE__) . '/../lib/base.php';
+
+require_once dirname(__FILE__) . '/../lib/Application.php';
+Horde_Registry::appInit('ansel');
+
$faces = Ansel_Faces::factory();
$face_id = Horde_Util::getFormData('face');
try {
require ANSEL_TEMPLATES . '/common-header.inc';
require ANSEL_TEMPLATES . '/menu.inc';
require_once ANSEL_TEMPLATES . '/faces/face.inc';
-require $registry->get('templates', 'horde') . '/common-footer.inc';
\ No newline at end of file
+require $registry->get('templates', 'horde') . '/common-footer.inc';
*
* @author Duck <duck@obala.net>
*/
-require_once dirname(__FILE__) . '/../lib/base.php';
+
+require_once dirname(__FILE__) . '/../lib/Application.php';
+Horde_Registry::appInit('ansel');
$gallery_id = (int)Horde_Util::getFormData('gallery');
if (empty($gallery_id)) {
*
* @author Duck <duck@obala.net>
*/
-require_once dirname(__FILE__) . '/../lib/base.php';
+
+require_once dirname(__FILE__) . '/../lib/Application.php';
+Horde_Registry::appInit('ansel');
$faces = Ansel_Faces::factory();
require_once ANSEL_TEMPLATES . '/faces/image.inc';
} else {
echo _("No faces found");
-}
\ No newline at end of file
+}
*
* @author Duck <duck@obala.net>
*/
-require_once dirname(__FILE__) . '/../lib/base.php';
+
+require_once dirname(__FILE__) . '/../lib/Application.php';
+Horde_Registry::appInit('ansel');
$face_id = Horde_Util::getFormData('face');
$faces = Ansel_Faces::factory();
*
* @author Duck <duck@obala.net>
*/
-require_once dirname(__FILE__) . '/../lib/base.php';
+
+require_once dirname(__FILE__) . '/../lib/Application.php';
+Horde_Registry::appInit('ansel');
$image_id = (int)Horde_Util::getFormData('image');
$face_id = (int)Horde_Util::getFormData('face');
*
* @author Duck <duck@obala.net>
*/
-require_once dirname(__FILE__) . '/../lib/base.php';
+
+require_once dirname(__FILE__) . '/../lib/Application.php';
+Horde_Registry::appInit('ansel');
$face_id = Horde_Util::getFormData('face');
$form->renderActive(null, null, null, 'post');
-require $registry->get('templates', 'horde') . '/common-footer.inc';
\ No newline at end of file
+require $registry->get('templates', 'horde') . '/common-footer.inc';
*
* @author Duck <duck@obala.net>
*/
-require_once dirname(__FILE__) . '/../lib/base.php';
+
+require_once dirname(__FILE__) . '/../lib/Application.php';
+Horde_Registry::appInit('ansel');
$image_id = (int)Horde_Util::getFormData('image_id');
$gallery_id = (int)Horde_Util::getFormData('gallery_id');
*
* @author Duck <duck@obala.net>
*/
-require_once dirname(__FILE__) . '/../../lib/base.php';
-/* Face search is allowd only to */
-if (!Horde_Auth::isauthenticated()) {
- exit;
-}
+require_once dirname(__FILE__) . '/../../lib/Application.php';
+Horde_Registry::appInit('ansel');
$thumb = Horde_Util::getGet('thumb');
$tmp = Horde::getTempDir();
*
* @author Duck <duck@obala.net>
*/
-require_once dirname(__FILE__) . '/../../lib/base.php';
+
+require_once dirname(__FILE__) . '/../../lib/Application.php';
+Horde_Registry::appInit('ansel');
$faces = Ansel_Faces::factory();
-/* Face search is allowed only to authenticated users */
-if (!Horde_Auth::isauthenticated()) {
- Horde_Auth::authenticateFailure();
-}
/* Show tabs */
$vars = Horde_Variables::getDefaultVariables();
* @author Chuck Hagenbuch <chuck@horde.org>
*/
-require_once dirname(__FILE__) . '/lib/base.php';
+require_once dirname(__FILE__) . '/lib/Application.php';
+Horde_Registry::appInit('ansel');
// Redirect to the gallery list if no action has been requested.
$actionID = Horde_Util::getFormData('actionID');
* @author Chuck Hagenbuch <chuck@horde.org>
*/
-require_once dirname(__FILE__) . '/../lib/base.php';
+require_once dirname(__FILE__) . '/../lib/Application.php';
+Horde_Registry::appInit('ansel');
$galleryId = Horde_Util::getFormData('gallery');
if (!$galleryId) {
* @author Chuck Hagenbuch <chuck@horde.org>
*/
-require_once dirname(__FILE__) . '/../lib/base.php';
+require_once dirname(__FILE__) . '/../lib/Application.php';
+Horde_Registry::appInit('ansel');
// Delete/empty the gallery if we're provided with a valid galleryId.
$actionID = Horde_Util::getPost('action');
* @author Chuck Hagenbuch <chuck@horde.org>
*/
-require_once dirname(__FILE__) . '/../lib/base.php';
+require_once dirname(__FILE__) . '/../lib/Application.php';
+Horde_Registry::appInit('ansel');
/* If we aren't provided with a gallery, redirect to the gallery
* list. */
* @author Ben Chavet <ben@horde.org>
*/
-require_once dirname(__FILE__) . '/lib/base.php';
+require_once dirname(__FILE__) . '/lib/Application.php';
+Horde_Registry::appInit('ansel');
// check for grouping
$groupby = basename(Horde_Util::getFormData('groupby', $prefs->getValue('groupby')));
* @author Michael J. Rubinsky <mrubinsk@horde.org>
*/
-require_once dirname(__FILE__) . '/lib/base.php';
+require_once dirname(__FILE__) . '/lib/Application.php';
+Horde_Registry::appInit('ansel');
/* Get all the form data */
$actionID = Horde_Util::getFormData('actionID');
* @author Chuck Hagenbuch <chuck@horde.org>
*/
-require_once dirname(__FILE__) . '/../lib/base.php';
+require_once dirname(__FILE__) . '/../lib/Application.php';
+Horde_Registry::appInit('ansel');
$id = Horde_Util::getFormData('image');
$image = &$ansel_storage->getImage($id);
* @author Michael Slusarz <slusarz@horde.org>
*/
-require_once dirname(__FILE__) . '/../lib/base.php';
+require_once dirname(__FILE__) . '/../lib/Application.php';
+Horde_Registry::appInit('ansel');
/* Abort if ecard sending is disabled. */
if (empty($conf['ecard']['enable'])) {
* @author Chuck Hagenbuch <chuck@horde.org>
*/
-require_once dirname(__FILE__) . '/../lib/base.php';
+require_once dirname(__FILE__) . '/../lib/Application.php';
+Horde_Registry::appInit('ansel');
$id = Horde_Util::getFormData('image');
$image = &$ansel_storage->getImage($id);
* @author Chuck Hagenbuch <chuck@horde.org>
*/
-require_once dirname(__FILE__) . '/../lib/base.php';
+require_once dirname(__FILE__) . '/../lib/Application.php';
+Horde_Registry::appInit('ansel');
$id = Horde_Util::getFormData('image');
$image = &$ansel_storage->getImage($id);
* @author Chuck Hagenbuch <chuck@horde.org>
*/
-require_once dirname(__FILE__) . '/../lib/base.php';
+require_once dirname(__FILE__) . '/../lib/Application.php';
+Horde_Registry::appInit('ansel');
$id = Horde_Util::getFormData('image');
$image = &$ansel_storage->getImage($id);
* @author Michael J. Rubinsky <mrubinsk@horde.org>
*/
-require_once dirname(__FILE__) . '/../lib/base.php';
+require_once dirname(__FILE__) . '/../lib/Application.php';
+Horde_Registry::appInit('ansel');
$style = Horde_Util::getFormData('style');
$id = Horde_Util::getFormData('image');
* @author Chuck Hagenbuch <chuck@horde.org>
*/
-require_once dirname(__FILE__) . '/../lib/base.php';
+require_once dirname(__FILE__) . '/../lib/Application.php';
+Horde_Registry::appInit('ansel');
$id = Horde_Util::getFormData('image');
$image = &$ansel_storage->getImage($id);
* @author Chuck Hagenbuch <chuck@horde.org>
*/
-require_once dirname(__FILE__) . '/../lib/base.php';
+require_once dirname(__FILE__) . '/../lib/Application.php';
+Horde_Registry::appInit('ansel');
$id = Horde_Util::getFormData('image');
$image = &$ansel_storage->getImage($id);
* @author Chuck Hagenbuch <chuck@horde.org>
*/
-require_once dirname(__FILE__) . '/../lib/base.php';
+require_once dirname(__FILE__) . '/../lib/Application.php';
+Horde_Registry::appInit('ansel');
$gallery_id = Horde_Util::getFormData('gallery');
$gallery = &$ansel_storage->getGallery($gallery_id);
* @author Chuck Hagenbuch <chuck@horde.org>
*/
-require_once dirname(__FILE__) . '/../lib/base.php';
+require_once dirname(__FILE__) . '/../lib/Application.php';
+Horde_Registry::appInit('ansel');
$gallery_id = (int)Horde_Util::getFormData('gallery');
$gallery = $ansel_storage->getGallery($gallery_id);
* @author Chuck Hagenbuch <chuck@horde.org>
*/
-require_once dirname(__FILE__) . '/lib/base.php';
+require_once dirname(__FILE__) . '/lib/Application.php';
+Horde_Registry::appInit('ansel');
+
header('Location: ' . Ansel::getUrlFor('default_view', array()));
public function handle($args, $post)
{
- include_once dirname(__FILE__) . '/../../base.php';
-
if (Horde_Auth::getAuth()) {
/* Are we requesting the unformatted text? */
if (!empty($args['action']) && $args['action'] == 'load') {
function handle($args, $post)
{
- include_once dirname(__FILE__) . '/../../base.php';
-
if (Horde_Auth::getAuth()) {
$action = $args['action'];
$image_id = (int)$post['image'];
*/
public function handle($args, $post)
{
- include_once dirname(__FILE__) . '/../../base.php';
-
/* First, determine the type of view we are asking for */
$view = empty($args['gallery_view']) ? 'Mini' : $args['gallery_view'];
$class = 'Ansel_View_EmbeddedRenderer_' . basename($view);
public function handle($args, $post)
{
- include_once dirname(__FILE__) . '/../../base.php';
if (empty($args['input'])) {
return array('response' => '1');
}
public function handle($args, $post)
{
- include_once dirname(__FILE__) . '/../../base.php';
-
$type = $args['action'];
$location = empty($post['location']) ? null : $post['location'];
$lat = empty($post['lat']) ? null : $post['lat'];
public function handle($args, $post)
{
- include_once dirname(__FILE__) . '/../../base.php';
-
// Avoid errors if 'input' isn't set and short-circuit empty searches.
if (empty($args['input']) ||
!($input = Horde_Util::getFormData($args['input']))) {
public function handle($args, $post)
{
- include_once dirname(__FILE__) . '/../../base.php';
-
$action = $args['action'];
$tags = $post['tags'];
if (empty($action) || empty($tags)) {
*/
public function browse($path = '', $properties = array())
{
- require_once dirname(__FILE__) . '/base.php';
-
// Default properties.
if (!$properties) {
$properties = array('name', 'icon', 'browseable');
*/
public function put($path, $content, $content_type)
{
- require_once dirname(__FILE__) . '/base.php';
-
if (substr($path, 0, 5) == 'ansel') {
$path = substr($path, 9);
}
*/
public function commentCallback($image_id)
{
- require_once dirname(__FILE__) . '/base.php';
-
if (!$GLOBALS['conf']['comments']['allow']) {
return false;
}
*/
public function hasComments()
{
- require_once dirname(__FILE__) . '/base.php';
-
if (($GLOBALS['conf']['comments']['allow'] == 'all' ||
($GLOBALS['conf']['comments']['allow'] == 'authenticated' &&
Horde_Auth::getAuth()))) {
$gallery_data = null, $encoding = null, $slug = null,
$compression = 'none', $skiphook = false)
{
- require_once dirname(__FILE__) . '/base.php';
-
$image_data = null;
/* If no app is given use Ansel's own gallery which is initialized
*/
public function postBatchUpload($image_ids)
{
- require_once dirname(__FILE__) . '/base.php';
if (!empty($conf['hooks']['postupload'])) {
return Horde::callHook('_ansel_hook_postupload', array($image_ids), 'ansel');
}
*/
public function removeImage($app = null, $gallery_id, $image_id)
{
- require_once dirname(__FILE__) . '/base.php';
-
/* Check global Ansel permissions */
if (!($GLOBALS['perms']->getPermissions('ansel'))) {
return PEAR::raiseError(_("Access denied deleting galleries."));
*/
public function createGallery($app = null, $attributes = array(), $perm = null, $parent = null)
{
- require_once dirname(__FILE__) . '/base.php';
-
if (!(Horde_Auth::isAdmin() ||
(!$GLOBALS['perms']->exists('ansel') && Horde_Auth::getAuth()) ||
$GLOBALS['perms']->hasPermission('ansel', Horde_Auth::getAuth(), Horde_Perms::EDIT))) {
*/
public function removeGallery($app = null, $gallery_id)
{
- require_once dirname(__FILE__) . '/base.php';
-
/* Check global Ansel permissions */
if (!($GLOBALS['perms']->getPermissions('ansel'))) {
return PEAR::raiseError(_("Access denied deleting galleries."));
*/
public function count($app = null, $gallery_id = null, $slug = '')
{
- require_once dirname(__FILE__) . '/base.php';
-
/* If no app is given use Ansel's own gallery which is initialized in
base.php */
if (!is_null($app)) {
public function getDefaultImage($app = null, $gallery_id = null,
$style = 'ansel_default', $slug = '')
{
- require_once dirname(__FILE__) . '/base.php';
-
/* If no app is given use Ansel's own gallery which is initialized in
base.php */
if (!is_null($app)) {
public function getImageUrl($app = null, $image_id, $view = 'screen',
$full = false, $style = null)
{
- require_once dirname(__FILE__) . '/base.php';
-
/* If no app is given use Ansel's own gallery which is initialized in
base.php */
if (!is_null($app)) {
public function getImageContent($image_id, $view = 'screen', $style = null,
$app = null, $encoding = null, $compression = 'none')
{
- require_once dirname(__FILE__) . '/base.php';
-
/* If no app is given use Ansel's own gallery which is initialized in
base.php */
if (!is_null($app)) {
$allLevels = true, $from = 0, $count = 0,
$attributes = null, $sort_by = null, $direction = 0)
{
- require_once dirname(__FILE__) . '/base.php';
-
/* If no app is given use Ansel's own gallery which is initialized in
base.php */
if (!is_null($app)) {
*/
public function getGalleries($ids = array(), $app = null, $slugs = array())
{
- require_once dirname(__FILE__) . '/base.php';
-
if (!is_null($app)) {
$GLOBALS['ansel_storage'] = new Ansel_Storage($app);
}
$allLevels = true, $from = 0, $count = 0,
$default = null)
{
- require_once dirname(__FILE__) . '/base.php';
-
/* If no app is given use Ansel's own gallery which is initialized in
base.php */
if (!is_null($app)) {
$view = 'screen', $full = false, $from = 0,
$count = 0, $style = null, $slug = '')
{
- require_once dirname(__FILE__) . '/base.php';
-
/* If no app is given use Ansel's own gallery which is initialized in
base.php */
if (!is_null($app)) {
$full = false, $limit = 10, $style = null,
$slugs = array())
{
- require_once dirname(__FILE__) . '/base.php';
if (!is_null($app)) {
$GLOBALS['ansel_storage'] = new Ansel_Storage($app);
}
public function countGalleries($app = null, $perm = Horde_Perms::SHOW, $attributes = null,
$parent = null, $allLevels = true)
{
- require_once dirname(__FILE__) . '/base.php';
-
/* If no app is given use Ansel's own gallery which is initialized
* in base.php */
if (!is_null($app)) {
*/
public function listTagInfo($tags = null)
{
- require_once dirname(__FILE__) . '/base.php';
-
return Ansel_Tags::listTagInfo($tags);
}
$resource_type = 'all', $user = null, $raw = false,
$app = null)
{
- require_once dirname(__FILE__) . '/base.php';
-
if (!is_null($app)) {
$GLOBALS['ansel_storage'] = new Ansel_Storage($app);
} else {
*/
public function galleryExists($app, $gallery_id = null, $slug = '')
{
- require_once dirname(__FILE__) . '/base.php';
-
if (!is_null($app)) {
$GLOBALS['ansel_storage'] = new Ansel_Storage($app);
}
*/
public function getGalleryStyles()
{
- require_once dirname(__FILE__) . '/base.php';
-
return Ansel::getAvailableStyles();
}
public function renderView($params = array(), $app = null,
$view = 'Gallery')
{
- require_once dirname(__FILE__) . '/base.php';
-
if (!is_null($app)) {
$GLOBALS['ansel_storage'] = new Ansel_Storage($app);
}
/**
* Ansel application API.
*
+ * This file defines Horde's core API interface. Other core Horde libraries
+ * can interact with Horde through this API.
+ *
* Copyright 2004-2010 The Horde Project (http://www.horde.org/)
*
* See the enclosed file COPYING for license information (GPL). If you
* @author Michael J. Rubinsky <mrubinsk@horde.org>
* @package Ansel
*/
+
+if (!defined('ANSEL_BASE')) {
+ define('ANSEL_BASE', dirname(__FILE__) . '/..');
+}
+
+if (!defined('HORDE_BASE')) {
+ /* If horde does not live directly under the app directory, the HORDE_BASE
+ * constant should be defined in config/horde.local.php. */
+ if (file_exists(ANSEL_BASE . '/config/horde.local.php')) {
+ include ANSEL_BASE . '/config/horde.local.php';
+ } else {
+ define('HORDE_BASE', ANSEL_BASE . '/..');
+ }
+}
+
+/* Load the Horde Framework core (needed to autoload
+ * Horde_Registry_Application::). */
+require_once HORDE_BASE . '/lib/core.php';
+
class Ansel_Application extends Horde_Registry_Application
{
+ /**
+ * The application's version.
+ *
+ * @var string
+ */
public $version = 'H4 (2.0-git)';
/**
+ * Initialization function.
+ *
+ * Global variables defined:
+ * $ansel_db - TODO
+ * $ansel_storage - TODO
+ * $ansel_styles - TODO
+ * $ansel_vfs - TODO
+ * $cache - A Horde_Cache object.
+ *
+ * @throws Horde_Exception
+ */
+ protected function _init()
+ {
+ // Create a cache object if we need it.
+ if ($GLOBALS['conf']['ansel_cache']['usecache']) {
+ $GLOBALS['cache'] = Horde_Cache::singleton($GLOBALS['conf']['cache']['driver'], Horde::getDriverConfig('cache', $GLOBALS['conf']['cache']['driver']));
+ }
+
+ // Create db, share, and vfs instances.
+ $GLOBALS['ansel_db'] = Ansel::getDb();
+ if (is_a($GLOBALS['ansel_db'], 'PEAR_Error')) {
+ throw new Horde_Exception($GLOBALS['ansel_db']);
+ }
+
+ $GLOBALS['ansel_storage'] = new Ansel_Storage();
+ $GLOBALS['ansel_vfs'] = Ansel::getVFS();
+
+ // Get list of available styles for this client.
+ $GLOBALS['ansel_styles'] = Ansel::getAvailableStyles();
+ if ($logger = Horde::getLogger()) {
+ $GLOBALS['ansel_vfs']->setLogger($logger, $GLOBALS['conf']['log']['priority'
+ ]);
+ }
+
+ /**
* Returns a list of available permissions.
*
* @return array An array describing all available permissions.
function _content()
{
- require_once dirname(__FILE__) . '/../base.php';
-
global $registry;
/* Get the tags */
function _params()
{
- require_once dirname(__FILE__) . '/../base.php';
-
$params = array('gallery' => array(
'name' => _("Gallery"),
'type' => 'enum',
function _getGallery($retry = false)
{
- require_once dirname(__FILE__) . '/../base.php';
-
// Make sure we haven't already selected a gallery.
if (is_a($this->_gallery, 'Ansel_Gallery')) {
return $this->_gallery;
function _content()
{
- require_once dirname(__FILE__) . '/../base.php';
-
$gallery = $GLOBALS['ansel_storage']->getRandomGallery();
if (!$gallery) {
return _("There are no photo galleries available.");
function _params()
{
- require_once dirname(__FILE__) . '/../base.php';
-
$params = array('gallery' => array(
'name' => _("Gallery"),
'type' => 'enum',
function _title()
{
- require_once dirname(__FILE__) . '/../base.php';
-
if ($this->_params['gallery'] != 'all') {
$gallery = $this->_getGallery();
if (is_a($gallery, 'PEAR_Error')) {
function _content()
{
- require_once dirname(__FILE__) . '/../base.php';
$faces = Ansel_Faces::factory();
$results = $faces->allFaces(0, $this->_params['limit']);
$html = '';
function _params()
{
- require_once dirname(__FILE__) . '/../base.php';
-
$params = array('gallery' => array(
'name' => _("Gallery"),
'type' => 'enum',
function _title()
{
- require_once dirname(__FILE__) . '/../base.php';
-
if ($this->_params['gallery'] != 'all') {
$gallery = $this->_getGallery();
if (is_a($gallery, 'PEAR_Error')) {
function _content()
{
- require_once dirname(__FILE__) . '/../base.php';
-
if ($this->_params['gallery'] == 'all') {
$galleries = array();
} elseif (!is_array($this->_params['gallery'])) {
function _params()
{
- require_once dirname(__FILE__) . '/../base.php';
-
$params = array('gallery' => array(
'name' => _("Gallery"),
'type' => 'enum',
function _title()
{
- require_once dirname(__FILE__) . '/../base.php';
-
Horde::addScriptFile('http://maps.google.com/maps?file=api&v=2&sensor=false&key=' . $GLOBALS['conf']['api']['googlemaps'], 'ansel', array('external' => true));
Horde::addScriptFile('http://gmaps-utility-library.googlecode.com/svn/trunk/markermanager/1.1/src/markermanager.js', 'ansel', array('external' => true));
Horde::addScriptFile('googlemap.js');
function _content()
{
- require_once dirname(__FILE__) . '/../base.php';
-
if ($this->_params['gallery'] == 'all') {
$galleries = array();
} elseif (!is_array($this->_params['gallery'])) {
+++ /dev/null
-<?php
-/**
- * Script to determine the correct *_BASE values.
- *
- * Copyright 2009-2010 The Horde Project (http://www.horde.org/)
- *
- * See the enclosed file COPYING for license information (GPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
- *
- * @package Ansel
- */
-
-if (!defined('ANSEL_BASE')) {
- define('ANSEL_BASE', dirname(__FILE__) . '/..');
-}
-
-if (!defined('HORDE_BASE')) {
- /* If horde does not live directly under the app directory, the HORDE_BASE
- * constant should be defined in config/horde.local.php. */
- if (file_exists(ANSEL_BASE . '/config/horde.local.php')) {
- include ANSEL_BASE . '/config/horde.local.php';
- } else {
- define('HORDE_BASE', ANSEL_BASE . '/..');
- }
-}
+++ /dev/null
-<?php
-/**
- * This file brings in all of the dependencies that every Ansel script will need
- * and sets up objects that all scripts use.
- *
- * Copyright 2003-2010 The Horde Project (http://www.horde.org/)
- *
- * See the enclosed file COPYING for license information (GPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
- *
- * @author Chuck Hagenbuch <chuck@horde.org>
- * @author Michael J. Rubinsky <mrubinsk@horde.org>
- *
- * @package Ansel
- */
-
-// Determine BASE directories.
-require_once dirname(__FILE__) . '/base.load.php';
-
-// Load the Horde Framework core, and set up inclusion paths.
-require_once HORDE_BASE . '/lib/core.php';
-
-// Registry.
-$s_ctrl = 0;
-switch (Horde_Util::nonInputVar('imp_session_control')) {
-case 'readonly':
- $s_ctrl = Horde_Registry::SESSION_READONLY;
- break;
-}
-$registry = Horde_Registry::singleton($s_ctrl);
-
-// Authentication
-try {
- $registry->pushApp('ansel', array('check_perms' => (Horde_Util::nonInputVar('ansel_authentication') != 'none'), 'logintasks' => true));
-} catch (Horde_Exception $e) {
- Horde_Auth::authenticateFailure('ansel', $e);
-}
-$conf = $GLOBALS['conf'];
-define('ANSEL_TEMPLATES', $registry->get('templates'));
-
-// Notification system.
-$GLOBALS['notification'] = Horde_Notification::singleton();
-$GLOBALS['notification']->attach('status');
-
-// Create a cache object if we need it.
-if ($conf['ansel_cache']['usecache']) {
- $GLOBALS['cache'] = Horde_Cache::singleton($conf['cache']['driver'],
- Horde::getDriverConfig('cache', $conf['cache']['driver']));
-}
-
-// Create db, share, and vfs instances.
-$GLOBALS['ansel_db'] = Ansel::getDb();
-if (is_a($GLOBALS['ansel_db'], 'PEAR_Error')) {
- Horde::fatal($GLOBALS['ansel_db'], __FILE__, __LINE__, false);
-}
-$GLOBALS['ansel_storage'] = new Ansel_Storage();
-$GLOBALS['ansel_vfs'] = Ansel::getVFS();
-
-// Get list of available styles for this client.
-$GLOBALS['ansel_styles'] = Ansel::getAvailableStyles();
-if ($logger = Horde::getLogger()) {
- $GLOBALS['ansel_vfs']->setLogger($logger, $GLOBALS['conf']['log']['priority']);
-}
* @author Michael J. Rubinsky <mrubinsk@horde.org>
*/
-require_once dirname(__FILE__) . '/lib/base.php';
+require_once dirname(__FILE__) . '/lib/Application.php';
+Horde_Registry::appInit('ansel');
/* Script includes */
Horde::addScriptFile('http://maps.google.com/maps?file=api&v=2&sensor=false&key=' . $GLOBALS['conf']['api']['googlemaps'], 'ansel', array('external' => true));
'delete' => 3
);
-require_once dirname(__FILE__) . '/lib/base.php';
+require_once dirname(__FILE__) . '/lib/Application.php';
+Horde_Registry::appInit('ansel');
+
require_once 'Horde/Group.php';
$groups = Group::singleton();
* @author Michael Rubinsky <mrubinsk@horde.org>
*/
-require_once dirname(__FILE__) . '/lib/base.php';
+require_once dirname(__FILE__) . '/lib/Application.php';
+Horde_Registry::appInit('ansel');
+
$imageId = Horde_Util::getFormData('image');
$image = &$ansel_storage->getImage($imageId);
if (is_a($image, 'PEAR_Error')) {
* @author Duck <duck@obala.net>
*/
-require_once dirname(__FILE__) . '/lib/base.php';
+require_once dirname(__FILE__) . '/lib/Application.php';
+Horde_Registry::appInit('ansel');
$vars = Horde_Variables::getDefaultVariables();
$gallery = $ansel_storage->getGallery($vars->get('gallery'));
* @package Ansel
*/
-require_once dirname(__FILE__) . '/lib/base.php';
+require_once dirname(__FILE__) . '/lib/Application.php';
+Horde_Registry::appInit('ansel');
$title = _("Do you really want to report this gallery?");
$gallery_id = (int)Horde_Util::getFormData('gallery');
* @package Ansel
*/
-$ansel_session_control = 'readonly';
-require_once dirname(__FILE__) . '/lib/base.php';
+require_once dirname(__FILE__) . '/lib/Application.php';
+Horde_Registry::appInit('ansel', array('session_control' => 'readonly'));
// Get form data
$stream_type = Horde_Util::getFormData('stream_type', 'all');
*/
// Do CLI checks and environment setup first.
-require_once dirname(__FILE__) . '/../../lib/base.load.php';
-require_once HORDE_BASE . '/lib/core.php';
+require_once dirname(__FILE__) . '/../../lib/Application.php';
// Make sure no one runs this from the web.
if (!Horde_Cli::runningFromCLI()) {
}
}
-$ansel_authentication = 'none';
-require_once ANSEL_BASE . '/lib/base.php';
+Horde_Registry::appInit('ansel', array('authentication' => 'none'));
// Login to horde if username & password are set.
if (!empty($username) && !empty($password)) {
*/
// Do CLI checks and environment setup first.
-require_once dirname(__FILE__) . '/../../lib/base.load.php';
-require_once HORDE_BASE . '/lib/core.php';
+require_once dirname(__FILE__) . '/../../lib/Application.php';
// Make sure no one runs this from the web.
if (!Horde_Cli::runningFromCLI()) {
$cli = Horde_Cli::singleton();
// Load Ansel.
-$ansel_authentication = 'none';
-require_once ANSEL_BASE . '/lib/base.php';
+Horde_Registry::appInit('ansel', array('authentication' => 'none'));
// We accept the user name on the command-line.
$ret = Console_Getopt::getopt(Console_Getopt::readPHPArgv(),
*/
// Do CLI checks and environment setup first.
-require_once dirname(__FILE__) . '/../../lib/base.load.php';
-require_once HORDE_BASE . '/lib/core.php';
+require_once dirname(__FILE__) . '/../../lib/Application.php';
// Make sure no one runs this from the web.
if (!Horde_Cli::runningFromCLI()) {
// some variables, etc.
Horde_Cli::init();
-$ansel_authentication = 'none';
-require_once ANSEL_BASE . '/lib/base.php';
+Horde_Registry::appInit('ansel', array('authentication' => 'none'));
// Default arguments.
$move = false;
*/
// Do CLI checks and environment setup first.
-require_once dirname(__FILE__) . '/../../lib/base.load.php';
-require_once HORDE_BASE . '/lib/core.php';
+require_once dirname(__FILE__) . '/../../lib/Application.php';
// Make sure no one runs this from the web.
if (!Horde_Cli::runningFromCLI()) {
$cli = Horde_Cli::singleton();
// Load Ansel.
-$ansel_authentication = 'none';
-require_once ANSEL_BASE . '/lib/base.php';
+Horde_Registry::appInit('ansel', array('authentication' => 'none'));
// We accept the user name on the command-line.
$ret = Console_Getopt::getopt(Console_Getopt::readPHPArgv(), 'hu:p:lc:g:a:d:k',
*/
// Do CLI checks and environment setup first.
-require_once dirname(__FILE__) . '/../../lib/base.load.php';
-require_once HORDE_BASE . '/lib/core.php';
+require_once dirname(__FILE__) . '/../../lib/Application.php';
// Make sure no one runs this from the web.
if (!Horde_CLI::runningFromCLI()) {
Horde_CLI::init();
$cli = Horde_CLI::singleton();
-$ansel_authentication = 'none';
-require_once ANSEL_BASE . '/lib/base.php';
+Horde_Registry::appInit('ansel', array('authentication' => 'none'));
// First update the tables
$alter = array("ALTER TABLE ansel_images ADD COLUMN image_latitude VARCHAR(32) NOT NULL DEFAULT ''",
*/
// Do CLI checks and environment setup first.
-require_once dirname(__FILE__) . '/../../lib/base.load.php';
-require_once HORDE_BASE . '/lib/core.php';
+require_once dirname(__FILE__) . '/../../lib/Application.php';
// Make sure no one runs this from the web.
if (!Horde_Cli::runningFromCLI()) {
Horde_Cli::init();
$cli = Horde_Cli::singleton();
-$ansel_authentication = 'none';
-require_once ANSEL_BASE . '/lib/base.php';
+Horde_Registry::appInit('ansel', array('authentication' => 'none'));
$sql = 'SELECT image_id, image_original_date, image_uploaded_date FROM ansel_images';
$results = $ansel_db->queryAll($sql, null, MDB2_FETCHMODE_ASSOC);
*/
// Do CLI checks and environment setup first.
-require_once dirname(__FILE__) . '/../../base.load.php';
-require_once HORDE_BASE . '/lib/core.php';
+require_once dirname(__FILE__) . '/../../Application.php';
// Make sure no one runs this from the web.
if (!Horde_Cli::runningFromCLI()) {
Horde_Cli::init();
$cli = Horde_Cli::singleton();
-$ansel_authentication = 'none';
-require_once ANSEL_BASE . '/lib/base.php';
+Horde_Registry::appInit('ansel', array('authentication' => 'none'));
$sql = 'SELECT image_id, image_latitude, image_longitude FROM ansel_images_geolocation;';
$results = $ansel_db->queryAll($sql, null, MDB2_FETCHMODE_ASSOC);
*/
// Do CLI checks and environment setup first.
-require_once dirname(__FILE__) . '/lib/base.load.php';
-require_once HORDE_BASE . '/lib/core.php';
+require_once dirname(__FILE__) . '/lib/Application.php';
// Make sure no one runs this from the web.
if (!Horde_Cli::runningFromCLI()) {
Horde_Cli::init();
$cli = Horde_Cli::singleton();
-$ansel_authentication = 'none';
-require_once ANSEL_BASE . '/lib/base.php';
+Horde_Registry::appInit('ansel', array('authentication' => 'none'));
$sql = 'SELECT image_id, image_latitude, image_longitude FROM ansel_images_geolocation;';
$results = $ansel_db->queryAll($sql, null, MDB2_FETCHMODE_ASSOC);
* @author Chuck Hagenbuch <chuck@horde.org>
*/
-require_once dirname(__FILE__) . '/lib/base.php';
+require_once dirname(__FILE__) . '/lib/Application.php';
+Horde_Registry::appInit('ansel');
$viewname = basename(Horde_Util::getFormData('view', 'Gallery'));
$view = 'Ansel_View_' . $viewname;
* @author Chuck Hagenbuch <chuck@horde.org>
*/
-$ansel_authentication = 'none';
-require_once dirname(__FILE__) . '/lib/base.php';
+require_once dirname(__FILE__) . '/lib/Application.php';
+Horde_Registry::appInit('ansel', array('authentication' => 'none'));
$cmd = Horde_Util::getFormData('cmd');
if (empty($cmd)) {