Changeset 2334
- Timestamp:
- 06/08/10 17:25:04 (13 years ago)
- Location:
- plugins/mymeta/trunk
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
plugins/mymeta/trunk/_public.php
r2333 r2334 25 25 $core->tpl->addValue('MetaType',array('tplMyMeta','MetaType')); 26 26 $core->tpl->addValue('MyMetaTypePrompt',array('tplMyMeta','MyMetaTypePrompt')); 27 $core->tpl->addValue('EntryMyMetaValue',array('tplMyMeta','EntryMyMetaValue'));28 27 $core->tpl->addValue('EntryMyMetaValue',array('tplMyMeta','EntryMyMetaValue')); 29 28 $core->tpl->addValue('MyMetaValue',array('tplMyMeta','MyMetaValue')); … … 267 266 268 267 if (sizeof($values)==1) { 269 self::serveDocument('mymetas.html'); 270 } else { 268 $tpl = ($mymeta->tpl_list=='')?'mymetas.html':$mymeta->tpl_list; 269 if ($mymeta->url_list_enabled && $core->tpl->getFilePath($tpl)) { 270 self::serveDocument($tpl); 271 } else { 272 self::p404(); 273 } 274 } else { 271 275 $mymeta_value=$values[1]; 272 276 $_ctx->meta = $core->mymeta->dcmeta->getMeta($mymeta->id,null,$mymeta_value); 273 if ($_ctx->meta->isEmpty()) { 277 $tpl = ($mymeta->tpl_single=='')?'mymeta.html':$mymeta->tpl_single; 278 if (!$_ctx->meta->isEmpty() && $mymeta->url_single_enabled && $core->tpl->getFilePath($tpl)) { 279 self::serveDocument($tpl); 280 } else { 274 281 self::p404(); 275 } else { 276 self::serveDocument('mymeta.html'); 282 return; 277 283 } 278 284 } -
plugins/mymeta/trunk/class.mymeta.php
r2324 r2334 315 315 $inSection=true; 316 316 } elseif ($meta->enabled) { 317 if (!isset($post ->post_type) || $meta->isEnabledFor($post->post_type)) {317 if (!isset($post) || $meta->isEnabledFor($post->post_type)) { 318 318 if (!$inSection) { 319 319 $res .= '<fieldset><legend>'.__('My Meta').'</legend>'; -
plugins/mymeta/trunk/class.mymetatypes.php
r2333 r2334 40 40 public $contexts; 41 41 public $post_types; 42 public $template_list = null; 43 public $template_single = null; 42 public $tpl_list = ''; 43 public $url_list_enabled = true; 44 public $tpl_single = ''; 45 public $url_single_enabled = true; 44 46 45 47 -
plugins/mymeta/trunk/index_edit.php
r2324 r2334 25 25 require DC_ROOT.'/inc/admin/lib.pager.php'; 26 26 27 28 function filterTplFile($file,$default) { 29 $f = trim($file); 30 if (preg_match('#[/\\]#',$f) || $f == $default) 31 return ''; 32 else 33 return $f; 34 } 35 36 27 37 if (!empty($_POST['mymeta_id'])) { 28 38 $mymetaid = preg_replace('#[^a-zA-Z0-9_-]#','',$_POST['mymeta_id']); … … 37 47 } 38 48 } 39 49 $mymetaEntry->url_list_enabled = isset($_POST['enable_list']); 50 $mymetaEntry->url_single_enabled = isset($_POST['enable_single']); 51 $mymetaEntry->tpl_single = filterTplFile($_POST['single_tpl'],"mymeta.html"); 52 $mymetaEntry->tpl_list = filterTplFile($_POST['list_tpl'],"mymetas.html"); 40 53 41 54 $mymetaEntry->adminUpdate($_POST); 42 55 $mymeta->update($mymetaEntry); 43 56 $mymeta->store(); 44 http::redirect( 'plugin.php?p=mymeta');57 http::redirect($p_url.'&status=mmupd'); 45 58 exit; 46 59 } … … 66 79 $type_label = array_search ($mymeta_type,$types); 67 80 if (!$type_label) 68 http::redirect( 'plugin.php?p=mymeta');81 http::redirect($p_url); 69 82 70 83 … … 107 120 </fieldset> 108 121 <fieldset> 122 <legend><?php echo __('Metadata URLs'); ?></legend> 123 <?php 124 $base_url = $core->blog->url.$core->url->getBase("mymeta").'/'.$mymetaentry->id; 125 $tpl_single = $mymetaentry->tpl_single; 126 $tpl_list = $mymetaentry->tpl_list; 127 echo 128 '<p><label class="classic">'. 129 form::checkbox(array('enable_list'),1,$mymetaentry->url_list_enabled). 130 __('Enable metadata values list public page').'</label><br />'. 131 '<label class="classic">'.__('List template file (leave empty for default mymetas.html)').' : '. 132 form::field(array('list_tpl'), 40, 255, empty($tpl_list)?'mymetas.html':$tpl_list). 133 '</label></p>'. 134 '<p><label class="classic">'. 135 form::checkbox(array('enable_single'),1,$mymetaentry->url_single_enabled). 136 __('Enable single metadata value public page'). 137 '</label><br />'. 138 '<label class="classic">'.__('Single template file (leave empty for default mymeta.html)').' : '. 139 form::field(array('single_tpl'), 40, 255, empty($tpl_single)?'mymeta.html':$tpl_single). 140 '</label></p>'; ?> 141 </fieldset> 142 <fieldset> 109 143 <legend><?php echo __('Metadata restrictions'); ?></legend> 110 144 <p> -
plugins/mymeta/trunk/index_edit_section.php
r2324 r2334 35 35 $mymeta->store(); 36 36 } 37 http::redirect( 'plugin.php?p=mymeta');37 http::redirect($p_url.'&status=secupd'); 38 38 exit; 39 39 } … … 44 44 $mymetasection=$mymeta->getByID($_REQUEST['id']); 45 45 if (!($mymetasection instanceof myMetaSection)) { 46 http::redirect( 'plugin.php?p=mymeta');46 http::redirect($p_url); 47 47 exit; 48 48 } 49 49 50 50 } else { 51 http::redirect( 'plugin.php?p=mymeta');51 http::redirect($p_url); 52 52 exit; 53 53 } -
plugins/mymeta/trunk/index_home.php
r2324 r2334 77 77 $combo_action[__('disable')] = 'disable'; 78 78 $combo_action[__('delete')] = 'delete'; 79 80 $statuses = array( 81 'mmupd' => __('MyMeta has been successfully updated'), 82 'secupd' => __('Section has been successfully updated') 83 ); 84 79 85 ?> 80 86 <html> … … 88 94 </head> 89 95 <body> 90 96 <?php 97 if (isset($_GET['status']) && in_array($_GET['status'], $statuses)) { 98 echo '<p class="message">'.$statuses[$_GET['status']].'</p>'; 99 } 100 ?> 91 101 <h2><?php echo html::escapeHTML($core->blog->name); ?> > 92 102 <?php echo __('My Metadata').' > '.__('Main menu'); ?></h2> … … 141 151 '<td class="minimal">'.form::checkbox(array('entries[]'),$meta->id).'</td>'. 142 152 '<td class="nowrap minimal"><a href="plugin.php?p=mymeta&m=editsection&id='.$meta->id.'">'. 143 '<img src="images/menu/edit.png" alt="'.__('edit Metadata').'" /></ td>'.153 '<img src="images/menu/edit.png" alt="'.__('edit Metadata').'" /></a></td>'. 144 154 '<td class="nowrap" colspan="6">'. 145 155 '<strong>Section: '.html::escapeHTML($meta->prompt).'</strong></td>'. … … 162 172 '<td class="minimal">'.form::checkbox(array('entries[]'),$meta->id).'</td>'. 163 173 '<td class="nowrap minimal"><a href="plugin.php?p=mymeta&m=edit&id='.$meta->id.'">'. 164 '<img src="images/menu/edit.png" alt="'.__('edit Metadata').'" /></ td>'.174 '<img src="images/menu/edit.png" alt="'.__('edit Metadata').'" /></a></td>'. 165 175 '<td class="nowrap"><a href="plugin.php?p=mymeta&m=view&id='.$meta->id.'">'. 166 176 html::escapeHTML($meta->id).'</a></td>'. -
plugins/mymeta/trunk/index_view.php
r2324 r2334 25 25 require DC_ROOT.'/inc/admin/lib.pager.php'; 26 26 if (empty($_GET['id'])) { 27 http::redirect( 'plugin.php?p=mymeta');27 http::redirect($p_url); 28 28 exit; 29 29 } … … 31 31 $mymetaEntry = $mymeta->getByID($_GET['id']); 32 32 if ($mymetaEntry == null) { 33 http::redirect( 'plugin.php?p=mymeta');33 http::redirect($p_url); 34 34 exit; 35 35 } … … 90 90 } 91 91 } 92 $statuses = array( 93 'valchg' => __('Value has been successfully changed') 94 ); 92 95 93 96 ?> … … 99 102 <body> 100 103 <?php 104 105 if (isset($_GET['status']) && array_key_exists($_GET['status'], $statuses)) { 106 echo '<p class="message">'.$statuses[$_GET['status']].'</p>'; 107 } 108 echo '<h2>'.html::escapeHTML($core->blog->name).'>'.__('My Metadata').' > </h2>'; 109 101 110 echo '<p><a href="plugin.php?p=mymeta" class="multi-part">'.__('My metadata').'</a></p>'; 102 111 echo '<div class="multi-part" id="mymeta" title="'.__('Metadata').' : '.html::escapeHTML($mymetaEntry->id).'">'; -
plugins/mymeta/trunk/index_view_posts.php
r2324 r2334 48 48 try { 49 49 if ($core->meta->updateMeta($value,$new_value,$mymetaEntry->id)) { 50 http::redirect($p_url.'&m=view&id='.$mymetaEntry->id );50 http::redirect($p_url.'&m=view&id='.$mymetaEntry->id.'&status=valchg'); 51 51 } 52 52 } catch (Exception $e) { -
plugins/mymeta/trunk/locales/_pot/main.pot
r2324 r2334 8 8 "Project-Id-Version: Dotclear 2 mymeta module\n" 9 9 "Report-Msgid-Bugs-To: \n" 10 "POT-Creation-Date: 2010-06-0 7 23:10+0200\n"10 "POT-Creation-Date: 2010-06-08 17:17+0200\n" 11 11 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 12 12 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" … … 32 32 msgstr "" 33 33 34 #: plugins/mymeta/_admin.php:27 plugins/mymeta/index_edit.php:81 35 #: plugins/mymeta/index_edit_section.php:65 plugins/mymeta/index_home.php:82 36 #: plugins/mymeta/index_home.php:92 plugins/mymeta/index_home.php:93 34 #: plugins/mymeta/_admin.php:27 plugins/mymeta/index_edit.php:94 35 #: plugins/mymeta/index_edit_section.php:65 plugins/mymeta/index_home.php:88 36 #: plugins/mymeta/index_home.php:102 plugins/mymeta/index_home.php:103 37 #: plugins/mymeta/index_view.php:108 37 38 msgid "My Metadata" 38 39 msgstr "" … … 54 55 msgstr "" 55 56 56 #: plugins/mymeta/class.mymetatypes.php:22 257 #: plugins/mymeta/class.mymetatypes.php:226 57 58 msgid "String" 58 59 msgstr "" 59 60 60 #: plugins/mymeta/class.mymetatypes.php:23 561 #: plugins/mymeta/class.mymetatypes.php:239 61 62 msgid "Items List" 62 63 msgstr "" 63 64 64 #: plugins/mymeta/class.mymetatypes.php:28 165 #: plugins/mymeta/class.mymetatypes.php:288 65 66 msgid "Values : enter 1 value per line (syntax for each line : ID: description)" 66 67 msgstr "" 67 68 68 #: plugins/mymeta/class.mymetatypes.php:3 0469 #: plugins/mymeta/class.mymetatypes.php:311 69 70 msgid "Checkbox" 70 71 msgstr "" 71 72 72 #: plugins/mymeta/index_edit.php: 4973 #: plugins/mymeta/index_edit.php:62 73 74 msgid "Edit Metadata" 74 75 msgstr "" 75 76 76 #: plugins/mymeta/index_edit.php: 60 plugins/mymeta/index_home.php:9677 #: plugins/mymeta/index_edit.php:73 plugins/mymeta/index_home.php:106 77 78 msgid "New Metadata" 78 79 msgstr "" 79 80 80 #: plugins/mymeta/index_edit.php: 74 plugins/mymeta/index_edit.php:8381 #: plugins/mymeta/index_edit.php:87 plugins/mymeta/index_edit.php:96 81 82 #: plugins/mymeta/index_edit_section.php:58 82 #: plugins/mymeta/index_edit_section.php:67 plugins/mymeta/index_view.php:9 683 #: plugins/mymeta/index_view.php:1 01 plugins/mymeta/index_view_posts.php:13283 #: plugins/mymeta/index_edit_section.php:67 plugins/mymeta/index_view.php:99 84 #: plugins/mymeta/index_view.php:110 plugins/mymeta/index_view_posts.php:146 84 85 msgid "My metadata" 85 86 msgstr "" 86 87 87 #: plugins/mymeta/index_edit.php: 90plugins/mymeta/index_edit_section.php:7488 #: plugins/mymeta/index_edit.php:103 plugins/mymeta/index_edit_section.php:74 88 89 msgid "Metadata definition" 89 90 msgstr "" 90 91 91 #: plugins/mymeta/index_edit.php: 9292 #: plugins/mymeta/index_edit.php:105 92 93 msgid "Identifier (as stored in meta_type in database):" 93 94 msgstr "" 94 95 95 #: plugins/mymeta/index_edit.php: 9796 #: plugins/mymeta/index_edit.php:110 96 97 msgid "Metadata type" 97 98 msgstr "" 98 99 99 #: plugins/mymeta/index_edit.php:1 02 plugins/mymeta/index_home.php:120100 #: plugins/mymeta/index_edit.php:115 plugins/mymeta/index_home.php:130 100 101 msgid "Prompt" 101 102 msgstr "" 102 103 103 #: plugins/mymeta/index_edit.php:109 104 #: plugins/mymeta/index_edit.php:122 105 msgid "Metadata URLs" 106 msgstr "" 107 108 #: plugins/mymeta/index_edit.php:130 109 msgid "Enable metadata values list public page" 110 msgstr "" 111 112 #: plugins/mymeta/index_edit.php:131 113 msgid "List template" 114 msgstr "" 115 116 #: plugins/mymeta/index_edit.php:136 117 msgid "Enable single metadata value public page" 118 msgstr "" 119 120 #: plugins/mymeta/index_edit.php:138 121 msgid "Single template" 122 msgstr "" 123 124 #: plugins/mymeta/index_edit.php:143 104 125 msgid "Metadata restrictions" 105 126 msgstr "" 106 127 107 #: plugins/mymeta/index_edit.php:1 13128 #: plugins/mymeta/index_edit.php:147 108 129 msgid "Display meta field for any post type" 109 130 msgstr "" 110 131 111 #: plugins/mymeta/index_edit.php:1 15112 msgid " 132 #: plugins/mymeta/index_edit.php:149 133 msgid "Restrict to the following post types :" 113 134 msgstr "" 114 135 … … 125 146 msgstr "" 126 147 127 #: plugins/mymeta/index_home.php:92 148 #: plugins/mymeta/index_home.php:81 149 msgid "MyMeta has been successfully updated" 150 msgstr "" 151 152 #: plugins/mymeta/index_home.php:82 153 msgid "Section has been successfully updated" 154 msgstr "" 155 156 #: plugins/mymeta/index_home.php:102 128 157 msgid "Main menu" 129 158 msgstr "" 130 159 131 #: plugins/mymeta/index_home.php: 98160 #: plugins/mymeta/index_home.php:108 132 161 msgid "Create Metadata" 133 162 msgstr "" 134 163 135 #: plugins/mymeta/index_home.php:1 06164 #: plugins/mymeta/index_home.php:116 136 165 msgid "New section" 137 166 msgstr "" 138 167 139 #: plugins/mymeta/index_home.php:1 08168 #: plugins/mymeta/index_home.php:118 140 169 msgid "Create section" 141 170 msgstr "" 142 171 143 #: plugins/mymeta/index_home.php:1 18172 #: plugins/mymeta/index_home.php:128 144 173 msgid "ID" 145 174 msgstr "" 146 175 147 #: plugins/mymeta/index_home.php:1 21176 #: plugins/mymeta/index_home.php:131 148 177 msgid "Post types" 149 178 msgstr "" 150 179 151 #: plugins/mymeta/index_home.php:1 22180 #: plugins/mymeta/index_home.php:132 152 181 msgid "Number of Posts" 153 182 msgstr "" 154 183 155 #: plugins/mymeta/index_home.php:155 184 #: plugins/mymeta/index_home.php:153 plugins/mymeta/index_home.php:174 185 msgid "edit Metadata" 186 msgstr "" 187 188 #: plugins/mymeta/index_home.php:167 156 189 msgid "All" 157 190 msgstr "" 158 191 159 #: plugins/mymeta/index_home.php: 187192 #: plugins/mymeta/index_home.php:200 160 193 msgid "Selected metas action:" 161 194 msgstr "" … … 169 202 msgstr "" 170 203 171 #: plugins/mymeta/index_view.php:102 plugins/mymeta/index_view_posts.php:133 204 #: plugins/mymeta/index_view.php:93 205 msgid "Value has been successfully changed" 206 msgstr "" 207 208 #: plugins/mymeta/index_view.php:111 plugins/mymeta/index_view_posts.php:147 172 209 msgid "Metadata" 173 210 msgstr "" 174 211 175 #: plugins/mymeta/index_view.php:1 08212 #: plugins/mymeta/index_view.php:117 176 213 msgid "Values" 177 214 msgstr "" 178 215 179 #: plugins/mymeta/index_view_posts.php:1 25216 #: plugins/mymeta/index_view_posts.php:139 180 217 msgid "Edit MyMeta" 181 218 msgstr "" 182 219 183 #: plugins/mymeta/index_view_posts.php:1 29220 #: plugins/mymeta/index_view_posts.php:143 184 221 msgid "MyMeta has been successfully renamed" 185 222 msgstr "" 186 223 187 #: plugins/mymeta/index_view_posts.php:1 34224 #: plugins/mymeta/index_view_posts.php:148 188 225 msgid "MyMeta Posts" 189 226 msgstr "" 190 227 191 #: plugins/mymeta/index_view_posts.php:1 38228 #: plugins/mymeta/index_view_posts.php:152 192 229 msgid "Current value :" 193 230 msgstr "" 194 231 195 #: plugins/mymeta/index_view_posts.php:1 42232 #: plugins/mymeta/index_view_posts.php:156 196 233 msgid "Change MyMeta value" 197 234 msgstr "" -
plugins/mymeta/trunk/locales/fr/main.po
r2324 r2334 5 5 "Project-Id-Version: \n" 6 6 "Report-Msgid-Bugs-To: \n" 7 "POT-Creation-Date: 2010-06-0 7 23:10+0200\n"7 "POT-Creation-Date: 2010-06-08 17:17+0200\n" 8 8 "PO-Revision-Date: \n" 9 9 "Last-Translator: Kozlika <kozlika@free.fr>\n" … … 38 38 39 39 msgid "Mymeta errors :" 40 msgstr "Erreurs Mymeta "40 msgstr "Erreurs Mymeta :" 41 41 42 42 msgid "String" … … 73 73 msgstr "Invite" 74 74 75 #, fuzzy 75 msgid "Metadata URLs" 76 msgstr "URL des Métadonnées" 77 78 msgid "Enable metadata values list public page" 79 msgstr "Activer les pages publiques des listes de valeurs de la métadonnée" 80 81 msgid "List template file (leave empty for default mymetas.html)" 82 msgstr "Fichier de template pour les listes (laisser vide pour mymetas.html)" 83 84 msgid "Enable single metadata value public page" 85 msgstr "Activer les pages publiques des bilelts d'une valeur donnée de la métadonnée" 86 87 msgid "Single template file (leave empty for default mymeta.html)" 88 msgstr "Fichier de template pour les listes de billets (laisser vide pour mymeta.html)" 89 90 76 91 msgid "Metadata restrictions" 77 92 msgstr "Restrictions sur la métadonnée" … … 92 107 msgstr "désactiver" 93 108 109 110 msgid "MyMeta has been successfully updated" 111 msgstr "La métadonnée a été mise à jour avec succès" 112 113 msgid "Section has been successfully updated" 114 msgstr "La section a été mise à jour avec succès" 115 94 116 msgid "Main menu" 95 117 msgstr "Menu principal" … … 108 130 109 131 msgid "Post types" 110 msgstr " "132 msgstr "Types de billets" 111 133 112 134 msgid "Number of Posts" 113 135 msgstr "Nombre de billets" 136 137 138 msgid "edit Metadata" 139 msgstr "Editer la métadonnée" 114 140 115 141 msgid "All" … … 125 151 msgstr "Nombre de billets" 126 152 153 #, fuzzy 154 msgid "Value has been successfully changed" 155 msgstr "La métadonnée a été renommée avec succès" 156 127 157 msgid "Metadata" 128 158 msgstr "Métadonnées" … … 132 162 133 163 msgid "Edit MyMeta" 134 msgstr "Editer l a métadonnée"164 msgstr "Editer les métadonnées" 135 165 136 166 msgid "MyMeta has been successfully renamed"
Note: See TracChangeset
for help on using the changeset viewer.