Changeset 2411
- Timestamp:
- 06/29/10 01:19:42 (13 years ago)
- Location:
- plugins/templator
- Files:
-
- 1 deleted
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
plugins/templator/_admin.php
r2162 r2411 18 18 $core->auth->check('admin',$core->blog->id)); 19 19 20 if ($core->blog->settings->templator _flag)20 if ($core->blog->settings->templator->templator_flag) 21 21 { 22 22 $core->addBehavior('adminPostFormSidebar',array('templatorBehaviors','adminPostFormSidebar')); … … 31 31 $core->addBehavior('adminPostsActions',array('templatorBehaviors','adminPostsActions')); 32 32 $core->addBehavior('adminPostsActionsContent',array('templatorBehaviors','adminPostsActionsContent')); 33 $core->addBehavior('adminPagesActionsCombo',array('templatorBehaviors','adminPostsActionsCombo')); 34 $core->addBehavior('adminPagesActions',array('templatorBehaviors','adminPostsActions')); 35 $core->addBehavior('adminPagesActionsContent',array('templatorBehaviors','adminPostsActionsContent')); 33 36 } 34 37 … … 39 42 global $core; 40 43 41 $meta = new dcMeta($core); 42 43 $setting = unserialize($core->blog->settings->templator_files_active); 44 $ressources = unserialize($core->blog->settings->templator_files); 44 $setting = unserialize($core->blog->settings->templator->templator_files_active); 45 $ressources = unserialize($core->blog->settings->templator->templator_files); 45 46 $tpl = array(' ' => ''); 46 47 $tpl_post = array(); 48 //$type = (isset($_REQUEST['type'])) ? $_REQUEST['type'] : 'post' ; 49 $selected = ''; 47 50 48 51 foreach ($setting as $k => $v) { 49 if ( ($ressources[$k]['type'] == 'post') &&($v['used'] == true))52 if (/*($ressources[$k]['type'] == $type) && */($v['used'] == true)) 50 53 { 51 54 $tpl_post= array_merge($tpl_post, array($ressources[$k]['title']=> $k)); … … 58 61 if ($post) 59 62 { 60 $post_meta = $meta->getMeta('template',null,null,$post->post_id); 63 $params['meta_type'] = 'template'; 64 $params['post_id'] = $post->post_id; 65 $post_meta = $core->meta->getMetadata($params); 61 66 $selected = $post_meta->isEmpty()? '' : $post_meta->meta_id ; 62 67 } … … 72 77 global $core; 73 78 74 $meta = new dcMeta($core); 75 76 $setting = unserialize($core->blog->settings->templator_files_active); 77 $ressources = unserialize($core->blog->settings->templator_files); 79 $setting = unserialize($core->blog->settings->templator->templator_files_active); 80 $ressources = unserialize($core->blog->settings->templator->templator_files); 78 81 $tpl = array('' => ''); 79 82 $tpl_post = array(); 83 //$type = (isset($_REQUEST['type'])) ? $_REQUEST['type'] : 'page' ; 84 $selected = ''; 80 85 81 86 foreach ($setting as $k => $v) { 82 if ( ($ressources[$k]['type'] == 'page') &&($v['used'] == true))87 if (/*($ressources[$k]['type'] == $type) && */($v['used'] == true)) 83 88 { 84 89 $tpl_post= array_merge($tpl_post, array($ressources[$k]['title']=> $k)); … … 91 96 if ($post) 92 97 { 93 $post_meta = $meta->getMeta('template',null,null,$post->post_id); 98 $params['meta_type'] = 'template'; 99 $params['post_id'] = $post->post_id; 100 $post_meta = $core->meta->getMetadata($params); 94 101 $selected = $post_meta->isEmpty()? '' : $post_meta->meta_id ; 95 102 } … … 110 117 $tpl = $_POST['post_tpl']; 111 118 112 $meta = new dcMeta($core); 113 114 $meta->delPostMeta($post_id,'template'); 119 $core->meta->delPostMeta($post_id,'template'); 115 120 if (!empty($_POST['post_tpl'])) 116 121 { 117 $ meta->setPostMeta($post_id,'template',$tpl);122 $core->meta->setPostMeta($post_id,'template',$tpl); 118 123 } 119 124 } … … 131 136 try 132 137 { 133 $meta = new dcMeta($core);134 138 $tpl = $_POST['post_tpl']; 135 139 136 140 while ($posts->fetch()) 137 141 { 138 $ meta->delPostMeta($posts->post_id,'template');142 $core->meta->delPostMeta($posts->post_id,'template'); 139 143 if (!empty($_POST['post_tpl'])) 140 144 { 141 $ meta->setPostMeta($posts->post_id,'template',$tpl);145 $core->meta->setPostMeta($posts->post_id,'template',$tpl); 142 146 } 143 147 } … … 156 160 if ($action == 'tpl') 157 161 { 158 $meta = new dcMeta($core); 159 160 $setting = unserialize($core->blog->settings->templator_files_active); 161 $ressources = unserialize($core->blog->settings->templator_files); 162 $setting = unserialize($core->blog->settings->templator->templator_files_active); 163 $ressources = unserialize($core->blog->settings->templator->templator_files); 162 164 $tpl = array(' ' => ''); 163 165 $tpl_post = array(); 164 166 165 167 foreach ($setting as $k => $v) { 166 if ( ($ressources[$k]['type'] == 'post') && ($v['used'] == true))168 if ($v['used'] == true) 167 169 { 168 170 $tpl_post= array_merge($tpl_post, array($ressources[$k]['title']=> $k)); -
plugins/templator/_define.php
r2215 r2411 15 15 $this->registerModule( 16 16 /* Name */ 'Templator', 17 /* Description*/ ' Select specific template for a post or a page',17 /* Description*/ 'Create and select more templates for your posts', 18 18 /* Author */ 'Osku and contributors', 19 /* Version */ ' 0.10',19 /* Version */ '1.0beta', 20 20 /* Permissions */ 'contentadmin' 21 21 ); -
plugins/templator/_install.php
r2162 r2411 12 12 13 13 if (!defined('DC_CONTEXT_ADMIN')) { exit; } 14 15 if (version_compare(DC_VERSION,'2.2-beta','<')) 16 { 17 $core->error->add(__('Version 2.2-beta of Dotclear at least is required for module Templator.')); 18 $core->plugins->deactivateModule('templator'); 19 return false; 20 } 21 22 $new_version = $core->plugins->moduleInfo('templator','version'); 14 23 15 $ m_version = $core->plugins->moduleInfo('templator','version');24 $current_version = $core->getVersion('templator'); 16 25 17 $i_version = $core->getVersion('templator'); 18 19 if (version_compare($i_version,$m_version,'>=')) { 26 if (version_compare($current_version,$new_version,'>=')) { 20 27 return; 21 28 } 22 29 23 $core->blog->settings-> setNamespace('templator');24 $s =& $core->blog->settings ;30 $core->blog->settings->addNamespace('templator'); 31 $s =& $core->blog->settings->templator; 25 32 $s->put('templator_flag',false,'boolean','Templator activation flag',true,true); 26 33 $s->put('templator_files','','string','My own supplementary template files',true,true); 27 34 $s->put('templator_files_active','','string','My active supplementary template files',true,true); 28 35 29 $core->setVersion('templator',$ m_version);36 $core->setVersion('templator',$new_version); 30 37 return true; 31 38 ?> -
plugins/templator/_prepend.php
r2116 r2411 12 12 if (!defined('DC_RC_PATH')) { return; } 13 13 14 if (version_compare(DC_VERSION,'2.2-beta','<')) { return; } 15 14 16 $__autoload['dcTemplator'] = dirname(__FILE__).'/inc/class.templator.php'; 15 17 ?> -
plugins/templator/_public.php
r2215 r2411 12 12 if (!defined('DC_RC_PATH')) { return; } 13 13 14 if ($core->blog->settings->templator _flag)14 if ($core->blog->settings->templator->templator_flag) 15 15 { 16 16 $core->addBehavior('publicBeforeDocument',array('publicTemplatorBehaviors','addTplPath')); 17 $core->addBehavior('urlHandler ServeDocument',array('publicTemplatorBehaviors','urlHandlerServeDocument'));17 $core->addBehavior('urlHandlerBeforeGetData',array('publicTemplatorBehaviors','BeforeGetData')); 18 18 } 19 19 … … 22 22 public static function addTplPath($core) 23 23 { 24 $core->tpl->setPath($core->tpl->getPath(), dirname(__FILE__).'/default-templates');24 $core->tpl->setPath($core->tpl->getPath(), DC_TPL_CACHE.'/templator/default-templates'); 25 25 } 26 26 27 public static function urlHandlerServeDocument ($result)27 public static function BeforeGetData ($_ctx) 28 28 { 29 global $core , $_ctx;29 global $core; 30 30 31 if ( $_ctx->posts->post_id)31 if (array_key_exists($core->url->type,$core->getPostTypes())) 32 32 { 33 $meta = new dcMeta($core); 34 $post_meta = $meta->getMeta('template',null,null,$_ctx->posts->post_id); 33 $params = array(); 34 $params['meta_type'] = 'template'; 35 $params['post_id'] = $_ctx->posts->post_id; 36 $post_meta = $core->meta->getMetadata($params); 35 37 36 38 if (!$post_meta->isEmpty()) 37 39 { 38 try 39 { 40 $result['content'] = $core->tpl->getData($post_meta->meta_id); 41 //$result['tpl'] = $tpl; 42 } 43 catch (Exception $e) 44 { 45 return; 46 } 40 $_ctx->current_tpl = $post_meta->meta_id; 47 41 } 48 }49 else50 {51 return;52 42 } 53 43 } -
plugins/templator/inc/class.templator.php
r2116 r2411 22 22 23 23 public $tpl = array(); 24 public $theme_tpl = array(); 24 25 25 26 public function __construct($core) … … 27 28 $this->core =& $core; 28 29 30 $this->user_theme = $this->core->blog->themes_path.'/'.$this->core->blog->settings->system->theme; 29 31 //$this->user_theme = path::real($this->core->blog->themes_path.'/'.$this->core->blog->settings->system->theme); 32 $this->user_post_tpl = path::real($this->user_theme.'/tpl/'.$this->post_default_name); 33 $this->user_page_tpl = path::real($this->user_theme.'/tpl/'.$this->page_default_name); 30 34 $this->post_tpl = path::real($this->core->blog->themes_path.'/default/tpl/'.$this->post_default_name); 31 35 $plugin_page = $this->core->plugins->getModules('pages'); … … 38 42 public function canUseRessources($create=false) 39 43 { 40 $path = $this->core->plugins->moduleInfo($this->self_name,'root') ; 41 42 $path_tpl = $this->core->plugins->moduleInfo($this->self_name,'root').'/'.$this->template_dir_name ; 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; 43 48 44 49 if (!is_dir($path)) { 45 return false; 50 if (!is_writable(DC_TPL_CACHE)) { 51 return false; 52 } 53 if ($create) { 54 files::makeDir($path); 55 } 56 return true; 46 57 } 47 58 … … 76 87 } 77 88 78 //throw new Exception(sprintf(__(' %s'),$source[$f]));79 80 89 return array( 81 90 'c' => file_get_contents($source[$f]), 82 91 'w' => $this->getDestinationFile($f) !== false, 83 //'type' => $type,84 92 'f' => $f 85 93 ); … … 109 117 if ($type == 'page') 110 118 { 111 $base = $this->page_tpl ; 119 if ($this->user_page_tpl) { 120 $base = $this->user_page_tpl; 121 } else { 122 $base = $this->page_tpl; 123 } 112 124 } 113 125 else { 114 $base = $this->post_tpl ; 126 if ($this->user_post_tpl) { 127 $base = $this->user_post_tpl; 128 } else { 129 $base = $this->post_tpl; 130 } 115 131 } 116 132 … … 174 190 $fp = @fopen($dest,'wb'); 175 191 if (!$fp) { 176 throw new Exception('tocatch');192 //throw new Exception('tocatch'); 177 193 } 178 194 … … 188 204 } 189 205 } 190 191 protected function getDestinationFile($f) 192 { 193 $dest = $this->core->plugins->moduleInfo($this->self_name,'root').'/'.$this->template_dir_name.'/'.$f ; 206 207 public function copyTpl($name) 208 { 209 try 210 { 211 $file = $this->getSourceContent($name); 212 $dest = $this->getDestinationFile($name,true); 213 214 if ($dest == false) { 215 throw new Exception(); 216 } 217 218 if (!is_dir(dirname($dest))) { 219 files::makeDir(dirname($dest)); 220 } 221 222 $fp = @fopen($dest,'wb'); 223 if (!$fp) { 224 throw new Exception('tocatch'); 225 } 226 227 $content = preg_replace('/(\r?\n)/m',"\n",$file['c']); 228 $content = preg_replace('/\r/m',"\n",$file['c']); 229 230 fwrite($fp,$file['c']); 231 fclose($fp); 232 } 233 catch (Exception $e) 234 { 235 throw $e; 236 } 237 } 238 239 protected function getDestinationFile($f,$totheme=false) 240 { 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; 243 if ($totheme) { 244 $dest = $this->user_theme.'/tpl/'.$f; 245 } 194 246 195 247 if (file_exists($dest) && is_writable($dest)) { … … 197 249 } 198 250 199 if (!is_dir(dirname($dest))) {200 if (is_writable($this->core->blog->public_path)) {201 return $dest;202 }203 }204 205 251 if (is_writable(dirname($dest))) { 206 252 return $dest; … … 212 258 protected function findTemplates() 213 259 { 214 $this->tpl = $this->getFilesInDir($this->core->plugins->moduleInfo($this->self_name,'root').'/'.$this->template_dir_name); 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); 262 $this->theme_tpl = $this->getFilesInDir(path::real($this->user_theme).'/tpl'); 215 263 216 264 uksort($this->tpl,array($this,'sortFilesHelper')); 265 uksort($this->theme_tpl,array($this,'sortFilesHelper')); 217 266 } 218 267 -
plugins/templator/index.php
r2215 r2411 14 14 $file_default = $file = array('c'=>null, 'w'=>false, 'type'=>null, 'f'=>null, 'default_file'=>false); 15 15 16 $combo_ types= array(17 __('Entry')=> 'post',18 __('Page')=> 'page'16 $combo_source = array( 17 'post.html' => 'post', 18 'page.html' => 'page' 19 19 ); 20 20 21 $tpl = unserialize($core->blog->settings->templator_files); 22 $active_tpl = unserialize($core->blog->settings->templator_files_active); 23 $templator_flag = (boolean)$core->blog->settings->templator_flag; 21 foreach ($core->getPostTypes() as $k => $v) { 22 $combo_types[ucfirst($k)] = $k; 23 } 24 25 // Settings 26 $core->blog->settings->addNamespace('templator'); 27 $s = $core->blog->settings->templator; 28 $tpl = unserialize($s->templator_files); 29 $active_tpl = unserialize($s->templator_files_active); 30 $templator_flag = (boolean)$s->templator_flag; 31 32 // Get theme Infos 33 $core->themes = new dcThemes($core); 34 $core->themes->loadModules($core->blog->themes_path,null); 35 $T = $core->themes->getModules($core->blog->settings->system->theme); 24 36 25 37 $o = new dcTemplator($core); 26 38 $ressources = $o->canUseRessources(true); 27 39 $files= $o->tpl; 40 $t_files = $o->theme_tpl; 28 41 29 42 $add_template = false; … … 40 53 if (!empty($_REQUEST['tpl']) && $core->auth->isSuperAdmin()) { 41 54 $file = $o->getSourceContent($_REQUEST['tpl']); 55 $core->blog->triggerBlog(); 42 56 } 43 57 } … … 62 76 unset($tpl[$id]); 63 77 unset($active_tpl[$id]); 64 $core->blog->settings->setNamespace('templator'); 65 $core->blog->settings->put('templator_files',serialize($tpl),'string','My own supplementary template files',true,true); 66 $core->blog->settings->put('templator_files',serialize($tpl),'string','My own supplementary template files'); 67 $core->blog->settings->put('templator_files_active',serialize($active_tpl),'string','My active supplementary template files'); 78 $s->put('templator_files',serialize($tpl),'string','My own supplementary template files',true,true); 79 $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'); 68 81 $core->blog->triggerBlog(); 69 82 http::redirect($p_url.'&del='.$id); … … 75 88 $active_tpl[$id]['used'] = false; 76 89 77 $core->blog->settings->setNamespace('templator'); 78 $core->blog->settings->put('templator_files_active',serialize($active_tpl),'string','My active supplementary template files'); 90 $s->put('templator_files_active',serialize($active_tpl),'string','My active supplementary template files'); 79 91 http::redirect($p_url.'&hide='.$id); 80 92 } … … 85 97 $active_tpl[$id]['used'] = true; 86 98 87 $core->blog->settings->setNamespace('templator'); 88 $core->blog->settings->put('templator_files_active',serialize($active_tpl),'string','My active supplementary template files'); 99 $s->put('templator_files_active',serialize($active_tpl),'string','My active supplementary template files'); 89 100 $core->blog->triggerBlog(); 90 101 http::redirect($p_url.'&show='.$id); … … 96 107 $tpl[$id]['title'] = $_POST['file_title'][$id]; 97 108 98 $core->blog->settings->setNamespace('templator'); 99 $core->blog->settings->put('templator_files',serialize($tpl),'string','My own supplementary template files',true,true); 100 $core->blog->settings->put('templator_files',serialize($tpl),'string','My own supplementary template files'); 109 $s->put('templator_files',serialize($tpl),'string','My own supplementary template files',true,true); 110 $s->put('templator_files',serialize($tpl),'string','My own supplementary template files'); 101 111 $core->blog->triggerBlog(); 102 112 http::redirect($p_url.'&update='.$id); 103 113 } 114 115 if (!empty($_POST['copy']) && $core->blog->settings->system->theme != 'default') 116 { 117 $id = $_POST['file_id']; 118 $o->copyTpl($id); 119 120 //$core->blog->triggerBlog(); 121 http::redirect($p_url.'©='.$id); 122 } 104 123 } 105 124 catch (Exception $e) … … 113 132 { 114 133 $templator_flag = (empty($_POST['templator_flag'])) ? false : true; 115 $core->blog->settings->setNamespace('templator'); 116 $ core->blog->settings->put('templator_flag',$templator_flag,'boolean','Templator activation flag');134 135 $s->put('templator_flag',$templator_flag,'boolean','Templator activation flag'); 117 136 $core->blog->triggerBlog(); 118 137 http::redirect($p_url.'&config=1'); … … 124 143 } 125 144 126 if (!empty($_POST['filename']) && !empty($_POST['filetype']) && !empty($_POST['filetitle']) &&$core->auth->isSuperAdmin())145 if (!empty($_POST['filename']) && $core->auth->isSuperAdmin()) 127 146 { 128 147 $type = $_POST['filetype']; 148 $source = $_POST['filesource']; 129 149 $name = files::tidyFileName($_POST['filename']).'.html'; 130 150 131 151 try { 132 $o->initializeTpl($name,$ type);133 $tpl[$name]['title'] = $_POST['filetitle'];134 $tpl[$name]['type'] = $type;152 $o->initializeTpl($name,$source); 153 $tpl[$name]['title'] = (empty($_POST['filetitle'])) ? $name : trim($_POST['filetitle']); 154 //$tpl[$name]['type'] = $type; 135 155 $active_tpl[$name]['used'] = true; 136 $core->blog->settings->setNamespace('templator'); 137 $core->blog->settings->put('templator_files',serialize($tpl),'string','My own supplementary template files',true,true); 138 $core->blog->settings->put('templator_files',serialize($tpl),'string','My own supplementary template files'); 139 $core->blog->settings->put('templator_files_active',serialize($active_tpl),'string','My active supplementary template files'); 156 $s->put('templator_files',serialize($tpl),'string','My own supplementary template files',true,true); 157 $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'); 140 159 } catch (Exception $e) { 141 160 $core->error->add($e->getMessage()); … … 155 174 $fp = fopen('php://output','wb'); 156 175 $zip = new fileZip($fp); 157 $zip->addDirectory( $core->plugins->moduleRoot('templator').'/default-templates','',true);176 $zip->addDirectory(DC_TPL_CACHE.'/templator/default-templates','',true); 158 177 header('Content-Disposition: attachment;filename=templator-templates.zip'); 159 178 header('Content-Type: application/x-zip'); … … 206 225 } 207 226 227 if (!empty($_GET['copy'])) { 228 echo '<p class="message">'.__('The template has been successfully copied to blog theme.').'</p>'; 229 } 230 208 231 if (!empty($_GET['del'])) { 209 232 echo '<p class="message">'.sprintf(__('The template %s has been deleted.'),$_GET['del']).'</p>'; … … 241 264 '<fieldset>'. 242 265 '<legend>'.__('Create a new template').'</legend>'. 243 '<p><label>'.__('Usage:').' '. 244 form::combo('filetype',$combo_types).'</label></p>'. 245 '<p><label class="required" title="'.__('Required field').'">'.__('Filename:').' '. 246 form::field('filename',30,255).'</label></p>'. 247 '<p class="form-note">'.sprintf(__('The extension %s is automatically added'),'<code>.html</code>').'</p>'. 248 '<p><label class="required" title="'.__('Required field').'">'.__('Title:').' '. 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:').' '. 249 273 form::field('filetitle',30,255).'</label></p>'. 250 274 '<p>'.form::hidden(array('p'),'templator'). … … 264 288 '<thead>'. 265 289 '<tr>'. 266 '<th >'.__('Usage').'</th>'.290 //'<th >'.__('Usage').'</th>'. 267 291 '<th>'.__('Filename').'</th>'. 268 292 '<th>'.__('Title').'</th>'. 269 '<th colspan="2">'.__('Action').'</th>'.293 '<th>'.__('Action').'</th>'. 270 294 '<th> </th>'. 271 295 '</tr>'. … … 275 299 foreach ($tpl as $k => $v) 276 300 { 277 if ($v['type'] == 'page') { 278 $type = __('Page'); 279 } 280 else 281 { 282 $type = __('Entry'); 283 } 301 //$type = ucfirst($v['type']); 284 302 285 303 if(isset($active_tpl[$k]['used']) && $active_tpl[$k]['used']) { 286 304 $line = ''; 287 $status = '<img alt="'.__('available').'" title="'.__('available').'" src="images/check-on.png" />';305 //$status = '<img alt="'.__('available').'" title="'.__('available').'" src="images/check-on.png" />'; 288 306 } 289 307 else 290 308 { 291 309 $line = 'offline'; 292 $status = '<img alt="'.__('unavailable').'" title="'.__('unavailable').'" src="images/check-off.png" />';310 //$status = '<img alt="'.__('unavailable').'" title="'.__('unavailable').'" src="images/check-off.png" />'; 293 311 } 294 312 … … 298 316 echo 299 317 '<tr class="line '.$line.'" id="l_'.($k).'">'. 300 '<td class="nowrap">'.$type.'</td>'.301 '<td > <code>'.$k.'</code></td>'.318 //'<td class="nowrap">'.$type.'</td>'. 319 '<td >'.$k.'</td>'. 302 320 '<td >'. 303 '<form action="'.$p_url.'" method="post"> <p>'.321 '<form action="'.$p_url.'" method="post">'. 304 322 $core->formNonce(). 305 323 form::hidden(array('file_id'),html::escapeHTML($k)). 324 '<p>'. 306 325 form::field(array('file_title['.$k.']','t'.$k),30,255,$v['title']). 307 '<input type="submit" class="update" name="update" value="'.__('Update').'" />'. 308 '</p></form></td>'. 326 ' <input type="submit" class="update" name="update" value="'.__('Update').'" /> '. 327 '</p>'. 328 '</form></td>'. 309 329 310 330 '<td>'. … … 314 334 ((isset($active_tpl[$k]['used'])) && $active_tpl[$k]['used'] ? 315 335 '<input type="submit" class="disable" name="disable" value="'.__('Disable').'" /> ' : 316 '<input type="submit" class="enable" name="enable" value="'.__('Enable').'" /> ' ). 336 '<input type="submit" class="enable" name="enable" value="'.__('Enable').'" /> ' ); 337 if (((!isset($t_files[$k]) || 338 (strpos($t_files[$k],path::real($core->blog->themes_path.'/'.$core->blog->settings->system->theme)) !== 0))) && 339 $core->blog->settings->system->theme != 'default') 340 { 341 echo ' <input type="submit" class="copy" name="copy" value="'.__('Copy').'" />'; 342 } 343 echo 317 344 '</p></form></td>'. 318 '<td class="nowrap status">'.$status.'</td>'.319 345 '<td class="nowrap status" >'.$edit.'</td >'. 320 321 346 '</tr>'; 322 347 } 323 echo '</tbody></table></div>'; 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>'; 324 351 325 352 if ($core->auth->isSuperAdmin()) … … 347 374 (files::isDeletable($files[$k]) ? '<input type="submit" class="delete" name="delete" value="'.__('delete').'" /> ' : ''). 348 375 '</p>'; 376 377 349 378 } 350 379 else 351 380 { 352 echo '<p>'.__('This file is not writable. Please check your themefiles permissions.').'</p>';381 echo '<p>'.__('This file is not writable. Please check your files permissions.').'</p>'; 353 382 } 354 383 -
plugins/templator/locales/fr/main.po
r2162 r2411 1 # Language: français2 # Module: templator - 0. 73 # Date: 2010-0 4-05 13:00:464 # Translated with translater 1. 31 # Language: Français 2 # Module: templator - 0.11.1 3 # Date: 2010-06-28 15:23:58 4 # Translated with translater 1.4.1 5 5 6 6 msgid "" 7 7 msgstr "" 8 8 "Content-Type: text/plain; charset=UTF-8\n" 9 "Project-Id-Version: templator 0. 7\n"9 "Project-Id-Version: templator 0.11.1\n" 10 10 "POT-Creation-Date: \n" 11 "PO-Revision-Date: 2010-0 4-05T13:00:46+00:00\n"12 "Last-Translator: Osku\n"11 "PO-Revision-Date: 2010-06-28T15:23:58+00:00\n" 12 "Last-Translator: osku\n" 13 13 "Language-Team: \n" 14 14 "MIME-Version: 1.0\n" … … 24 24 msgstr "Gabarit spécifique :" 25 25 26 #: _admin.php:12 426 #: _admin.php:122 27 27 msgid "Appearance" 28 28 msgstr "Aspect" 29 29 30 #: _admin.php:12 430 #: _admin.php:122 31 31 msgid "Select template" 32 32 msgstr "Sélectionner le gabarit" 33 33 34 #: _admin.php:17 734 #: _admin.php:172 35 35 msgid "Select template for these entries" 36 36 msgstr "Sélectionner le gabarit pour ces billets" 37 37 38 #: _admin.php:17 938 #: _admin.php:174 39 39 msgid "Choose template:" 40 40 msgstr "Choisir le gabarit :" 41 41 42 #: _admin.php:18 643 #: index.php:3 3942 #: _admin.php:181 43 #: index.php:367 44 44 msgid "save" 45 45 msgstr "enregistrer" 46 46 47 #: inc/class.templator.php:70 47 #: _install.php:17 48 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 moule Templator." 50 51 #: inc/class.templator.php:81 48 52 msgid "File does not exist." 49 53 msgstr "Le fichier n'existe pas." 50 54 51 #: inc/class.templator.php: 7552 #: inc/class.templator.php:1 2555 #: inc/class.templator.php:86 56 #: inc/class.templator.php:141 53 57 msgid "File %s is not readable" 54 58 msgstr "Le fichier %s n'est pas lisible" 55 59 56 #: inc/class.templator.php: 9360 #: inc/class.templator.php:101 57 61 msgid "No file" 58 62 msgstr "Aucun fichier" 59 63 60 #: index.php:17 61 #: index.php:278 62 msgid "Entry" 63 msgstr "Billet" 64 65 #: index.php:18 66 #: index.php:274 67 msgid "Page" 68 msgstr "Page" 69 70 #: index.php:33 64 #: index.php:46 71 65 msgid "The plugin is unusable with your configuration. You have to change file permissions." 72 66 msgstr "L'extension est inutilisable avec votre configuration. Vous devez modifier les permissions des fichiers." 73 67 74 #: index.php: 6068 #: index.php:74 75 69 msgid "Cannot delete file." 76 70 msgstr "Impossible d'effacer le fichier" 77 71 78 #: index.php:1 6872 #: index.php:191 79 73 msgid "Templator" 80 74 msgstr "Templator" 81 75 82 #: index.php:1 7276 #: index.php:195 83 77 msgid "Saving document..." 84 78 msgstr "Sauvegarde du document..." 85 79 86 #: index.php:1 7380 #: index.php:196 87 81 msgid "Document saved" 88 82 msgstr "Document sauvegardé" 89 83 90 #: index.php:1 7484 #: index.php:197 91 85 msgid "An error occurred:" 92 86 msgstr "Une erreur s'est produite :" 93 87 94 #: index.php: 18688 #: index.php:209 95 89 msgid "Supplementary templates" 96 90 msgstr "Gabarits supplémentaires" 97 91 98 #: index.php: 18992 #: index.php:212 99 93 msgid "Configuration successfully updated." 100 94 msgstr "Configuration mise à jour avec succès." 101 95 102 #: index.php: 19396 #: index.php:216 103 97 msgid "The template %s is now unavailable." 104 msgstr "Le gaba grit %s est maintenant indisponible."105 106 #: index.php: 19798 msgstr "Le gabarit %s est maintenant indisponible." 99 100 #: index.php:220 107 101 msgid "The template %s is now available." 108 102 msgstr "Le gabarit %s est maintenant disponible." 109 103 110 #: index.php:2 01104 #: index.php:224 111 105 msgid "The template title has been successfully updated." 112 106 msgstr "Le titre du gabarit a été mis à jour avec succès." 113 107 114 #: index.php:205 108 #: index.php:228 109 msgid "The template has been successfully copied to blog theme." 110 msgstr "Le gabarit a été copié vers le thème du blog avec succès." 111 112 #: index.php:232 115 113 msgid "The template %s has been deleted." 116 114 msgstr "Le gabarit %s a été supprimé." 117 115 118 #: index.php:2 09116 #: index.php:236 119 117 msgid "The template %s has been successfully created." 120 118 msgstr "Le gabarit %s a été créé avec succès." 121 119 122 #: index.php:2 15120 #: index.php:242 123 121 msgid "Plugin activation" 124 122 msgstr "Activation de l'extension" 125 123 126 #: index.php:2 18124 #: index.php:245 127 125 msgid "Enable extension" 128 126 msgstr "Activer l'extension" 129 127 130 #: index.php:2 23128 #: index.php:250 131 129 msgid "Save configuration" 132 130 msgstr "Enregistrer la configuration" 133 131 134 #: index.php:2 31135 #: index.php:2 38132 #: index.php:258 133 #: index.php:265 136 134 msgid "Create a new template" 137 135 msgstr "Créer un nouveau gabarit" 138 136 139 #: index.php:239 137 #: index.php:266 138 msgid "Required field" 139 msgstr "Champ obligatoire" 140 141 #: index.php:266 142 msgid "Filename:" 143 msgstr "Nom de fichier :" 144 145 #: index.php:268 140 146 msgid "Usage:" 141 147 msgstr "Usage :" 142 148 143 #: index.php:241 144 #: index.php:244 145 msgid "Required field" 146 msgstr "Champ obligatoire" 147 148 #: index.php:241 149 msgid "Filename:" 150 msgstr "Nom de fichier :" 151 152 #: index.php:243 153 msgid "The extension %s is automatically added" 154 msgstr "L'extension %s est automatiquement ajoutée" 155 156 #: index.php:244 149 #: index.php:270 150 msgid "Template source:" 151 msgstr "Gabarit source :" 152 153 #: index.php:272 157 154 msgid "Title:" 158 155 msgstr "Titre :" 159 156 160 #: index.php:2 48157 #: index.php:276 161 158 msgid "Create" 162 159 msgstr "Créer" 163 160 164 #: index.php:2 58161 #: index.php:286 165 162 msgid "Available templates" 166 163 msgstr "Gabarits disponibles" 167 164 168 #: index.php:2 62165 #: index.php:290 169 166 msgid "Usage" 170 167 msgstr "Usage" 171 168 172 #: index.php:2 63169 #: index.php:291 173 170 msgid "Filename" 174 171 msgstr "Nom de fichier" 175 172 176 #: index.php:2 64173 #: index.php:292 177 174 msgid "Title" 178 175 msgstr "Titre" 179 176 180 #: index.php:2 65177 #: index.php:293 181 178 msgid "Action" 182 179 msgstr "Action" 183 180 184 #: index.php: 283185 #: index.php: 283181 #: index.php:305 182 #: index.php:305 186 183 msgid "available" 187 184 msgstr "disponible" 188 185 189 #: index.php: 288190 #: index.php: 288186 #: index.php:310 187 #: index.php:310 191 188 msgid "unavailable" 192 189 msgstr "indisponible" 193 190 194 #: index.php: 292191 #: index.php:314 195 192 msgid "edit this template" 196 193 msgstr "éditer le gabarit" 197 194 198 #: index.php:3 03195 #: index.php:326 199 196 msgid "Update" 200 197 msgstr "Mettre à jour" 201 198 202 #: index.php:3 11199 #: index.php:335 203 200 msgid "Disable" 204 201 msgstr "Désactiver" 205 202 206 #: index.php:3 12203 #: index.php:336 207 204 msgid "Enable" 208 205 msgstr "Activer" 209 206 210 #: index.php:323 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 211 217 msgid "Download the templates directory as a zip file" 212 218 msgstr "Télécharger le répertoire des gabarits dans un fichier zip" 213 219 214 #: index.php:3 32220 #: index.php:360 215 221 msgid "File editor" 216 222 msgstr "Éditeur de fichier" 217 223 218 #: index.php:3 33224 #: index.php:361 219 225 msgid "Editing file %s" 220 226 msgstr "Modification du fichier %s" 221 227 222 #: index.php:3 42228 #: index.php:370 223 229 msgid "delete" 224 230 msgstr "supprimer" 225 231 226 #: index.php:3 47227 msgid "This file is not writable. Please check your themefiles permissions."228 msgstr "Ce fichier ne peut pas être modifié. Veuillez vérifier les permissions des fichiers de votre thème."229 232 #: index.php:377 233 msgid "This file is not writable. Please check your files permissions." 234 msgstr "Ce fichier ne peut pas être modifié. Veuillez vérifier les permissions des fichiers." 235 -
plugins/templator/style.css
r2162 r2411 11 11 12 12 input.enable { 13 border-color:#009900; 14 color:#009900; 13 color:#72921B; 15 14 } 16 15 17 16 input.disable { 18 border-color:#CC0000; 19 color:#CC0000; 17 color:#931B2C; 18 } 19 20 input.copy { 21 color:#751658; 20 22 } 21 23 22 24 input.delete { 23 color:# FF0000 !important;25 color:#DD0000; 24 26 } 27 28 input.update { 29 color:#777777; 30 } 31 32 span.copy{ 33 -moz-border-radius:3px 3px 3px 3px; 34 padding:2px; 35 background-color:#E2DFCA; 36 color:#751658; 37 font-weight:bold; 38 } 39 40
Note: See TracChangeset
for help on using the changeset viewer.