Changeset 2313:ef1db3d7c388 for inc/core/class.dc.core.php
- Timestamp:
- 10/08/13 15:27:39 (12 years ago)
- 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. - Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
inc/core/class.dc.core.php
r1315 r2313 65 65 if ($this->con instanceof mysqlConnection) { 66 66 mysqlConnection::$weak_locks = true; 67 } elseif ($this->con instanceof mysqliConnection) { 68 mysqliConnection::$weak_locks = true; 67 69 } 68 70 … … 382 384 } 383 385 384 public function setPostType($type,$admin_url,$public_url )386 public function setPostType($type,$admin_url,$public_url,$label='') 385 387 { 386 388 $this->post_types[$type] = array( 387 389 'admin_url' => $admin_url, 388 'public_url' => $public_url 390 'public_url' => $public_url, 391 'label' => ($label != '' ? $label : $type) 389 392 ); 390 393 } … … 854 857 $strReq = 855 858 'SELECT U.user_id AS user_id, user_super, user_name, user_firstname, '. 856 'user_displayname, permissions '.859 'user_displayname, user_email, permissions '. 857 860 'FROM '.$this->prefix.'user U '. 858 861 'JOIN '.$this->prefix.'permissions P ON U.user_id = P.user_id '. … … 863 866 'UNION '. 864 867 '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 ". 866 869 'FROM '.$this->prefix.'user U '. 867 870 'WHERE user_super = 1 '; … … 878 881 'firstname' => $rs->user_firstname, 879 882 'displayname' => $rs->user_displayname, 883 'email' => $rs->user_email, 880 884 'super' => (boolean) $rs->user_super, 881 885 'p' => $this->auth->parsePermissions($rs->permissions) … … 965 969 966 970 if (!empty($params['q'])) { 967 $params['q'] = str _replace('*','%',$params['q']);971 $params['q'] = strtolower(str_replace('*','%',$params['q'])); 968 972 $where .= 969 973 'AND ('. … … 1375 1379 array('use_smilies','boolean',false, 1376 1380 'Show smilies on entries and comments'), 1381 array('inc_subcats','boolean',false, 1382 'Include sub-categories in category page and category posts feed'), 1377 1383 array('wiki_comments','boolean',false, 1378 1384 'Allow commenters to use a subset of wiki syntax') -
inc/core/class.dc.core.php
r2198 r2313 4 4 # This file is part of Dotclear 2. 5 5 # 6 # Copyright (c) 2003-201 3Olivier Meunier & Association Dotclear6 # Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear 7 7 # Licensed under the GPL version 2.0 license. 8 8 # See LICENSE file or … … 39 39 public $rest; ///< <b>dcRestServer</b> dcRestServer object 40 40 public $log; ///< <b>dcLog</b> dcLog object 41 public $tpl; ///< <b>Twig_Environment</b> Twig_Environment object 41 42 42 43 private $versions = null; … … 97 98 $this->addFormater('xhtml', create_function('$s','return $s;')); 98 99 $this->addFormater('wiki', array($this,'wikiTransform')); 100 $this->loadTemplateEnvironment(); 99 101 } 100 102 … … 120 122 } 121 123 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 } 122 159 123 160 /// @name Blog init methods
Note: See TracChangeset
for help on using the changeset viewer.