GITHUB and instructions findtoilet.dkMaybe something has been changed since GITHUB were made in 2010 by Morten Wulff Maybe https://circleci.com/vcs-authorize/ is something we can use in the future to save my code for other people to take over Drupal - Android - iOS after me. Thorvald foreslog GITHUB |
Technic, instructions and files At the moment it's Drupal 6. Modules Gmap and Location are used. Also custom module called toilet_map.modul. And mobile_feed.module which is especially for getting data from online map and FindToilet app updated at once for Android app programmed by Troels Thylstrup and iOS programmed by Thomas Thisgaard Steffensen. After Troels and Thomas stopped a few years ago Thorvald Aagaard is helping me. Android and iPhone apps. But what make this so great and special are these javascript-files FindToiletMap.js and init_v3.js in Google Maps API v3 which was made by Martin Pearman. Later Ying Ho and vertikal.dk also helped a little with Drupal. API-file http://beta.findtoilet.dk/api/v1/toilets where toiletdata are used in apps from Drupal. There is a LOT more info in this GoogleDoc for the interested. :-) |
Architecture.md The findtoilet.dk site is made up of two major components: A Drupal site for handling data entry and a custom map for displaying the information. This page only covers the configuration of the Drupal site. # Data collection The site uses a custom content type to collect data on public toilets. Users can get access to create and manage data for a specific geographic region. ## The basics The "toilet" content type uses basic CCK fields to capture data such as toilet type, available facilities, etc. Custom content types are used to make it possible to add images and information on hours of operation. A single taxonomy "Kommune" (municipality) is used to group toilets. When used in conjunction with the Forced term module, this makes it possible to ensure that all toilets created by a specific municipality are tagged with the correct taxonomy term. The taxonomy is used to provide simple filtering on the map display. Go to Administer > Content management > Content types to take a closer look at how the individual fields have been configured. ## Location All location information is handled by the Location module. It provides a custom CCK field type which makes it possible to either enter an address or specific coordinates when creating a new toilet node. If the user enters a latitude and longitude, those values are stored on the node. If the user only enters an address, the module will use the Google geocoder API to figure out the coordinates for the address. Go to Administer > Site configuration > Location > Geocoding options to modify the accuracy settings for the geocoder. In addition to the Location module, the GMap module is used to provide a map view when adding or editing a toilet node. This lets the user choose a location by clicking directly on the map. This can behavior can be modified by changing the general settings for the Location module at Administer > Site configuration > Location. The size, default zoom level, and other settings for the map can be modified at Administer > Site configuration > GMap. # Data display The data entered by the users can be displayed on a map (the main interface), as custom XML feeds, or in sortable table view in the backend. ## Map The data for the custom map widget is provided by the following views: * **toilet_node** provides information on a specific toilet When the user changes the filter settings in the main map view, the code in FindToiletMap.js calls one of the following callbacks to retrieve information for display on the map: * **/xml/node/[nid]** For a full description of the various options, refer to the feeds page on the demo site: http://beta.findtoilet.dk/node/72 The *toilet_proximity* view uses some of the handlers provided by the Location module to make proximity searches possible. The following handlers are used: * **Location proximity argument** The argument handler accepts input on the form [latitude],[longitude]_[distance]. The distance part is optional. It can be configured to use either kilometers or miles as the unit and to use either circular or rectangular proximity. This is the handler that receives coordinates from the map widget. ## Feeds In addition to the feeds used by the map widget, the view *toilet_all* makes it possible to get information on all toilets in the database at once. All the basic views are configured with two displays: One for creating output in XML format (using the "Views bonus" module) and one for creating output in RSS format. The view *toilet_feeds* provides an overview of all feeds related to a specific region. ## Administration To make administration easier for the users providing data for the site, the view *toilet_overview* provides a table of all content owned by the current user (i.e. the account used by Københavns Kommune will only be able to see toilets in Copenhagen in the table). # Rules All views except *toilet_overview* are cached to improve performance. To make sure that the cache doesn't contain stale data, the Rules and Rules actions modules are used to clear the views cache when content is added or edited. You can edit the rules at Administer > Rules > Triggered rules. Currently only the caches for the views used by the map widget are cleared. In addition to clearing cache, the custom rules are used to modify the node title and populate the "field_nid" field. # Features To make it possible to manage the code using a version control system, all views and the most important settings have been exported to code using the Features module. Most of the files in the "toilet_map" module have been generated by Features. They contain exported views, user permissions, content types, etc. They are not meant to be modified manually! Whenever you add new content types, views or settings to the site, you can go to Administer > Site building > Features and recreate the Toilet Map feature. When you recreate a feature you can select which components you want to add to or remove from the feature. When you are satisfied with the settings, you simply bump the version number and download the new version of the feature. The Features module is mainly for use by developers to make it easier to handle configuration changes and other administrative tasks. Further information is available in the Features handbook and the draft KIT Feature Specification: http://drupal.org/node/580026 |
Getting started.md This document details how to set up a local or hosted copy of the findtoilet.dk site. # Requirements Find Toilet requires the following software to run: * Apache You can either set up an account with a hosting provider or run the server software locally by installing MAMP, WampServer, or a similar package. If you don't want to download Pressflow and all the required modules by hand, you must have a working installation of Drush. You can grab the latest versions from Drupal.org: http://drupal.org/project/drush This guide doesn't cover the installation and configuration of the required software. # Install Drupal core and required modules Before you can start installing Drupal, you must grab the latest copy of the findtoilet project from GitHub: git clone git://github.com/wulff/findtoilet.git When you have cloned the repository, you can download all the necessary software either manually or using drush. ## Manually First, you'll need to install Drupal core. In this case we'll be grabbing the latest version of Pressflow 6 from the following URL: http://pressflow.org/ When you have downloaded Pressflow, you must extract it somewhere in the webserver's document root. Follow the installation instructions in the Pressflow package to configure the settings.php file and prepare for installation. Next, you must install all necessary contrib modules. Use the list of modules in the findtoilet.make file as a guide to what you need to download from drupal.org. Get the latest Drupal 6 versions of all modules and install them in the sites/all/modules/contrib folder. ## Using drush make If drush is available on your system, you can run the following command to install all the necessary software: drush make findtoilet.make findtoilet This will create a new Drupal site in a folder named "findtoilet". ## Adding custom code Before you can start the installation process, you must add the custom code from the repository to the site. Three folders have to be added to the Drupal site: 1. Copy the "features" folder to the "sites/all/modules" folder in the Drupal site ## Run the installation script Now you are ready to run the installation script. Follow the installation instructions provided in the Pressflow package, but select the "Findtoilet.dk" profile. This will enable all required modules during the installation process. When the installer finishes you must go to Administer > Site building > Features and enable the "Toilet Map" feature. This will set up the content types, views, etc. needed to display the main map and provide the various data feeds. Finally, you must add some data to the municipality taxonomy and set up a Google Maps key for the site. Go to Administer > Site configuration > GMap to enter the API key provided by Google. |
Modules.md The site uses the following third party modules from drupal.org: * **Administration menu** displays a nice menu at the top of the page |