Changeset 16380 for extensions/hr_os_xl


Ignore:
Timestamp:
Jul 5, 2012, 10:24:53 PM (12 years ago)
Author:
flop25
Message:

drop down menu styled and successfully placed (relative positions changed)
custom size for the picture page :
pattern added
concatenation of the 'define derivative'
css to center the picture

Location:
extensions/hr_os_xl
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • extensions/hr_os_xl/theme.css

    r16305 r16380  
    5959        color: #FFF;
    6060}
     61#derivativeSwitchBox, #sortOrderBox {
     62        font-size: 11px;
     63        color: #000033;
     64        text-shadow: 0 0 2px #ccc;
     65        padding: 4px 8px;
     66        border: 1px solid rgba(255,255,255,0.25);
     67        background-color: rgb(255,255,255);
     68        background-color: rgba(255,255,255,0.92);
     69        background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(transparent), to(#fff));
     70        border-radius: 3px;
     71        -webkit-border-radius: 3px;
     72        -moz-border-radius: 3px;
     73        box-shadow: 0 0 5px #555;
     74        -webkit-box-shadow: 0 0 5px #555;
     75        -moz-box-shadow: 0 0 5px #555;
     76}
     77#derivativeSwitchBox A, #sortOrderBox A {
     78        color: #000;
     79}
     80
     81#derivativeSwitchBox A:hover, #sortOrderBox A:hover {
     82        text-shadow: 0 0 2px #000;
     83}
     84
    6185/* Page
    6286-------------------------------------------------------- */
     
    6690        width: 940px;
    6791        margin: 0 auto;
    68         position: relative;
    6992        background: transparent url(img/back.jpg) repeat-y top center;
    7093}
     
    135158        padding: 5px 8px;
    136159}
    137 
     160#imageToolBar .imageNumber {
     161    float: right;
     162    margin: -30px 9px 0 0;
     163}
    138164#theImage IMG {
    139165  padding: 5px;
    140166  border: 1px solid #aaa;
    141167}
     168#theMainImage {max-width:880px}
    142169
    143170#imageHeaderBar H2 {
     
    201228}
    202229
    203 #menubar { position: relative; z-index: 2; }
    204 #content { position: relative; z-index: 1; }
     230#menubar { position: relative; }
     231#theHeader { position: relative; }
    205232
    206233#content div.thumbnailCategory div.description {
  • extensions/hr_os_xl/themeconf.inc.php

    r12266 r16380  
    5757  $template->assign('display_hr_os_xl_banner', $header);
    5858}
     59// function load_pattern
     60// include the right ***.pattern.php
     61// not compatible 2.2and<2.2
     62
     63function load_pattern()
     64{
     65  global $pattern;
     66  $pwgversion=str_replace('.','',PHPWG_VERSION);
     67  $pwgversion_array=explode('.', PHPWG_VERSION);
     68  if (file_exists($pwgversion.'pattern.php'))
     69  {
     70    include($pwgversion.'.pattern.php');
     71    return true;
     72  }
     73  elseif (file_exists(PHPWG_ROOT_PATH.'themes/hr_os_xl/'.$pwgversion_array[0].$pwgversion_array[1].'x.pattern.php'))
     74  {
     75    include(PHPWG_ROOT_PATH.'themes/hr_os_xl/'.$pwgversion_array[0].$pwgversion_array[1].'x.pattern.php');
     76    return true;
     77  }
     78  else
     79  {
     80    $list_pattern_path=array();
     81    $dir=PHPWG_ROOT_PATH.'themes/hr_os_xl';
     82    $dh = opendir($dir);
     83    while (($file = readdir ($dh)) !== false ) {
     84      if ($file !== '.' && $file !== '..') {
     85        $path =$dir.'/'.$file;
     86        if (!is_dir ($path)) {
     87          if(strpos($file,'pattern.php')!==false) { //On ne prend que les .pattern.php
     88            $list_pattern_path[]=$file;
     89          }
     90        }
     91      }
     92    }
     93    closedir($dh);
     94    $f=0;
     95    for($i = 10; $i >=0; $i--)
     96    {
     97      if (in_array($pwgversion_array[0].$i.'.pattern.php',$list_pattern_path))
     98      {
     99        include($pwgversion_array[0].$i.'.pattern.php');
     100        return true;
     101        $f=1;
     102        break;
     103      }
     104    }
     105    if ($f=0)
     106    {
     107      return false;
     108    }
     109  }
     110 
     111}
     112if(!load_pattern())
     113{
     114  global $page;
     115  $page['errors'][]='Theme not compatible';
     116}
     117
     118/************************************ picture.tpl ************************************/
     119add_event_handler('render_element_content', 'hr_os_xl_picture',  EVENT_HANDLER_PRIORITY_NEUTRAL, 20 );
     120function hr_os_xl_picture($content, $element_info)
     121{
     122  global $template;
     123  $template->set_prefilter('default_content', 'hr_os_xl_prefilter_picture');
     124  return $content;
     125}
     126function hr_os_xl_prefilter_picture($content, &$smarty)
     127{
     128  global $pattern;
     129  $r=$pattern['hr_os_xl_prefilter_picture']['R'];
     130  $ps=$pattern['hr_os_xl_prefilter_picture']['S'];
     131  foreach($r as $i => $pr)
     132  {
     133    $content = str_replace($ps[$i], $pr, $content);
     134  }
     135 
     136  $content ='{define_derivative name=\'der_hr_os_xl\' width=900 height=9999 crop=false}
     137{assign var=der value=$pwg->derivative($der_hr_os_xl, $current.src_image)}
     138'.$content;
     139  return $content;
     140}
     141
     142
    59143?>
Note: See TracChangeset for help on using the changeset viewer.