예제 #1
0
function filters_switcher_link($mainFilterSwitchOn)
{
    $options_on = $options_off = array();
    $options_on['id'] = 'filter_switch_on';
    $options_off['id'] = 'filter_switch_off';
    if ($mainFilterSwitchOn) {
        $options_off['style'] = 'display: none;';
    } else {
        $options_on['style'] = 'display: none;';
    }
    $html = picto_tag('action_on', __('some filters active'), $options_on);
    $html .= picto_tag('action_off', __('some filters have been defined but are not activated'), $options_off);
    if (defined('PUN_ROOT')) {
        // we are in the forum
        // it is not possible to activate/disactivate filter because the FiltersSwitchFilter will not get executed.
        // moreover, forums are not filtered on activities, regions, langs.
        return $html;
    } else {
        return link_to_function($html, "\$('#indicator').show();" . "\$.ajax('" . url_for('@default?module=common&action=switchallfilters') . "')" . ".done(function() { \$('#filter_switch_on, #filter_switch_off').toggle(); window.location.reload(); })" . ".always(function() { \$('#indicator').hide(); })");
    }
}
예제 #2
0
function start_section_tag($label, $container_id, $state = 'opened', $map = false, $first = false, $hide = false, $show_tip = true)
{
    $class = 'article_titre_bg';
    if ($first) {
        $class .= ' hfirst';
    }
    $picto_class = $state == 'opened' ? 'picto_close' : 'picto_open';
    $status = __($state == 'opened' ? 'section close' : 'section open');
    $label = picto_tag($picto_class, '', array('id' => $container_id . '_toggle')) . __($label);
    if ($show_tip && !c2cTools::mobileVersion()) {
        $label .= '<span id="tip_' . $container_id . '" class="tips">[' . $status . ']</span>';
        $up = '<a href="#header">' . picto_tag('action_up', __('menu'), array('class' => 'go_up')) . '</a>';
    } else {
        $up = '';
    }
    $style = $hide ? '" style="display:none' : '';
    $html = '<div class="' . $class . '" id="' . $container_id . '_tbg' . $style . '">' . '<div class="title" id="' . $container_id . '_section_title" title="' . $status . '">' . '<a href="#" id="' . $container_id . '" data-toggle-view="' . $container_id . '">' . $label . '</a>' . $up . '</div>' . '</div>';
    if (!$map) {
        $display = $state == 'opened' && !$hide ? '' : ' style="display:none;"';
        $html .= '<section id="' . $container_id . '_section_container" class="section"' . $display . '>';
    }
    return $html;
}
예제 #3
0
function picto_header_list_tag($picto, $title = '')
{
    sfLoader::loadHelpers(array('General'));
    return '<th>' . picto_tag($picto, __($title)) . '</th>';
}
예제 #4
0
<?php

use_helper('Field', 'Link');
$item_i18n = $item['ProductI18n'][0];
?>
<div><?php 
echo list_link($item_i18n, 'products');
?>
</div>
<div><?php 
echo displayWithSuffix($item['elevation'], 'meters'), ' - ', get_paginated_value_from_list($item['product_type'], 'mod_products_types_list');
if (isset($item['linked_docs'])) {
    echo '<div>', __('access'), ' ';
    include_partial('parkings/parkings4list', array('parkings' => $item['linked_docs']));
    echo '</div>';
}
?>
<div><?php 
include_partial('documents/regions4list', array('geoassociations' => $item['geoassociations']));
?>
</div>
<div><?php 
echo picto_tag('picto_images', __('nb_linked_images')), ' ', isset($item['nb_images']) ? $item['nb_images'] : '0', ' ', picto_tag('action_comment', __('nb_comments')), ' ', isset($item['nb_comments']) ? link_to($item['nb_comments'], '@document_comment?module=products&id=' . $item_i18n['id'] . '&lang=' . $item_i18n['culture']) : '0';
?>
</div>
예제 #5
0
<?php

use_helper('General');
?>
<br />
<?php 
echo picto_tag('picto_huts') . __('Hut:') . ' ' . (isset($autofocus) ? input_tag('hnam', null, array('autofocus' => 'autofocus')) : input_tag('hnam'));
echo __('elevation') . ' ' . elevation_selector('halt');
?>
<br />
<?php 
echo __('shelter_type') . ' ' . field_value_selector('htyp', 'mod_huts_shelter_types_list', array('keepfirst' => false, 'multiple' => true));
echo __('is_staffed') . __('&nbsp;:') . ' ' . bool_selector('hsta');
?>
<br />
<?php 
echo __('staffed_capacity') . ' ' . elevation_selector('hscap', null);
?>
<br />
<?php 
echo __('unstaffed_capacity') . ' ' . elevation_selector('hucap', null);
?>
<br />
<?php 
echo __('has_unstaffed_matress') . ' ' . field_value_selector('hmat', 'app_boolean_list');
echo __('has_unstaffed_blanket') . ' ' . field_value_selector('hbla', 'app_boolean_list');
echo __('has_unstaffed_gas') . ' ' . field_value_selector('hgas', 'app_boolean_list');
echo __('has_unstaffed_wood') . ' ' . field_value_selector('hwoo', 'app_boolean_list');
예제 #6
0
                    echo simple_pager_navigation($count, count($routes_outings), 'routings_group_');
                }
                ?>
               </div>
            <?php 
            }
            // routes outings list link
            include_partial('outings/linked_outings', array('id' => $ids, 'module' => 'routes', 'nb_outings' => $nb_routes_outings, 'document' => $document));
        }
    }
    // new outing button
    if ($show_link_tool) {
        echo '<div class="add_content">' . link_to(picto_tag('picto_add', __('Associate new outing')) . __('Associate new outing'), "outings/edit?link={$id}") . '</div>';
    }
    echo end_section_tag();
    // associated images section
    include_partial('documents/images', array('images' => $associated_images, 'document_id' => $id, 'dissociation' => 'moderator', 'is_protected' => $document->get('is_protected')));
    if ($mobile_version) {
        include_partial('documents/mobile_comments', array('id' => $id, 'lang' => $lang, 'nb_comments' => $nb_comments));
        if ($is_connected) {
            $version = $document->getVersion();
            $txt = __('Edit');
            echo '<div id="edit_route_button" class="add_content">', link_to(picto_tag('picto_tools', $txt) . $txt, "@document_edit_archive?module=routes&id={$id}&lang={$lang}&version={$version}"), '</div>';
        }
    }
    // annex docs section
    include_partial('documents/annex_docs', array('document' => $document, 'related_articles' => $associated_articles, 'related_portals' => $related_portals, 'show_link_to_delete' => $show_link_to_delete));
}
include_partial('documents/license', array('license' => 'by-sa', 'version' => $current_version, 'created_at' => isset($created_at) ? $created_at : null, 'timer' => $timer));
echo end_content_tag();
include_partial('common/content_bottom');
    if (array_key_exists($cat, $choices)) {
        $choices[$cat] .= ' *';
    }
}
echo select_tag("categories[{$image_number}]", options_for_select($choices), array('multiple' => true, 'size' => 6));
?>
</div>
<br />
<div class="image_form_error"<?php 
echo isset($image_title) ? ' style="display:none"' : '';
?>
>
↓&nbsp;<?php 
echo __('this name is too short (4 characters minimum)');
?>
 &nbsp;↓</div>
