Changeset 2577
- Timestamp:
- 08/22/10 14:29:58 (13 years ago)
- Location:
- plugins/muppet
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
plugins/muppet/_define.php
r2557 r2577 17 17 /* Description*/ "Create and manage entries with others post types", 18 18 /* Author */ "Osku and contributors", 19 /* Version */ '0. 8.5',19 /* Version */ '0.9', 20 20 /* Permissions */ 'usage' 21 21 ); -
plugins/muppet/index.php
r2556 r2577 55 55 56 56 for ($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(' • %s',$i) => sprintf('image-%s.png',$i))); 58 58 } 59 59 … … 80 80 } 81 81 82 $urlformat = empty($_POST['urlformat']) ? '{t}': $_POST['urlformat']; 83 82 84 //if (!preg_match('/^\w+(\s*\w+)?$/',$name)) 83 85 if (empty($name)) … … 90 92 'plural' => mb_strtolower($plural), 91 93 'icon' => $_POST['icon'], 92 'urlformat' => $ _POST['urlformat'],94 'urlformat' => $urlformat, 93 95 'integration' => $integration, 94 96 'feed' => $feed … … 149 151 img.icon {vertical-align:middle;} 150 152 span.hot {color:#009966} 151 input.delete {color:# FF0000;}153 input.delete {color:#DD0000;} 152 154 a.none{border:none;} 153 155 div.post {border-right:1px dotted #cecfca;margin: 0 20px 10px 0;} 154 156 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;} 155 160 </style> 156 161 </head> … … 167 172 168 173 $legend = __('Create a new post type'); 169 $label_add = __(' Create');174 $label_add = __('create'); 170 175 171 176 if (!empty($edit)) … … 182 187 183 188 $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" />'; 189 194 190 195 echo 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:').' '. 201 form::combo('icon',$icons,$icon).'</label></p> 202 <p class="field"><label class="required classic" title="'.__('Required field').'">'.__('Type:').' '. 203 form::field('newtype',30,255,$newtype).'</label></p> 204 <p class="field"><label class="required classic" title="'.__('Required field').'">'.__('Name:').' '. 205 form::field('name',30,255,$name).'</label></p> 206 <h3>'.__('Miscellaneous').'</h3> 207 <p class="field"><label class="classic" title="'.__('Required field').'">'.__('Plural form:').' '. 208 form::field('plural',30,255,$plural).'</label></p> 209 <p class="field"><label class="classic" >'.__('New post URL format:'). 210 form::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:'). 214 form::checkbox('integration','1',$integration).'</label></p> 215 <p class="field"><label class="classic" >'.__('Feeds:'). 216 form::checkbox('feed','2',$feed).'</label></p> 217 <p>'.form::hidden(array('p'),'muppet'). 211 218 $core->formNonce(). 212 219 '<input type="submit" name="typeadd" value="'.$label_add.'" /> '; 213 echo (!empty($edit)) ? '<input type="submit" class="delete" name="typedel" value="'.__(' Delete').'" />' : '';214 echo '</p> '.215 '</fieldset>'. 216 '</form></div>';220 echo (!empty($edit)) ? '<input type="submit" class="delete" name="typedel" value="'.__('delete').'" />' : ''; 221 echo '</p> 222 </fieldset> 223 </form></div>'; 217 224 218 225 if (empty($my_types)) … … 237 244 <li><strong>'.__('Name:').'</strong> '.$v['name'].' ('.$plural.')</li> 238 245 <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> 240 247 <li><strong>'.__('In content:').'</strong> '.$content.'</li> 241 248 <li><strong>'.__('In feeds:').'</strong> '.$feeds.'</li> … … 269 276 </div>'; 270 277 } 278 279 dcPage::helpBlock('muppet'); 271 280 ?> 272 281 </body> -
plugins/muppet/js/misc.js
r2313 r2577 1 1 $(function() { 2 $('#icon').change( 2 var selected = $('#icon option:selected').val(); 3 $('#icon').css('background-image','url(' + dotclear.icon_base_url + selected +')').change( 3 4 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+')'); 5 7 } 6 8 ); 9 $('#icon option').each(function(){ 10 var name = $(this).val(); 11 $(this).css('background-image','url(' + dotclear.icon_base_url + name +')'); 12 }); 7 13 }); 8 14 -
plugins/muppet/list.php
r2485 r2577 3 3 # 4 4 # This file is part of muppet, a plugin for Dotclear 2. 5 # 5 # 6 6 # Copyright (c) 2010 Osku and contributors 7 7 # … … 21 21 dcPage::check($my_types[$type]['perm'].',contentadmin'); 22 22 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']); 24 24 25 25 /* Pager class … … 39 39 $pager->html_next = $this->html_next; 40 40 $pager->var_page = 'page'; 41 41 42 42 $html_block = 43 43 '<table class="clear"><tr>'. … … 50 50 '<th>'.__('Status').'</th>'. 51 51 '</tr>%s</table>'; 52 52 53 53 if ($enclose_block) { 54 54 $html_block = sprintf($enclose_block,$html_block); 55 55 } 56 56 57 57 echo '<p>'.__('Page(s)').' : '.$pager->getLinks().'</p>'; 58 58 59 59 $blocks = explode('%s',$html_block); 60 60 61 61 echo $blocks[0]; 62 62 63 63 while ($this->rs->fetch()) 64 64 { 65 65 echo $this->postLine(); 66 66 } 67 67 68 68 echo $blocks[1]; 69 69 70 70 echo '<p>'.__('Page(s)').' : '.$pager->getLinks().'</p>'; 71 71 } 72 72 } 73 73 74 74 private function postLine() 75 75 { … … 101 101 $cat_title = __('None'); 102 102 } 103 103 104 104 $protected = ''; 105 105 if ($this->rs->post_password) { 106 106 $protected = sprintf($img,__('protected'),'locker.png'); 107 107 } 108 108 109 109 $selected = ''; 110 110 if ($this->rs->post_selected) { 111 111 $selected = sprintf($img,__('selected'),'selected.png'); 112 112 } 113 113 114 114 $attach = ''; 115 115 $nb_media = $this->rs->countMedia(); … … 118 118 $attach = sprintf($img,sprintf($attach_str,$nb_media),'attach.png'); 119 119 } 120 120 121 121 $res = '<tr class="line'.($this->rs->post_status != 1 ? ' offline' : '').'"'. 122 122 ' id="p'.$this->rs->post_id.'">'; 123 123 124 124 $res .= 125 125 '<td class="nowrap">'. … … 134 134 '<td class="nowrap status">'.$img_status.' '.$selected.' '.$protected.' '.$attach.'</td>'. 135 135 '</tr>'; 136 136 137 137 return $res; 138 138 } 139 139 } 140 140 141 /* Getting threads141 /* Getting Posts 142 142 -------------------------------------------------------- */ 143 143 $params = array( … … 183 183 $user_cn = dcUtils::getUserCN($users->user_id,$users->user_name, 184 184 $users->user_firstname,$users->user_displayname); 185 185 186 186 if ($user_cn != $users->user_id) { 187 187 $user_cn .= ' ('.$users->user_id.')'; 188 188 } 189 190 $users_combo[$user_cn] = $users->user_id; 191 } 192 189 190 $users_combo[$user_cn] = $users->user_id; 191 } 192 193 193 while ($categories->fetch()) { 194 194 $categories_combo[str_repeat(' ',$categories->level-1).'• '. … … 196 196 ' ('.$categories->nb_post.')'] = $categories->cat_id; 197 197 } 198 198 199 199 $status_combo = array( 200 200 '-' => '' … … 203 203 $status_combo[$v] = (string) $k; 204 204 } 205 205 206 206 $selected_combo = array( 207 207 '-' => '', … … 209 209 __('not selected') => '0' 210 210 ); 211 211 212 212 # Months array 213 213 $dt_m_combo['-'] = ''; … … 215 215 $dt_m_combo[dt::str('%B %Y',$dates->ts())] = $dates->year().$dates->month(); 216 216 } 217 217 218 218 $lang_combo['-'] = ''; 219 219 while ($langs->fetch()) { 220 220 $lang_combo[$langs->post_lang] = $langs->post_lang; 221 221 } 222 222 223 223 $sortby_combo = array( 224 224 __('Date') => 'post_dt', … … 229 229 __('Selected') => 'post_selected' 230 230 ); 231 231 232 232 $order_combo = array( 233 233 __('Descending') => 'desc', … … 330 330 $params['order'] = $sortby.' '.$order; 331 331 } 332 332 333 333 if ($sortby != 'post_dt' || $order != 'desc') { 334 334 $show_filters = true; … … 383 383 __('Filters').'</a></p>'; 384 384 } 385 385 386 386 echo 387 387 '<form action="'.$p_url.'" method="get" id="filters-form">'. … … 396 396 form::combo('status',$status_combo,$status).'</label> '. 397 397 '</div>'. 398 398 399 399 '<div class="col">'. 400 400 '<label>'.__('Selected:'). … … 405 405 form::combo('lang',$lang_combo,$lang).'</label> '. 406 406 '</div>'. 407 407 408 408 '<div class="col">'. 409 409 '<p><label>'.__('Order by:'). … … 413 413 '<p><label class="classic">'. form::field('nb',3,3,$nb_per_page).' '. 414 414 __('Entries per page').'</label> '. 415 '<p><input type="hidden" name="p" value="megapost" />'. 415 '<p><input type="hidden" name="p" value="megapost" />'. 416 416 '<input type="hidden" name="type" value="'.$type.'" />'. 417 417 '<input type="hidden" name="list" value="ok" />'. … … 422 422 '</fieldset>'. 423 423 '</form>'; 424 424 425 425 # Show pages 426 426 $post_list->display($page,$nb_per_page, 427 427 '<form action="posts_actions.php" method="post" id="form-entries">'. 428 428 429 429 '%s'. 430 430 431 431 '<div class="two-cols">'. 432 432 '<p class="col checkboxes-helpers"></p>'. 433 433 434 434 '<p class="col right">'.__('Selected entries action:').' '. 435 435 form::combo('action',$combo_action). -
plugins/muppet/locales/fr/main.lang.php
r2556 r2577 13 13 $GLOBALS['__l10n']['Muppet: last posts'] = 'Muppet : derniers billets'; 14 14 $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).'; 16 16 $GLOBALS['__l10n']['This post type is aleady used by another plugin.'] = 'Le type de billet est déjà utilisé par une autre extension.'; 17 17 $GLOBALS['__l10n']['Name should be a nice word.'] = 'Le nom doit être un joli mot.'; … … 22 22 $GLOBALS['__l10n']['New post type'] = 'Nouveau type de billet'; 23 23 $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'; 25 25 $GLOBALS['__l10n']['Modify a post type'] = 'Modifier le type de billet'; 26 $GLOBALS['__l10n']['Image:'] = 'Image :'; 27 $GLOBALS['__l10n']['Miscellaneous'] = 'Divers'; 26 28 $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 :'; 30 33 $GLOBALS['__l10n']['No type has been defined yet.'] = 'Aucun type n\'a été défini pour le moment.'; 31 34 $GLOBALS['__l10n']['edit this post type'] = 'modifier le type de billet'; -
plugins/muppet/locales/fr/main.po
r2556 r2577 3 3 msgstr "" 4 4 "Content-Type: text/plain; charset=UTF-8\n" 5 "Project-Id-Version: muppet 0. 8\n"5 "Project-Id-Version: muppet 0.9\n" 6 6 "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" 8 8 "Last-Translator: Osku\n" 9 9 "Language-Team: \n" … … 51 51 52 52 msgid "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) "53 msgstr "Le type de billet doit contenir au moins 2 lettres (seulement des lettres)." 54 54 55 55 msgid "This post type is aleady used by another plugin." … … 77 77 msgstr "Créer un nouveau type de billet" 78 78 79 msgid " Create"80 msgstr " Créer"79 msgid "create" 80 msgstr "créer" 81 81 82 82 msgid "Modify a post type" 83 83 msgstr "Modifier le type de billet" 84 84 85 msgid "Image:" 86 msgstr "Image :" 87 88 msgid "Miscellaneous" 89 msgstr "Divers" 90 85 91 msgid "Plural form:" 86 92 msgstr "Forme plurielle :" 87 93 88 msgid " Image:"89 msgstr " Image :"94 msgid "{y}: year, {m}: month, {d}: day, {id}: post id, {t}: entry title" 95 msgstr "{y} : année, {m} : mois, {d} : jour, {id} : id du billet, {t} : titre du billet" 90 96 91 msgid " Content integration:"92 msgstr "Intégration au contenu :"97 msgid "Integration" 98 msgstr "Intégration" 93 99 94 msgid "Feed integration:" 95 msgstr "Intégration à la syndication :" 100 msgid "Blog content:" 101 msgstr "Contenu du blog :" 102 103 msgid "Feeds:" 104 msgstr "Syndication :" 96 105 97 106 msgid "No type has been defined yet."
Note: See TracChangeset
for help on using the changeset viewer.