Esempio n. 1
0
 function enqueue_scripts_and_styles()
 {
     $admin_ajax_url = array('ajax_url' => admin_url('admin-ajax.php'));
     if (is_map_page()) {
         // Make sure we are on the right page
         enqueue_js('console', 'console.js');
         enqueue_css('font-awesome', '//maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css');
         enqueue_css('material-icons', '//fonts.googleapis.com/icon?family=Material+Icons');
         // If the user is an administrator
         if (current_user_can('administrator')) {
             // Vendor JavaScript
             enqueue_js('materialize', 'materialize.min.0.97.5.js');
             enqueue_js('tables', 'jquery.dataTables.min.js');
             enqueue_js('typeahead', 'jquery-ui.min.js');
             // Searching and table functionality
             enqueue_js('arcarbon_admin_search', 'admin-search.js');
             localize_js('arcarbon_admin_typeahead', $admin_ajax_url);
             localize_js('arcarbon_admin_retrieve', $admin_ajax_url);
             localize_js('arcarbon_admin_add_column', $admin_ajax_url);
             localize_js('arcarbon_admin_update_headers', $admin_ajax_url);
             // Update variables in the table
             enqueue_js('arcarbon_admin_update', 'admin-update.js');
             localize_js('arcarbon_admin_update', $admin_ajax_url);
             enqueue_css('materialize', 'materialize-custom.css');
             enqueue_css('jquery-ui', 'jquery-ui.min.css');
             enqueue_css('datatables', 'jquery.dataTables.min.css');
             enqueue_css('admin', 'admin.css');
         } else {
             enqueue_js('leaflet', 'leaflet.js');
             enqueue_js('esri-leaflet', 'esri-leaflet.js');
             enqueue_js('leaflet-draw', 'leaflet.draw.js');
             enqueue_js('leaflet-locate', 'L.Control.Locate.min.js');
             enqueue_js('esri-leaflet-geocoder', 'esri-leaflet-geocoder.js');
             enqueue_js('turf', 'turf.min.js');
             enqueue_js('materialize', 'materialize.min.0.97.5.js');
             enqueue_js('arcarbon', 'arcarbon.js');
             localize_js('arcarbon', array('USER_LOGGED_IN' => is_user_logged_in() ? 'true' : 'false', 'USER_GEOJSON' => cleanse_user_geojson(get_user_meta(get_current_user_id(), "arcarbon_map_geojson", true)), 'user_id' => get_current_user_id(), 'ajax_url' => admin_url('admin-ajax.php')));
             enqueue_css('materialize', 'materialize-custom.css');
             enqueue_css('leaflet', 'leaflet.css');
             enqueue_css('leaflet-draw', 'leaflet.draw.css');
             enqueue_css('leaflet-locate', 'L.Control.Locate.min.css');
             enqueue_css('esri-leafet', 'esri-leaflet-geocoder.css');
             enqueue_css('farmer', 'farmer.css');
         }
     }
 }
#
# You should have received a copy of the GNU Affero General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
/*
 * The map
 */
require 'load.php';
enqueue_css('leaflet');
enqueue_css('my-fuel-map');
foreach ($JQUERY_UI_PARTS as $part) {
    enqueue_js("jquery.ui.{$part}");
}
enqueue_js('leaflet');
enqueue_js('leaflet.bouncemarker');
enqueue_js('my-fuel-map.l10n');
enqueue_js('my-fuel-map');
get_header('map');
$last_price_rfc3339 = last_price_date(DateTime::RFC3339);
$last_price_text = last_price_date();
?>
<div id="overworld">
	<div class="card-panel">
		<h1 class="hide-on-small-only"><?php 
echo HTML::a(URL, SITE_NAME, SITE_DESCRIPTION, 'orange-text');
?>
</h1>
		<h5 class="hide-on-med-and-up"><?php 
echo HTML::a(URL, SITE_NAME, SITE_DESCRIPTION, 'orange-text');
?>
</h5>
		<noscript>
function get_header($uid, $args = [])
{
    $args = merge_args_defaults($args, ['theme' => 'default']);
    switch ($args['theme']) {
        case 'default':
            enqueue_css('materialize');
            enqueue_css('materialize.icons');
            enqueue_js('jquery');
            enqueue_js('materialize');
            break;
    }
    header("Content-Type: text/html; charset=utf-8");
    ?>
<!DOCTYPE html>
<html>
<head>
	<title><?php 
    echo SITE_NAME;
    ?>
 - <?php 
    echo get_menu_entry($uid)->name;
    ?>
</title>
	<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
	<meta property="og:title" content="<?php 
    echo get_menu_entry($uid)->name;
    ?>
" />
	<meta property="og:url" content="<?php 
    echo get_menu_entry($uid)->url;
    ?>
" />
	<meta property="og:image" content="<?php 
    echo URL . _ . IMAGES . '/fuel-300px.png';
    ?>
" />
	<meta property="og:type" content="website" />
	<link rel="icon" type="image/jpeg" href="<?php 
    echo URL . _ . IMAGES . '/fuel-64px.png';
    ?>
" /><?php 
    load_module('header');
    ?>

</head>
<!--
 This website is
  _____                                          _             _____                            _
 |  ___|  _ __    ___    ___      __ _   ___    (_)  _ __     |  ___|  _ __    ___    ___    __| |   ___    _ __ ___
 | |_    | '__|  / _ \  / _ \    / _` | / __|   | | | '_ \    | |_    | '__|  / _ \  / _ \  / _` |  / _ \  | '_ ` _ \
 |  _|   | |    |  __/ |  __/   | (_| | \__ \   | | | | | |   |  _|   | |    |  __/ |  __/ | (_| | | (_) | | | | | | |
 |_|     |_|     \___|  \___|    \__,_| |___/   |_| |_| |_|   |_|     |_|     \___|  \___|  \__,_|  \___/  |_| |_| |_|

 Learn more from:

 http://www.gnu.org

-->
<body>
<?php 
}