Changes in [2594:e10cf5fd3749:2610:a9bc70b5a85d]
- Files:
-
- 52 added
- 22 deleted
- 32 edited
Legend:
- Unmodified
- Added
- Removed
-
.hgsubstate
r2548 r2606 1 a51d747b2601fd10b50926a017e25764abe0c872inc/libs/clearbricks1 40b662e0ce7bb257e56bffeead7d6996feaf9dc9 inc/libs/clearbricks -
admin/_charte.php
r2501 r2504 31 31 <script type="text/javascript" src="js/jquery/jquery.js"></script> 32 32 <script type="text/javascript" src="js/jquery/jquery-ui.custom.js"></script> 33 <script type="text/javascript" src="js/jquery/jquery.ui.touch-punch.js"></script> 33 34 <script type="text/javascript" src="js/jquery/jquery.pageTabs.js"></script> 34 35 <script type="text/javascript" src="js/jquery/jquery.biscuit.js"></script> -
admin/blog.php
r2566 r2596 21 21 22 22 # Create a blog 23 if (!isset($_POST['id']) && !empty($_POST['blog_id']))23 if (!isset($_POST['id']) && (isset($_POST['create']))) 24 24 { 25 25 $cur = $core->con->openCursor($core->prefix.'blog'); … … 84 84 '<p class="form-note">'.__('At least 2 characters using letters, numbers or symbols.').'</p> '; 85 85 86 if ($blog_id) {87 echo88 '<p class="form-note warn">'.__('Please note that changing your blog ID may require changes in your public index.php file.').'</p>';89 }90 91 86 echo 92 87 '<p><label class="required" for="blog_name"><abbr title="'.__('Required field').'">*</abbr> '.__('Blog name:').'</label> '. … … 99 94 form::textarea('blog_desc',60,5,html::escapeHTML($blog_desc)).'</p>'. 100 95 101 '<p><input type="submit" accesskey="s" value="'.__('Create').'" /></p>'.96 '<p><input type="submit" accesskey="s" name="create" value="'.__('Create').'" /></p>'. 102 97 '</form>'; 103 98 -
admin/blog_pref.php
r2566 r2577 166 166 $media_img_m_size = abs((integer) $_POST['media_img_m_size']); 167 167 if ($media_img_m_size < 0) { $media_img_m_size = 448; } 168 169 $nb_post_for_home = abs((integer) $_POST['nb_post_for_home']); 170 if ($nb_post_for_home <= 1) { $nb_post_for_home = 1; } 168 171 169 172 $nb_post_per_page = abs((integer) $_POST['nb_post_per_page']); … … 231 234 $blog_settings->system->put('note_title_tag',$_POST['note_title_tag']); 232 235 236 $blog_settings->system->put('nb_post_for_home',$nb_post_for_home); 233 237 $blog_settings->system->put('nb_post_per_page',$nb_post_per_page); 234 238 $blog_settings->system->put('use_smilies',!empty($_POST['use_smilies'])); … … 512 516 513 517 '<div class="col">'. 518 '<p><label for="nb_post_for_home" class="classic">'.sprintf(__('Display %s entries on home page'), 519 form::field('nb_post_for_home',2,3,$blog_settings->system->nb_post_for_home)). 520 '</label></p>'. 521 514 522 '<p><label for="nb_post_per_page" class="classic">'.sprintf(__('Display %s entries per page'), 515 523 form::field('nb_post_per_page',2,3,$blog_settings->system->nb_post_per_page)). -
admin/categories.php
r2566 r2567 109 109 && $rs->count()>1) { 110 110 $starting_script .= dcPage::jsLoad('js/jquery/jquery-ui.custom.js'); 111 $starting_script .= dcPage::jsLoad('js/jquery/jquery.ui.touch-punch.js'); 111 112 $starting_script .= dcPage::jsLoad('js/jquery/jquery.mjs.nestedSortable.js'); 112 113 } -
admin/media.php
r2529 r2582 362 362 } 363 363 364 // Remove hidden directories (unless DC_SHOW_HIDDEN_DIRS is set to true) 365 if (!defined('DC_SHOW_HIDDEN_DIRS') || (DC_SHOW_HIDDEN_DIRS == false)) { 366 for ($i = count($dir['dirs']) - 1; $i >= 0; $i--) { 367 if ($dir['dirs'][$i]->d) { 368 if (strpos($dir['dirs'][$i]->relname,'.') !== false) { 369 unset($dir['dirs'][$i]); 370 } 371 } 372 } 373 } 364 374 $items = array_values(array_merge($dir['dirs'],$dir['files'])); 365 375 -
admin/preferences.php
r2566 r2567 305 305 ($user_acc_nodragdrop ? '' : dcPage::jsLoad('js/_preferences-dragdrop.js')). 306 306 dcPage::jsLoad('js/jquery/jquery-ui.custom.js'). 307 dcPage::jsLoad('js/jquery/jquery.ui.touch-punch.js'). 307 308 dcPage::jsLoad('js/jquery/jquery.pwstrength.js'). 308 309 '<script type="text/javascript">'."\n". -
inc/core/class.dc.blog.php
r2566 r2567 1894 1894 - post_id: (integer) Get comments belonging to given post_id 1895 1895 - cat_id: (integer or array) Get comments belonging to entries of given category ID 1896 - comment_id: (integer ) Get comment with given ID1896 - comment_id: (integer or array) Get comment with given ID (or IDs) 1897 1897 - comment_site: (string) Get comments with given comment_site 1898 1898 - comment_status: (integer) Get comments with given comment_status … … 1984 1984 1985 1985 if (isset($params['comment_id']) && $params['comment_id'] !== '') { 1986 $strReq .= 'AND comment_id = '.(integer) $params['comment_id'].' '; 1986 if (is_array($params['comment_id'])) { 1987 array_walk($params['comment_id'],create_function('&$v,$k','if($v!==null){$v=(integer)$v;}')); 1988 } else { 1989 $params['comment_id'] = array((integer) $params['comment_id']); 1990 } 1991 $strReq .= 'AND comment_id '.$this->con->in($params['comment_id']); 1987 1992 } 1988 1993 -
inc/core/class.dc.core.php
r2566 r2596 39 39 public $rest; ///< <b>dcRestServer</b> dcRestServer object 40 40 public $log; ///< <b>dcLog</b> dcLog object 41 public $stime; ///< <b>float</b> starting time 41 42 42 43 private $versions = null; … … 59 60 public function __construct($driver, $host, $db, $user, $password, $prefix, $persist) 60 61 { 62 if (defined('DC_START_TIME')) { 63 $this->stime=DC_START_TIME; 64 } else { 65 $this->stime = microtime(true); 66 } 67 61 68 $this->con = dbLayer::init($driver,$host,$db,$user,$password,$persist); 62 69 … … 982 989 private function getBlogCursor($cur) 983 990 { 984 if ($cur->blog_id !== null 985 && !preg_match('/^[A-Za-z0-9._-]{2,}$/',$cur->blog_id)) { 991 if (($cur->blog_id !== null 992 && !preg_match('/^[A-Za-z0-9._-]{2,}$/',$cur->blog_id)) || 993 (!$cur->blog_id)) { 986 994 throw new Exception(__('Blog ID must contain at least 2 characters using letters, numbers or symbols.')); 987 995 } 988 996 989 if ($cur->blog_name !== null && $cur->blog_name == '') { 997 if (($cur->blog_name !== null && $cur->blog_name == '') || 998 (!$cur->blog_name)) { 990 999 throw new Exception(__('No blog name')); 991 1000 } 992 1001 993 if ($cur->blog_url !== null && $cur->blog_url == '') { 1002 if (($cur->blog_url !== null && $cur->blog_url == '') || 1003 (!$cur->blog_url)) { 994 1004 throw new Exception(__('No blog URL')); 995 1005 } … … 1306 1316 array('media_img_title_pattern','string','Title ;; Date(%b %Y) ;; separator(, )', 1307 1317 'Pattern to set image title when you insert it in a post'), 1318 array('nb_post_for_home','integer',20, 1319 'Number of entries on first home page'), 1308 1320 array('nb_post_per_page','integer',20, 1309 'Number of entries on home page and category pages'),1321 'Number of entries on home pages and category pages'), 1310 1322 array('nb_post_per_feed','integer',20, 1311 1323 'Number of entries on feeds'), … … 1469 1481 } 1470 1482 } 1483 1484 /** 1485 Return elapsed time since script has been started 1486 @param $mtime <b>float</b> timestamp (microtime format) to evaluate delta from 1487 current time is taken if null 1488 @return <b>float</b> elapsed time 1489 */ 1490 public function getElapsedTime ($mtime=null) { 1491 if ($mtime !== null) { 1492 return $mtime-$this->stime; 1493 } else { 1494 return microtime(true)-$this->stime; 1495 } 1496 } 1471 1497 //@} 1498 1499 1500 1472 1501 } -
inc/core/class.dc.namespace.php
r2566 r2567 125 125 126 126 /** 127 Returns global setting value if exists. 128 129 @param n <b>string</b> setting name 130 @return <b>mixed</b> 131 */ 132 public function getGlobal($n) 133 { 134 if (isset($this->global_settings[$n]['value'])) { 135 return $this->global_settings[$n]['value']; 136 } 137 138 return null; 139 } 140 141 /** 142 Returns local setting value if exists. 143 144 @param n <b>string</b> setting name 145 @return <b>mixed</b> 146 */ 147 public function getLocal($n) 148 { 149 if (isset($this->local_settings[$n]['value'])) { 150 return $this->local_settings[$n]['value']; 151 } 152 153 return null; 154 } 155 156 /** 127 157 Magic __get method. 128 158 @copydoc ::get -
inc/core/class.dc.themes.php
r2566 r2607 59 59 # Themes specifics properties 60 60 $properties = array_merge( 61 array('parent' => null ),61 array('parent' => null, 'tplset' => DC_DEFAULT_TPLSET), 62 62 $properties, 63 63 array('permissions' => 'admin') // force themes perms -
inc/prepend.php
r2591 r2610 10 10 # 11 11 # -- END LICENSE BLOCK ----------------------------------------- 12 13 /* Start tick */ 14 define('DC_START_TIME',microtime(true)); 12 15 13 16 /* ------------------------------------------------------------------------------------------- */ … … 135 138 # Constants 136 139 define('DC_ROOT',path::real(dirname(__FILE__).'/..')); 137 define('DC_VERSION','2. 6.2');140 define('DC_VERSION','2.7-dev'); 138 141 define('DC_DIGESTS',dirname(__FILE__).'/digests'); 139 142 define('DC_L10N_ROOT',dirname(__FILE__).'/../locales'); … … 141 144 define('DC_DISTRIB_PLUGINS','aboutConfig,akismet,antispam,attachments,blogroll,blowupConfig,dclegacy,fairTrackbacks,importExport,maintenance,pages,pings,simpleMenu,tags,themeEditor,userPref,widgets'); 142 145 define('DC_DISTRIB_THEMES','blueSilence,blowupConfig,customCSS,default,ductile'); 146 define('DC_DEFAULT_TPLSET','mustek'); 143 147 144 148 if (!defined('DC_VENDOR_NAME')) { -
inc/public/class.dc.template.php
r2590 r2610 235 235 } 236 236 237 protected function compileFile($file)238 {239 $fc = file_get_contents($file);240 241 $this->compile_stack[] = $file;242 243 # Remove every PHP tags244 if ($this->remove_php)245 {246 $fc = preg_replace('/<\?(?=php|=|\s).*?\?>/ms','',$fc);247 }248 249 # Transform what could be considered as PHP short tags250 $fc = preg_replace('/(<\?(?!php|=|\s))(.*?)(\?>)/ms',251 '<?php echo "$1"; ?>$2<?php echo "$3"; ?>',$fc);252 253 # Remove template comments <!-- #... -->254 $fc = preg_replace('/(^\s*)?<!-- #(.*?)-->/ms','',$fc);255 256 # Lexer part : split file into small pieces257 # each array entry will be either a tag or plain text258 $blocks = preg_split(259 '#(<tpl:\w+[^>]*>)|(</tpl:\w+>)|({{tpl:\w+[^}]*}})#msu',$fc,-1,260 PREG_SPLIT_DELIM_CAPTURE|PREG_SPLIT_NO_EMPTY);261 262 # Next : build semantic tree from tokens.263 $rootNode = new tplNode();264 $node = $rootNode;265 $errors = array();266 foreach ($blocks as $id => $block) {267 $isblock = preg_match('#<tpl:(\w+)(?:(\s+.*?)>|>)|</tpl:(\w+)>|{{tpl:(\w+)(\s(.*?))?}}#ms',$block,$match);268 if ($isblock == 1) {269 if (substr($match[0],1,1) == '/') {270 // Closing tag, check if it matches current opened node271 $tag = $match[3];272 if (($node instanceof tplNodeBlock) && $node->getTag() == $tag) {273 $node->setClosing();274 $node = $node->getParent();275 } else {276 // Closing tag does not match opening tag277 // Search if it closes a parent tag278 $search = $node;279 while($search->getTag() != 'ROOT' && $search->getTag() != $tag) {280 $search = $search->getParent();281 }282 if ($search->getTag() == $tag) {283 $errors[] = sprintf(284 __('Did not find closing tag for block <tpl:%s>. Content has been ignored.'),285 html::escapeHTML($node->getTag()));286 $search->setClosing();287 $node = $search->getParent();288 } else {289 $errors[]=sprintf(290 __('Unexpected closing tag </tpl:%s> found.'),291 $tag);;292 }293 }294 } elseif (substr($match[0],0,1) == '{') {295 // Value tag296 $tag = $match[4];297 $str_attr = '';298 $attr = array();299 if (isset($match[6])) {300 $str_attr = $match[6];301 $attr = $this->getAttrs($match[6]);302 }303 $node->addChild(new tplNodeValue($tag,$attr,$str_attr));304 } else {305 // Opening tag, create new node and dive into it306 $tag = $match[1];307 $newnode = new tplNodeBlock($tag,isset($match[2])?$this->getAttrs($match[2]):array());308 $node->addChild($newnode);309 $node = $newnode;310 }311 } else {312 // Simple text313 $node->addChild(new tplNodeText($block));314 }315 }316 317 if (($node instanceof tplNodeBlock) && !$node->isClosed()) {318 $errors[] = sprintf(319 __('Did not find closing tag for block <tpl:%s>. Content has been ignored.'),320 html::escapeHTML($node->getTag()));321 }322 323 $err = "";324 if (count($errors) > 0) {325 $err = "\n\n<!-- \n".326 __('WARNING: the following errors have been found while parsing template file :').327 "\n * ".328 join("\n * ",$errors).329 "\n -->\n";330 }331 332 return $rootNode->compile($this).$err;333 }334 335 237 public function compileBlockNode($tag,$attr,$content) 336 238 { … … 343 245 $this->core->callBehavior('templateInsideBlock',$this->core,$this->current_tag,$attr,array(&$content)); 344 246 345 if (isset($this->blocks[$this->current_tag])) { 346 $res .= call_user_func($this->blocks[$this->current_tag],$attr,$content); 347 } elseif ($this->unknown_block_handler != null) { 348 $res .= call_user_func($this->unknown_block_handler,$this->current_tag,$attr,$content); 349 } 247 $res .= parent::compileBlockNode($this->current_tag,$attr,$content); 350 248 351 249 # --BEHAVIOR-- templateAfterBlock … … 363 261 $res = $this->core->callBehavior('templateBeforeValue',$this->core,$this->current_tag,$attr); 364 262 365 if (isset($this->values[$this->current_tag])) { 366 $res .= call_user_func($this->values[$this->current_tag],$attr,ltrim($str_attr)); 367 } elseif ($this->unknown_value_handler != null) { 368 $res .= call_user_func($this->unknown_value_handler,$this->current_tag,$attr,$str_attr); 369 } 263 $res .= parent::compileValueNode($this->current_tag,$attr,$str_attr); 370 264 371 265 # --BEHAVIOR-- templateAfterValue … … 373 267 374 268 return $res; 375 }376 377 public function setUnknownValueHandler($callback)378 {379 if (is_callable($callback)) {380 $this->unknown_value_handler = $callback;381 }382 }383 384 public function setUnknownBlockHandler($callback)385 {386 if (is_callable($callback)) {387 $this->unknown_block_handler = $callback;388 }389 269 } 390 270 … … 1173 1053 1174 1054 if ($lastn != 0) { 1055 // Set limit (aka nb of entries needed) 1175 1056 if ($lastn > 0) { 1057 // nb of entries per page specified in template -> regular pagination 1176 1058 $p .= "\$params['limit'] = ".$lastn.";\n"; 1177 1059 } else { 1178 $p .= "\$params['limit'] = \$_ctx->nb_entry_per_page;\n"; 1060 // nb of entries per page not specified -> use ctx settings 1061 $p .= "\$params['limit'] = (\$_page_number == 1 ? \$_ctx->nb_entry_first_page : \$_ctx->nb_entry_per_page);\n"; 1179 1062 } 1180 1063 // Set offset (aka index of first entry) 1181 1064 if (!isset($attr['ignore_pagination']) || $attr['ignore_pagination'] == "0") { 1182 $p .= "\$params['limit'] = array(((\$_page_number-1)*\$params['limit']),\$params['limit']);\n"; 1065 // standard pagination, set offset 1066 $p .= "\$params['limit'] = array((\$_page_number == 1 ? 0 : (\$_page_number - 2) * \$_ctx->nb_entry_per_page + \$_ctx->nb_entry_first_page),\$params['limit']);\n"; 1183 1067 } else { 1068 // no pagination, get all posts from 0 to limit 1184 1069 $p .= "\$params['limit'] = array(0, \$params['limit']);\n"; 1185 1070 } -
inc/public/lib.tpl.context.php
r2566 r2577 206 206 207 207 $nb_posts = $_ctx->pagination->f(0); 208 $nb_per_page = $_ctx->post_params['limit'][1]; 209 210 $nb_pages = ceil($nb_posts/$nb_per_page); 208 $nb_pages = ceil(($nb_posts - $_ctx->nb_entry_first_page) / $_ctx->nb_entry_per_page + 1); 211 209 212 210 return $nb_pages; -
inc/public/lib.urlhandlers.php
r2566 r2585 86 86 $_ctx->nb_entry_per_page = $core->blog->settings->system->nb_post_per_page; 87 87 } 88 if ($_ctx->nb_entry_first_page === null) { 89 $_ctx->nb_entry_first_page = $_ctx->nb_entry_per_page; 90 } 88 91 89 92 $tpl_file = $core->tpl->getFilePath($tpl); … … 188 191 else 189 192 { 193 $_ctx =& $GLOBALS['_ctx']; 190 194 $core =& $GLOBALS['core']; 191 195 … … 196 200 197 201 if (empty($_GET['q'])) { 202 if ($core->blog->settings->system->nb_post_for_home !== null) { 203 $_ctx->nb_entry_first_page = $core->blog->settings->system->nb_post_for_home; 204 } 198 205 self::serveDocument('home.html'); 199 206 $core->blog->publishScheduledEntries(); … … 411 418 if ($content != '') 412 419 { 413 if ($core->blog->settings->system->wiki_comments) { 414 $core->initWikiComment(); 420 # --BEHAVIOR-- publicBeforeCommentTransform 421 $buffer = $core->callBehavior('publicBeforeCommentTransform',$content); 422 if ($buffer != '') { 423 $content = $buffer; 415 424 } else { 416 $core->initWikiSimpleComment(); 425 if ($core->blog->settings->system->wiki_comments) { 426 $core->initWikiComment(); 427 } else { 428 $core->initWikiSimpleComment(); 429 } 430 $content = $core->wikiTransform($content); 417 431 } 418 $content = $core->wikiTransform($content);419 432 $content = $core->HTMLfilter($content); 420 433 } -
inc/public/prepend.php
r2566 r2567 134 134 $__theme_tpl_path[] = $core->blog->themes_path.'/'.$__parent_theme.'/tpl'; 135 135 } 136 137 $core->tpl->setPath( 138 $__theme_tpl_path, 139 dirname(__FILE__).'/default-templates', 140 $core->tpl->getPath()); 141 136 $tplset = $core->themes->moduleInfo($core->blog->settings->system->theme,'tplset'); 137 if (!empty($tplset) && is_dir(dirname(__FILE__).'/default-templates/'.$tplset)) { 138 $core->tpl->setPath( 139 $__theme_tpl_path, 140 dirname(__FILE__).'/default-templates/'.$tplset, 141 $core->tpl->getPath()); 142 } else { 143 $core->tpl->setPath( 144 $__theme_tpl_path, 145 $core->tpl->getPath()); 146 } 142 147 $core->url->mode = $core->blog->settings->system->url_scan; 143 148 -
locales/fr/main.po
r2512 r2577 399 399 400 400 #, php-format 401 msgid "Display %s entries on home page" 402 msgstr "Afficher %s billets sur la page d'accueil" 403 404 #, php-format 401 405 msgid "Display %s entries per page" 402 406 msgstr "Afficher %s billets par page" -
plugins/antispam/filters/class.dc.filter.linkslookup.php
r2566 r2567 48 48 49 49 $i = count($domain_elem) - 1; 50 if ($i == 0) { 51 // "domain" is 1 word long, don't check it 52 return null; 53 } 50 54 $host = $domain_elem[$i]; 51 55 do -
plugins/antispam/index.php
r2566 r2567 117 117 echo 118 118 dcPage::jsLoad('js/jquery/jquery-ui.custom.js'). 119 dcPage::jsLoad('js/jquery/jquery.ui.touch-punch.js'). 119 120 dcPage::jsLoad('index.php?pf=antispam/antispam.js'); 120 121 } -
plugins/blogroll/index.php
r2566 r2567 177 177 echo 178 178 dcPage::jsLoad('js/jquery/jquery-ui.custom.js'). 179 dcPage::jsLoad('js/jquery/jquery.ui.touch-punch.js'). 179 180 dcPage::jsLoad('index.php?pf=blogroll/blogroll.js'); 180 181 } -
plugins/pages/_public.php
r2566 r2607 112 112 if ($content != '') 113 113 { 114 if ($core->blog->settings->system->wiki_comments) { 115 $core->initWikiComment(); 114 # --BEHAVIOR-- publicBeforeCommentTransform 115 $buffer = $core->callBehavior('publicBeforeCommentTransform',$content); 116 if ($buffer != '') { 117 $content = $buffer; 116 118 } else { 117 $core->initWikiSimpleComment(); 119 if ($core->blog->settings->system->wiki_comments) { 120 $core->initWikiComment(); 121 } else { 122 $core->initWikiSimpleComment(); 123 } 124 $content = $core->wikiTransform($content); 118 125 } 119 $content = $core->wikiTransform($content);120 126 $content = $core->HTMLfilter($content); 121 127 } … … 184 190 header('X-Pingback: '.$core->blog->url.$core->url->getURLFor("xmlrpc",$core->blog->id)); 185 191 } 186 $core->tpl->setPath($core->tpl->getPath(), dirname(__FILE__).'/default-templates'); 192 193 $tplset = $core->themes->moduleInfo($core->blog->settings->system->theme,'tplset'); 194 if (!empty($tplset) && is_dir(dirname(__FILE__).'/default-templates/'.$tplset)) { 195 $core->tpl->setPath($core->tpl->getPath(), dirname(__FILE__).'/default-templates/'.$tplset); 196 } else { 197 $core->tpl->setPath($core->tpl->getPath(), dirname(__FILE__).'/default-templates/'.DC_DEFAULT_TPLSET); 198 } 187 199 self::serveDocument('page.html'); 188 200 } -
plugins/pages/list.php
r2566 r2567 55 55 <title><?php echo __('Pages'); ?></title> 56 56 <?php 57 echo dcPage::jsLoad('js/jquery/jquery-ui.custom.js'). 57 echo 58 dcPage::jsLoad('js/jquery/jquery-ui.custom.js'). 59 dcPage::jsLoad('js/jquery/jquery.ui.touch-punch.js'). 58 60 dcPage::jsLoad('index.php?pf=pages/list.js'). 59 61 '<script type="text/javascript">'. -
plugins/simpleMenu/_public.php
r2576 r2605 127 127 // Final rendering 128 128 if ($ret) { 129 $ret = '<ul '.($id ? 'id="'.$id.'"' : '').' class="simple-menu'.($class ? ' '.$class : '').'" >'."\n".$ret."\n".'</ul>';129 $ret = '<ul '.($id ? 'id="'.$id.'"' : '').' class="simple-menu'.($class ? ' '.$class : '').'" role="navigation">'."\n".$ret."\n".'</ul>'; 130 130 } 131 131 } -
plugins/simpleMenu/index.php
r2576 r2588 347 347 echo 348 348 dcPage::jsLoad('js/jquery/jquery-ui.custom.js'). 349 dcPage::jsLoad('js/jquery/jquery.ui.touch-punch.js'). 349 350 dcPage::jsLoad('index.php?pf=simpleMenu/simplemenu.js'); 350 351 } -
plugins/tags/_public.php
r2566 r2607 82 82 public static function addTplPath($core) 83 83 { 84 $core->tpl->setPath($core->tpl->getPath(), dirname(__FILE__).'/default-templates'); 84 $tplset = $core->themes->moduleInfo($core->blog->settings->system->theme,'tplset'); 85 if (!empty($tplset) && is_dir(dirname(__FILE__).'/default-templates/'.$tplset)) { 86 $core->tpl->setPath($core->tpl->getPath(), dirname(__FILE__).'/default-templates/'.$tplset); 87 } else { 88 $core->tpl->setPath($core->tpl->getPath(), dirname(__FILE__).'/default-templates/'.DC_DEFAULT_TPLSET); 89 } 85 90 } 86 91 -
plugins/themeEditor/class.themeEditor.php
r2566 r2607 16 16 protected $core; 17 17 18 protected $default_theme;19 18 protected $user_theme; 20 19 protected $parent_theme; 21 22 protected $default_tpl = array(); 20 protected $tplset_theme; 21 23 22 public $tpl = array(); 24 23 public $css = array(); … … 31 30 $this->default_theme = path::real($this->core->blog->themes_path.'/default'); 32 31 $this->user_theme = path::real($this->core->blog->themes_path.'/'.$this->core->blog->settings->system->theme); 32 $this->tplset_theme = DC_ROOT.'/inc/public/default-templates/'.DC_DEFAULT_TPLSET; 33 33 if (null !== $this->core->themes) { 34 34 $parent_theme = $this->core->themes->moduleInfo($this->core->blog->settings->system->theme,'parent'); 35 35 if ($parent_theme) { 36 36 $this->parent_theme = path::real($this->core->blog->themes_path.'/'.$parent_theme); 37 } 38 $tplset = $this->core->themes->moduleInfo($this->core->blog->settings->system->theme,'tplset'); 39 if ($tplset) { 40 $this->tplset_theme = DC_ROOT.'/inc/public/default-templates/'.$tplset; 37 41 } 38 42 } … … 207 211 protected function findTemplates() 208 212 { 209 # First, we look in template paths210 $this->default_tpl = $this->getFilesInDir($this->default_theme.'/tpl');211 212 213 $this->tpl = array_merge( 213 $this-> default_tpl,214 $this->getFilesInDir($this->tplset_theme), 214 215 $this->getFilesInDir($this->parent_theme.'/tpl'), 215 216 $this->getFilesInDir($this->user_theme.'/tpl') 216 217 ); 217 $this->tpl = array_merge($this->getFilesInDir(DC_ROOT.'/inc/public/default-templates'),$this->tpl);218 218 219 219 # Then we look in 'default-templates' plugins directory -
plugins/widgets/_widgets_functions.php
r2565 r2605 29 29 ($w->content_only ? '' : '<div id="search"'.($w->class ? ' class="'.html::escapeHTML($w->class).'"' : '').'>'). 30 30 ($w->title ? '<h2><label for="q">'.html::escapeHTML($w->title).'</label></h2>' : ''). 31 '<form action="'.$core->blog->url.'" method="get" >'.31 '<form action="'.$core->blog->url.'" method="get" role="search">'. 32 32 '<fieldset>'. 33 33 '<p><input type="text" size="10" maxlength="255" id="q" name="q" value="'.$value.'" /> '. … … 50 50 ($w->content_only ? '' : '<div id="topnav"'.($w->class ? ' class="'.html::escapeHTML($w->class).'"' : '').'>'). 51 51 ($w->title ? '<h2>'.html::escapeHTML($w->title).'</h2>' : ''). 52 '<ul >';52 '<ul role="navigation">'; 53 53 54 54 if ($core->url->type != 'default') { -
plugins/widgets/index.php
r2509 r2520 218 218 echo 219 219 dcPage::jsLoad('js/jquery/jquery-ui.custom.js'). 220 dcPage::jsLoad('js/jquery/jquery.ui.touch-punch.js'). 220 221 dcPage::jsLoad('index.php?pf=widgets/widgets.js'); 221 222 ?> … … 366 367 $altUp = $i == 0 ? ' alt=""' : ' alt="'.__('Up the widget').'"'; 367 368 $altDown = $i == count($widgets->elements())-1 ? ' alt=""' : ' alt="'.__('Down the widget').'"'; 368 369 369 370 $iname = 'w['.$pr.']['.$i.']'; 370 371 -
themes/ductile/_config.php
r2566 r2581 273 273 $ductile_counts_base = array( 274 274 'default' => null, 275 'default-page' => null, 275 276 'category' => null, 276 277 'tag' => null, … … 290 291 $ductile_lists = $ductile_lists_base; 291 292 } 293 $ductile_lists = array_merge($ductile_lists_base,$ductile_lists); 292 294 293 295 $ductile_counts = $core->blog->settings->themes->get($core->blog->settings->system->theme.'_entries_counts'); … … 296 298 $ductile_counts = $ductile_counts_base; 297 299 } 300 $ductile_counts = array_merge($ductile_counts_base,$ductile_counts); 298 301 299 302 $ductile_stickers = $core->blog->settings->themes->get($core->blog->settings->system->theme.'_stickers'); -
themes/ductile/_define.php
r2566 r2581 15 15 /* Description*/ "Mediaqueries compliant elegant theme", 16 16 /* Author */ "Dotclear Team", 17 /* Version */ '1. 3.1',17 /* Version */ '1.4', 18 18 /* Properties */ array( 19 19 'standalone_config' => true, -
themes/ductile/_prepend.php
r2566 r2567 26 26 if (!$core->auth->user_prefs->accessibility->nodragdrop) { 27 27 echo 28 dcPage::jsLoad('js/jquery/jquery-ui.custom.js'); 28 dcPage::jsLoad('js/jquery/jquery-ui.custom.js'). 29 dcPage::jsLoad('js/jquery/jquery.ui.touch-punch.js'); 29 30 echo <<<EOT 30 31 <script type="text/javascript"> -
themes/ductile/_public.php
r2566 r2581 36 36 global $_ctx; 37 37 38 $nb = 0; 38 $nb_other = $nb_first = 0; 39 39 40 $s = $GLOBALS['core']->blog->settings->themes->get($GLOBALS['core']->blog->settings->system->theme.'_entries_counts'); 40 41 if ($s !== null) { 41 42 $s = @unserialize($s); 42 43 if (is_array($s)) { 43 if (isset($s[$GLOBALS['core']->url->type])) { 44 // Nb de billets par page défini par la config du thème 45 $nb = (integer) $s[$GLOBALS['core']->url->type]; 46 } else { 47 if (($GLOBALS['core']->url->type == 'default-page') && (isset($s['default']))) { 48 // Les pages 2 et suivantes de la home ont le même nombre de billet que la première page 49 $nb = (integer) $s['default']; 50 } 51 } 52 } 53 } 54 55 if ($nb == 0) { 44 switch ($GLOBALS['core']->url->type) { 45 case 'default': 46 case 'default-page': 47 if (isset($s['default'])) { 48 $nb_first = $nb_other = (integer) $s['default']; 49 } 50 if (isset($s['default-page'])) { 51 $nb_other = (integer) $s['default-page']; 52 } 53 break; 54 default: 55 if (isset($s[$GLOBALS['core']->url->type])) { 56 // Nb de billets par page défini par la config du thème 57 $nb_first = $nb_other = (integer) $s[$GLOBALS['core']->url->type]; 58 } 59 break; 60 } 61 } 62 } 63 64 if ($nb_other == 0) { 56 65 if (!empty($attr['nb'])) { 57 66 // Nb de billets par page défini par défaut dans le template 58 $nb = (integer) $attr['nb']; 59 } 60 } 61 62 if ($nb > 0) 63 $_ctx->nb_entry_per_page = $nb; 67 $nb_other = $nb_first = (integer) $attr['nb']; 68 } 69 } 70 71 if ($nb_other > 0) { 72 $_ctx->nb_entry_per_page = $nb_other; 73 } 74 if ($nb_first > 0) { 75 $_ctx->nb_entry_first_page = $nb_first; 76 } 64 77 } 65 78
Note: See TracChangeset
for help on using the changeset viewer.