Example #1
0
function show_georef_map($lon, $lat, $layer)
{
    $lang = sfContext::getInstance()->getUser()->getCulture();
    if (empty($layer)) {
        $layer = sfContext::getInstance()->getModuleName();
    }
    $html = '<div class="section" id="georef_container" style="display:none;">';
    $html .= '<div id="map" style="height:400px;width:100%">';
    $html .= '<div id="mapLoading">' . image_tag(sfConfig::get('app_static_url') . '/static/images/indicator.gif');
    $html .= __('Map is loading...') . '</div>';
    $html .= '</div>';
    $html .= '</div>';
    $async_map = sfConfig::get('app_async_map', false) && !sfContext::getInstance()->getRequest()->getParameter('debug', false);
    $js = "\n        C2C.map_init = function() {\n            Ext.get('georef_container').show();\n            var lon = Ext.getDom('lon') && Ext.getDom('lon').value || 0;\n            var lat = Ext.getDom('lat') && Ext.getDom('lat').value || 0;\n            c2corg.Map({\n                div: 'map',\n                lang: '{$lang}',\n                loading: 'mapLoading',\n                layers: ['{$layer}'],\n                connected: true,\n                georef: {\n                    initialState: {\n                        lon: lon,\n                        lat: lat,\n                        zoom: 15\n                    },\n                    callback: function(lonlat) {\n                        if (lonlat) {\n                            Ext.getDom('lon').value = Math.round(lonlat.lon*1E6)/1E6;\n                            Ext.getDom('lat').value = Math.round(lonlat.lat*1E6)/1E6;\n                        } else {\n                            Ext.getDom('lon').value = '';\n                            Ext.getDom('lat').value = '';\n                        }\n                        c2corg.coords.update_degminsec('lon');\n                        c2corg.coords.update_degminsec('lat');\n                    }\n                }\n            });\n        };";
    // asynchronous map loading
    if ($async_map) {
        use_helper('MyMinify');
        $c2c_script_url = minify_get_combined_files_url(array('/static/js/carto/build/carto.min.js', "/static/js/carto/build/lang-{$lang}.min.js", '/static/js/popup.js', '/static/js/carto/embedded.js'), (bool) sfConfig::get('app_minify_debug'));
        $js .= "C2C.async_map_init = function() {\n          \$.ajax({\n            url: '{$c2c_script_url}',\n            dataType: 'script',\n            cache: true\n          }).done(function() {\n            C2C.map_init();\n            Ext.EventManager.fireDocReady();\n          });\n        };";
    }
    // if coordinates not set, open automatically open the map
    if (!$lon && !$lat && !in_array($layer, array('sites', 'users', 'images', 'portals'))) {
        if ($async_map) {
            $js .= "C2C.async_map_init()";
        } else {
            $js .= "\$(window).load(C2C.map_init)";
        }
    }
    $html .= javascript_queue($js);
    return $html;
}
function geocode_auto_complete($name, $service)
{
    $mobile_version = c2cTools::mobileVersion();
    $service_class = $service === 'nominatim' ? ' nominatim' : ' geonames';
    $out = input_tag($name, '', array('class' => 'geocode_auto_complete' . $service_class, 'placeholder' => __('enter place name'), 'data-noresult' => __('no results')));
    if ($mobile_version) {
        $out .= content_tag('span', '<br />' . __('autocomplete_help'), array('class' => 'mobile_auto_complete_background'));
        $out .= content_tag('span', 'X', array('class' => 'mobile_auto_complete_escape'));
    }
    // following script will automatically intanciate geocode autocompleter
    $out .= javascript_queue('$.ajax({
      url: "' . minify_get_combined_files_url('/static/js/geocode_autocompleter.js') . '",
      dataType: "script",
      cache: true});');
    return $out;
}
Example #3
0
function insert_popup_js()
{
    return '<script type="text/javascript" src="' . minify_get_combined_files_url(array('/static/js/jquery.min.js', '/static/js/popup.js')) . '"></script>';
}
<?php

