Changeset 29615


Ignore:
Timestamp:
Sep 18, 2014, 12:22:53 PM (10 years ago)
Author:
JanisV
Message:

Replace picture page

Location:
extensions/Fotorama
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • extensions/Fotorama/admin.php

    r29593 r29615  
    1414    'loop' => isset($_POST['loop']),
    1515    'enable_caption' => isset($_POST['enable_caption']),
     16    'replace_picture' => isset($_POST['replace_picture']),
     17    'replace_picture_only_users' => isset($_POST['replace_picture_only_users']),
    1618    );
    1719  if (isset($_POST['allowfullscreen']))
  • extensions/Fotorama/language/ru_RU/plugin.lang.php

    r29593 r29615  
    1414$lang['Show caption with image title'] = 'Показывать заголовок с названием изображения';
    1515$lang['Tumbnail height (when present)'] = 'Высота миниатюр (когда присутствуют)';
     16$lang['Replace picture page'] = 'Заменить страницы с фотографиями';
     17$lang['except an administrator'] = 'кроме администратора';
    1618
    1719?>
  • extensions/Fotorama/main.inc.php

    r29596 r29615  
    3636        $conf['Fotorama']['thumbheight'] = 64;
    3737  }
     38  // Upgrade params from 2.7.l
     39  if (!isset($conf['Fotorama']['replace_picture'])) {
     40        $conf['Fotorama']['replace_picture'] = false;
     41        $conf['Fotorama']['replace_picture_only_users'] = false;
     42  }
    3843
    3944  add_event_handler('loc_end_picture', 'Fotorama_end_picture');
     
    4449{
    4550  global $template, $conf, $user, $page;
     51 
     52  if ($conf['Fotorama']['replace_picture'] and (!$conf['Fotorama']['replace_picture_only_users'] or !is_admin()))
     53  {
     54    $page['slideshow'] = true;
     55
     56    $url_up = duplicate_index_url(
     57      array(
     58        'start' =>
     59          floor($page['current_rank'] / $page['nb_image_page'])
     60          * $page['nb_image_page']
     61        ),
     62      array(
     63        'start',
     64        )
     65      );
     66    //slideshow end
     67    $template->assign(
     68      array(
     69        'U_SLIDESHOW_STOP' => $url_up,
     70        )
     71      );
     72
     73    $template->assign('replace_picture', true);
     74  }
    4675
    4776  if ($page['slideshow'] and $conf['light_slideshow'])
     
    134163  global $template, $conf, $page;
    135164
     165  if ($conf['Fotorama']['replace_picture'] and (!$conf['Fotorama']['replace_picture_only_users'] or !is_admin()))
     166  {
     167    $page['slideshow'] = true;
     168  }
     169
    136170  if (isset($page['slideshow']) and $page['slideshow'] and $conf['light_slideshow'])
    137171  {
  • extensions/Fotorama/maintain.inc.php

    r29593 r29615  
    2020    'enable_caption' => false,
    2121    'thumbheight' => 64,
     22    'replace_picture' => false,
     23    'replace_picture_only_users' => false,
    2224  );
    2325
  • extensions/Fotorama/template/admin.tpl

    r29597 r29615  
    101101    </label>
    102102  </li>
     103  <li>
     104    <input type="checkbox" id="replace_picture" name="replace_picture"{if $Fotorama.replace_picture} checked="checked"{/if}>
     105    <label for="replace_picture">
     106      <b>{'Replace picture page'|@translate}</b>
     107    </label>
     108  </li>
     109  <li>
     110    &nbsp;&nbsp;&nbsp;&nbsp;<input type="checkbox" id="replace_picture_only_users" name="replace_picture_only_users"{if $Fotorama.replace_picture_only_users} checked="checked"{/if}>
     111    <label for="replace_picture_only_users">
     112      <b>{'except an administrator'|@translate}</b>
     113    </label>
     114  </li>
    103115</ul>
    104116</fieldset>
  • extensions/Fotorama/template/slideshow.tpl

    r29593 r29615  
    5050            function (e, fotorama, extra) {
    5151              if (!fullscreen) {
     52                {/literal}{if isset($replace_picture)}{literal}
     53                history.replaceState(null, null, fotorama.activeFrame['url']);
     54                {/literal}{else}{literal}
    5255                history.replaceState(null, null, fotorama.activeFrame['url']+'&slideshow=');
    5356                jQuery('#slideshow .browsePath a').attr('href', fotorama.activeFrame['url']);
     57                {/literal}{/if}{literal}
     58
    5459                jQuery('#slideshow .showtitle').text(fotorama.activeFrame['caption']);
    5560                jQuery('#slideshow .imageNumber').text((fotorama.activeFrame['i'])+'/'+{/literal}{count($items)}{literal});
     
    8590              });
    8691
     92              {/literal}{if isset($replace_picture)}{literal}
     93              history.replaceState(null, null, fotorama.activeFrame['url']);
     94              {/literal}{else}{literal}
    8795              history.replaceState(null, null, fotorama.activeFrame['url']+'&slideshow=');
    8896              jQuery('#slideshow .browsePath a').attr('href', fotorama.activeFrame['url']);
     97              {/literal}{/if}{literal}
     98
    8999              jQuery('#slideshow .showtitle').text(fotorama.activeFrame['caption']);
    90100              jQuery('#slideshow .imageNumber').text((fotorama.activeFrame['i'])+'/'+{/literal}{count($items)}{literal});
Note: See TracChangeset for help on using the changeset viewer.