Changeset 13489 for trunk


Ignore:
Timestamp:
Mar 6, 2012, 9:43:18 PM (12 years ago)
Author:
rvelices
Message:

added event for src image url
simplify js in picture.tpl
action.php fix history saving

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/action.php

    r12922 r13489  
    2323
    2424define('PHPWG_ROOT_PATH','./');
     25session_cache_limiter('public');
    2526include_once(PHPWG_ROOT_PATH.'include/common.inc.php');
    2627
     
    7172;';
    7273
    73 $result = pwg_query($query);
    74 $element_info = pwg_db_fetch_assoc($result);
     74$element_info = pwg_db_fetch_assoc(pwg_query($query));
    7575if ( empty($element_info) )
    7676{
     
    106106    if ( $user['enabled_high']!='true' )
    107107    {
    108       do_error(401, 'Access denied h');
     108      do_error(401, 'Access denied e');
    109109    }
    110110    $file = get_element_path($element_info);
     
    120120}
    121121
    122 if ($_GET['part'] == 'h') {
     122if ($_GET['part'] == 'e') {
    123123  pwg_log($_GET['id'], 'high');
    124124}
  • trunk/include/derivative.inc.php

    r13452 r13489  
    7777  function get_url()
    7878  {
    79     return embellish_url(get_root_url().$this->rel_path);
     79    $url = get_root_url().$this->rel_path;
     80    if ($this->flags & self::IS_ORIGINAL)
     81    {
     82      $url = trigger_event('get_src_image_url', $url, $this);
     83    }
     84    return embellish_url($url);
    8085  }
    8186
  • trunk/themes/default/template/picture.tpl

    r13478 r13489  
    2121{if count($current.unique_derivatives)>1}
    2222{footer_script}{literal}
    23 function changeImgSrc(url,typeSave,typeMap,typeDisplay)
     23function changeImgSrc(url,typeSave,typeMap)
    2424{
    2525        var theImg = document.getElementById("theMainImage");
     
    2828                theImg.removeAttribute("width");theImg.removeAttribute("height");
    2929                theImg.src = url;
    30                 var elt = document.getElementById("derivativeSwitchLink");
    31                 /* if (elt) elt.innerHTML = typeDisplay; */
    3230                theImg.useMap = "#map"+typeMap;
    3331        }
     
    5452<div id="derivativeSwitchBox" onclick="toggleDerivativeSwitchBox()" style="display:none">
    5553{foreach from=$current.unique_derivatives item=derivative key=derivative_type}
    56 <a href="javascript:changeImgSrc('{$derivative->get_url()|@escape:javascript}','{$derivative_type}','{$derivative->get_type()}','{$derivative->get_type()|@translate|@escape:javascript}')">{$derivative->get_type()|@translate} ({$derivative->get_size_hr()})</a><br>
     54<a href="javascript:changeImgSrc('{$derivative->get_url()|@escape:javascript}','{$derivative_type}','{$derivative->get_type()}')">{$derivative->get_type()|@translate} ({$derivative->get_size_hr()})</a><br>
    5755{/foreach}
    5856{if isset($U_ORIGINAL)}
Note: See TracChangeset for help on using the changeset viewer.