Dotclear

Changeset 2577


Ignore:
Timestamp:
08/22/10 14:29:58 (13 years ago)
Author:
Osku
Message:

muppet 0.9 - please test if you want it on Dotaddict.

Location:
plugins/muppet
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • plugins/muppet/_define.php

    r2557 r2577  
    1717     /* Description*/    "Create and manage entries with others post types", 
    1818     /* Author */        "Osku and contributors", 
    19      /* Version */       '0.8.5', 
     19     /* Version */       '0.9', 
    2020     /* Permissions */   'usage' 
    2121); 
  • plugins/muppet/index.php

    r2556 r2577  
    5555 
    5656for ($i = 1; $i <= 49; $i++) { 
    57      $icons= array_merge($icons, array(sprintf('- %s -',$i) => sprintf('image-%s.png',$i))); 
     57     $icons= array_merge($icons, array(sprintf('&nbsp;&bull; %s',$i) => sprintf('image-%s.png',$i))); 
    5858} 
    5959 
     
    8080     } 
    8181 
     82     $urlformat = empty($_POST['urlformat']) ? '{t}': $_POST['urlformat']; 
     83 
    8284     //if (!preg_match('/^\w+(\s*\w+)?$/',$name)) 
    8385     if (empty($name)) 
     
    9092          'plural' => mb_strtolower($plural), 
    9193          'icon' => $_POST['icon'], 
    92           'urlformat' => $_POST['urlformat'], 
     94          'urlformat' => $urlformat, 
    9395          'integration' => $integration, 
    9496          'feed' => $feed 
     
    149151          img.icon {vertical-align:middle;} 
    150152          span.hot {color:#009966} 
    151           input.delete {color:#FF0000;} 
     153          input.delete {color:#DD0000;} 
    152154          a.none{border:none;} 
    153155          div.post {border-right:1px dotted #cecfca;margin: 0 20px 10px 0;} 
    154156          dl.list dd{margin-left:1em;padding:5px;} 
     157          #icon,#icon option {background-color:transparent; 
     158               background-repeat:no-repeat;background-position:4% 50%; 
     159               padding:1px 1px 1px 16px;color:#444;} 
    155160     </style> 
    156161</head> 
     
    167172 
    168173$legend = __('Create a new post type'); 
    169 $label_add = __('Create'); 
     174$label_add = __('create'); 
    170175 
    171176if (!empty($edit)) 
     
    182187 
    183188          $legend = __('Modify a post type'); 
    184           $label_add = __('Save'); 
    185      } 
    186 } 
    187  
    188 $preview_icon = '<img class="icon" src="index.php?pf=muppet/img/'.$icon.'" alt="'.$icon.'" title="'.$icon.'" id="icon-preview" />'; 
     189          $label_add = __('save'); 
     190     } 
     191} 
     192 
     193//$preview_icon = '<img class="icon" src="index.php?pf=muppet/img/'.$icon.'" alt="'.$icon.'" title="'.$icon.'" id="icon-preview" />'; 
    189194 
    190195echo 
    191 '<div class="clear">'. 
    192 '<form action="'.$p_url.'" method="post" id="add-post-type">'. 
    193 '<fieldset>'. 
    194 '<legend>'.$legend .'</legend>'. 
    195 '<p><label class="required" title="'.__('Required field').'">'.__('Type:').' '. 
    196 form::field('newtype',30,255,$newtype).'</label></p>'. 
    197 '<p><label class="required" title="'.__('Required field').'">'.__('Name:').' '. 
    198 form::field('name',30,255,$name).'</label></p>'. 
    199 '<p><label class="" title="'.__('Required field').'">'.__('Plural form:').' '. 
    200 form::field('plural',30,255,$plural).'</label></p>'. 
    201 ''. 
    202 '<p><label class="classic required" title="'.__('Required field').'">'.__('Image:').' '. 
    203 form::combo('icon',$icons,$icon).'</label>'.$preview_icon.'</p>'. 
    204 '<p><label class="" >'.__('New post URL format:').' '. 
    205 form::combo('urlformat',$post_url_combo,$post_url).'</label></p>'. 
    206 '<p><label class="classic" >'.__('Content integration:').' '. 
    207 form::checkbox('integration','1',$integration).'</label></p>'. 
    208 '<p><label class="classic" >'.__('Feed integration:').' '. 
    209 form::checkbox('feed','2',$feed).'</label></p>'. 
    210 '<p>'.form::hidden(array('p'),'muppet'). 
     196'<div class="clear"> 
     197<form action="'.$p_url.'" method="post" id="add-post-type"> 
     198<fieldset> 
     199<legend>'.$legend .'</legend> 
     200<p class="field"><label class="classic required" title="'.__('Required field').'">'.__('Image:').' '. 
     201form::combo('icon',$icons,$icon).'</label></p> 
     202<p class="field"><label class="required classic" title="'.__('Required field').'">'.__('Type:').' '. 
     203form::field('newtype',30,255,$newtype).'</label></p> 
     204<p class="field"><label class="required classic" title="'.__('Required field').'">'.__('Name:').' '. 
     205form::field('name',30,255,$name).'</label></p> 
     206<h3>'.__('Miscellaneous').'</h3> 
     207<p class="field"><label class="classic" title="'.__('Required field').'">'.__('Plural form:').' '. 
     208form::field('plural',30,255,$plural).'</label></p> 
     209<p class="field"><label class="classic" >'.__('New post URL format:'). 
     210form::field('urlformat',30,255,$post_url).'</label></p> 
     211<p class="form-note">'.__('{y}: year, {m}: month, {d}: day, {id}: post id, {t}: entry title').'</p> 
     212<h3>'.__('Integration').'</h3> 
     213<p class="field"><label class="classic" >'.__('Blog content:'). 
     214form::checkbox('integration','1',$integration).'</label></p> 
     215<p class="field"><label class="classic" >'.__('Feeds:'). 
     216form::checkbox('feed','2',$feed).'</label></p> 
     217<p>'.form::hidden(array('p'),'muppet'). 
    211218$core->formNonce(). 
    212219'<input type="submit" name="typeadd" value="'.$label_add.'" />&nbsp;'; 
    213 echo (!empty($edit)) ? '<input type="submit" class="delete"  name="typedel" value="'.__('Delete').'" />' : ''; 
    214 echo '</p>'. 
    215 '</fieldset>'. 
    216 '</form></div>'; 
     220echo (!empty($edit)) ? '<input type="submit" class="delete"  name="typedel" value="'.__('delete').'" />' : ''; 
     221echo '</p> 
     222</fieldset> 
     223</form></div>'; 
    217224 
    218225if (empty($my_types)) 
     
    237244          <li><strong>'.__('Name:').'</strong> '.$v['name'].'&nbsp;('.$plural.')</li> 
    238245          <li><strong>'.__('Permission:').'</strong> '.sprintf(__('manage the %s'),$plural).'</li> 
    239           <li><strong>'.__('New post URL format:').'</strong> '.form::combo(array($k,'url'),$post_url_combo,$v['urlformat'],'','',true).'</li> 
     246          <li><strong>'.__('New post URL format:').'</strong> '.$v['urlformat'].'</li> 
    240247          <li><strong>'.__('In content:').'</strong> '.$content.'</li> 
    241248          <li><strong>'.__('In feeds:').'</strong> '.$feeds.'</li> 
     
    269276     </div>'; 
    270277} 
     278 
     279dcPage::helpBlock('muppet'); 
    271280?> 
    272281</body> 
  • plugins/muppet/js/misc.js

    r2313 r2577  
    11$(function() { 
    2      $('#icon').change( 
     2     var selected = $('#icon option:selected').val(); 
     3     $('#icon').css('background-image','url(' + dotclear.icon_base_url + selected +')').change( 
    34          function(){ 
    4                $('#icon-preview').attr('src',dotclear.icon_base_url+this.value).attr('title',this.value).attr('alt',this.value); 
     5               //$('#icon-preview').attr('src',dotclear.icon_base_url+this.value).attr('title',this.value).attr('alt',this.value); 
     6               $(this).css('background-image','url('+dotclear.icon_base_url+this.value+')'); 
    57          } 
    68     ); 
     9     $('#icon option').each(function(){ 
     10          var name = $(this).val(); 
     11          $(this).css('background-image','url(' + dotclear.icon_base_url + name +')'); 
     12     }); 
    713}); 
    814 
  • plugins/muppet/list.php

    r2485 r2577  
    33# 
    44# This file is part of muppet, a plugin for Dotclear 2. 
    5 #  
     5# 
    66# Copyright (c) 2010 Osku and contributors 
    77# 
     
    2121dcPage::check($my_types[$type]['perm'].',contentadmin'); 
    2222 
    23 $plural = empty($my_types[$type]['plural']) ? $my_types[$type]['name'].'s' : $my_types[$type]['plural']; 
     23$plural = empty($my_types[$type]['plural']) ? ucfirst($my_types[$type]['name'].'s') : ucfirst($my_types[$type]['plural']); 
    2424 
    2525/* Pager class 
     
    3939               $pager->html_next = $this->html_next; 
    4040               $pager->var_page = 'page'; 
    41                 
     41 
    4242               $html_block = 
    4343               '<table class="clear"><tr>'. 
     
    5050               '<th>'.__('Status').'</th>'. 
    5151               '</tr>%s</table>'; 
    52                 
     52 
    5353               if ($enclose_block) { 
    5454                    $html_block = sprintf($enclose_block,$html_block); 
    5555               } 
    56                 
     56 
    5757               echo '<p>'.__('Page(s)').' : '.$pager->getLinks().'</p>'; 
    58                 
     58 
    5959               $blocks = explode('%s',$html_block); 
    60                 
     60 
    6161               echo $blocks[0]; 
    62                 
     62 
    6363               while ($this->rs->fetch()) 
    6464               { 
    6565                    echo $this->postLine(); 
    6666               } 
    67                 
     67 
    6868               echo $blocks[1]; 
    69                 
     69 
    7070               echo '<p>'.__('Page(s)').' : '.$pager->getLinks().'</p>'; 
    7171          } 
    7272     } 
    73       
     73 
    7474     private function postLine() 
    7575     { 
     
    101101               $cat_title = __('None'); 
    102102          } 
    103            
     103 
    104104          $protected = ''; 
    105105          if ($this->rs->post_password) { 
    106106               $protected = sprintf($img,__('protected'),'locker.png'); 
    107107          } 
    108            
     108 
    109109          $selected = ''; 
    110110          if ($this->rs->post_selected) { 
    111111               $selected = sprintf($img,__('selected'),'selected.png'); 
    112112          } 
    113            
     113 
    114114          $attach = ''; 
    115115          $nb_media = $this->rs->countMedia(); 
     
    118118               $attach = sprintf($img,sprintf($attach_str,$nb_media),'attach.png'); 
    119119          } 
    120            
     120 
    121121          $res = '<tr class="line'.($this->rs->post_status != 1 ? ' offline' : '').'"'. 
    122122          ' id="p'.$this->rs->post_id.'">'; 
    123            
     123 
    124124          $res .= 
    125125          '<td class="nowrap">'. 
     
    134134          '<td class="nowrap status">'.$img_status.' '.$selected.' '.$protected.' '.$attach.'</td>'. 
    135135          '</tr>'; 
    136            
     136 
    137137          return $res; 
    138138     } 
    139139} 
    140140 
    141 /* Getting threads 
     141/* Getting Posts 
    142142-------------------------------------------------------- */ 
    143143$params = array( 
     
    183183          $user_cn = dcUtils::getUserCN($users->user_id,$users->user_name, 
    184184          $users->user_firstname,$users->user_displayname); 
    185            
     185 
    186186          if ($user_cn != $users->user_id) { 
    187187               $user_cn .= ' ('.$users->user_id.')'; 
    188188          } 
    189            
    190           $users_combo[$user_cn] = $users->user_id;  
    191      } 
    192       
     189 
     190          $users_combo[$user_cn] = $users->user_id; 
     191     } 
     192 
    193193     while ($categories->fetch()) { 
    194194          $categories_combo[str_repeat('&nbsp;&nbsp;',$categories->level-1).'&bull; '. 
     
    196196               ' ('.$categories->nb_post.')'] = $categories->cat_id; 
    197197     } 
    198       
     198 
    199199     $status_combo = array( 
    200200     '-' => '' 
     
    203203          $status_combo[$v] = (string) $k; 
    204204     } 
    205       
     205 
    206206     $selected_combo = array( 
    207207     '-' => '', 
     
    209209     __('not selected') => '0' 
    210210     ); 
    211       
     211 
    212212     # Months array 
    213213     $dt_m_combo['-'] = ''; 
     
    215215          $dt_m_combo[dt::str('%B %Y',$dates->ts())] = $dates->year().$dates->month(); 
    216216     } 
    217       
     217 
    218218     $lang_combo['-'] = ''; 
    219219     while ($langs->fetch()) { 
    220220          $lang_combo[$langs->post_lang] = $langs->post_lang; 
    221221     } 
    222       
     222 
    223223     $sortby_combo = array( 
    224224     __('Date') => 'post_dt', 
     
    229229     __('Selected') => 'post_selected' 
    230230     ); 
    231       
     231 
    232232     $order_combo = array( 
    233233     __('Descending') => 'desc', 
     
    330330          $params['order'] = $sortby.' '.$order; 
    331331     } 
    332       
     332 
    333333     if ($sortby != 'post_dt' || $order != 'desc') { 
    334334          $show_filters = true; 
     
    383383          __('Filters').'</a></p>'; 
    384384     } 
    385       
     385 
    386386     echo 
    387387     '<form action="'.$p_url.'" method="get" id="filters-form">'. 
     
    396396     form::combo('status',$status_combo,$status).'</label> '. 
    397397     '</div>'. 
    398       
     398 
    399399     '<div class="col">'. 
    400400     '<label>'.__('Selected:'). 
     
    405405     form::combo('lang',$lang_combo,$lang).'</label> '. 
    406406     '</div>'. 
    407       
     407 
    408408     '<div class="col">'. 
    409409     '<p><label>'.__('Order by:'). 
     
    413413     '<p><label class="classic">'. form::field('nb',3,3,$nb_per_page).' '. 
    414414     __('Entries per page').'</label> '. 
    415      '<p><input type="hidden" name="p" value="megapost" />'.      
     415     '<p><input type="hidden" name="p" value="megapost" />'. 
    416416     '<input type="hidden" name="type" value="'.$type.'" />'. 
    417417     '<input type="hidden" name="list" value="ok" />'. 
     
    422422     '</fieldset>'. 
    423423     '</form>'; 
    424       
     424 
    425425     # Show pages 
    426426     $post_list->display($page,$nb_per_page, 
    427427     '<form action="posts_actions.php" method="post" id="form-entries">'. 
    428       
     428 
    429429     '%s'. 
    430       
     430 
    431431     '<div class="two-cols">'. 
    432432     '<p class="col checkboxes-helpers"></p>'. 
    433       
     433 
    434434     '<p class="col right">'.__('Selected entries action:').' '. 
    435435     form::combo('action',$combo_action). 
  • plugins/muppet/locales/fr/main.lang.php

    r2556 r2577  
    1313$GLOBALS['__l10n']['Muppet: last posts'] = 'Muppet : derniers billets'; 
    1414$GLOBALS['__l10n']['id'] = 'id'; 
    15 $GLOBALS['__l10n']['Post type must contain at least 2 letters (only letters).'] = 'Le type de billet doit contenir au moins 2 lettres (seulement des lettres)'; 
     15$GLOBALS['__l10n']['Post type must contain at least 2 letters (only letters).'] = 'Le type de billet doit contenir au moins 2 lettres (seulement des lettres).'; 
    1616$GLOBALS['__l10n']['This post type is aleady used by another plugin.'] = 'Le type de billet est déjà utilisé par une autre extension.'; 
    1717$GLOBALS['__l10n']['Name should be a nice word.'] = 'Le nom doit être un joli mot.'; 
     
    2222$GLOBALS['__l10n']['New post type'] = 'Nouveau type de billet'; 
    2323$GLOBALS['__l10n']['Create a new post type'] = 'Créer un nouveau type de billet'; 
    24 $GLOBALS['__l10n']['Create'] = 'Créer'; 
     24$GLOBALS['__l10n']['create'] = 'créer'; 
    2525$GLOBALS['__l10n']['Modify a post type'] = 'Modifier le type de billet'; 
     26$GLOBALS['__l10n']['Image:'] = 'Image :'; 
     27$GLOBALS['__l10n']['Miscellaneous'] = 'Divers'; 
    2628$GLOBALS['__l10n']['Plural form:'] = 'Forme plurielle :'; 
    27 $GLOBALS['__l10n']['Image:'] = 'Image :'; 
    28 $GLOBALS['__l10n']['Content integration:'] = 'Intégration au contenu :'; 
    29 $GLOBALS['__l10n']['Feed integration:'] = 'Intégration à la syndication :'; 
     29$GLOBALS['__l10n']['{y}: year, {m}: month, {d}: day, {id}: post id, {t}: entry title'] = '{y} : année, {m} : mois, {d} : jour, {id} : id du billet, {t} : titre du billet'; 
     30$GLOBALS['__l10n']['Integration'] = 'Intégration'; 
     31$GLOBALS['__l10n']['Blog content:'] = 'Contenu du blog :'; 
     32$GLOBALS['__l10n']['Feeds:'] = 'Syndication :'; 
    3033$GLOBALS['__l10n']['No type has been defined yet.'] = 'Aucun type n\'a été défini pour le moment.'; 
    3134$GLOBALS['__l10n']['edit this post type'] = 'modifier le type de billet'; 
  • plugins/muppet/locales/fr/main.po

    r2556 r2577  
    33msgstr "" 
    44"Content-Type: text/plain; charset=UTF-8\n" 
    5 "Project-Id-Version: muppet 0.8\n" 
     5"Project-Id-Version: muppet 0.9\n" 
    66"POT-Creation-Date: \n" 
    7 "PO-Revision-Date: 2010-08-18T18:10:36+00:00\n" 
     7"PO-Revision-Date: 2010-08-21T10:37:54+00:00\n" 
    88"Last-Translator: Osku\n" 
    99"Language-Team: \n" 
     
    5151 
    5252msgid "Post type must contain at least 2 letters (only letters)." 
    53 msgstr "Le type de billet doit contenir au moins 2 lettres (seulement des lettres)" 
     53msgstr "Le type de billet doit contenir au moins 2 lettres (seulement des lettres)." 
    5454 
    5555msgid "This post type is aleady used by another plugin." 
     
    7777msgstr "Créer un nouveau type de billet" 
    7878 
    79 msgid "Create" 
    80 msgstr "Créer" 
     79msgid "create" 
     80msgstr "créer" 
    8181 
    8282msgid "Modify a post type" 
    8383msgstr "Modifier le type de billet" 
    8484 
     85msgid "Image:" 
     86msgstr "Image :" 
     87 
     88msgid "Miscellaneous" 
     89msgstr "Divers" 
     90 
    8591msgid "Plural form:" 
    8692msgstr "Forme plurielle :" 
    8793 
    88 msgid "Image:" 
    89 msgstr "Image :" 
     94msgid "{y}: year, {m}: month, {d}: day, {id}: post id, {t}: entry title" 
     95msgstr "{y} : année, {m} : mois, {d} : jour, {id} : id du billet, {t} : titre du billet" 
    9096 
    91 msgid "Content integration:" 
    92 msgstr "Intégration au contenu :" 
     97msgid "Integration" 
     98msgstr "Intégration" 
    9399 
    94 msgid "Feed integration:" 
    95 msgstr "Intégration à la syndication :" 
     100msgid "Blog content:" 
     101msgstr "Contenu du blog :" 
     102 
     103msgid "Feeds:" 
     104msgstr "Syndication :" 
    96105 
    97106msgid "No type has been defined yet." 
Note: See TracChangeset for help on using the changeset viewer.

Sites map