Changeset 13172 for trunk/admin


Ignore:
Timestamp:
02/15/12 17:52:24 (8 years ago)
Author:
patdenice
Message:

feature:2577
Add functionnality in core files.

Location:
trunk/admin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/include/themes.class.php

    r12922 r13172  
    4949  function perform_action($action, $theme_id) 
    5050  { 
     51    global $conf; 
     52 
    5153    if (isset($this->db_themes_by_id[$theme_id])) 
    5254    { 
     
    8789        } 
    8890 
     91        if ($this->fs_themes[$theme_id]['mobile'] and !empty($conf['mobile_theme'])) 
     92        { 
     93          array_push($errors, l10n('You can activate only one mobile theme.')); 
     94          break; 
     95        } 
     96 
    8997        if (file_exists($file_to_include)) 
    9098        { 
     
    106114;'; 
    107115          pwg_query($query); 
     116 
     117          if ($this->fs_themes[$theme_id]['mobile']) 
     118          { 
     119            conf_update_param('mobile_theme', $theme_id); 
     120          } 
    108121        } 
    109122        break; 
     
    165178;'; 
    166179        pwg_query($query); 
     180 
     181        if ($this->fs_themes[$theme_id]['mobile']) 
     182        { 
     183          conf_update_param('mobile_theme', ''); 
     184        } 
    167185        break; 
    168186 
     
    326344            'description' => '', 
    327345            'author' => '', 
     346            'mobile' => false, 
    328347            ); 
    329348          $theme_data = implode( '', file($path.'/themeconf.inc.php') ); 
     
    366385            $theme['parent'] = $val[1]; 
    367386          } 
    368           if (preg_match('/["\']activable["\'].*?(true|false)/', $theme_data, $val)) 
     387          if (preg_match('/["\']activable["\'].*?(true|false)/i', $theme_data, $val)) 
    369388          { 
    370389            $theme['activable'] = get_boolean($val[1]); 
     390          } 
     391          if (preg_match('/["\']mobile["\'].*?(true|false)/i', $theme_data, $val)) 
     392          { 
     393            $theme['mobile'] = get_boolean($val[1]); 
    371394          } 
    372395 
  • trunk/admin/themes/default/template/themes_installed.tpl

    r12613 r13172  
    1818{foreach from=$active_themes item=theme} 
    1919  <div class="themeBox{if $theme.is_default} themeDefault{/if}"> 
    20     <div class="themeName">{$theme.name}{if $theme.is_default} <em>({'default'|@translate})</em>{/if}</div> 
     20    <div class="themeName">{$theme.name}{if $theme.is_default} <em>({'default'|@translate})</em>{/if} {if $theme.mobile} <em>({'mobile'|@translate})</em>{/if}</div> 
    2121    <div class="themeShot"><a href="{$theme.screenshot}" class="preview-box" title="{$theme.name}"><img src="{$theme.screenshot}" alt=""></a></div> 
    2222    <div class="themeActions"> 
     
    4848{foreach from=$inactive_themes item=theme} 
    4949  <div class="themeBox"> 
    50     <div class="themeName">{$theme.name}</div> 
     50    <div class="themeName">{$theme.name}{if $theme.mobile} <em>({'mobile'|@translate})</em>{/if}</div> 
    5151    <div class="themeShot"><a href="{$theme.screenshot}" class="preview-box" title="{$theme.name}"><img src="{$theme.screenshot}" alt=""></a></div> 
    5252    <div class="themeActions"> 
Note: See TracChangeset for help on using the changeset viewer.