if (in_array($module, array('areas', 'articles', 'books', 'huts', 'outings', 'parkings', 'routes', 'sites', 'summits'))) {
    ?>
<br />
<div id="google_search">
<?php 
    use_helper('Form', 'JavascriptQueue', 'MyMinify');
    echo image_tag('//www.google.com/uds/css/small-logo.png');
    echo __('Results from google for %1%', array('%1%' => $query_string));
    ?>
<div id="google_search_results"></div>
</div>
<?php 
    $google_i18n = array('first page', 'previous page', 'next page', 'Document title', 'Extract', 'No result');
    $google_i18n = array_map('__', $google_i18n);
    $cse = sfConfig::get('app_google_cse');
    $script = minify_get_combined_files_url('/static/js/google_search.js');
    echo javascript_queue("\$.extend(C2C.GoogleSearch = C2C.GoogleSearch || {}, {\n  i18n: ['" . implode("', '", $google_i18n) . "']," . "\n  base_url: 'https://www.googleapis.com/customsearch/v1?key=" . sfConfig::get('app_google_api_key') . '&cx=' . $cse[$module] . "&callback=C2C.GoogleSearch.handleResponse',\n  q: '" . urlencode($query_string) . "'});\n\$.ajax({\n    url: '{$script}',\n    dataType: 'script',\n    cache: true })\n.done(function() {\n  C2C.GoogleSearch.search();\n});");
}
Example #5
0
<div id="on_the_web" class="latest">
<?php 
use_helper('SmartDate', 'JavascriptQueue', 'MyMinify');
$response = sfContext::getInstance()->getResponse();
if (!isset($default_open)) {
    $default_open = true;
}
$tr_module = __('meta outings');
include_partial('documents/home_section_title', array('module' => 'on_the_web', 'custom_section_id' => 'on_the_web', 'custom_title' => link_to(__('Latest outings from MetaEngine'), sfConfig::get('app_meta_engine_base_url')), 'custom_rss' => link_to('', sfConfig::get('app_meta_engine_base_url') . 'outings', array('class' => 'home_title_right picto_rss', 'title' => __('Subscribe to latest outings from MetaEngine'))), 'custom_title_icon' => 'outings'));
?>
<div id="on_the_web_section_container" class="home_container_text">
<?php 
$cookie_position = array_search('on_the_web', sfConfig::get('app_personalization_cookie_fold_positions'));
// script that allow ie8 and ie9 to make the CORS request
$script_url = minify_get_combined_files_url('/static/js/jquery.xdomainrequest.min.js', (bool) sfConfig::get('app_minify_debug'));
echo javascript_queue('
var section_list = $("#on_the_web_section_list");

function load2() {
  $.get("' . $sf_data->getRaw('feed_url') . '").done(function(data) {
    var $xml = $(data), date, count = 0;

    $xml.find("item").each(function() {
      var $this = $(this), item = {}, els;
      $.each(["title", "link", "description", "pubDate", "author"], function(i, v) {
        item[v] = $this.find(v).text();
      });

      if (!count) section_list.html("");
      count++;
      if (count > 10) return;
function minify_get_stylesheets($position_array = array('first', '', 'last'), $debug = false, $my_already_seen = array())
{
    $response = sfContext::getInstance()->getResponse();
    $response->setParameter('stylesheets_included', true, 'symfony/view/asset');
    $app_static_url = sfConfig::get('app_static_url');
    $already_seen = $my_already_seen;
    $minify_files = array();
    foreach ($position_array as $position) {
        foreach ($response->getStylesheets($position) as $files => $options) {
            if (!is_array($files)) {
                $files = array($files);
            }
            $options = array_merge(array('rel' => 'stylesheet', 'type' => 'text/css', 'media' => 'all'), $options);
            foreach ($files as $file) {
                if (isset($already_seen[$file])) {
                    continue;
                }
                $already_seen[$file] = 1;
                $absolute = false;
                if (isset($options['absolute'])) {
                    unset($options['absolute']);
                    $absolute = true;
                }
                if (!isset($options['raw_name'])) {
                    $file = stylesheet_path($file, $absolute);
                } else {
                    unset($options['raw_name']);
                }
                $type = serialize($options);
                if (isset($minify_files[$type])) {
                    array_push($minify_files[$type], $file);
                } else {
                    $minify_files[$type] = array($file);
                }
            }
        }
    }
    $html = '';
    foreach ($minify_files as $options => $files) {
        $options = unserialize($options);
        $options['href'] = minify_get_combined_files_url($files, $debug);
        $html .= tag('link', $options) . "\n";
    }
    return $html;
}
Example #7
0
     $id_list_associated_docs = "list_associated_docs";
     if ($section_list['docs']) {
         echo '<p class="default_text" id="' . $id_no_associated_docs . '">' . __('No associated document found') . '</p>';
     }
     if ($show_link_tool) {
         echo '<ul id="' . $id_list_associated_docs . '"><li style="display:none"></li></ul>', '<div id="association_tool" class="plus">', '<p>', __('You can associate this book with existing document using the following tool:'), '</p>';
         $modules_list = array('summits', 'sites', 'routes', 'huts', 'articles');
         echo c2c_form_add_multi_module('books', $id, $modules_list, 13, array('field_prefix' => $id_list_associated_docs, 'hide' => false, 'removed_id' => $id_no_associated_docs));
         echo '</div>';
     }
     echo end_section_tag();
 }
 include_partial('documents/images', array('images' => $associated_images, 'document_id' => $id, 'dissociation' => 'moderator', 'is_protected' => $document->get('is_protected')));
 if ($document['isbn']) {
     // TODO checks on ISBN value (multiple isbns?)
     $script = minify_get_combined_files_url('/static/js/books.js');
     $isbn_or_issn = 'ISBN:';
     foreach ($document['book_types'] as $type) {
         if ($type == '18') {
             $isbn_or_issn = 'ISSN:';
             break;
         }
     }
     echo start_section_tag('Buy the book', 'buy_books', 'opened', false, false, true);
     echo javascript_queue("\$.extend(C2C.GoogleBooks = C2C.GoogleBooks || {}, {\n          preview_logo_src: 'http://books.google.com/intl/{$lang}/googlebooks/images/gbs_preview_button1.png'," . "\n          translation: '" . __('Google Book Search') . "'," . "\n          book_isbn: '" . $isbn_or_issn . $document['isbn'] . "'});\n        \$.ajax({\n          url: '{$script}',\n          dataType: 'script',\n          cache: true })\n        .done(function() {\n          C2C.GoogleBooks.search();\n        });");
     echo end_section_tag();
 }
 if ($mobile_version) {
     include_partial('documents/mobile_comments', array('id' => $id, 'lang' => $lang, 'nb_comments' => $nb_comments));
 }
 include_partial('documents/annex_docs', array('related_portals' => $related_portals));
Example #8
0
function show_map($container_div, $document, $lang, $layers_list = null, $height = null, $center = null, $has_geom = null, $connected = false)
{
    // define div identifiers
    $map_container_div_id = $container_div . '_section_container';
    $app_static_url = sfConfig::get('app_static_url');
    $objects_list = array();
    if ($has_geom or is_null($has_geom)) {
        if ($document->get('geom_wkt') != null) {
            // FIXME
            // When using polygons in openlayers, we have a bug preventing to pan the map when mouse cursor is above
            // a polygon object
            // As a workaround, we have replaced polygons by linestrings in javascript code. This was not working well with
            // multipolygons.
            // Eventually we directly modify this helper to replace MULTIPOLYGON by MULTILINESTRINGS
            $geom = $document->get('geom_wkt');
            if (substr($geom, 0, 7) == 'POLYGON') {
                $geom = str_replace('POLYGON', 'MULTILINESTRING', $geom);
            }
            if (substr($geom, 0, 12) == 'MULTIPOLYGON') {
                $geom = str_replace(array('MULTIPOLYGON', '((', '))'), array('MULTILINESTRING', '(', ')'), $geom);
            }
            $objects_list[] = _convertObjectToGeoJSON($document, $geom);
        }
    }
    // we display possible associated docs
    foreach (array('summits', 'parkings', 'huts') as $type) {
        if (!isset($document->{$type})) {
            continue;
        }
        _addAssociatedDocsWithGeom($document->{$type}, $objects_list);
    }
    if (is_null($layers_list)) {
        $layers_list = '[]';
    } else {
        if (!is_array($layers_list)) {
            $layers_list = str_replace(' ', '', $layers_list);
            $layers_list = explode(',', $layers_list);
        }
        $layers_list = "['" . implode("','", $layers_list) . "']";
    }
    if (is_null($height)) {
        $height = 400;
    } else {
        $height = min(800, max(400, $height));
    }
    if (is_null($center)) {
        $init_center = '[]';
    } else {
        if (!is_array($center)) {
            $init_center = str_replace(' ', '', $center);
        } else {
            $init_center = implode(', ', $center);
        }
        $init_center = '[' . $init_center . ']';
    }
    $html = '<section class="section" id="' . $map_container_div_id . '"><div class="article_contenu">';
    $html .= '<div id="map" style="height:' . $height . 'px;width:auto">';
    $html .= '<div id="mapLoading" style="position:absolute">' . image_tag($app_static_url . '/static/images/indicator.gif');
    $html .= __('Map is loading...') . '</div>';
    $html .= '</div>';
    $html .= '</div></section>';
    $async_map = sfConfig::get('app_async_map', false) && !sfContext::getInstance()->getRequest()->getParameter('debug', false);
    $connected = $connected ? 'true' : 'false';
    $js = "\n      C2C.map_init = function() {\n        c2corg.Map({\n          div: 'map',\n          lang: '{$lang}',\n          loading: 'mapLoading',\n          layers: {$layers_list},\n          center: {$init_center},\n          features: " . _makeFeatureCollection($objects_list) . ",\n          connected: {$connected}\n        });\n       };";
    // asynchronous map loading
    if ($async_map) {
        use_helper('MyMinify');
        $c2c_script_url = minify_get_combined_files_url(array('/static/js/carto/build/carto.min.js', "/static/js/carto/build/lang-{$lang}.min.js", '/static/js/popup.js', '/static/js/carto/embedded.js'), (bool) sfConfig::get('app_minify_debug'));
        // Ext.onReady doesn't seem to fire if extjs is loaded after the dom has been loaded
        // (but works in chrome???)
        // so we manually trigger it to be sure
        $js .= "\n        C2C.async_map_init = function() {\n          \$.ajax({\n            url: '{$c2c_script_url}',\n            dataType: 'script',\n            cache: true\n          }).done(function() {\n            C2C.map_init();\n            Ext.EventManager.fireDocReady();\n          });\n        };";
    }
    $html .= javascript_queue($js);
    return $html;
}
Example #9
0
<input id="pickfiles" class="plupload-pickfiles" type="button" value="<?php 
echo __('Add images');
?>
" disabled="disabled" />
<input class="plupload-cancel" type="button" value="<?php 
echo __('cancel');
?>
" />
<input class="plupload-submit" type="submit" value="<?php 
echo __('save');
?>
" disabled="disabled" />
<div class="tooltip top" style="display:none">
  <div class="tooltip-inner"><?php 
echo __('plupload invalid image titles');
?>
</div>
  <div class="tooltip-arrow"></div>
</div>
</div>
<?php 
$jsfiles = array('/static/js/mixitup.js', '/static/js/plupload.full.min.js', '/static/js/plupload.wrapper.js');
if (!c2cTools::mobileVersion()) {
    $jsfiles[] = '/static/js/plupload.dropdown.js';
}
$plupload_js = minify_get_combined_files_url($jsfiles);
$backup_url = url_for("@image_jsupload?mod={$mod}&document_id={$document_id}?noplupload=true");
echo javascript_queue("var height = \$(window).height() - \$('.modal-header').outerHeight(true) - \$('.plupload-tips').outerHeight(true)" . "- \$('#plupload-container').outerHeight(true) - \$('.modal-footer').outerHeight(true)" . "- parseInt(\$('.modal-body').css('paddingBottom'), 10)*2 - 30;" . "\$('#images_validate_form').height(height);" . "\$.ajax({ url: '{$plupload_js}', dataType: 'script', cache: true })" . ".done(function() { C2C.PlUploadWrapper('/images/addpltempimage/mod/{$mod}/document_id/{$document_id}', '{$backup_url}', {" . "badselect: '" . __('plupload bad selection') . "', extensions: '" . __('plupload extension') . "', unknownerror: '" . __('plupload unknown') . "'," . "sending: '" . __('plupload sending') . "', waiting: '" . __('plupload waiting') . "', serverop: '" . __('plupload serverop') . "'," . "cancel: '" . __('cancel') . "', drop: '" . __('plupload drop') . "'" . "});" . "});");
?>
</form>
    <ol id="languages-order">
        <?php 
foreach ($sf_user->getPreferedLanguageList() as $language_code) {
    ?>
          <li id="<?php 
    echo "lang_" . $language_code;
    ?>
"><?php 
    echo format_language_c2c($language_code);
    ?>
</li>
        <?php 
}
?>
    </ol>
<?php 
echo end_fieldset_tag();
echo __('Reorder these languages according to your preferences, using drag-and-drop');
// html5sortable is fine for desktop version, but it has no supprot for touch. It is very small and
// follows the same api as jquery sortable
// on the other hand, slip.js has touch support, but is a bit bigger
// We don't show js feedback on mobile version (would be janky)
if (c2cTools::mobileVersion()) {
    echo javascript_queue("\$.ajax({\n  url: '" . minify_get_combined_files_url('/static/js/slip.js') . "',\n  dataType: 'script',\n  cache: true })\n.done(function() {\n  var ol = document.getElementById('languages-order');\n  ol.addEventListener('slip:beforeswipe', function(e) {\n    e.preventDefault();\n  }, false);\n  ol.addEventListener('slip:beforewait', function(e) {\n    e.preventDefault();\n  }, false);\n  ol.addEventListener('slip:reorder', function(e) {\n    e.target.parentNode.insertBefore(e.target, e.detail.insertBefore);\n    \$.post('" . url_for('users/sortPreferedLanguages') . "',\n                \$('#languages-order li').map(function() { return 'order[]=' + this.id.match(/^lang_(.*)\$/)[1]; }).get().join('&'));\n    return false;\n  }, false);\n  new Slip(ol);\n});");
} else {
    echo javascript_queue("\$.ajax({\n  url: '" . minify_get_combined_files_url('/static/js/jquery.sortable.js') . "',\n  dataType: 'script',\n  cache: true })\n.done(function() {\n  \$('#languages-order').sortable({forcePlaceholderSize: true}).on('sortupdate', function() {\n    \$('#indicator').show();\n    \$.post('" . url_for('users/sortPreferedLanguages') . "',\n                \$('#languages-order li').map(function() { return 'order[]=' + this.id.match(/^lang_(.*)\$/)[1]; }).get().join('&'))\n      .always(function() { \$('#indicator').hide(); })\n      .done(function(data) { C2C.showSuccess(data); });\n  });\n});");
}
?>
</div>
<!-- end div customize -->
Example #11
0
<?php

use_helper('MyMinify');
$static_base_url = sfConfig::get('app_static_url');
?>
<!doctype html>
<html lang="<?php 
echo __('meta_language');
?>
">
<head>
    <?php 
echo include_http_metas();
?>
    <link rel="stylesheet" type="text/css" href="<?php 
echo minify_get_combined_files_url(array('/static/css/default.css', '/static/css/popup.css'));
?>
" />
    <!-- FIXME this is hacky but we don't want to have a min width of 1000px for our popup when embbedded in 3rd party website -->
    <style>
      html, body { min-width: 200px; }
    </style>
    <title><?php 
echo __('Mini card Camptocamp.org');
?>
</title>
</head>
<body>
<div class="popup_content external">
    <?php 
echo $sf_data->getRaw('sf_content');
Example #12
0
<?php

echo '(' . f_link_to($UnreadMsg, 'message_list.php') . ')';
if ($UnreadMsg && !c2cTools::mobileVersion()) {
    use_helper('JavascriptQueue');
    echo javascript_queue("\$.ajax({ url: '" . minify_get_combined_files_url('/static/js/tinycon.min.js') . "', dataType: 'script', cache: true })\n      .done(function() { Tinycon.setBubble({$UnreadMsg}); });");
}
  <form class="xaxis-dimension">
    <span class="xaxis-label"><?php 
echo __('x axis:');
?>
</span>
    <label><input type="radio" name="profile_mode" value="distance" checked /> <?php 
echo __('Distance');
?>
</label>
    <label><input type="radio" name="profile_mode" value="time" /> <?php 
echo __('Time');
?>
</label>
  </form>
</div>
<div id="elevation_profile">
</div>
<?php 
echo end_section_tag();
// note: d3js uses functions unsupported by ie<=8 but
// feature detecting svg support should be enough
$script_url = minify_get_combined_files_url(array('/static/js/d3.min.js', '/static/js/elevation_profile.js'), (bool) sfConfig::get('app_minify_debug'));
// notes:
// - first test is to test for support of inline svg
// - we also test if css animations are supported; else replace the spinner
//   by an animated gif. We d'ont test for css transforms support (also needed)
//   since every browser supporting animations supports transforms
// - c2c_load_elevation_profile is called once the section is opened, and
//   ensures the js is only loaded once
$js = "var div = document.createElement('div');\ndiv.innerHTML = '<svg/>';\nvar svg_supported = (div.firstChild && div.firstChild.namespaceURI) == 'http://www.w3.org/2000/svg';\nif (!svg_supported) {\n  \$('#elevation_profile_container_tbg').hide();\n  \$('#elevation_profile_nav').hide();\n} else {\n  C2C.elevation_profile_data = {\n    track: '" . url_for("@export_gpx?module=outings&id={$id}&lang=" . $sf_user->getCulture()) . "',\n    i18n: {\n      yLegend: '" . __('Elevation (m)') . "',\n      x1Legend: '" . __('Distance (km)') . "',\n      x2Legend: '" . __('Duration (hrs)') . "',\n      elevation: '" . __('Elevation') . "',\n      distance: '" . __('Distance') . "',\n      time: '" . __('Time') . "',\n      duration: '" . __('Duration') . "',\n      meters: '" . __('meters') . "',\n      kilometers: '" . __('kilometers') . "'\n    }\n  };\n  var animation = false;\n  var props = ['animationName', 'WebkitAnimationName', 'MozAnimationName'];\n  var elt = \$('.ui-spinner .fill')[0];\n  for (var i in props) {\n    var prop = props[i];\n    if (elt.style[prop] !== undefined) {\n      animation = true;\n      break;\n    }\n  }\n  if (!animation) {\n    elt = \$('.elevation_profile_loading')\n      .html('" . image_tag('/static/images/indicator.gif') . "')\n      .removeClass('ui-spinner');\n  }\n  \$('#elevation_profile_container').one('click', function() {\n    \$.ajax({\n      url: '{$script_url}',\n      dataType: 'script',\n      cache: true\n    });\n  });\n}";
echo javascript_queue($js);
Example #14
0
//echo form_tag('@user_edit');
echo c2c_form_remote_tag('@signUp');
echo tips_tag('After subscription you will receive an email with a generated password, to confirm, login within %1% days', array('%1%' => sfConfig::get('app_pending_users_lifetime')));
echo group_tag('Username:'******'login_name', 'input_tag', $sf_params->get('login_name'), array('autofocus' => 'autofocus', 'class' => 'long_input'));
echo group_tag('Email:', 'email', 'input_tag', $sf_params->get('email'), array('class' => 'long_input', 'type' => 'email'));
echo content_tag('div', __('Did you mean %1%?', array('%1%' => '<a class="suggested-email"></a>')), array('class' => 'email-suggestion', 'style' => 'display:none'));
echo group_tag('Copy following string:', 'captcha', 'input_tag', null, array('class' => 'long_input'));
?>
    <img src="<?php 
echo url_for('@sf_captcha');
?>
" alt="captcha" title="<?php 
echo __('Copy following string:');
?>
" />
    <p class="tips"><?php 
echo __('captcha test is case-insensitive');
?>
</p>
  <p style="margin-top:20px"><?php 
echo c2c_submit_tag(__('Signup'));
?>
 <?php 
echo login_link_to();
?>
</p>
</form>
<?php 
// load mailcheck, helps users correctly entering their email
echo javascript_queue("\$.ajax({ url: '" . minify_get_combined_files_url(array('/static/js/mailcheck.min.js', '/static/js/mailcheck.c2c.js')) . "',\ndataType: 'script', cache: true });");
Example #15
0
echo '&nbsp;&nbsp;';
echo button_to_function(__('save'), "\$('.images_submit').hide(); \$('#images_validate_form').submit()", array('disabled' => 'disabled', 'class' => 'images_submit'));
echo input_hidden_tag('action', 'addtempimages');
echo input_hidden_tag('image_number', 0);
?>
<span id="image_add_str" style="display:none">
<?php 
echo __('add an other image');
?>
</span>
</div>
</form>
</div>
<?php 
echo form_tag('images/jsupload?mod=' . $mod . '&document_id=' . $document_id, array('id' => 'images_validate_form'));
?>
<div>
</div>
<ul id="files_to_upload" class="legacy">
</ul>
<div>
<?php 
echo button_to_function(__('save'), "\$('.images_submit').hide(); \$('#images_validate_form').submit()", array('disabled' => 'disabled', 'class' => 'images_submit'));
?>
</div>
<?php 
$image_upload_js = minify_get_combined_files_url('/static/js/image_upload.js');
echo javascript_queue("\$.ajax({ url: '{$image_upload_js}', dataType: 'script', cache: true }).done(function() {\n  window.setTimeout(C2C.ImageUpload.init, 1000)});");
?>
</form>
Example #16
0
<script type="text/javascript">
(function(m,w){var l='<?php 
    echo trim(minify_get_main_stylesheets(!$debug, $debug));
    ?>
',r=1
w.devicePixelRatio?r=w.devicePixelRatio:"matchMedia"in w&&w.matchMedia&&(w.matchMedia("(min-resolution: 2dppx)").matches||w.matchMedia("(min-resolution: 192dpi)").matches?r=2:(w.matchMedia("(min-resolution: 1.5dppx)").matches||w.matchMedia("(min-resolution: 144dpi)").matches)&&(r=1.5))
if(r>1){l=l.replace(m,m+'@'+(r>=2?2:1.5)+'x');}document.write(l);})('mobile',window);
</script>
<?php 
} else {
    minify_include_main_stylesheets(!$debug, $debug);
}
if (!$mobile_version) {
    ?>
<!--[if IE 7]><link rel="stylesheet" type="text/css" media="all" href="<?php 
    echo minify_get_combined_files_url('/static/css/ie7.css');
    ?>
" /><![endif]-->
<!--[if lt IE 9]><script src="<?php 
    echo minify_get_combined_files_url(array('/static/js/html5shiv.js', '/static/js/autofocus.js', '/static/js/indexof.js'));
    ?>
"></script><![endif]-->
<?php 
} else {
    ?>
<link rel="apple-touch-icon-precomposed" href="<?php 
    echo PUN_STATIC_URL;
    ?>
/apple-touch-icon-precomposed.png" />
<?php 
}
<?php

use_helper('JavascriptQueue', 'Form', 'MyMinify');
if (!empty($message) || $sf_user->hasCredential('moderator') && !c2cTools::mobileVersion()) {
    $output_message = empty($message) ? __('No message defined. Click to edit') : $sf_data->getRaw('message');
    // unescaped data : we trust moderators !
    ?>
    <div id="edit_me" class="front_message"><?php 
    echo $output_message;
    ?>
</div>
    <?php 
    if ($sf_user->hasCredential('moderator') && !$mobile_version) {
        echo javascript_queue("\n          \$.ajax({\n            url: '" . minify_get_combined_files_url('/static/js/jquery.jeditable.js') . "',\n            dataType: 'script',\n            cache: true})\n          .done(function() {\n            \$('#edit_me')\n              .addClass('editable')\n              .editable('" . url_for('@default?module=common&action=edit&lang=' . $sf_user->getCulture()) . "', {\n                type: 'textarea',\n                submit: '<input type=\"submit\" value=\"" . __('Update') . "\" />',\n                cancel: '<input type=\"submit\" value=\"" . __('Cancel') . "\" />',\n                indicator: '" . __('saving...') . "',\n                tooltip: '" . __('Click to edit') . "',\n                onblur: 'ignore',\n                rows: 4\n              });\n          });");
    }
}