Changeset 2477
- Timestamp:
- 07/10/10 19:30:32 (13 years ago)
- Location:
- plugins/templator
- Files:
-
- 1 added
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
plugins/templator/_admin.php
r2411 r2477 21 21 { 22 22 $core->addBehavior('adminPostFormSidebar',array('templatorBehaviors','adminPostFormSidebar')); 23 $core->addBehavior('adminPageFormSidebar',array('templatorBehaviors','adminP ageFormSidebar'));23 $core->addBehavior('adminPageFormSidebar',array('templatorBehaviors','adminPostFormSidebar')); 24 24 25 25 $core->addBehavior('adminAfterPostCreate',array('templatorBehaviors','adminBeforePostUpdate')); … … 42 42 global $core; 43 43 44 $setting = unserialize($core->blog->settings->templator->templator_files_active);45 44 $ressources = unserialize($core->blog->settings->templator->templator_files); 46 $tpl = array( ' '=> '');45 $tpl = array(__(' — standard — ') => ''); 47 46 $tpl_post = array(); 48 //$type = (isset($_REQUEST['type'])) ? $_REQUEST['type'] : 'post' ;49 47 $selected = ''; 50 48 51 foreach ($ settingas $k => $v) {52 if ( /*($ressources[$k]['type'] == $type) && */($v['used'] == true))49 foreach ($ressources as $k => $v) { 50 if (($v['isCat'] == false) && ($v['used'] == true)) 53 51 { 54 $tpl_post= array_merge($tpl_post, array($ ressources[$k]['title']=> $k));52 $tpl_post= array_merge($tpl_post, array($v['title']=> $k)); 55 53 } 56 54 } 57 55 58 if (!empty($tpl_post)) 56 $tpl = array_merge($tpl,$tpl_post); 57 if ($post) 59 58 { 60 $tpl = array_merge($tpl,$tpl_post); 61 if ($post) 62 { 63 $params['meta_type'] = 'template'; 64 $params['post_id'] = $post->post_id; 65 $post_meta = $core->meta->getMetadata($params); 66 $selected = $post_meta->isEmpty()? '' : $post_meta->meta_id ; 67 } 68 69 echo 70 '<h3><label for="post_tpl">'.__('Specific template:').'</label></h3>'. 71 '<div class="p" id="meta-edit-tpl">'.form::combo('post_tpl',$tpl,$selected).'</div>'; 59 $params['meta_type'] = 'template'; 60 $params['post_id'] = $post->post_id; 61 $post_meta = $core->meta->getMetadata($params); 62 $selected = $post_meta->isEmpty()? '' : $post_meta->meta_id ; 72 63 } 73 }74 75 public static function adminPageFormSidebar($post)76 {77 global $core;78 79 $setting = unserialize($core->blog->settings->templator->templator_files_active);80 $ressources = unserialize($core->blog->settings->templator->templator_files);81 $tpl = array('' => '');82 $tpl_post = array();83 //$type = (isset($_REQUEST['type'])) ? $_REQUEST['type'] : 'page' ;84 $selected = '';85 64 86 foreach ($setting as $k => $v) { 87 if (/*($ressources[$k]['type'] == $type) && */($v['used'] == true)) 88 { 89 $tpl_post= array_merge($tpl_post, array($ressources[$k]['title']=> $k)); 90 } 91 } 92 93 if (!empty($tpl_post)) 94 { 95 $tpl = array_merge($tpl,$tpl_post); 96 if ($post) 97 { 98 $params['meta_type'] = 'template'; 99 $params['post_id'] = $post->post_id; 100 $post_meta = $core->meta->getMetadata($params); 101 $selected = $post_meta->isEmpty()? '' : $post_meta->meta_id ; 102 } 103 104 echo 105 '<h3><label for="post_tpl">'.__('Specific template:').'</label></h3>'. 106 '<div class="p" id="meta-edit-tpl">'.form::combo('post_tpl',$tpl,$selected).'</div>'; 107 } 65 echo 66 '<h3><label for="post_tpl">'.__('Specific template:').'</label></h3>'. 67 '<div class="p" id="meta-edit-tpl">'.form::combo('post_tpl',$tpl,$selected).'</div>'; 68 108 69 } 109 70 … … 160 121 if ($action == 'tpl') 161 122 { 162 $setting = unserialize($core->blog->settings->templator->templator_files_active);163 123 $ressources = unserialize($core->blog->settings->templator->templator_files); 164 $tpl = array( ' '=> '');124 $tpl = array(__(' — standard — ') => ''); 165 125 $tpl_post = array(); 166 126 167 foreach ($ settingas $k => $v) {168 if ( $v['used'] == true)127 foreach ($ressources as $k => $v) { 128 if (($v['isCat'] == false) && ($v['used'] == true)) 169 129 { 170 $tpl_post= array_merge($tpl_post, array($ ressources[$k]['title']=> $k));130 $tpl_post= array_merge($tpl_post, array($v['title']=> $k)); 171 131 } 172 132 } 173 133 174 if (!empty($tpl_post)) 175 { 176 $tpl = array_merge($tpl,$tpl_post); 134 135 $tpl = array_merge($tpl,$tpl_post); 136 137 echo 138 '<h2>'.__('Select template for these entries').'</h2>'. 139 '<form action="posts_actions.php" method="post">'. 140 '<p><label class="classic">'.__('Choose template:').' '. 141 form::combo('post_tpl',$tpl). 142 '</label> '. 143 144 $hidden_fields. 145 $core->formNonce(). 146 form::hidden(array('action'),'tpl'). 147 '<input type="submit" value="'.__('save').'" /></p>'. 148 '</form>'; 177 149 178 echo179 '<h2>'.__('Select template for these entries').'</h2>'.180 '<form action="posts_actions.php" method="post">'.181 '<p><label class="classic">'.__('Choose template:').' '.182 form::combo('post_tpl',$tpl).183 '</label> '.184 185 $hidden_fields.186 $core->formNonce().187 form::hidden(array('action'),'tpl').188 '<input type="submit" value="'.__('save').'" /></p>'.189 '</form>';190 }191 150 } 192 151 } -
plugins/templator/_define.php
r2411 r2477 17 17 /* Description*/ 'Create and select more templates for your posts', 18 18 /* Author */ 'Osku and contributors', 19 /* Version */ '1.0 beta',19 /* Version */ '1.0RC5', 20 20 /* Permissions */ 'contentadmin' 21 21 ); -
plugins/templator/_install.php
r2411 r2477 28 28 } 29 29 30 $core->blog->settings->addNamespace('templator');31 30 $s =& $core->blog->settings->templator; 32 31 $s->put('templator_flag',false,'boolean','Templator activation flag',true,true); 33 32 $s->put('templator_files','','string','My own supplementary template files',true,true); 34 $s->put('templator_files_active','','string','My active supplementary template files',true,true);35 33 36 34 $core->setVersion('templator',$new_version); -
plugins/templator/_prepend.php
r2411 r2477 13 13 14 14 if (version_compare(DC_VERSION,'2.2-beta','<')) { return; } 15 15 $core->blog->settings->addNamespace('templator'); 16 16 $__autoload['dcTemplator'] = dirname(__FILE__).'/inc/class.templator.php'; 17 17 ?> -
plugins/templator/_public.php
r2411 r2477 22 22 public static function addTplPath($core) 23 23 { 24 $core->tpl->setPath($core->tpl->getPath(), DC_TPL_CACHE.'/templator/ default-templates');24 $core->tpl->setPath($core->tpl->getPath(), DC_TPL_CACHE.'/templator/'.$core->blog->id.'-default-templates'); 25 25 } 26 26 … … 28 28 { 29 29 global $core; 30 31 $files_tpl = unserialize($core->blog->settings->templator->templator_files); 30 32 31 33 if (array_key_exists($core->url->type,$core->getPostTypes())) … … 36 38 $post_meta = $core->meta->getMetadata($params); 37 39 38 if (!$post_meta->isEmpty() )40 if (!$post_meta->isEmpty() && $files_tpl[$post_meta->meta_id]['used']) 39 41 { 40 42 $_ctx->current_tpl = $post_meta->meta_id; 43 } 44 } 45 46 if (($_ctx->current_tpl == "category.html") 47 && preg_match('/^[0-9]{1,}/',$_ctx->categories->cat_id,$cat_id)) 48 { 49 $tpl = 'category-'.$cat_id[0].'.html'; 50 if (($core->tpl->getFilePath($tpl)) && ($files_tpl[$tpl]['used'])) { 51 $_ctx->current_tpl = $tpl; 41 52 } 42 53 } -
plugins/templator/form.js
r2116 r2477 8 8 return false; 9 9 }); 10 11 $("#filecat").parent().parent().hide(); 12 13 $("#filesource").change(function() { 14 var f = $(this).val(); 15 if (f == 'category') { 16 $("#filename, #filetitle").parent().parent().hide(); 17 $("#filecat").parent().parent().show(); 18 } 19 else { 20 $("#filename, #filetitle").parent().parent().show(); 21 $("#filecat").parent().parent().hide(); 22 } 23 }); 24 25 10 26 }); -
plugins/templator/inc/class.templator.php
r2411 r2477 19 19 protected $post_default_name = 'post.html'; 20 20 protected $page_default_name = 'page.html'; 21 protected $category_default_name = 'category.html'; 21 22 protected $template_dir_name = 'default-templates'; 23 24 public $path; 22 25 23 26 public $tpl = array(); … … 28 31 $this->core =& $core; 29 32 33 $this->path = DC_TPL_CACHE.'/'.$this->self_name.'/'.$this->core->blog->id.'-'.$this->template_dir_name; 30 34 $this->user_theme = $this->core->blog->themes_path.'/'.$this->core->blog->settings->system->theme; 31 //$this->user_theme = path::real($this->core->blog->themes_path.'/'.$this->core->blog->settings->system->theme);32 35 $this->user_post_tpl = path::real($this->user_theme.'/tpl/'.$this->post_default_name); 33 36 $this->user_page_tpl = path::real($this->user_theme.'/tpl/'.$this->page_default_name); 37 $this->user_category_tpl = path::real($this->user_theme.'/tpl/'.$this->category_default_name); 34 38 $this->post_tpl = path::real($this->core->blog->themes_path.'/default/tpl/'.$this->post_default_name); 35 39 $plugin_page = $this->core->plugins->getModules('pages'); 36 40 $this->page_tpl = path::real($plugin_page['root'].'/'.$this->template_dir_name.'/'.$this->page_default_name); 41 $this->category_tpl = path::real($this->core->blog->themes_path.'/default/tpl/'.$this->category_default_name); 37 42 38 43 $this->findTemplates(); … … 42 47 public function canUseRessources($create=false) 43 48 { 44 //$path = $this->core->plugins->moduleInfo($this->self_name,'root') ; 45 //$path_tpl = $this->core->plugins->moduleInfo($this->self_name,'root').'/'.$this->template_dir_name ; 46 $path = DC_TPL_CACHE.'/'.$this->self_name; 47 $path_tpl = $path.'/'.$this->template_dir_name; 48 49 if (!is_dir($path)) { 49 if (!is_dir($this->path)) { 50 50 if (!is_writable(DC_TPL_CACHE)) { 51 51 return false; 52 52 } 53 53 if ($create) { 54 files::makeDir($ path);54 files::makeDir($this->path,true); 55 55 } 56 56 return true; 57 57 } 58 58 59 if (!is_dir($path_tpl)) { 60 if (!is_writable($path)) { 61 return false; 62 } 63 if ($create) { 64 files::makeDir($path_tpl); 65 } 66 return true; 67 } 68 69 if (!is_writable($path_tpl)) { 59 if (!is_writable($this->path)) { 70 60 return false; 71 61 } … … 115 105 public function initializeTpl($name,$type) 116 106 { 117 if ($type == 'page') 107 if ($type == 'category') 108 { 109 if ($this->user_category_tpl) { 110 $base = $this->user_category_tpl; 111 } else { 112 $base = $this->category_tpl; 113 } 114 } 115 elseif ($type == 'page') 118 116 { 119 117 if ($this->user_page_tpl) { … … 236 234 } 237 235 } 238 236 239 237 protected function getDestinationFile($f,$totheme=false) 240 238 { 241 //$dest = $this->core->plugins->moduleInfo($this->self_name,'root').'/'.$this->template_dir_name.'/'.$f ; 242 $dest = DC_TPL_CACHE.'/'.$this->self_name.'/'.$this->template_dir_name.'/'.$f; 239 $dest = $this->path.'/'.$f; 243 240 if ($totheme) { 244 241 $dest = $this->user_theme.'/tpl/'.$f; … … 258 255 protected function findTemplates() 259 256 { 260 //$this->tpl = $this->getFilesInDir($this->core->plugins->moduleInfo($this->self_name,'root').'/'.$this->template_dir_name); 261 $this->tpl = $this->getFilesInDir(DC_TPL_CACHE.'/'.$this->self_name.'/'.$this->template_dir_name); 257 $this->tpl = $this->getFilesInDir($this->path); 262 258 $this->theme_tpl = $this->getFilesInDir(path::real($this->user_theme).'/tpl'); 263 259 -
plugins/templator/index.php
r2411 r2477 14 14 $file_default = $file = array('c'=>null, 'w'=>false, 'type'=>null, 'f'=>null, 'default_file'=>false); 15 15 16 // Categories 17 try { 18 $categories = $core->blog->getCategories(array('post_type'=>'post')); 19 while ($categories->fetch()) { 20 $categories_combo[] = new formSelectOption( 21 str_repeat(' ',$categories->level-1).'• '.html::escapeHTML($categories->cat_title), 22 $categories->cat_id 23 ); 24 $categories_name['category-'.$categories->cat_id.'.html'] = $categories->cat_title; 25 } 26 } catch (Exception $e) { } 27 28 $hasCategories = ($categories->isEmpty()) ? false : true; 29 16 30 $combo_source = array( 17 31 'post.html' => 'post', 18 'page.html' => 'page' 32 'page.html' => 'page' 19 33 ); 20 34 21 foreach ($core->getPostTypes() as $k => $v) {22 $combo_ types[ucfirst($k)] = $k;35 if (!$categories->isEmpty()) { 36 $combo_source['category.html'] = 'category'; 23 37 } 24 38 25 39 // Settings 26 $core->blog->settings->addNamespace('templator');27 40 $s = $core->blog->settings->templator; 28 41 $tpl = unserialize($s->templator_files); 29 $active_tpl = unserialize($s->templator_files_active);30 42 $templator_flag = (boolean)$s->templator_flag; 31 43 … … 35 47 $T = $core->themes->getModules($core->blog->settings->system->theme); 36 48 49 // New Templator 37 50 $o = new dcTemplator($core); 38 51 $ressources = $o->canUseRessources(true); … … 40 53 $t_files = $o->theme_tpl; 41 54 55 // May repair broken settings 56 foreach ($files as $k => $v) 57 { 58 if(!isset($tpl[$k])) 59 { 60 $tpl[$k]; 61 $tpl[$k]['title'] = $k; 62 $tpl[$k]['isCat'] = preg_match('/^(category)(.+)$/',$k)? true : false; 63 $tpl[$k]['used'] = false; 64 } 65 } 66 foreach ($tpl as $k => $v) 67 { 68 if(!isset($files[$k])) 69 { 70 unset($tpl[$k]); 71 } 72 } 73 74 $s->put('templator_files',serialize($tpl),'string','My own supplementary template files'); 75 76 42 77 $add_template = false; 43 78 … … 75 110 } 76 111 unset($tpl[$id]); 77 unset($active_tpl[$id]);78 $s->put('templator_files',serialize($tpl),'string','My own supplementary template files',true,true);79 112 $s->put('templator_files',serialize($tpl),'string','My own supplementary template files'); 80 $s->put('templator_files_active',serialize($active_tpl),'string','My active supplementary template files');81 113 $core->blog->triggerBlog(); 82 114 http::redirect($p_url.'&del='.$id); … … 86 118 { 87 119 $id = $_POST['file_id']; 88 $ active_tpl[$id]['used'] = false;89 90 $ s->put('templator_files_active',serialize($active_tpl),'string','My active supplementary template files');120 $tpl[$id]['used'] = false; 121 $s->put('templator_files',serialize($tpl),'string','My own supplementary template files'); 122 $core->blog->triggerBlog(); 91 123 http::redirect($p_url.'&hide='.$id); 92 124 } … … 95 127 { 96 128 $id = $_POST['file_id']; 97 $active_tpl[$id]['used'] = true; 98 99 $s->put('templator_files_active',serialize($active_tpl),'string','My active supplementary template files'); 129 $tpl[$id]['used'] = true; 130 $s->put('templator_files',serialize($tpl),'string','My own supplementary template files'); 100 131 $core->blog->triggerBlog(); 101 132 http::redirect($p_url.'&show='.$id); … … 105 136 { 106 137 $id = $_POST['file_id']; 107 $tpl[$id]['title'] = $_POST['file_title'][$id]; 108 109 $s->put('templator_files',serialize($tpl),'string','My own supplementary template files',true,true); 138 $tpl[$id]['title'] = empty($_POST['file_title'][$id]) ? $id : $_POST['file_title'][$id]; 110 139 $s->put('templator_files',serialize($tpl),'string','My own supplementary template files'); 111 140 $core->blog->triggerBlog(); … … 117 146 $id = $_POST['file_id']; 118 147 $o->copyTpl($id); 119 120 //$core->blog->triggerBlog(); 148 $core->blog->triggerBlog(); 121 149 http::redirect($p_url.'©='.$id); 122 150 } … … 132 160 { 133 161 $templator_flag = (empty($_POST['templator_flag'])) ? false : true; 134 135 162 $s->put('templator_flag',$templator_flag,'boolean','Templator activation flag'); 136 163 $core->blog->triggerBlog(); … … 143 170 } 144 171 145 if (!empty($_POST['filename']) && $core->auth->isSuperAdmin()) 146 { 147 $type = $_POST['filetype']; 172 if (!empty($_POST['filesource']) && $core->auth->isSuperAdmin()) 173 { 148 174 $source = $_POST['filesource']; 149 175 $name = files::tidyFileName($_POST['filename']).'.html'; 150 176 $isCat = false; 177 if ($source == 'category') 178 { 179 $name = 'category-'.$_POST['filecat'].'.html'; 180 $isCat = true; 181 } 182 $title = (empty($_POST['filetitle'])) ? $name : trim($_POST['filetitle']); 183 151 184 try { 152 185 $o->initializeTpl($name,$source); 153 $tpl[$name]['title'] = (empty($_POST['filetitle'])) ? $name : trim($_POST['filetitle']); 154 //$tpl[$name]['type'] = $type; 155 $active_tpl[$name]['used'] = true; 156 $s->put('templator_files',serialize($tpl),'string','My own supplementary template files',true,true); 186 $tpl[$name]['title'] = $title; 187 $tpl[$name]['isCat'] = $isCat; 188 $tpl[$name]['used'] = true; 157 189 $s->put('templator_files',serialize($tpl),'string','My own supplementary template files'); 158 $s->put('templator_files_active',serialize($active_tpl),'string','My active supplementary template files');159 190 } catch (Exception $e) { 160 191 $core->error->add($e->getMessage()); … … 163 194 if (!$core->error->flag()) { 164 195 $core->blog->triggerBlog(); 165 http::redirect($p_url.'&newtpl='.$ type.'&name='.$name);196 http::redirect($p_url.'&newtpl='.$name); 166 197 } 167 198 } … … 174 205 $fp = fopen('php://output','wb'); 175 206 $zip = new fileZip($fp); 176 $zip->addDirectory(DC_TPL_CACHE.'/templator/ default-templates','',true);207 $zip->addDirectory(DC_TPL_CACHE.'/templator/'.$core->blog->id.'-default-templates/','',true); 177 208 header('Content-Disposition: attachment;filename=templator-templates.zip'); 178 209 header('Content-Type: application/x-zip'); … … 234 265 235 266 if (!empty($_GET['newtpl'])) { 236 echo '<p class="message">'.sprintf(__('The template %s has been successfully created.'),$_GET['name']).'</p>'; 237 } 238 239 echo '<div id="private_options">'. 240 '<form method="post" action="'.$p_url.'">'. 241 '<fieldset>'. 242 '<legend>'. __('Plugin activation').'</legend>'. 243 '<p class="field">'. 244 form::checkbox('templator_flag', 1, $templator_flag). 245 '<label class=" classic" for="templator_flag">'.__('Enable extension').'</label>'. 246 '</p>'. 247 '</fieldset>'. 248 '<p>'.form::hidden(array('p'),'templator'). 249 $core->formNonce(). 250 '<input type="submit" name="saveconfig" value="'.__('Save configuration').'" /></p></form></div>'; 267 echo '<p class="message">'.sprintf(__('The template %s has been successfully created.'),$_GET['newtpl']).'</p>'; 268 } 269 270 echo '<div id="private_options"> 271 <form method="post" action="'.$p_url.'"> 272 <fieldset> 273 <legend>'. __('Plugin activation').'</legend> 274 <p class="field">'. 275 form::checkbox('templator_flag', 1, $templator_flag). 276 '<label class=" classic" for="templator_flag">'.__('Enable extension').'</label> 277 </p> 278 <p>'.form::hidden(array('p'),'templator'). 279 $core->formNonce(). 280 '<input type="submit" name="saveconfig" value="'.__('Save configuration').'" /> 281 </p> 282 </fieldset> 283 </form> 284 </div>'; 251 285 252 286 if (!$core->error->flag()) 253 287 { 254 if ($core->auth->isSuperAdmin()) 255 { 256 if (!$add_template) { 257 echo '<div class="two-cols" id="new-template"><h3><a class="new" id="templator-control" href="#">'. 258 __('Create a new template').'</a></h3></div>'; 259 } 260 288 if(!empty($tpl)) 289 { 261 290 echo 262 '<div class="col">'. 263 '<form action="'.$p_url.'" method="post" id="add-template">'. 264 '<fieldset>'. 265 '<legend>'.__('Create a new template').'</legend>'. 266 '<p><label class="classic required" title="'.__('Required field').'">'.__('Filename:').' '. 267 form::field('filename',20,255).'</label><strong>'.html::escapeHTML('.html').'</strong></p>'. 268 //'<p class="field"><label>'.__('Usage:').' '. 269 //form::combo('filetype',$combo_types).'</label></p>'. 270 '<p class="field"><label for="filesource">'.__('Template source:').' '. 271 form::combo('filesource',$combo_source).'</label></p>'. 272 '<p class="field"><label for="filetitle">'.__('Title:').' '. 273 form::field('filetitle',30,255).'</label></p>'. 274 '<p>'.form::hidden(array('p'),'templator'). 275 $core->formNonce(). 276 '<input type="submit" name="add_message" value="'.__('Create').'" /></p>'. 277 '</fieldset>'. 278 '</form></div>'; 279 280 } 281 282 if(!empty($tpl)) 283 { 284 echo 285 '<div class="col">'. 286 '<h3>'.__('Available templates').'</h3>'. 287 '<table class="maximal">'. 288 '<thead>'. 289 '<tr>'. 290 //'<th >'.__('Usage').'</th>'. 291 '<th>'.__('Filename').'</th>'. 292 '<th>'.__('Title').'</th>'. 293 '<th>'.__('Action').'</th>'. 294 '<th> </th>'. 295 '</tr>'. 296 '</thead>'. 297 '<tbody id="tpl-post-list">'; 291 '<div class="col"> 292 <fieldset> 293 <legend>'.__('Available templates').'</legend> 294 <table class="maximal"> 295 <thead> 296 <tr> 297 <th>'.__('Filename').'</th> 298 <th>'.__('Title').'</th> 299 <th>'.__('Action').'</th> 300 <th> </th> 301 </tr> 302 </thead> 303 <tbody id="tpl-post-list">'; 304 305 ksort($tpl); 298 306 299 307 foreach ($tpl as $k => $v) 300 308 { 301 //$type = ucfirst($v['type']); 302 303 if(isset($active_tpl[$k]['used']) && $active_tpl[$k]['used']) { 309 if(isset($tpl[$k]['used']) && $tpl[$k]['used']) { 304 310 $line = ''; 305 //$status = '<img alt="'.__('available').'" title="'.__('available').'" src="images/check-on.png" />';306 311 } 307 312 else 308 313 { 309 314 $line = 'offline'; 310 //$status = '<img alt="'.__('unavailable').'" title="'.__('unavailable').'" src="images/check-off.png" />';311 315 } 316 317 $hisCat = $v['isCat']; 312 318 313 319 $edit = ($core->auth->isSuperAdmin()) ? … … 316 322 echo 317 323 '<tr class="line '.$line.'" id="l_'.($k).'">'. 318 //'<td class="nowrap">'.$type.'</td>'.319 324 '<td >'.$k.'</td>'. 320 '<td >'. 325 '<td >'; 326 if (!$hisCat) 327 { 328 echo 321 329 '<form action="'.$p_url.'" method="post">'. 322 330 $core->formNonce(). … … 324 332 '<p>'. 325 333 form::field(array('file_title['.$k.']','t'.$k),30,255,$v['title']). 326 ' <input type="submit" class="update" name="update" value="'.__(' Update').'" /> '.334 ' <input type="submit" class="update" name="update" value="'.__('Rename').'" /> '. 327 335 '</p>'. 328 '</form></td>'. 329 336 '</form>'; 337 } 338 else 339 { 340 echo __('Category template').' : <strong>'.$categories_name[$k].'</strong>'; 341 } 342 echo 343 '</td>'. 330 344 '<td>'. 331 345 '<form action="'.$p_url.'" method="post"><p>'. 332 346 $core->formNonce(). 333 347 form::hidden(array('file_id'),html::escapeHTML($k)). 334 ((isset($ active_tpl[$k]['used'])) && $active_tpl[$k]['used'] ?348 ((isset($tpl[$k]['used'])) && $tpl[$k]['used'] ? 335 349 '<input type="submit" class="disable" name="disable" value="'.__('Disable').'" /> ' : 336 350 '<input type="submit" class="enable" name="enable" value="'.__('Enable').'" /> ' ); … … 346 360 '</tr>'; 347 361 } 348 echo '</tbody></table> 349 <p>'.sprintf(__('The %s button makes a copy to blog theme (<strong>%s</strong>).'),'<span class="copy">'.__('Copy').'</span>',html::escapeHTML($T['name'])).'</p> 350 </div>'; 351 362 echo '</tbody></table>'; 363 364 if ($core->blog->settings->system->theme != 'default') 365 { 366 echo '<p>'.sprintf(__('The %s button makes a copy to blog theme (<strong>%s</strong>).'),'<span class="copy">'.__('Copy').'</span>',html::escapeHTML($T['name'])).'</p>'; 367 } 368 352 369 if ($core->auth->isSuperAdmin()) 353 370 { … … 355 372 __('Download the templates directory as a zip file').'</a></p>'; 356 373 } 374 echo '</fieldset></div>'; 375 } 376 377 if ($core->auth->isSuperAdmin() && $file['c'] === null) 378 { 379 if (!$add_template) { 380 echo '<div class="two-cols" id="new-template"><h3><a class="new" id="templator-control" href="#">'. 381 __('Create a new template').'</a></h3></div>'; 382 } 383 384 echo 385 '<div class="col">'. 386 '<form action="'.$p_url.'" method="post" id="add-template">'. 387 '<fieldset>'. 388 '<legend>'.__('Create a new template').'</legend>'. 389 '<p class="field"><label for="filesource" class="required">'.__('Template source:').' '. 390 form::combo('filesource',$combo_source).'</label></p>'. 391 '<p><label for="filename" class="classic required" title="'.__('Required field').'">'.__('Filename:').' '. 392 form::field('filename',20,255).'</label><strong>'.html::escapeHTML('.html').'</strong></p>'; 393 394 if ($hasCategories) { 395 echo 396 '<p class="field"><label for="filecat">'.__('Category:'). 397 form::combo('filecat',$categories_combo,'').'</label></p>'; 398 } 399 400 echo 401 '<p class="field"><label for="filetitle">'.__('Title:').' '. 402 form::field('filetitle',30,255).'</label></p>'. 403 '<p>'.form::hidden(array('p'),'templator'). 404 $core->formNonce(). 405 '<input type="submit" name="add_message" value="'.__('Create').'" /></p>'. 406 '</fieldset>'. 407 '</form></div>'; 408 357 409 } 358 410 -
plugins/templator/locales/fr/main.po
r2411 r2477 1 1 # Language: Français 2 # Module: templator - 0.11.13 # Date: 2010-0 6-28 15:23:582 # Module: templator - 1.0RC2 3 # Date: 2010-07-07 09:27:21 4 4 # Translated with translater 1.4.1 5 5 … … 7 7 msgstr "" 8 8 "Content-Type: text/plain; charset=UTF-8\n" 9 "Project-Id-Version: templator 0.11.1\n"9 "Project-Id-Version: templator 1.0RC2\n" 10 10 "POT-Creation-Date: \n" 11 "PO-Revision-Date: 2010-0 6-28T15:23:58+00:00\n"11 "PO-Revision-Date: 2010-07-07T09:27:21+00:00\n" 12 12 "Last-Translator: osku\n" 13 13 "Language-Team: \n" … … 19 19 msgstr "Plus de gabarits" 20 20 21 #: _admin.php:65 22 #: _admin.php:98 21 #: _admin.php:45 22 #: _admin.php:124 23 msgid " — standard — " 24 msgstr " — standard — " 25 26 #: _admin.php:66 23 27 msgid "Specific template:" 24 28 msgstr "Gabarit spécifique :" 25 29 26 #: _admin.php: 12230 #: _admin.php:90 27 31 msgid "Appearance" 28 32 msgstr "Aspect" 29 33 30 #: _admin.php: 12234 #: _admin.php:90 31 35 msgid "Select template" 32 36 msgstr "Sélectionner le gabarit" 33 37 34 #: _admin.php:1 7238 #: _admin.php:138 35 39 msgid "Select template for these entries" 36 40 msgstr "Sélectionner le gabarit pour ces billets" 37 41 38 #: _admin.php:1 7442 #: _admin.php:140 39 43 msgid "Choose template:" 40 44 msgstr "Choisir le gabarit :" 41 45 42 #: _admin.php:1 8143 #: index.php: 36746 #: _admin.php:147 47 #: index.php:419 44 48 msgid "save" 45 49 msgstr "enregistrer" … … 47 51 #: _install.php:17 48 52 msgid "Version 2.2-beta of Dotclear at least is required for module Templator." 49 msgstr "La version 2.2-beta de Dotclear est requise pour le mo ule Templator."50 51 #: inc/class.templator.php: 8153 msgstr "La version 2.2-beta de Dotclear est requise pour le module Templator." 54 55 #: inc/class.templator.php:71 52 56 msgid "File does not exist." 53 57 msgstr "Le fichier n'existe pas." 54 58 55 #: inc/class.templator.php: 8656 #: inc/class.templator.php:1 4159 #: inc/class.templator.php:76 60 #: inc/class.templator.php:139 57 61 msgid "File %s is not readable" 58 62 msgstr "Le fichier %s n'est pas lisible" 59 63 60 #: inc/class.templator.php: 10164 #: inc/class.templator.php:91 61 65 msgid "No file" 62 66 msgstr "Aucun fichier" 63 67 64 #: index.php: 4668 #: index.php:81 65 69 msgid "The plugin is unusable with your configuration. You have to change file permissions." 66 70 msgstr "L'extension est inutilisable avec votre configuration. Vous devez modifier les permissions des fichiers." 67 71 68 #: index.php: 7472 #: index.php:109 69 73 msgid "Cannot delete file." 70 74 msgstr "Impossible d'effacer le fichier" 71 75 72 #: index.php: 19176 #: index.php:222 73 77 msgid "Templator" 74 78 msgstr "Templator" 75 79 76 #: index.php: 19580 #: index.php:226 77 81 msgid "Saving document..." 78 82 msgstr "Sauvegarde du document..." 79 83 80 #: index.php: 19684 #: index.php:227 81 85 msgid "Document saved" 82 86 msgstr "Document sauvegardé" 83 87 84 #: index.php: 19788 #: index.php:228 85 89 msgid "An error occurred:" 86 msgstr "Une erreur s'est produite 87 88 #: index.php:2 0990 msgstr "Une erreur s'est produite :" 91 92 #: index.php:240 89 93 msgid "Supplementary templates" 90 94 msgstr "Gabarits supplémentaires" 91 95 92 #: index.php:2 1296 #: index.php:243 93 97 msgid "Configuration successfully updated." 94 98 msgstr "Configuration mise à jour avec succès." 95 99 96 #: index.php:2 16100 #: index.php:247 97 101 msgid "The template %s is now unavailable." 98 102 msgstr "Le gabarit %s est maintenant indisponible." 99 103 100 #: index.php:2 20104 #: index.php:251 101 105 msgid "The template %s is now available." 102 106 msgstr "Le gabarit %s est maintenant disponible." 103 107 104 #: index.php:2 24108 #: index.php:255 105 109 msgid "The template title has been successfully updated." 106 110 msgstr "Le titre du gabarit a été mis à jour avec succès." 107 111 108 #: index.php:2 28112 #: index.php:259 109 113 msgid "The template has been successfully copied to blog theme." 110 114 msgstr "Le gabarit a été copié vers le thème du blog avec succès." 111 115 112 #: index.php:2 32116 #: index.php:263 113 117 msgid "The template %s has been deleted." 114 118 msgstr "Le gabarit %s a été supprimé." 115 119 116 #: index.php:2 36120 #: index.php:267 117 121 msgid "The template %s has been successfully created." 118 122 msgstr "Le gabarit %s a été créé avec succès." 119 123 120 #: index.php:2 42124 #: index.php:273 121 125 msgid "Plugin activation" 122 126 msgstr "Activation de l'extension" 123 127 124 #: index.php:2 45128 #: index.php:276 125 129 msgid "Enable extension" 126 130 msgstr "Activer l'extension" 127 131 128 #: index.php:2 50132 #: index.php:280 129 133 msgid "Save configuration" 130 134 msgstr "Enregistrer la configuration" 131 135 132 #: index.php:258 133 #: index.php:265 136 #: index.php:293 137 msgid "Available templates" 138 msgstr "Gabarits disponibles" 139 140 #: index.php:297 141 msgid "Filename" 142 msgstr "Nom de fichier :" 143 144 #: index.php:298 145 msgid "Title" 146 msgstr "Titre" 147 148 #: index.php:299 149 msgid "Action" 150 msgstr "Action" 151 152 #: index.php:320 153 msgid "edit this template" 154 msgstr "éditer le gabarit" 155 156 #: index.php:334 157 msgid "Rename" 158 msgstr "Renommer" 159 160 #: index.php:340 161 msgid "Category template" 162 msgstr "Gabarit de catégorie" 163 164 #: index.php:349 165 msgid "Disable" 166 msgstr "Désactiver" 167 168 #: index.php:350 169 msgid "Enable" 170 msgstr "Activer" 171 172 #: index.php:355 173 #: index.php:363 174 msgid "Copy" 175 msgstr "Copier" 176 177 #: index.php:363 178 msgid "The %s button makes a copy to blog theme (<strong>%s</strong>)." 179 msgstr "Le bouton %s réalise une copie vers le thème du blog (<strong>%s</strong>)." 180 181 #: index.php:368 182 msgid "Download the templates directory as a zip file" 183 msgstr "Télécharger le répertoire des gabarits dans un fichier zip" 184 185 #: index.php:377 186 #: index.php:384 134 187 msgid "Create a new template" 135 188 msgstr "Créer un nouveau gabarit" 136 189 137 #: index.php:266 190 #: index.php:385 191 msgid "Template source:" 192 msgstr "Gabarit source :" 193 194 #: index.php:387 138 195 msgid "Required field" 139 196 msgstr "Champ obligatoire" 140 197 141 #: index.php: 266198 #: index.php:387 142 199 msgid "Filename:" 143 200 msgstr "Nom de fichier :" 144 201 145 #: index.php:268 146 msgid "Usage:" 147 msgstr "Usage :" 148 149 #: index.php:270 150 msgid "Template source:" 151 msgstr "Gabarit source :" 152 153 #: index.php:272 202 #: index.php:392 203 msgid "Category:" 204 msgstr "Catégorie :" 205 206 #: index.php:397 154 207 msgid "Title:" 155 msgstr "Titre 156 157 #: index.php: 276208 msgstr "Titre :" 209 210 #: index.php:401 158 211 msgid "Create" 159 212 msgstr "Créer" 160 213 161 #: index.php:286 162 msgid "Available templates" 163 msgstr "Gabarits disponibles" 164 165 #: index.php:290 166 msgid "Usage" 167 msgstr "Usage" 168 169 #: index.php:291 170 msgid "Filename" 171 msgstr "Nom de fichier" 172 173 #: index.php:292 174 msgid "Title" 175 msgstr "Titre" 176 177 #: index.php:293 178 msgid "Action" 179 msgstr "Action" 180 181 #: index.php:305 182 #: index.php:305 183 msgid "available" 184 msgstr "disponible" 185 186 #: index.php:310 187 #: index.php:310 188 msgid "unavailable" 189 msgstr "indisponible" 190 191 #: index.php:314 192 msgid "edit this template" 193 msgstr "éditer le gabarit" 194 195 #: index.php:326 196 msgid "Update" 197 msgstr "Mettre à jour" 198 199 #: index.php:335 200 msgid "Disable" 201 msgstr "Désactiver" 202 203 #: index.php:336 204 msgid "Enable" 205 msgstr "Activer" 206 207 #: index.php:339 208 #: index.php:345 209 msgid "Copy" 210 msgstr "Copier" 211 212 #: index.php:345 213 msgid "The %s button makes a copy to blog theme (<strong>%s</strong>)." 214 msgstr "Le bouton %s réalise une copie vers le thème du blog (<strong>%s</strong>)." 215 216 #: index.php:351 217 msgid "Download the templates directory as a zip file" 218 msgstr "Télécharger le répertoire des gabarits dans un fichier zip" 219 220 #: index.php:360 214 #: index.php:412 221 215 msgid "File editor" 222 216 msgstr "Éditeur de fichier" 223 217 224 #: index.php: 361218 #: index.php:413 225 219 msgid "Editing file %s" 226 220 msgstr "Modification du fichier %s" 227 221 228 #: index.php: 370222 #: index.php:422 229 223 msgid "delete" 230 224 msgstr "supprimer" 231 225 232 #: index.php: 377226 #: index.php:429 233 227 msgid "This file is not writable. Please check your files permissions." 234 228 msgstr "Ce fichier ne peut pas être modifié. Veuillez vérifier les permissions des fichiers."
Note: See TracChangeset
for help on using the changeset viewer.