<?php 
// if image_title is set, we prefill the title input
// note that we use raw value, since input_tag will escape values anyway
// and we thus prevent double escaping
$image_title = isset($image_title) ? $sf_data->getRaw('image_title') : '';
echo __('name'), ' ', input_tag("name[{$image_number}]", $image_title, array('maxlength' => '150', 'class' => 'large_input', 'placeholder' => __('write a caption'))), ' ', input_hidden_tag("image_unique_filename[{$image_number}]", $image_filename);
echo '<br /><br />';
$license_choices = array_map('__', sfConfig::get('mod_images_type_list'));
if ($default_license == 1) {
    $types = sfConfig::get('mod_images_type_list');
    echo __('image_type') . ' ' . __($types[1]) . '&nbsp;' . link_to(picto_tag('cc-by-sa-mini', 'CC-by-sa'), getMetaArticleRoute('licenses', false, 'cc-by-sa'));
    echo input_hidden_tag("image_type[{$image_number}]", 1);
} else {
    echo __('image_type') . ' ' . select_tag("image_type[{$image_number}]", options_for_select($license_choices, $default_license));
}
예제 #8
0
<?php

use_helper('FilterForm', 'General', 'MyForm');
$is_connected = $sf_user->isConnected();
echo around_selector('sarnd');
$ranges_raw = $sf_data->getRaw('ranges');
$selected_areas_raw = $sf_data->getRaw('selected_areas');
include_partial('areas/areas_selector', array('ranges' => $ranges_raw, 'selected_areas' => $selected_areas_raw, 'use_personalization' => true));
?>
<br />
<br />
<?php 
echo '<div class="fieldname">' . picto_tag('picto_outings') . __('name') . ' </div>' . input_tag('onam', null, array('autofocus' => 'autofocus'));
echo georef_selector('With GPS track:');
$activities_raw = $sf_data->getRaw('activities');
include_partial('routes_filter', array('activities' => $activities_raw));
include_partial('summits/summits_short_filter');
include_partial('huts/huts_short_filter');
include_partial('parkings/parkings_filter');
echo __('outing_with_public_transportation') . ' ' . bool_selector('owtp');
?>
<br /><br />
<?php 
echo __('Date') . __('&nbsp;:') . ' ' . date_selector(array('month' => true, 'year' => true, 'day' => true));
?>
<div data-act-filter="1 2 5 7" style="display:none">
<?php 
echo __('avalanche_infos') . ' ' . select_tag('avdate', options_for_select(array('2-3-4-5' => __('yes'), '1' => __('no'), ' ' => __('filled in'), '-' => __('nonwell informed')), '', array('include_blank' => true)));
?>
</div>
<br />
예제 #9
0
function field_export($module, $id, $lang, $version = null)
{
    $route_suffix = !empty($version) ? "_version?version={$version}&" : '?';
    $route_suffix .= "module={$module}&id={$id}&lang={$lang}";
    $title = 'download geo data under %1% format';
    $result = '<div class="no_print">' . content_tag('span', __('Export:'), array('class' => 'section_subtitle', 'id' => 'geo_export', 'data-tooltip' => '')) . ' ' . picto_tag('action_gps') . ' ' . link_to('GPX', "@export_gpx{$route_suffix}", array('title' => __($title, array('%1%' => 'GPX')), 'rel' => 'nofollow'));
    if (!c2cTools::mobileVersion()) {
        $result .= ' ' . picto_tag('action_kml') . ' ' . link_to('KML', "@export_kml{$route_suffix}", array('title' => __($title, array('%1%' => 'KML')), 'rel' => 'nofollow')) . ' ' . picto_tag('action_json') . ' ' . link_to('JSON', "@export_json{$route_suffix}", array('title' => __($title, array('%1%' => 'JSON')), 'rel' => 'nofollow'));
    }
    $result .= '</div>';
    return $result;
}
예제 #10
0
    echo picto_tag('action_edit') . f_link_to(__('User profile'), 'profile.php?section=personality');
    ?>
</li>
                    <li><?php 
    echo picto_tag('action_contact') . link_to(__('Mailing lists link'), 'users/mailinglists');
    ?>
</li>
                <?php 
} else {
    ?>
                    <li><?php 
    echo picto_tag('action_edit') . link_to(__('create an account?'), getMetaArticleRoute('create_account'));
    ?>
</li>
                    <?php 
}
if ($is_connected) {
    ?>
                    <li class="lilast"><?php 
    echo picto_tag('action_cc') . link_to(__('User image management'), 'users/manageimages');
    ?>
</li>
                    <?php 
}
?>
                </ul>
            </li>
        </ul>
        <br class="clearer" />
    </div>
