Dotclear


Ignore:
Timestamp:
10/08/13 15:27:39 (12 years ago)
Author:
Dsls
Branch:
twig
Parents:
1524:913f5a36bbb0 (diff), 2312:d01c85eaa37d (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Twig merge - lots of things to adapt yet

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • inc/core/class.dc.core.php

    r1315 r2313  
    6565          if ($this->con instanceof mysqlConnection) { 
    6666               mysqlConnection::$weak_locks = true; 
     67          } elseif ($this->con instanceof mysqliConnection) { 
     68               mysqliConnection::$weak_locks = true; 
    6769          } 
    6870           
     
    382384     } 
    383385      
    384      public function setPostType($type,$admin_url,$public_url) 
     386     public function setPostType($type,$admin_url,$public_url,$label='') 
    385387     { 
    386388          $this->post_types[$type] = array( 
    387389               'admin_url' => $admin_url, 
    388                'public_url' => $public_url 
     390               'public_url' => $public_url, 
     391               'label' => ($label != '' ? $label : $type) 
    389392          ); 
    390393     } 
     
    854857          $strReq = 
    855858          'SELECT U.user_id AS user_id, user_super, user_name, user_firstname, '. 
    856           'user_displayname, permissions '. 
     859          'user_displayname, user_email, permissions '. 
    857860          'FROM '.$this->prefix.'user U '. 
    858861          'JOIN '.$this->prefix.'permissions P ON U.user_id = P.user_id '. 
     
    863866               'UNION '. 
    864867               'SELECT U.user_id AS user_id, user_super, user_name, user_firstname, '. 
    865                "user_displayname, NULL AS permissions ". 
     868               "user_displayname, user_email, NULL AS permissions ". 
    866869               'FROM '.$this->prefix.'user U '. 
    867870               'WHERE user_super = 1 '; 
     
    878881                    'firstname' => $rs->user_firstname, 
    879882                    'displayname' => $rs->user_displayname, 
     883                    'email' => $rs->user_email, 
    880884                    'super' => (boolean) $rs->user_super, 
    881885                    'p' => $this->auth->parsePermissions($rs->permissions) 
     
    965969           
    966970          if (!empty($params['q'])) { 
    967                $params['q'] = str_replace('*','%',$params['q']); 
     971               $params['q'] = strtolower(str_replace('*','%',$params['q'])); 
    968972               $where .= 
    969973               'AND ('. 
     
    13751379                    array('use_smilies','boolean',false, 
    13761380                    'Show smilies on entries and comments'), 
     1381                    array('inc_subcats','boolean',false, 
     1382                    'Include sub-categories in category page and category posts feed'), 
    13771383                    array('wiki_comments','boolean',false, 
    13781384                    'Allow commenters to use a subset of wiki syntax') 
  • inc/core/class.dc.core.php

    r2198 r2313  
    44# This file is part of Dotclear 2. 
    55# 
    6 # Copyright (c) 2003-2013 Olivier Meunier & Association Dotclear 
     6# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear 
    77# Licensed under the GPL version 2.0 license. 
    88# See LICENSE file or 
     
    3939     public $rest;       ///< <b>dcRestServer</b> dcRestServer object 
    4040     public $log;        ///< <b>dcLog</b>             dcLog object 
     41     public $tpl;        ///< <b>Twig_Environment</b>  Twig_Environment object 
    4142      
    4243     private $versions = null; 
     
    9798          $this->addFormater('xhtml', create_function('$s','return $s;')); 
    9899          $this->addFormater('wiki', array($this,'wikiTransform')); 
     100          $this->loadTemplateEnvironment(); 
    99101     } 
    100102      
     
    120122     } 
    121123      
     124     /** 
     125     Create template environment (Twig_Environment instance) 
     126      
     127     default-templates path must be added from admin|public/prepend.php with: 
     128     $core->tpl->getLoader()->addPath('PATH_TO/default-templates'); 
     129     Selected theme path must be added with: 
     130     $core->tpl->getLoader()->prependPath('PATH_TO/MY_THEME'); 
     131     */ 
     132     public function loadTemplateEnvironment() 
     133     { 
     134          $cache_dir = path::real(DC_TPL_CACHE.'/twtpl',false); 
     135          if (!is_dir($cache_dir)) { 
     136               try { 
     137                    files::makeDir($cache_dir); 
     138               } catch (Exception $e) { 
     139                    $cache_dir = false; 
     140               } 
     141          } 
     142           
     143          $this->tpl = new Twig_Environment( 
     144               new Twig_Loader_Filesystem(dirname(__FILE__).'/../swf'), 
     145               array( 
     146                    'auto_reload' => true, 
     147                    'autoescape' => false, 
     148                    'base_template_class' => 'Twig_Template', 
     149                    'cache' => $cache_dir,  
     150                    'charset' => 'UTF-8', 
     151                    'debug' => DC_DEBUG, 
     152                    'optimizations' => -1, 
     153                    'strict_variables' => 0 //DC_DEBUG // Please fix undefined variables! 
     154               ) 
     155          ); 
     156          $this->tpl->addExtension(new dcFormExtension($this)); 
     157          $this->tpl->addExtension(new dcTabExtension($this)); 
     158     } 
    122159      
    123160     /// @name Blog init methods 
Note: See TracChangeset for help on using the changeset viewer.

Sites map