Changeset 7340 for extensions/PWG_Stuffs


Ignore:
Timestamp:
10/22/10 10:53:03 (9 years ago)
Author:
patdenice
Message:

Added feature: hide main block on home page.

Location:
extensions/PWG_Stuffs
Files:
15 edited

Legend:

Unmodified
Added
Removed
  • extensions/PWG_Stuffs/admin/manage.php

    r3609 r7340  
    1818WHERE id=' . $id . ' LIMIT 1'); 
    1919  } 
     20 
     21    pwg_query(' 
     22UPDATE ' . STUFFS_TABLE . ' 
     23SET datas = "'.addslashes(serialize(array('hide' => isset($_POST['hidemb'])))).'" 
     24WHERE id=0;'); 
     25 
    2026  array_push($page['infos'], l10n('stuffs_order_saved')); 
    2127} 
    2228 
    2329// Affichage des modules et de leur position 
    24 $q = 'SELECT id, name, descr, type, id_line, width 
     30$q = 'SELECT id, name, descr, type, id_line, width, datas 
    2531FROM ' . STUFFS_TABLE . ' 
    2632ORDER BY pos ASC;'; 
     
    6066    'U_DELETE' => !is_adviser() ? PHPWG_ROOT_PATH . 'admin.php?page=plugin&section=' . STUFFS_DIR . '%2Fadmin%2Fadmin.php&del=' . $module['id'] : '', 
    6167  )); 
     68 
     69  if ($module['type'] == 'MainBlock' and !empty($module['datas'])) 
     70  { 
     71    $datas = unserialize($module['datas']); 
     72    $template->assign('HIDEMB', $datas['hide']);  
     73  } 
    6274} 
    6375 
  • extensions/PWG_Stuffs/admin/template/manage.tpl

    r5727 r7340  
    5353      {if $module.TYPE != 'MainBlock'} 
    5454      <ul class="categoryActions"> 
    55         {if $module.TYPE != 'MainBlock'} 
    5655        <li class="stuffs_line"> 
    5756          {'stuffs_id_ligne'|@translate}&nbsp; 
     
    6463          <input type="text" size="2" maxlength="2" value="{$module.WIDTH}" name="width[{$module.ID}]" > % 
    6564        </li> 
    66         {/if} 
    6765        <li><a href="{$module.U_EDIT}" title="{'stuffs_edit'|@translate}"><img src="{$themeconf.admin_icon_dir}/category_edit.png" class="button" alt="{'stuffs_edit'|@translate}"/></a></li> 
    6866        {if !empty($module.U_DELETE) } 
     
    7977 
    8078      {if !empty($module.DESC)} 
    81       <p style="margin-left: 30px;"><i>{$module.DESC}</i></p> 
     79        <p style="margin-left: 30px;"><i>{$module.DESC}</i></p> 
     80      {elseif $module.TYPE == 'MainBlock'} 
     81        <p style="margin-left: 30px;"><input name="hidemb" type="checkbox" {if $HIDEMB}checked="checked"{/if}> &nbsp;{'Hide on home page'|@translate}</p> 
    8282      {/if} 
    8383 
     
    9797  </p> 
    9898</form> 
    99  
    100  
    101  
    102 {* 
    103         <legend>{'stuffs_mods_management'|@translate}</legend> 
    104         <table class="table2"> 
    105         <thead> 
    106                 <tr class="throw"> 
    107                 <td>{'stuffs_module_title'|@translate}</td> 
    108                 <td>{'stuffs_desc'|@translate}</td> 
    109                         <td>{'stuffs_type'|@translate}</td> 
    110                         <td>{'stuffs_position'|@translate}</td> 
    111                         <td>{'stuffs_id_ligne'|@translate}</td> 
    112                         <td>{'stuffs_width'|@translate}</td> 
    113                         <td>{'stuffs_action'|@translate}</td> 
    114                 </tr> 
    115         </thead> 
    116  
    117         {foreach from=$modules item=module} 
    118         <tr class="{$module.CLASS}" height="28"> 
    119                 <td align="center">{$module.NAME}</td> 
    120                 <td align="center">{$module.DESC}</td> 
    121                 <td align="center">{$module.TYPE}</td> 
    122                 <td align="center"><input type="text" size="2" maxlength="2" value="{$module.POS}" name="position[{$module.ID}]"/></td> 
    123                 <td align="center">{$module.ID_LINE}</td> 
    124                 <td align="center">{$module.WIDTH}</td> 
    125                 <td align="center">{$module.ACTION}</td> 
    126         </tr> 
    127         {/foreach} 
    128 *} 
  • extensions/PWG_Stuffs/include/class.inc.php

    r7336 r7340  
    7373      { 
    7474                $this->pos = 'end'; 
     75        if (!empty($module['datas']) 
     76          and $datas = unserialize($module['datas']) 
     77          and $datas['hide']) 
     78        { 
     79          add_event_handler('loc_end_index', 'remove_main_block'); 
     80        } 
    7581                continue; 
    7682        } 
  • extensions/PWG_Stuffs/include/functions.inc.php

    r6417 r7340  
    113113} 
    114114 
     115function remove_main_block() 
     116{ 
     117  global $page, $template; 
     118 
     119  if (isset($page['section']) and $page['section'] == 'categories' and !isset($page['category'])) 
     120  { 
     121    $template->set_prefilter('index', 'remove_main_block_prefilter'); 
     122  } 
     123} 
     124 
     125function remove_main_block_prefilter($content, $smarty) 
     126{ 
     127  return preg_replace('#<div id="content" class="content">.*</div> <!-- content -->#s', '', $content); 
     128} 
     129 
    115130?> 
  • extensions/PWG_Stuffs/language/cs_CZ/plugin.lang.php

    r6971 r7340  
    1717$lang['stuffs_confirm_delete'] = 'Opravdu chcete odstranit modul %s?'; 
    1818$lang['stuffs_main_block'] = 'Hlavní blok'; 
     19/*TODO*/$lang['Hide on home page'] = 'Hide on home page'; 
    1920 
    2021$lang['stuffs_add_module'] = 'Přidat nový modul'; 
  • extensions/PWG_Stuffs/language/de_DE/plugin.lang.php

    r5727 r7340  
    1717$lang['stuffs_confirm_delete'] = 'Sind Sie sicher das Modul %s löschen zu wollen?'; 
    1818$lang['stuffs_main_block'] = 'Hauptblock'; 
     19/*TODO*/$lang['Hide on home page'] = 'Hide on home page'; 
    1920 
    2021$lang['stuffs_add_module'] = 'Neues Modul hinzufügen'; 
  • extensions/PWG_Stuffs/language/en_UK/plugin.lang.php

    r5727 r7340  
    3131$lang['stuffs_show_on_pictures'] = 'On picture pages'; 
    3232$lang['stuffs_no_options'] = 'No options for this module'; 
     33$lang['Hide on home page'] = 'Hide on home page'; 
    3334 
    3435//Messages d'infos 
  • extensions/PWG_Stuffs/language/es_ES/plugin.lang.php

    r5899 r7340  
    1717$lang['stuffs_confirm_delete'] = 'Es usted seguro de querer suprimir el módulo %s?'; 
    1818$lang['stuffs_main_block'] = 'Bloque principal'; 
     19/*TODO*/$lang['Hide on home page'] = 'Hide on home page'; 
    1920 
    2021$lang['stuffs_add_module'] = 'Añadir un nuevo módulo'; 
  • extensions/PWG_Stuffs/language/fr_FR/plugin.lang.php

    r5727 r7340  
    1717$lang['stuffs_confirm_delete'] = 'Etes-vous sur de vouloir supprimer le module %s?'; 
    1818$lang['stuffs_main_block'] = 'Bloc principal'; 
     19$lang['Hide on home page'] = 'Masquer sur la page d\'accueil'; 
    1920 
    2021$lang['stuffs_add_module'] = 'Ajout d\'un nouveau module'; 
  • extensions/PWG_Stuffs/language/hr_HR/plugin.lang.php

    r6745 r7340  
    1717$lang['stuffs_confirm_delete'] = 'Jeste li sigurni da želite obrisati modul %s?'; 
    1818$lang['stuffs_main_block'] = 'Glavni blok'; 
     19/*TODO*/$lang['Hide on home page'] = 'Hide on home page'; 
    1920 
    2021$lang['stuffs_add_module'] = 'Dodaj novi modul'; 
  • extensions/PWG_Stuffs/language/hu_HU/plugin.lang.php

    r7240 r7340  
    1717$lang['stuffs_confirm_delete'] = 'Biztos, hogy törölni akarja ezt a modult: %s?'; 
    1818$lang['stuffs_main_block'] = 'Fő blokk'; 
     19/*TODO*/$lang['Hide on home page'] = 'Hide on home page'; 
    1920 
    2021$lang['stuffs_add_module'] = 'Új modul hozzáadva'; 
  • extensions/PWG_Stuffs/language/it_IT/plugin.lang.php

    r6432 r7340  
    1717$lang['stuffs_confirm_delete'] = 'Siete sicuri di volere cancellare il modulo %s?'; 
    1818$lang['stuffs_main_block'] = 'Blocco principale'; 
     19/*TODO*/$lang['Hide on home page'] = 'Hide on home page'; 
    1920 
    2021$lang['stuffs_add_module'] = 'Aggiungere nuovo modulo'; 
  • extensions/PWG_Stuffs/language/ja_JP/plugin.lang.php

    r5727 r7340  
    1717$lang['stuffs_confirm_delete'] = '本当にこのモジュール %s を削除してもよろしいですか?'; 
    1818$lang['stuffs_main_block'] = 'メインブロック'; 
     19/*TODO*/$lang['Hide on home page'] = 'Hide on home page'; 
    1920 
    2021$lang['stuffs_add_module'] = '新しいモジュールを追加する'; 
  • extensions/PWG_Stuffs/language/ru_RU/plugin.lang.php

    r5727 r7340  
    1717$lang['stuffs_confirm_delete'] = 'Вы уверены, что хотите удалить модуль %s?'; 
    1818$lang['stuffs_main_block'] = 'Основной блок'; 
     19/*TODO*/$lang['Hide on home page'] = 'Hide on home page'; 
    1920 
    2021$lang['stuffs_add_module'] = 'Добавление нового модуля'; 
  • extensions/PWG_Stuffs/language/sk_SK/plugin.lang.php

    r7042 r7340  
    1717$lang['stuffs_confirm_delete'] = 'Ste si istý, že chcete vymazať modul %s?'; 
    1818$lang['stuffs_main_block'] = 'Hlavná skupina'; 
     19/*TODO*/$lang['Hide on home page'] = 'Hide on home page'; 
    1920 
    2021$lang['stuffs_add_module'] = 'Pridaj nový modul'; 
Note: See TracChangeset for help on using the changeset viewer.