예제 #11
0
if ($is_not_archive && $is_not_merged) {
    echo start_section_tag('Linked documents', 'associated_docs');
    $id_no_associated_docs = "no_associated_docs";
    $id_list_associated_docs = "list_associated_docs";
    if (!count($associated_documents)) {
        echo '<p class="default_text" id="' . $id_no_associated_docs . '">' . __("No document uses this picture.") . '</p>';
    }
    if (count($associated_documents) > 0) {
        echo '<ul id="' . $id_list_associated_docs . '">';
        foreach ($associated_documents as $doc) {
            $doc_id = $doc['id'];
            $module = $doc['module'];
            $type = c2cTools::Module2Letter($module) . 'i';
            $idstring = $type . '_' . $doc_id;
            echo '<li id="', $idstring, '">';
            echo picto_tag('picto_' . $module, __($module));
            echo ' ' . link_to($doc['name'], "@document_by_id_lang_slug?module={$module}&id=" . $doc_id . '&lang=' . $doc['culture'] . '&slug=' . make_slug($doc['name']));
            if ($show_link_to_delete) {
                echo c2c_link_to_delete_element($type, $doc_id, $id, false, 1);
            }
            echo '</li>';
        }
        echo '</ul>';
    } elseif ($show_link_tool) {
        echo '<ul id="' . $id_list_associated_docs . '"><li style="display:none"></li></ul>';
    }
    if ($show_link_tool) {
        ?>
        <div id="association_tool" class="plus">
        <p><?php 
        echo __('You can associate this picture with any existing document using the following tool:');
예제 #12
0
    foreach ($alist as $k => $act) {
        if (!in_array($k + 1, $act_filter)) {
            $unselected_act[] = $k;
        }
    }
    foreach ($unselected_act as $act_id) {
        $light[$act_id] = '_light';
    }
    foreach ($act_filter as $act_id) {
        $activities_class[] = 'act' . $act_id;
    }
}
?>
    <div id="quick_switch<?php 
echo empty($activities_class) ? '' : '" class="' . implode(' ', $activities_class);
?>
">
        <?php 
foreach ($alist as $act_id => $activity) {
    $alt = $act_filter == array($act_id) ? __('switch_off_activity_personalisation') : __('switch_to_' . $alist[$act_id]);
    $image_tag = picto_tag('activity_' . ($act_id + 1) . $light[$act_id], $alt);
    echo link_to($image_tag, '@quick_activity?activity=' . ($act_id + 1), array('class' => 'qck_sw'));
}
?>
    </div>
    <?php 
include_partial('common/menu_content', array('sf_cache_key' => ($is_connected ? 'connected' : 'not_connected') . '_' . $lang, 'lang' => $lang, 'is_connected' => $is_connected));
?>
</div>

<?php

use_helper('General');
?>
<br />
<?php 
echo '<div class="fieldname">' . picto_tag('picto_summits') . __('Summit:') . ' </div>' . input_tag('snam');
echo __('elevation') . ' ' . elevation_selector('salt');
echo __('summit_type') . ' ' . field_value_selector('styp', 'app_summits_summit_types', array('blank' => true));
예제 #14
0
use_helper('General');
$mobile_version = c2cTools::mobileVersion();
?>
<fieldset id="fs_area">
    <legend class="select_title">
        <?php 
if (!isset($show_picto)) {
    $show_picto = true;
}
if ($show_picto) {
    echo picto_tag('picto_areas') . ' - ';
}
echo link_to_function(__('ranges'), "console.log('plop');\$('#indicator').show();\n               \$.ajax('" . url_for('/areas/getmultipleselect?area_type=1') . "')\n                 .always(function() { \$('#indicator').hide(); })\n                 .done(function(data) { \$('#area_selector').html(data); })") . ' - ' . link_to_function(__('regions'), "\$('#indicator').show();\n               \$.ajax('" . url_for('/areas/getmultipleselect?area_type=3') . "')\n                 .always(function() { \$('#indicator').hide(); })\n                 .done(function(data) { \$('#area_selector').html(data); })") . ' - ' . link_to_function(__('countries'), "\$('#indicator').show();\n               \$.ajax('" . url_for('/areas/getmultipleselect?area_type=2') . "')\n                 .always(function() { \$('#indicator').hide(); })\n                 .done(function(data) { \$('#area_selector').html(data); })");
if (!$mobile_version) {
    echo ' -&nbsp;' . picto_tag('picto_close', __('Reduce the list'), array('onclick' => "C2C.changeSelectSize('places', false)")) . picto_tag('picto_open', __('Enlarge the list'), array('onclick' => "C2C.changeSelectSize('places', true)"));
}
?>
    </legend>
    <div id="area_selector">
        <?php 
//rq FIXME bug in symfony 1.0.11 which does not work with optgroups and escaping, see http://trac.symfony-project.org/ticket/3923
// plus using sf_data->getRaw is not enough because it is passed through different partials
$ranges_raw = array();
foreach ($ranges as $key => $value) {
    if ($value instanceof sfOutputEscaperArrayDecorator) {
        $rr = array();
        foreach ($value as $k => $v) {
            $rr[$k] = $v;
        }
        $ranges_raw[$key] = $rr;
예제 #15
0
<?php

use_helper('Field');
$id = $sf_params->get('id');
$is_connected = $sf_user->isConnected();
$is_not_archive = !$document->isArchive();
$is_not_merged = !$document->get('redirects_to');
$mobile_version = c2cTools::mobileVersion();
$is_gite_camping = $document->get('shelter_type') == 5 || $document->get('shelter_type') == 6;
$show_link_tool = !$is_gite_camping && $is_not_archive && $is_not_merged && $is_connected && !$mobile_version;
if ($is_gite_camping) {
    $access_label = 'access';
} else {
    $access_label = null;
}
echo field_text_data_if_set($document, 'staffed_period', null, array('needs_translation' => $needs_translation, 'images' => $images));
echo field_text_data_if_set($document, 'description', null, array('needs_translation' => $needs_translation, 'images' => $images));
if (count($associated_routes)) {
    echo field_text_data($document, 'pedestrian_access', $access_label, array('needs_translation' => $needs_translation, 'images' => $images));
    include_partial('routes/linked_routes', array('associated_routes' => $associated_routes, 'document' => $document, 'id' => $id, 'module' => 'huts', 'type' => '', 'strict' => true, 'show_list_link' => false));
} else {
    echo field_text_data_if_set($document, 'pedestrian_access', $access_label, array('needs_translation' => $needs_translation, 'images' => $images));
}
if ($show_link_tool) {
    echo '<div class="add_content">' . link_to(picto_tag('picto_add', __('Associate new access')) . __('Associate new access'), "@hut_addroute?document_id={$id}") . '</div>';
}
예제 #16
0
<?php

use_helper('FilterForm', 'General');
echo picto_tag('picto_areas') . __('region_name') . ' ' . input_tag('anam', null, array('autofocus' => 'autofocus'));
echo __('area_type') . ' ' . field_value_selector('atyp', 'mod_areas_area_types_list');
?>
<br />
<?php 
echo __('filter language') . __('&nbsp;:') . ' ' . lang_selector('acult');
?>
<br />
<?php 
include_partial('documents/filter_sort');
예제 #17
0
        $title = $i18n_item['name'];
        $filename = $item['filename'];
        $image_type = $item['image_type'];
        $thumb_url = image_url($filename, 'small');
        $image_route = '@document_by_id_lang_slug?module=images&id=' . $item['id'] . '&lang=' . $i18n_item['culture'] . '&slug=' . make_slug($i18n_item['name']);
        echo link_to(image_tag($thumb_url, array('class' => 'img', 'alt' => $title)), $mobile_version ? $image_route : absolute_link(image_url($filename, 'big', true), true), array('title' => $title, 'data-lightbox' => 'document_images', 'class' => 'view_big', 'id' => 'lightbox_' . $item['id'] . '_' . $image_type));
        ?>
    <div class="image_license <?php 
        echo 'license_' . $image_type;
        ?>
"></div>
    </div>
    <?php 
        echo $title . '<br />';
        echo link_to(__('Details'), $image_route);
        if (!empty($item['nb_comments'])) {
            echo ' - ' . picto_tag('action_comment', __('nb_comments'), array('style' => 'margin-bottom:-4px')) . ' (' . link_to($item['nb_comments'], '@document_comment?module=images&id=' . $item['id'] . '&lang=' . $i18n_item['culture']) . ')';
        }
        ?>
    </div>
<?php 
    }
    ?>
<div style="clear:both"><?php 
    echo $pager_navigation;
    ?>
</div>
<?php 
}
echo end_content_tag();
include_partial('common/content_bottom');
예제 #18
0
<table id="conditions_levels_table">
  <colgroup></colgroup>
  <?php 
foreach ($level_fields as $field) {
    ?>
  <colgroup id="<?php 
    echo $field;
    ?>
"></colgroup>
  <?php 
}
?>
  <thead>
    <tr>
      <th><?php 
echo link_to(picto_tag('picto_add', __('add a condition level')), '#', array('class' => 'add-condition-level'));
?>
</th>
      <?php 
foreach ($level_fields as $field) {
    ?>
        <th><?php 
    echo __($field);
    ?>
</th>
      <?php 
}
?>
    </tr>
  </thead>
  <tbody id="conditions_levels_tbody">
예제 #19
0
     <li><span class="picto action_description"></span> <?php 
 echo __('Guidebook contribs:');
 echo '<ul>';
 $module_list = array('routes', 'summits', 'sites', 'huts', 'parkings', 'products', 'books', 'areas', 'articles', 'images');
 foreach ($module_list as $module) {
     $module_title = $module;
     $url_param = '';
     if ($module == 'articles') {
         $module_title = 'collaborative articles';
         $url_param = 'ctyp=1&';
     }
     if ($module == 'images') {
         $module_title = 'collaborative images';
         $url_param = 'ityp=1&';
     }
     echo '<li>' . picto_tag('picto_' . $module) . ' ' . __($module_title) . __('&nbsp;:') . ' ' . link_to(__('creations'), "{$module}/whatsnew?{$url_param}" . "mode=creations&users={$id}") . ' (' . link_to(__('tracking'), "{$module}/whatsnew?{$url_param}" . "createdby={$id}") . ') - ' . link_to(__('editions'), "{$module}/whatsnew?{$url_param}" . "users={$id}") . ' (' . link_to(__('tracking'), "{$module}/whatsnew?{$url_param}" . "editedby={$id}") . ')' . '</li>';
 }
 echo '</ul>';
 if ($is_moderator) {
     /*    echo '<p><span class="picto action_list"></span> '
           . link_to(__('List all user collaborative contribs'), "documents/whatsnew?dtyp=collab&users=$id") . ' ('
           . link_to(__('creations'), "documents/whatsnew?dtyp=collab&mode=creations&users=$id") . ')'
           . '</p>';  */
     echo '<p><span class="picto action_list"></span> ' . link_to(__('List all user contribs'), "documents/whatsnew?users={$id}") . ' (' . link_to(__('creations'), "documents/whatsnew?mode=creations&users={$id}") . ')' . '</p>';
 }
 ?>
     </li>
 </ul>
 <?php 
 echo end_section_tag();
 include_partial('documents/images', array('images' => $associated_images, 'document_id' => $id, 'dissociation' => 'moderator', 'author_specific' => !$is_moderator, 'is_protected' => $document->get('is_protected')));
예제 #20
0
/**
 * Create a form that allow to link the current document with several kinds of other docs
 *
 * @param module current document module
 * @param id current document id
 * @param modules_list list of modules available for association
 * @param default_selected default selected module in the dropdown list
 * @param field_prefix used to prevent to have ids conflict when multiple forms
 * @param $options
 *   $hide if true, display button to hide/show the form + some text
 *   $indicator, the ID of the HTML object used to display indications on the ajax status (Loading, Success, ...)
 *   $removed_id, the ID of the HTML object to hide
 *   $suggest_near_docs, for suggesting docs based on geolocalization
 *   $suggest_friends, for suggesting people you go out with most
 *
 * FIXME js code is quite messy, would be great to move most of it into separate js file
 */
function c2c_form_add_multi_module($module, $id, $modules_list, $default_selected, $options)
{
    // optional values
    $field_prefix = _option($options, 'field_prefix', 'list_associated_docs');
    $hide = _option($options, 'hide', true);
    $indicator = _option($options, 'indicator', 'indicator');
    $removed_id = _option($options, 'removed_id');
    $suggest_near_docs = _option($options, 'suggest_near_docs', false);
    $suggest_friends = _option($options, 'suggest_friends', false);
    $conf = sfConfig::get('app_modules_list');
    $modules_list = array_intersect($conf, $modules_list);
    $modules_list_i18n = array_map('__', $modules_list);
    // modules for which lookig for neighboors has some sense
    $near_docs_modules_list = array_intersect($conf, array('huts', 'parkings', 'sites', 'summits', 'routes'));
    $near_docs_module_ids_list = array_keys($near_docs_modules_list);
    // for site-site, parking-parking or summit-summit associations, be explicit about association direction
    if (in_array($module, array('sites', 'parkings', 'summits'))) {
        $modules_list_i18n[array_search($module, $modules_list)] = __('sub-' . $module);
    }
    // dropdown for choosing the type of docs to link
    $select_modules = select_tag('dropdown_modules', options_with_classes_for_select($modules_list_i18n, array($default_selected), array(), 'picto picto_'), array('class' => 'picto picto_' . $default_selected));
    $picto_add = $hide ? '' : picto_tag('picto_add', in_array('users', $modules_list) ? __('Link an existing user or document') : __('Link an existing document')) . ' ';
    $out = $picto_add . $select_modules;
    // js code fro autocompletion
    $js = "\$('#dropdown_modules').change(function() {" . "var \$this = \$(this), value = \$this.val(), indicator = \$('#{$indicator}').show();" . "\$this.attr('class', 'picto picto_' + value);" . "\$.get('" . url_for("/{$module}/getautocomplete") . "', 'module_id=' + value + '&field_prefix={$field_prefix}" . ($suggest_near_docs ? "' + (['" . implode("','", $near_docs_module_ids_list) . "'].indexOf(value) > -1 ?\n              '&extra_params=" . urlencode("lat=" . $suggest_near_docs['lat'] . "&lon=" . $suggest_near_docs['lon']) . "' : '')" : '\'') . ")" . ".always(function() { indicator.hide(); })" . ".done(function(data) { \$('#{$field_prefix}_form').html(data);";
    if ($suggest_near_docs || $suggest_friends) {
        $suggest_exclude = _option($options, 'suggest_exclude', []);
        // additional code for suggesting documents in the neighborhood or friends when relevant
        $js = "function getSuggestions() {" . "var input = \$('#{$field_prefix}_form').find('input[autocomplete=off]')," . "module = input.attr('name').replace('_name', '')," . "exclude = " . json_encode($suggest_exclude) . "," . "suggestions_div = \$('.autocomplete-suggestions').empty();" . "if (['" . implode("','", $near_docs_modules_list) . "'].indexOf(module) > -1 || module == 'users') {" . "var params = (module == 'users') ? { id: \$('#name_to_use').attr('data-user-id') } :" . "{ lat:" . $suggest_near_docs['lat'] . ", lon:" . $suggest_near_docs['lon'] . " };" . "if (input.not('[data-suggest-no-exclude]') && exclude[module] && exclude[module].length) {" . "params['exclude'] = exclude[module].join(',');" . "}" . "\$.getJSON('/'+module+'/suggest', params)" . ".done(function(data) {" . "if (data.length) suggestions_div.append('" . __('Suggestions: ') . "');" . "\$.each(data, function(index, obj) {" . "suggestions_div.append(\$('<a href=\"'+obj.url+'\">'+obj.name+'</a>').click(function(e) {" . "if (e.which !== 1) return;" . "e.preventDefault();" . "\$('#{$field_prefix}_form input[type=text]').triggerHandler('forceselect.autocomplete'," . "\$('<span id='+obj.id+'>'+obj.name+'</span>'));" . "}), ' &nbsp;');" . "});" . "});" . "}" . "}" . "\$('#{$field_prefix}_form_association a').one('click', getSuggestions);" . $js;
        $js .= "getSuggestions();";
    }
    $js .= "});});";
    $out .= javascript_queue($js);
    // form start
    $out .= c2c_form_remote_add_element("{$module}/addAssociation?main_id={$id}", $field_prefix, $indicator, $removed_id);
    // default form content
    $auto_complete_options = array('field_prefix' => $field_prefix);
    if ($suggest_near_docs && in_array($modules_list[$default_selected], $near_docs_modules_list)) {
        $auto_complete_options['extra_params'] = "lat=" . $suggest_near_docs['lat'] . "&lon=" . $suggest_near_docs['lon'];
    }
    $out .= '<div id="' . $field_prefix . '_form' . '" class="ac_form">' . input_hidden_tag('document_id', '0', array('id' => $field_prefix . '_document_id')) . input_hidden_tag('document_module', $modules_list[$default_selected], array('id' => $field_prefix . '_document_module')) . c2c_auto_complete($modules_list[$default_selected], $field_prefix . '_document_id', $auto_complete_options) . '</div></form><div class="autocomplete-suggestions"></div>';
    // this is where the linked docs will be displayed after ajax
    $out = '<div class="doc_add">' . $out . '</div>';
    if ($hide) {
        $picto_add_rm = '<span class="assoc_img picto_add" title="' . __('show form') . '"></span>' . '<span class="assoc_img picto_rm" title="' . __('hide form') . '"></span>';
        $picto_add_rm = link_to_function($picto_add_rm, "C2C.toggleForm('{$field_prefix}_form')");
        $title = '<div id="_association_tool" class="section_subtitle extra" data-tooltip>' . (in_array('users', $modules_list) ? __('Link an existing user or document') : __('Link an existing document')) . __('&nbsp;:') . '</div> ';
        $pictos = ' ';
        foreach ($modules_list as $module) {
            $pictos .= picto_tag('picto_' . $module, __($module));
        }
        $pictos = link_to_function($pictos, "C2C.toggleForm('{$field_prefix}_form')");
        $pictos = '<div class="short_data">' . $pictos . '</div>';
        $out = '<div class="one_kind_association empty_content">' . '<div class="association_tool hide" id="' . $field_prefix . '_form_association">' . $picto_add_rm . $title . $pictos . '<ul id="' . $field_prefix . '"><li style="display:none"></li></ul>' . $out . '</div></div>';
    }
    return $out;
}
예제 #21
0
 /**
  * Executes "associate current document with document" action
  * associated document can only be : articles, summits, books, huts, outings, routes, sites, users
  * ... restricted in security.yml to logged people
  */
 public function executeAddAssociation()
 {
     $user = $this->getUser();
     $user_id = $user->getId();
     $is_moderator = $user->hasCredential(sfConfig::get('app_credentials_moderator'));
     //
     // Get parameters and check that association is allowed
     //
     // if session is time-over
     if (!$user_id) {
         return $this->ajax_feedback('Session is over. Please login again.');
     }
     if (!$this->hasRequestParameter('document_id') || !$this->hasRequestParameter('main_id') || !$this->hasRequestParameter('document_module')) {
         return $this->ajax_feedback('Operation not allowed');
     }
     $main_module = $this->getRequestParameter('module');
     $main_id = $this->getRequestParameter('main_id');
     $linked_module = $this->getRequestParameter('document_module');
     $linked_id = $this->getRequestParameter('document_id');
     $icon = $this->getRequestParameter('icon', '');
     $div = $this->getRequestParameter('div', false);
     if ($linked_id == $main_id) {
         return $this->ajax_feedback('A document can not be linked to itself');
     }
     switch ($linked_module) {
         case 'summits':
             $fields = array('id', 'is_protected', 'summit_type');
             break;
         case 'routes':
             $fields = array('id', 'is_protected', 'duration');
             break;
         case 'huts':
             $fields = array('id', 'is_protected', 'shelter_type');
             break;
         case 'articles':
             $fields = array('id', 'is_protected', 'article_type');
             break;
         case 'images':
             $fields = array('id', 'is_protected', 'image_type');
             break;
         case 'documents':
             $fields = array('id', 'is_protected', 'module');
             break;
             // FIXME prevent such case?
         // FIXME prevent such case?
         default:
             $fields = array('id', 'is_protected');
             break;
     }
     $linked_document = Document::find(c2cTools::module2model($linked_module), $linked_id, $fields);
     $linked_module = $linked_module != 'documents' ? $linked_module : $linked_document->get('module');
     if (!$linked_document) {
         return $this->ajax_feedback('Linked document does not exist');
     }
     $type_modules = c2cTools::Modules2Type($main_module, $linked_module);
     if (empty($type_modules)) {
         return $this->ajax_feedback('Wrong association type');
     }
     list($type, $swap, $main_module_new, $linked_module_new, $strict) = $type_modules;
     switch ($main_module) {
         case 'summits':
             $fields = array('id', 'is_protected', 'summit_type');
             break;
         case 'routes':
             $fields = array('id', 'is_protected', 'duration');
             break;
         case 'huts':
             $fields = array('id', 'is_protected', 'shelter_type');
             break;
         case 'articles':
             $fields = array('id', 'is_protected', 'article_type');
             break;
         case 'images':
             $fields = array('id', 'is_protected', 'image_type');
             break;
         case 'documents':
             $fields = array('id', 'is_protected', 'module');
             break;
             // FIXME prevent such case?
         // FIXME prevent such case?
         default:
             $fields = array('id', 'is_protected');
             break;
     }
     $main_document = Document::find(c2cTools::module2model($main_module), $main_id, $fields);
     if (!$main_document) {
         return $this->ajax_feedback('Main document does not exist');
     }
     if ($swap) {
         $main_document_new = $linked_document;
         $main_id_new = $linked_id;
         $linked_document_new = $main_document;
         $linked_id_new = $main_id;
     } else {
         $main_document_new = $main_document;
         $main_id_new = $main_id;
         $linked_document_new = $linked_document;
         $linked_id_new = $linked_id;
     }
     if ($linked_module_new == 'articles') {
         if (!$is_moderator) {
             if ($linked_document_new->get('article_type') == 2 && !Association::find($user_id, $linked_id_new, 'uc')) {
                 return $this->ajax_feedback('You do not have the right to link a document to a personal article');
             }
             if ($main_module_new == 'articles') {
                 if ($main_document_new->get('article_type') == 2 && !Association::find($user_id, $main_id_new, 'uc')) {
                     return $this->ajax_feedback('You do not have the right to link a document to a personal article');
                 }
             }
             if ($main_module_new == 'outings' && !Association::find($user_id, $main_id_new, 'uo')) {
                 return $this->ajax_feedback('You do not have the right to link an article to another user outing');
             }
         }
         if ($linked_document_new->get('article_type') != 2 && $type == 'uc') {
             return $this->ajax_feedback('An user can not be linked to a collaborative article');
         }
     }
     if ($linked_module_new == 'images') {
         if ($main_document_new->get('is_protected') && !$is_moderator) {
             return $this->ajax_feedback('Document is
             protected');
         }
         if (!$is_moderator) {
             if ($main_module_new == 'users' && $main_id_new != $user_id) {
                 return $this->ajax_feedback('You do not have the right to link an image to another user profile');
             }
             if ($main_module_new == 'outings' && !Association::find($user_id, $main_id_new, 'uo')) {
                 return $this->ajax_feedback('You do not have the right to link an image to another user outing');
             }
             if ($main_module_new == 'articles' && $main_document_new->get('article_type') == 2 && !Association::find($user_id, $main_id_new, 'uc')) {
                 return $this->ajax_feedback('You do not have the right to link an image to a personal article');
             }
             if ($main_module_new == 'images' && $main_document_new->get('image_type') == 2 && $document->getCreatorId() != $user_id) {
                 return $this->ajax_feedback('You do not have the right to link an image to a personal image');
             }
         }
     }
     if ($linked_module_new == 'outings') {
         if (!$is_moderator) {
             if ($main_module_new == 'users' && !Association::find($user_id, $linked_id_new, 'uo')) {
                 return $this->ajax_feedback('You do not have the right to link an user to another user outing');
             }
             if ($main_module_new == 'routes' && !Association::find($user_id, $linked_id_new, 'uo')) {
                 return $this->ajax_feedback('You do not have the right to link a route to another user outing');
             }
             if ($main_module_new == 'sites' && !Association::find($user_id, $linked_id_new, 'uo')) {
                 return $this->ajax_feedback('You do not have the right to link a site to another user outing');
             }
         }
     }
     if ($linked_module_new == 'xreports') {
         if (!$is_moderator) {
             if ($main_module_new == 'users' && !Association::find($user_id, $linked_id_new, 'ux')) {
                 return $this->ajax_feedback('You do not have the right to link an user to another user xreport');
             }
             if ($main_module_new == 'outings' && !Association::find($user_id, $linked_id_new, 'ux')) {
                 return $this->ajax_feedback('You do not have the right to link an outing to another user xreport');
             }
             if ($main_module_new == 'routes' && !Association::find($user_id, $linked_id_new, 'ux')) {
                 return $this->ajax_feedback('You do not have the right to link a route to another user xreport');
             }
             if ($main_module_new == 'sites' && !Association::find($user_id, $linked_id_new, 'ux')) {
                 return $this->ajax_feedback('You do not have the right to link a site to another user xreport');
             }
         }
     }
     if ($linked_module_new == 'huts') {
         if ($main_module_new == 'summits') {
             $associations = Association::findAllAssociations($linked_id_new, 'sh');
             if (count($associations)) {
                 return $this->ajax_feedback('This hut is already linked to a summit');
             }
         }
         if ($main_module_new == 'parkings') {
             $associations_pp = Association::findAllAssociations($main_id_new, 'pp');
             $associations_ph = Association::findAllAssociations($linked_id_new, 'ph');
             foreach ($associations_pp as $a_pp) {
                 foreach ($associations_ph as $a_ph) {
                     if ($a_pp['main_id'] == $a_ph['main_id'] || $a_pp['linked_id'] == $a_ph['main_id']) {
                         return $this->ajax_feedback('A parking can not be linked to a hut if a main/sub parking is already linked to it');
                     }
                 }
             }
         }
     }
     if ($linked_module_new == 'routes') {
         if ($main_module_new == 'summits' && $main_document_new->get('summit_type') == 5 && $linked_document_new->get('duration') <= 2) {
             return $this->ajax_feedback('A raid summit can not be linked to a stage route');
         }
         if ($main_module_new == 'huts' && ($main_document_new->get('shelter_type') == 5 || $main_document_new->get('shelter_type') == 6)) {
             return $this->ajax_feedback('A gite can not be linked to a route');
         }
         if ($main_module_new == 'parkings') {
             $associations_pp = Association::findAllAssociations($main_id_new, 'pp');
             $associations_pr = Association::findAllAssociations($linked_id_new, 'pr');
             foreach ($associations_pp as $a_pp) {
                 foreach ($associations_pr as $a_pr) {
                     if ($a_pp['main_id'] == $a_pr['main_id'] || $a_pp['linked_id'] == $a_pr['main_id']) {
                         return $this->ajax_feedback('A parking can not be linked to a route if a main/sub parking is already linked to it');
                     }
                 }
             }
         }
     }
     if ($linked_module_new == 'sites') {
         if ($main_module_new == 'sites') {
             if (Association::countAllMain(array($linked_id_new), 'tt')) {
                 return $this->ajax_feedback('A sub site can not be linked to more than one main site');
             }
         }
         if ($main_module_new == 'summits') {
             if (Association::countAllMain(array($linked_id_new), 'st')) {
                 return $this->ajax_feedback('A site can not be linked to more than one summit');
             }
             if (Association::countAllMain(array($linked_id_new), 'tt')) {
                 return $this->ajax_feedback('A summit can not be linked to a sub site');
             }
         }
         if ($main_module_new == 'parkings') {
             $associations_pp = Association::findAllAssociations($main_id_new, 'pp');
             $associations_pt = Association::findAllAssociations($linked_id_new, 'pt');
             foreach ($associations_pp as $a_pp) {
                 foreach ($associations_pt as $a_pt) {
                     if ($a_pp['main_id'] == $a_pt['main_id'] || $a_pp['linked_id'] == $a_pt['main_id']) {
                         return $this->ajax_feedback('A parking can not be linked to a site if a main/sub parking is already linked to it');
                     }
                 }
             }
         }
     }
     if ($linked_module_new == 'summits') {
         if ($main_module_new == 'summits') {
             if ($main_document_new->get('summit_type') == 5 || $linked_document_new->get('summit_type') == 5) {
                 return $this->ajax_feedback('A raid summit can not be linked to a real summit');
             }
             if (Association::countAllMain(array($linked_id_new), 'ss')) {
                 return $this->ajax_feedback('A sub summit can not be linked to more than one main summit');
             }
         }
     }
     if ($linked_module_new == 'parkings') {
         if ($main_module_new == 'parkings') {
             if (Association::countAllMain(array($linked_id_new), 'pp')) {
                 // return $this->ajax_feedback('A sub parking can not be linked to more than one main parking');
             }
         }
     }
     if (Association::find($main_id_new, $linked_id_new, $type, false)) {
         return $this->ajax_feedback('The document is already linked to the current document');
     }
     if ($linked_module_new == 'outings' && $main_module_new == 'users' && $linked_id != $user_id) {
         // send an email to warn the new user associated
         $email_recipient = UserPrivateData::find($linked_id)->getEmail();
         $email_subject = $this->__('You have been associated to an outing');
         $server = $_SERVER['SERVER_NAME'];
         $outing_link = 'http' . (empty($_SERVER['HTTPS']) ? '' : 's') . "://{$server}/outings/{$main_id}";
         $htmlBody = $this->__('You have been associated to outing %1% details', array('%1%' => '<a href="' . $outing_link . '">' . $outing_link . '</a>'));
         $mail = new sfMail();
         $mail->setCharset('utf-8');
         // definition of the required parameters
         $mail->setSender(sfConfig::get('app_outgoing_emails_sender'));
         $mail->setFrom(sfConfig::get('app_outgoing_emails_from'));
         $mail->addReplyTo(sfConfig::get('app_outgoing_emails_reply_to'));
         $mail->addAddress($email_recipient);
         $mail->setSubject($email_subject);
         $mail->setContentType('text/html');
         $mail->setBody($htmlBody);
         $mail->setAltBody(strip_tags($htmlBody));
         // send the email
         $mail->send();
     }
     // Perform association
     $a = new Association();
     $status = $a->doSaveWithValues($main_id_new, $linked_id_new, $type, $user_id);
     if (!$status) {
         return $this->ajax_feedback('Could not perform association');
     }
     // cache clearing for current doc in every lang:
     $this->clearCache($main_module, $main_id, false, 'view');
     $this->clearCache($linked_module, $linked_id, false, 'view');
     // html to return
     sfLoader::loadHelpers(array('Tag', 'Url', 'Asset', 'AutoComplete'));
     $linked_document->setBestName($user->getPreferedLanguageList());
     $bestname = $linked_document->get('name');
     if ($linked_module == 'routes') {
         // in that case, output not only route name but also best summit name whose id has been passed (summit_id)
         $summit = explode(' [', $this->getRequestParameter('summits_name'));
         $bestname = $summit[0] . $this->__('&nbsp;:') . ' ' . $bestname;
     }
     $linked_module_name = $icon ? $icon : $this->__($linked_module);
     $type_id_string = $type . '_' . $linked_id;
     $out = link_to($bestname, "@document_by_id?module={$linked_module}&id={$linked_id}");
     if ($user->hasCredential('moderator')) {
         $out .= c2c_link_to_delete_element($type, $main_id_new, $linked_id_new, !$swap, $strict);
     }
     if ($div) {
         $icon_string = '';
         if ($icon) {
             $icon_string = '<div class="assoc_img picto_' . $icon . '" title="' . ucfirst(__($icon)) . '">' . '<span>' . ucfirst(__($icon)) . __('&nbsp;:') . '</span>' . '</div>';
         }
         $out = '<div class="linked_elt" id="' . $type_id_string . '">' . $icon_string . $out . '</div>';
     } else {
         $out = '<li id="' . $type_id_string . '">' . picto_tag('picto_' . $linked_module, $linked_module_name) . ' ' . $out . '</li>';
     }
     return $this->renderText($out);
 }
예제 #22
0
<?php

use_helper('General');
echo picto_tag('picto_summits') . __('Summit:') . ' ' . (isset($autofocus) ? input_tag('snam', null, array('autofocus' => 'autofocus')) : input_tag('snam'));
echo __('elevation') . ' ' . elevation_selector('salt');
echo '<br />';
echo __('summit_type') . ' ' . field_value_selector('styp', 'app_summits_summit_types', array('keepfirst' => false, 'multiple' => true, 'size' => 5));
예제 #23
0
 } else {
     $upload_method = sfConfig::get('app_images_upload_method', 'js');
     $js = "var width = \$(window).width() - 60;";
     switch ($upload_method) {
         // note: ie<=7 doesn't support jsupload nor plupload
         case 'js':
             $js .= 'if (!/MSIE [67].0/.exec(navigator.userAgent)) { url = \'' . url_for("@image_jsupload?mod={$module_name}&document_id={$document_id}") . '?noplupload=true' . '\' } else { url = this.href; } $.modalbox.show({remote:url,title:this.title,width:width}); return false;';
             break;
         case 'plupload':
             $js .= 'if (!/MSIE [67].0/.exec(navigator.userAgent)) { url = \'' . url_for("@image_jsupload?mod={$module_name}&document_id={$document_id}") . '\' } else { url = this.href; } $.modalbox.show({remote:url,title:this.title,width:width}); return false;';
             break;
         default:
             $js = '$.modalbox.show({remote:\'' . url_for("@image_upload?mod={$module_name}&document_id={$document_id}") . '\',title:this.title,width:700}); return false;';
             break;
     }
     echo link_to(picto_tag('picto_add', $add) . $add, "@image_upload?mod={$module_name}&document_id={$document_id}", array('onclick' => $js, 'title' => $add));
 }
 // for mobile version we test if file input is enabled, as well
 // as some xhr support
 // this should be enough in order to have plupload run in html5 mode
 // file input test is taken from modernizr
 if ($mobile_version) {
     echo javascript_tag("if ((function() {\n          var xhr;\n          if (window.XMLHttpRequest) {\n            xhr = new XMLHttpRequest();\n            if (!xhr.sendAsBinary && !xhr.upload) return false;\n          } else {\n            return false;\n          }\n          if (navigator.userAgent.match(/(Android (1.0|1.1|1.5|1.6|2.0|2.1))|(Windows Phone (OS 7|8.0))|(XBLWP)|(ZuneWP)|(w(eb)?OSBrowser)|(webOS)|(Kindle\\/(1.0|2.0|2.5|3.0))/)) {\n            return false;\n          }\n          var e = document.createElement('input');\n          e.type = 'file';\n          return !e.disabled;\n        })()) { document.getElementById('add_images_button').style.display = ''; }");
 }
 // if user is not the author, and only the author can add images,
 // hide the button for uploading images to the document.
 // Moreover, if they are no images linked, simply hide the section
 if (isset($author_specific) && $author_specific) {
     if ($nb_images) {
         echo javascript_tag("if (!document.body.hasAttribute('data-user-author')) document.getElementById('add_images_button').style.display = 'none';");
     } else {
예제 #24
0
$iscopyright = $license == 'copyright';
$license_url = sfConfig::get('app_licenses_base_url') . $license . sfConfig::get('app_licenses_url_suffix');
$license_url .= $sf_user->getCulture();
$license_name = 'Creative Commons ' . __($license);
$license_title = __("{$license} title");
$class = 'license_box';
if (isset($large) && $large) {
    $class .= ' large';
}
?>
<footer class="<?php 
echo $class;
?>
">
<?php 
echo '<div class="cc">' . link_to(picto_tag(($iscopyright ? '' : 'cc-') . $license), getMetaArticleRoute('licenses', false, ($iscopyright ? '' : 'cc-') . $license), array('title' => $license != 'copyright' ? 'Creative Commons' : 'Copyright')) . '</div>';
echo ' ';
if ($iscopyright) {
    echo __('Image under copyright license');
} else {
    echo __('Page under %1% license', array('%1%' => "<a rel=\"license\" href=\"{$license_url}\" title=\"{$license_title}\">{$license_name}</a>"));
}
echo '<br />' . __('Images are under license specified in the original document of each image');
if (isset($version) && !c2cTools::mobileVersion()) {
    echo '<br /><span class="doc_infos">', __('Version #%1%, date %2%', array('%1%' => $version, '%2%' => format_date($created_at, 'D')));
    if ($sf_user->hasCredential(sfConfig::get('app_credentials_moderator'))) {
        echo '<span class="no_print"> - ', __('Document generated %1% in %2%', array('%1%' => format_datetime(time()), '%2%' => round(1000 * $timer->getElapsedTime()))), '</span>';
    }
    echo '</span>';
}
?>
예제 #25
0
<?php

use_helper('FilterForm', 'General');
$ranges_raw = $sf_data->getRaw('ranges');
$selected_areas_raw = $sf_data->getRaw('selected_areas');
include_partial('areas/areas_selector', array('ranges' => $ranges_raw, 'selected_areas' => $selected_areas_raw, 'use_personalization' => true));
?>
<br />
<br />
<?php 
echo picto_tag('picto_maps') . __('Name:') . ' ' . input_tag('mnam', null, array('autofocus' => 'autofocus'));
echo __('Code:') . ' ' . input_tag('code');
?>
<br />
<?php 
echo __('Scale:') . ' ' . field_value_selector('scal', 'mod_maps_scales_list', array('blank' => true));
echo __('Editor:') . ' ' . field_value_selector('edit', 'mod_maps_editors_list', array('blank' => true));
?>
<br />
<?php 
echo __('filter language') . __('&nbsp;:') . ' ' . lang_selector('mcult');
include_partial('documents/filter_sort');
[<?php 
echo link_to_function(__('toggle date info'), 'C2C.toggle_time()');
?>
]
</p>

<p class="whatsnew_controls">
<?php 
$pager_navigation = pager_navigation($pager);
echo $pager_navigation;
?>
</p>

<?php 
$added_pic = picto_tag('picto_add', __('added'));
$deleted_pic = picto_tag('picto_rm', __('deleted'));
?>

<table class="list">
    <thead>
        <tr>
            <th>&nbsp;</th>
            <th><?php 
echo __('Date');
?>
</th>
            <th><?php 
echo __('Main document');
?>
</th>
            <th><?php 
예제 #27
0
<?php

use_helper('General');
?>
<br />
<?php 
echo '<div class="fieldname">' . picto_tag('picto_huts') . __('Hut:') . ' </div>' . input_tag('hnam');
echo __('elevation') . ' ' . elevation_selector('halt');
echo __('is_staffed') . ' ' . bool_selector('hsta');
예제 #28
0
    echo '</div>';
}
echo end_section_tag();
// lang-dependent content starts here
echo start_section_tag('Description', 'description');
include_partial('documents/i18n_section', array('document' => $document, 'languages' => $sf_data->getRaw('languages'), 'needs_translation' => $needs_translation, 'images' => $associated_images, 'ids' => $ids));
echo end_section_tag();
// instead of $languages: XSS protection deactivation
// map section starts here
include_partial($mobile_version ? 'documents/mobile_map_section' : 'documents/map_section', array('document' => $document));
// associated routes section starts here
if ($is_not_archive && $is_not_merged) {
    echo start_section_tag('Linked routes', 'routes');
    include_partial('routes/linked_routes', array('associated_routes' => $associated_routes, 'document' => $document, 'id' => $ids, 'module' => 'summits', 'type' => 'sr', 'strict' => true));
    if ($show_link_tool) {
        echo '<div class="add_content">' . link_to(picto_tag('picto_add', __('Associate new route')) . __('Associate new route'), "routes/edit?link={$id}") . '</div>';
    }
    echo end_section_tag();
    echo start_section_tag('Latest outings', 'outings');
    include_partial('outings/linked_outings', array('id' => $ids, 'module' => 'summits', 'items' => $latest_outings, 'nb_outings' => $nb_outings, 'lat' => $lat, 'lon' => $lon));
    echo end_section_tag();
    if ($section_list['books']) {
        echo start_section_tag('Linked books', 'linked_books');
        include_partial('books/linked_books', array('associated_books' => $associated_books, 'document' => $document, 'type' => 'bs', 'strict' => true));
        echo end_section_tag();
    }
    include_partial('documents/images', array('images' => $associated_images, 'document_id' => $id, 'list_ids' => $ids, 'dissociation' => 'moderator', 'is_protected' => $document->get('is_protected')));
    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));
예제 #29
0
<?php

use_helper('General');
?>
<br /><br />
<?php 
echo '<div class="fieldname">' . picto_tag('picto_routes') . __('Route:') . ' </div>' . (isset($autofocus) ? input_tag('rnam', null, array('autofocus' => 'autofocus')) : input_tag('rnam'));
echo georef_selector('With GPS track:');
?>
<br /><br />
<?php 
$activities_raw = $sf_data->getRaw('activities');
$paragliding_tag = sfConfig::get('app_tags_paragliding');
$paragliding_tag = implode('/', $paragliding_tag);
echo __('activities') . ' ' . field_value_selector('acttyp', 'mod_routes_activities_type_list', array('keepfirst' => false, 'filled_options' => false));
echo activities_selector(true, true, $activities_raw, array(8 => $paragliding_tag));
?>
<fieldset>
<?php 
echo __('max_elevation') . ' ' . elevation_selector('malt');
echo __('height_diff_up') . ' ' . elevation_selector('hdif');
?>
<div data-act-filter="1 2 3 4 5" style="display:none">
<?php 
echo __('difficulties_start_elevation') . ' ' . elevation_selector('ralt');
echo __('difficulties_height') . ' ' . elevation_selector('dhei');
echo __('approach_height') . ' ' . elevation_selector('rappr');
?>
</div>
<div data-act-filter="1 2 3 4" style="display:none">
<?php 
예제 #30
0
        } elseif ($module == 'soft mobility outings') {
            $criteria = "/outings/list?areas={$id}&owtp=yes&orderby=date&order=desc";
            $picto = 'outings';
        } elseif ($module == 'amateurs') {
            $criteria = "/users/list?areas={$id}&ucat=1";
            $picto = 'users';
        } elseif ($module == 'pros') {
            $criteria = "/users/list?areas={$id}&ucat=2";
            $picto = 'users';
        } elseif ($module == 'clubs') {
            $criteria = "/users/list?areas={$id}&ucat=3";
            $picto = 'users';
        }
        ?>
            <li><?php 
        echo picto_tag("picto_{$picto}") . ' ' . link_to(ucfirst(__($module)), $criteria);
        ?>
</li>
        <?php 
    }
    ?>
    </ul>
    </div>
    <?php 
    echo end_section_tag();
    echo start_section_tag('Latest outings', 'outings');
    include_partial('outings/linked_outings', array('id' => $id, 'module' => 'areas', 'items' => $latest_outings, 'nb_outings' => $nb_outings));
    echo end_section_tag();
    include_partial('documents/images', array('images' => $associated_images, 'document_id' => $id, 'dissociation' => 'moderator', 'is_protected' => $document->get('is_protected')));
    include_partial('documents/annex_docs', array('related_portals' => $related_portals));
}