| 1 |
<?php
|
| 2 |
|
| 3 |
|
| 4 |
/*
|
| 5 |
* Copyright (C) October 2006 Jonathan Hendler
|
| 6 |
*
|
| 7 |
* This program is free software; you can redistribute it and/or
|
| 8 |
* modify it under the terms of the GNU General Public License
|
| 9 |
* as published by the Free Software Foundation; either version 2
|
| 10 |
* of the License, or (at your option) any later version.
|
| 11 |
*
|
| 12 |
* This program is distributed in the hope that it will be useful,
|
| 13 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| 14 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
| 15 |
* GNU General Public License for more details.
|
| 16 |
*
|
| 17 |
* You should have received a copy of the GNU General Public License
|
| 18 |
* along with this program; if not, write to the Free Software
|
| 19 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
| 20 |
*
|
| 21 |
* The author can be contacted at:
|
| 22 |
* - jonathan [at] civicactions (dot) com
|
| 23 |
*
|
| 24 |
* @license http://www.affero.org/oagpl.html
|
| 25 |
* @link http://drupal.org/project/semantic_search
|
| 26 |
*/
|
| 27 |
|
| 28 |
function _semantic_search_set_constants() {
|
| 29 |
$semantic_search_protocol = ($_SERVER['HTTPS']) ? 'https://' : 'http://';
|
| 30 |
|
| 31 |
/**
|
| 32 |
* full url to arrive at the semantic_search home
|
| 33 |
* */
|
| 34 |
define('SEMANTIC_SEARCH_HOME_URL', '' . _BASE_URL . '/' . SEMANTIC_SEARCH_BASE_URL . '/');
|
| 35 |
|
| 36 |
//Behagior settings
|
| 37 |
//get each of these $tid's parents although this creates reduntant data
|
| 38 |
// this is done in place of a RDF store's lack of class inference
|
| 39 |
define('SEMANTIC_SEARCH_TAXONOMY_IMPORT_INFERENCE', true);
|
| 40 |
|
| 41 |
//URL constants
|
| 42 |
define('SEMANTIC_SEARCH_ADMIN_HOME', $semantic_search_protocol . $_SERVER['HTTP_HOST'] . '/admin/semantic_search');
|
| 43 |
define('SEMANTIC_SEARCH_ADMIN_DATA_HOME', SEMANTIC_SEARCH_ADMIN_HOME . '/data');
|
| 44 |
define('SEMANTIC_SEARCH_ADMIN_PROPERTIES_HOME', SEMANTIC_SEARCH_ADMIN_HOME . '/properties');
|
| 45 |
define('SEMANTIC_SEARCH_ADMIN_CATEGORIES_HOME', SEMANTIC_SEARCH_ADMIN_HOME . '/categories');
|
| 46 |
define('SEMANTIC_SEARCH_ADMIN_EXPORT_HOME', SEMANTIC_SEARCH_ADMIN_HOME . '/export');
|
| 47 |
define('SEMANTIC_SEARCH_ADMIN_IMPORT_HOME', SEMANTIC_SEARCH_ADMIN_HOME . '/import');
|
| 48 |
|
| 49 |
//RPC constants
|
| 50 |
define('SEMANTIC_SEARCH_JSRPC_PATH', $semantic_search_protocol . $_SERVER['HTTP_HOST'] . '/' . SEMANTIC_SEARCH_JSRPC_PATH_PREFIX);
|
| 51 |
define('SEMANTIC_SEARCH_JSRPC_ADMIN_PATH', $semantic_search_protocol . $_SERVER['HTTP_HOST'] . '/' . SEMANTIC_SEARCH_JSRPC_ADMIN_PATH_PREFIX); // url(SEMANTIC_SEARCH_JSRPC_ADMIN_PATH_PREFIX,null,null,true));
|
| 52 |
|
| 53 |
//TODO check that each signal is unique
|
| 54 |
}
|
| 55 |
|
| 56 |
//MESSAGE PASSING SIGNALS
|
| 57 |
define('SEMANTIC_SEARCH_CREATE_OBJECT_SIGNAL', 1890);
|
| 58 |
define('SEMANTIC_SEARCH_CREATE_OBJECT_SIGNAL_STEP_ONE', 929);
|
| 59 |
define('SEMANTIC_SEARCH_CREATE_PROPERTY_SIGNAL', 1999);
|
| 60 |
define('SEMANTIC_SEARCH_EDIT_PROPERTY_SIGNAL', 19987);
|
| 61 |
define('SEMANTIC_SEARCH_DELETE_PROPERTY_SIGNAL', 23897);
|
| 62 |
define('SEMANTIC_SEARCH_EDIT_TWO_PROPERTY_SIGNAL', 22897);
|
| 63 |
define('SEMANTIC_SEARCH_CREATE_CATEGORY_SIGNAL', 10983);
|
| 64 |
define('SEMANTIC_SEARCH_EDIT_CATEGORY_SIGNAL', 98653);
|
| 65 |
|
| 66 |
define('SEMANTIC_SEARCH_EXPORT_DOWNLOAD_SIGNAL', 13897791);
|
| 67 |
define('SEMANTIC_SEARCH_EXPORT_PRINT_SIGNAL', 2378927);
|
| 68 |
|
| 69 |
// import choices
|
| 70 |
define('SEMANTIC_SEARCH_IMPORT_SIGNAL_SYNC_DUP_OLD', 549789);
|
| 71 |
define('SEMANTIC_SEARCH_IMPORT_SIGNAL_SYNC_NO_DUP_OLD', 243423);
|
| 72 |
define('SEMANTIC_SEARCH_IMPORT_SIGNAL_SYNC_NO_DUP_NEW', 2847526845);
|
| 73 |
define('SEMANTIC_SEARCH_IMPORT_SIGNAL_NO_OLD', 2873659284);
|
| 74 |
|
| 75 |
// notify that the signal is switched
|
| 76 |
define('SEMANTIC_SEARCH_CRUD_REQUEST_SIGNAL', 'ncrs');
|
| 77 |
|
| 78 |
define('SEMANTIC_SEARCH_PAGINATION_SIGNAL', 'pgn');
|
| 79 |
|
| 80 |
/**
|
| 81 |
* prefixes to convert Drupal IDs to SEMANTIC_SEARCH ids
|
| 82 |
*/
|
| 83 |
define('SEMANTIC_SEARCH_TID_PREFIX', 'tid');
|
| 84 |
define('SEMANTIC_SEARCH_VID_PREFIX', 'vid');
|
| 85 |
|
| 86 |
define('SEMANTIC_SEARCH_JSRPC_PATH_PREFIX', 'semantic_search_ajax/search');
|
| 87 |
define('SEMANTIC_SEARCH_JSRPC_ADMIN_PATH_PREFIX', 'semantic_search_ajax/admin');
|
| 88 |
|
| 89 |
//default admin home
|
| 90 |
define('SEMANTIC_SEARCH_ADMIN_HOME', 'admin/semantic_search');
|
| 91 |
|
| 92 |
/**
|
| 93 |
* DRUPAL VERSION
|
| 94 |
* */
|
| 95 |
define('SEMANTIC_SEARCH_IS_DRUPAL_5', true);
|
| 96 |
|
| 97 |
/**
|
| 98 |
* The location of the semantic_search include files
|
| 99 |
* */
|
| 100 |
define('SEMANTIC_SEARCH_INCLUDE_LOCATION', SEMANTIC_SEARCH_LOCATION . 'includes/');
|
| 101 |
|
| 102 |
/**
|
| 103 |
* The location of the CSS file that will be read through php
|
| 104 |
* This is done to account for various CMS's which may not provide
|
| 105 |
* a conistent mechanism to give a URL location for the CSS.
|
| 106 |
* */
|
| 107 |
define('CSS_LOCATION', SEMANTIC_SEARCH_LOCATION . 'css/');
|