Dotclear

Changeset 2654:5818627b7cc1


Ignore:
Timestamp:
02/12/14 10:35:31 (12 years ago)
Author:
Dsls
Branch:
twig
Message:

Twig no more in hg, welcome composer. Small tunings, need to see favs in index.

Files:
2 added
165 deleted
5 edited

Legend:

Unmodified
Added
Removed
  • .hgsubstate

    r2624 r2654  
    1 d80e4972aaaa26450e5d2f45d55ed8eca0706f9d inc/libs/clearbricks 
     10000000000000000000000000000000000000000 inc/libs/clearbricks 
  • admin/index.php

    r2650 r2654  
    6666     $new_v = $updater->check(DC_VERSION); 
    6767     $version_info = $new_v ? $updater->getInfoURL() : ''; 
    68       
     68 
    6969     if ($updater->getNotify() && $new_v) { 
    7070          $_ctx->updater = array( 
     
    145145          $categories = $core->blog->getCategories(array('post_type'=>'post')); 
    146146          while ($categories->fetch()) { 
    147                $categories_combo[$categories->cat_id] =  
     147               $categories_combo[$categories->cat_id] = 
    148148                    str_repeat('  ',$categories->level-1). 
    149149                    ($categories->level-1 == 0 ? '' : '• '). 
     
    151151          } 
    152152     } catch (Exception $e) { } 
    153       
     153 
    154154     $form = new dcForm($core,array('quickentry','quick-entry'),'post.php'); 
    155155     $form 
     
    184184               new dcFieldHidden ('save-publish',__('Save and publish'))); 
    185185     } 
    186       
     186 
    187187     $_ctx->dashboard_quickentry = true; 
    188188} 
     
    191191$__dashboard_icons = new ArrayObject(); 
    192192 
    193 # Dashboard favorites 
    194 $post_count = $core->blog->getPosts(array(),true)->f(0); 
    195 $str_entries = ($post_count > 1) ? __('%d entries') : __('%d entry'); 
    196  
    197 $comment_count = $core->blog->getComments(array(),true)->f(0); 
    198 $str_comments = ($comment_count > 1) ? __('%d comments') : __('%d comment'); 
    199  
    200 $ws = $core->auth->user_prefs->addWorkspace('favorites'); 
    201 $count = 0; 
    202 foreach ($ws->dumpPrefs() as $k => $v) { 
    203      // User favorites only 
    204      if (!$v['global']) { 
    205           $fav = unserialize($v['value']); 
    206           if (($fav['permissions'] == '*') || $core->auth->check($fav['permissions'],$core->blog->id)) { 
    207                if (dc_valid_fav($fav['url'])) { 
    208                     $count++; 
    209                     $title = ($fav['name'] == 'posts' ? sprintf($str_entries,$post_count) :  
    210                          ($fav['name'] == 'comments' ? sprintf($str_comments,$comment_count) : $fav['title'])); 
    211                     $__dashboard_icons[$fav['name']] = new ArrayObject(array(__($title),$fav['url'],$fav['large-icon'])); 
    212  
    213                     # Let plugins set their own title for favorite on dashboard 
    214                     $core->callBehavior('adminDashboardFavsIcon',$core,$fav['name'],$__dashboard_icons[$fav['name']]); 
     193$favs = $core->favs->getUserFavorites(); 
     194$core->favs->appendDashboardIcons($__dashboard_icons); 
     195 
     196 
     197# Check plugins and themes update from repository 
     198function dc_check_store_update($mod, $url, $img, $icon) 
     199{ 
     200     $repo = new dcStore($mod, $url); 
     201     $upd = $repo->get(true); 
     202     if (!empty($upd)) { 
     203          $icon[0] .= '<br />'.sprintf(__('An update is available', '%s updates are available.', count($upd)),count($upd)); 
     204          $icon[1] .= '#update'; 
     205          $icon[2] = 'images/menu/'.$img.'-b-update.png'; 
     206     } 
     207} 
     208if (isset($__dashboard_icons['plugins'])) { 
     209     dc_check_store_update($core->plugins, $core->blog->settings->system->store_plugin_url, 'plugins', $__dashboard_icons['plugins']); 
     210} 
     211if (isset($__dashboard_icons['blog_theme'])) { 
     212     $themes = new dcThemes($core); 
     213     $themes->loadModules($core->blog->themes_path, null); 
     214     dc_check_store_update($themes, $core->blog->settings->system->store_theme_url, 'blog-theme', $__dashboard_icons['blog_theme']); 
     215} 
     216 
     217# Latest news for dashboard 
     218$__dashboard_items = new ArrayObject(array(new ArrayObject(),new ArrayObject())); 
     219 
     220$dashboardItem = 0; 
     221 
     222 
     223if ($core->auth->user_prefs->dashboard->dcnews) { 
     224     try 
     225     { 
     226          if (empty($__resources['rss_news'])) { 
     227               throw new Exception(); 
     228          } 
     229 
     230          $feed_reader = new feedReader; 
     231          $feed_reader->setCacheDir(DC_TPL_CACHE); 
     232          $feed_reader->setTimeout(2); 
     233          $feed_reader->setUserAgent('Dotclear - http://www.dotclear.org/'); 
     234          $feed = $feed_reader->parse($__resources['rss_news']); 
     235          if ($feed) 
     236          { 
     237               $latest_news = '<div class="box medium dc-box"><h3>'.__('Dotclear news').'</h3><dl id="news">'; 
     238               $i = 1; 
     239               foreach ($feed->items as $item) 
     240               { 
     241                    $dt = isset($item->link) ? '<a href="'.$item->link.'" class="outgoing" title="'.$item->title.'">'. 
     242                         $item->title.' <img src="images/outgoing-blue.png" alt="" /></a>' : $item->title; 
     243 
     244                    if ($i < 3) { 
     245                         $latest_news .= 
     246                         '<dt>'.$dt.'</dt>'. 
     247                         '<dd><p><strong>'.dt::dt2str(__('%d %B %Y:'),$item->pubdate,'Europe/Paris').'</strong> '. 
     248                         '<em>'.text::cutString(html::clean($item->content),120).'...</em></p></dd>'; 
     249                    } else { 
     250                         $latest_news .= 
     251                         '<dt>'.$dt.'</dt>'. 
     252                         '<dd>'.dt::dt2str(__('%d %B %Y:'),$item->pubdate,'Europe/Paris').'</dd>'; 
     253                    } 
     254                    $i++; 
     255                    if ($i > 2) { break; } 
    215256               } 
    216           } 
    217      } 
    218 }     
    219 if (!$count) { 
    220      // Global favorites if any 
    221      foreach ($ws->dumpPrefs() as $k => $v) { 
    222           $fav = unserialize($v['value']); 
    223           if (($fav['permissions'] == '*') || $core->auth->check($fav['permissions'],$core->blog->id)) { 
    224                if (dc_valid_fav($fav['url'])) { 
    225                     $count++; 
    226                     $title = ($fav['name'] == 'posts' ? sprintf($str_entries,$post_count) :  
    227                          ($fav['name'] == 'comments' ? sprintf($str_comments,$comment_count) : $fav['title'])); 
    228                     $__dashboard_icons[$fav['name']] = new ArrayObject(array(__($title),$fav['url'],$fav['large-icon'])); 
    229  
    230                     # Let plugins set their own title for favorite on dashboard 
    231                     $core->callBehavior('adminDashboardFavsIcon',$core,$fav['name'],$__dashboard_icons[$fav['name']]); 
    232                } 
    233           } 
    234      } 
    235 } 
    236 if (!$count) { 
    237      // No user or global favorites, add "user pref" and "new entry" fav 
    238      if ($core->auth->check('usage,contentadmin',$core->blog->id)) { 
    239           $__dashboard_icons['new_post'] = new ArrayObject(array(__('New entry'),'post.php','images/menu/edit-b.png')); 
    240      } 
    241      $__dashboard_icons['prefs'] = new ArrayObject(array(__('My preferences'),'preferences.php','images/menu/user-pref-b.png')); 
    242 } 
    243  
    244 # Send dashboard icons to templates 
    245 $icons = array(); 
    246 foreach ($__dashboard_icons as $i) { 
    247      $icons[] = array( 
    248           'title'   => $i[0], 
    249           'url'     => $i[1], 
    250           'img'     => dc_admin_icon_url($i[2]) 
    251      ); 
    252 } 
    253 $_ctx->dashboard_icons = $icons; 
    254  
    255 # Dashboard items 
    256 $__dashboard_items = new ArrayObject(array(new ArrayObject,new ArrayObject)); 
     257               $latest_news .= '</dl></div>'; 
     258               $__dashboard_items[$dashboardItem][] = $latest_news; 
     259               $dashboardItem++; 
     260          } 
     261     } 
     262     catch (Exception $e) {} 
     263} 
     264 
     265# Documentation links 
     266if ($core->auth->user_prefs->dashboard->doclinks) { 
     267     if (!empty($__resources['doc'])) 
     268     { 
     269          $doc_links = '<div class="box small dc-box"><h3>'.__('Documentation and support').'</h3><ul>'; 
     270 
     271          foreach ($__resources['doc'] as $k => $v) { 
     272               $doc_links .= '<li><a class="outgoing" href="'.$v.'" title="'.$k.'">'.$k. 
     273               ' <img src="images/outgoing-blue.png" alt="" /></a></li>'; 
     274          } 
     275 
     276          $doc_links .= '</ul></div>'; 
     277          $__dashboard_items[$dashboardItem][] = $doc_links; 
     278          $dashboardItem++; 
     279     } 
     280} 
     281 
    257282$core->callBehavior('adminDashboardItems', $core, $__dashboard_items); 
    258283 
    259 # Send dashboard items to templates 
    260 $items = array(); 
    261 foreach ($__dashboard_items as $i) {     
    262      if ($i->count() > 0) { 
    263           foreach ($i as $v) { 
    264                $items[] = $v; 
    265           } 
    266      } 
    267 } 
    268 $_ctx->dashboard_items = $items; 
    269  
    270284# Dashboard content 
     285$dashboardContents = ''; 
    271286$__dashboard_contents = new ArrayObject(array(new ArrayObject,new ArrayObject)); 
    272287$core->callBehavior('adminDashboardContents', $core, $__dashboard_contents); 
    273  
    274 # Send dashboard contents to templates 
    275 $contents = array(); 
    276 foreach ($__dashboard_contents as $i) {  
    277      if ($i->count() > 0) { 
    278           foreach ($i as $v) { 
    279                $contents[] = $v; 
    280           } 
    281      } 
    282 } 
    283 $_ctx->dashboard_contents = $contents; 
    284288 
    285289# Blog status message 
  • inc/admin/class.dc.admincontext.php

    r2321 r2654  
    2222    /** 
    2323     * valuesToArray - converts a list of strings to an array having these strings as keys. 
    24      *  
     24     * 
    2525     * @param mixed $val the list to convert. 
    2626     * @access protected 
     
    6363          } 
    6464     } 
    65       
     65 
    6666     public function __isset($name) { 
    6767          if ($this->isAllowed($name,$this->attributes)) { 
     
    7171          } 
    7272     } 
    73       
     73 
    7474 
    7575     public function __call($name,$args) { 
     
    112112     protected $protected_globals = array(); 
    113113     protected $memory = array(); 
    114       
     114 
    115115     public function __construct($core) 
    116116     { 
    117117          $this->core = $core; 
    118            
     118 
    119119          # Globals editable via context 
    120120          $this->globals = array(); 
    121            
     121 
    122122          # Globals not editable via context 
    123123          $this->protected_globals = array( 
     
    128128                    'errors' => array() 
    129129               ), 
    130                 
     130 
    131131               'page_title'   => array(), 
    132132               'page_global'  => false, 
    133                 
     133 
    134134               'admin_url'    => DC_ADMIN_URL, 
    135135               'theme_url'    => '', 
    136136               'plugin_url'   => DC_ADMIN_URL.'index.php?pf=', 
    137                 
     137 
    138138               'version'           => DC_VERSION, 
    139139               'vendor_name'  => DC_VENDOR_NAME, 
    140                 
     140 
    141141               'safe_mode'    => isset($_SESSION['sess_safe_mode']) && $_SESSION['sess_safe_mode'], 
    142142               'debug_mode'   => DC_DEBUG 
    143143          ); 
    144144     } 
    145       
     145 
    146146     /** 
    147147     Prevent call crash from template on method that return this class 
     
    151151          return ''; 
    152152     } 
    153       
     153 
    154154     /** 
    155155     Test a global variable 
    156       
     156 
    157157     @param string $name Name of the variable to test 
    158158     @return boolean 
     
    162162          return isset($this->globals[$name]); 
    163163     } 
    164       
     164 
    165165     /** 
    166166     Add a global variable 
    167       
     167 
    168168     @param string $name Name of the variable 
    169169     @param mixed $value Value of the variable 
     
    182182          $this->globals[$name] = $value; 
    183183     } 
    184       
     184 
    185185     /** 
    186186     Get a global variable 
    187       
     187 
    188188     @param string $name Name of the variable 
    189189     @return mixed Value of the variable or null 
     
    193193          return isset($this->globals[$name]) ? $this->globals[$name] : null; 
    194194     } 
    195       
     195 
    196196     /** 
    197197     Returns a list of filters to add to the existing list. 
    198       
     198 
    199199     @return array An array of filters 
    200200     */ 
     
    205205          ); 
    206206     } 
    207       
     207 
    208208     /** 
    209209     Returns a list of functions to add to the existing list. 
    210       
     210 
    211211     @return array An array of functions 
    212212     */ 
     
    221221          ); 
    222222     } 
    223       
     223 
    224224 
    225225    /** 
    226226     * Builds an url given a base, and parameters 
    227      *  
     227     * 
    228228     * @param mixed $url    the base url as string 
    229229     * @param mixed $params the parameters. 
     
    252252     /** 
    253253     Returns a list of global variables to add to the existing list. 
    254       
     254 
    255255     This merges overloaded variables with defined variables. 
    256       
     256 
    257257     @return array An array of global variables 
    258258     */ 
    259259     public function getGlobals() 
    260260     { 
    261           $this->getBlogs(); 
    262           $this->getCurrentBlog(); 
    263           $this->getCurrentUser(); 
    264           $this->getMenus(); 
    265            
    266           # Additional globals 
    267           $p = path::info($_SERVER['REQUEST_URI']); 
    268           $this->protected_globals['current_page'] = $p['base']; 
    269           $this->protected_globals['blog_count'] = $this->core->auth->getBlogCount(); 
    270           $this->protected_globals['rtl'] = l10n::getTextDirection( 
    271                $this->protected_globals['current_user']['lang']) == 'rtl'; 
     261          if ($this->core->auth->userID()) { 
     262               $this->getBlogs(); 
     263               $this->getCurrentBlog(); 
     264               $this->getCurrentUser(); 
     265               $this->getMenus(); 
     266 
     267               # Additional globals 
     268               $p = path::info($_SERVER['REQUEST_URI']); 
     269               $this->protected_globals['current_page'] = $p['base']; 
     270               $this->protected_globals['blog_count'] = $this->core->auth->getBlogCount(); 
     271               $this->protected_globals['rtl'] = l10n::getTextDirection( 
     272                    $this->protected_globals['current_user']['lang']) == 'rtl'; 
     273          } 
    272274          $this->protected_globals['session'] = array( 
    273275               'id' => session_id(), 
     
    278280          return array_merge($this->globals,$this->protected_globals); 
    279281     } 
    280       
     282 
    281283     /** 
    282284     Returns the name of the extension. 
    283       
     285 
    284286     @return string The extension name 
    285287     */ 
     
    288290          return 'AdminContext'; 
    289291     } 
    290       
    291       
     292 
     293 
    292294     /** 
    293295     Add an informational message 
    294       
     296 
    295297     @param string $message A message 
    296298     @return object self 
     
    301303          return $this; 
    302304     } 
    303       
     305 
    304306     /** 
    305307     Add an informational message 
    306       
     308 
    307309     @param string $message A message 
    308310     @return object self 
     
    313315          return $this; 
    314316     } 
    315       
     317 
    316318     /** 
    317319     Add a list of informational messages 
    318       
     320 
    319321     @param string $message A title 
    320322     @param array $message A list of messages 
     
    326328          return $this; 
    327329     } 
    328       
     330 
    329331     /** 
    330332     Set an important message 
    331       
     333 
    332334     @param string $message A message 
    333335     @return object self 
     
    338340          return $this; 
    339341     } 
    340       
     342 
    341343     /** 
    342344     Add an error message 
    343       
     345 
    344346     @param string Error message 
    345347     @return object self 
     
    350352          return $this; 
    351353     } 
    352       
     354 
    353355     /** 
    354356     Check if there is an error message 
    355       
     357 
    356358     @return boolean 
    357359     */ 
     
    360362          return !empty($this->protected_globals['messages']['errors']); 
    361363     } 
    362       
     364 
    363365     /** 
    364366     Add a section to the breadcrumb 
    365       
    366      $title can be:  
    367      a string for page title part or  
     367 
     368     $title can be: 
     369     a string for page title part or 
    368370     TRUE to add blog name at the begining of title or 
    369371     NULL to empty/reset title 
    370       
     372 
    371373     @param mixed $title A title part 
    372374     @param boolean $url Link of the title part 
     
    381383          ); 
    382384     } 
    383       
     385 
    384386     /** 
    385387     Fill the page title 
    386       
    387      $title can be:  
    388      a string for page title part or  
     388 
     389     $title can be: 
     390     a string for page title part or 
    389391     TRUE to add blog name at the begining of title or 
    390392     NULL to empty/reset title 
    391       
     393 
    392394     @param mixed $title A title part 
    393395     @param boolean $url Link of the title part 
     
    411413          return $this; 
    412414     } 
    413       
     415 
    414416     /** 
    415417     Check if a page title is set 
     
    419421          return !empty($this->protected_globals['page_title']); 
    420422     } 
    421       
     423 
    422424     /** 
    423425     Get list of blogs 
     
    426428     { 
    427429          $blog_id = ''; 
    428            
     430 
    429431          # Blogs list 
    430432          $blogs = array(); 
     
    435437               while ($rs_blogs->fetch()) { 
    436438                    $blogs[$rs_blogs->blog_id] = $rs_blogs->blog_name.' - '.$rs_blogs->blog_url; 
    437                     $this->protected_globals['blogs'][$rs_blogs->blog_id] =  
     439                    $this->protected_globals['blogs'][$rs_blogs->blog_id] = 
    438440                    new dcArrayProxy($rs_blogs, array( 
    439441                         'blog_id','blog_name','blog_desc','blog_url','blog_creadt','blog_upddt')); 
    440442               } 
    441443          } 
    442            
     444 
    443445          # Switch blog form 
    444446          $form = new dcForm($this->core,'switchblog_menu','index.php'); 
     
    463465               ->setup(); 
    464466     } 
    465       
     467 
    466468     /** 
    467469     Get current blog information 
     
    482484               ); 
    483485     } 
    484       
     486 
    485487     /** 
    486488     Get current user information 
     
    493495               'post_status','creadt','upddt','cn' 
    494496          ); 
    495            
     497 
    496498          $user = array( 
    497499               'id' => '', 
     
    504506               ) 
    505507          ); 
    506            
     508 
    507509          foreach($infos as $i) { 
    508510               $user[$i] = ''; 
    509511          } 
    510            
     512 
    511513          if ($this->core->auth->userID()) { 
    512            
     514 
    513515               $user = array( 
    514516                    'id' => $this->core->auth->userID(), 
     
    519521                    ) 
    520522               ); 
    521                 
     523 
    522524               foreach($infos as $i) { 
    523525                    $user[$i] = $this->core->auth->getInfo('user_'.$i); 
    524526               } 
    525                 
     527 
    526528               foreach($this->core->auth->user_prefs->dumpWorkspaces() as $ws => $prefs) { 
    527529                    $user['prefs'][$ws] = $prefs->dumpPrefs(); 
    528530               } 
    529531          } 
    530            
     532 
    531533          $this->protected_globals['current_user'] = $user; 
    532534     } 
    533       
     535 
    534536     /** 
    535537     Get sidebar menus 
     
    538540     { 
    539541          global $_menu; 
    540            
     542 
    541543          $this->protected_globals['menus'] = array(); 
    542            
     544 
    543545          if (!isset($_menu)) { 
    544546               return; 
    545547          } 
    546            
     548 
    547549          foreach($_menu as $m) { 
    548550               $this->protected_globals['menus'][] = array( 
     
    554556          } 
    555557     } 
    556       
     558 
    557559     /** 
    558560     Get an array of debug/dev infos 
     
    563565               return array(); 
    564566          } 
    565            
     567 
    566568          $di = array( 
    567569               'global_vars' => implode(', ',array_keys($GLOBALS)), 
     
    572574               'xdebug' => array() 
    573575          ); 
    574            
     576 
    575577          if (function_exists('xdebug_get_profiler_filename')) { 
    576            
     578 
    577579               $url = http::getSelfURI(); 
    578580               $url .= strpos($url,'?') === false ? '?' : '&'; 
    579581               $url .= 'XDEBUG_PROFILE'; 
    580                 
     582 
    581583               $di['xdebug'] = array( 
    582584                    'elapse_time' => xdebug_time_index(), 
     
    584586                    'profiler_url' =>  $url 
    585587               ); 
    586                 
     588 
    587589               /* xdebug configuration: 
    588590               zend_extension = /.../xdebug.so 
     
    598600               */ 
    599601          } 
    600            
     602 
    601603          return $di; 
    602604     } 
    603       
     605 
    604606     /** 
    605607     Add a value in a namespace memory 
    606       
     608 
    607609     This help keep variable when recalling Twig macros 
    608       
     610 
    609611     @param string $ns A namespace 
    610612     @param string $str A value to memorize in this namespace 
     
    616618          } 
    617619     } 
    618       
     620 
    619621     /** 
    620622     Check if a value is previously memorized in a namespace 
    621       
     623 
    622624     @param string $ns A namespace 
    623625     @param string $str A value to search in this namespace 
  • inc/admin/default-templates/post.html.twig

    r1517 r2654  
    5555                    {{ block(bl) }} 
    5656               {% endfor %} 
    57                <p>{{ form_field('save')}}  
     57               <p>{{ form_field('save')}} 
    5858               {% if preview_url is defined %} 
    5959                    <a id="post-preview" href="{{ preview_url}}" class="button" accesskey="p">{{__('Preview')}} (p)</a> 
    6060               {% endif %} 
    61                 
     61 
    6262               {{form_field('delete',{'class':'delete'})}}{{form_hidden()}}</p> 
    6363 
     
    105105{% endblock %} 
    106106 
    107 {% block field_post_status %} 
     107{#{% block field_post_status %} 
    108108<p>{{ form_field('post_status',{},{'labelclass':'ib'}) }}</p> 
    109109{% endblock %} 
    110  
     110#} 
    111111{# Field-specific blocks #} 
    112112 
     
    128128 
    129129{% block post_status -%} 
    130      <p><label class="ib">{{form_field_attr('post_status','label')}} {{ _self.img_status(form_field_attr('post_status','value'))}}</label>{{ form_field('post_status',{},{'label':'','labelclass':'ib'})}}</p> 
     130     <p class="entry-status"><label for="post_status">{{form_field_attr('post_status','label')}} {{ _self.img_status(form_field_attr('post_status','value'))}}</label>{{ form_field('post_status',{},{'label':'','labelclass':'ib'})}}</p> 
    131131{%- endblock %} 
    132132 
     
    136136 
    137137{% block post_lang -%} 
    138      <p>{{ form_field('post_lang',{"class":"maximal"},{'nestedlabel':true, 'labelclass':'ib'})}}</p> 
     138     <p>{{ form_field('post_lang',{"class":"maximal"},{'labelclass':'ib'})}}</p> 
    139139{%- endblock %} 
    140140 
    141141{% block post_format -%} 
    142      <p>{{ form_field('post_format',{},{'labelclass':'ib'})}}</p> 
    143      {% if post_id and form_field_attr('post_format','value')=='xhtml' %} 
    144      <p><a id="convert-xhtml" class="button maximal" href="post.php?id={{post_id}}&amp;xconv=1"> 
    145      {{__('Convert to XHTML')}}</a></p> 
    146      {% endif %} 
     142     <div> 
     143          <h5 id="label_format" class="classic">{{form_field_attr('post_format','label')}}</h5> 
     144          <p>{{ form_field('post_format',{},{'label':''})}}</p> 
     145          {% if post_id and form_field_attr('post_format','value')=='xhtml' %} 
     146               <p><a id="format_control control_no_xhtml" class="button maximal" href="post.php?id={{post_id}}&amp;xconv=1"> 
     147               {{__('Convert to XHTML')}}</a></p> 
     148          {% endif %} 
     149     </div> 
    147150{%- endblock %} 
    148151 
     
    152155 
    153156{% block cat_id -%} 
    154      <p>{{ form_field('cat_id',{'class':'maximal'},{'labelclass':'ib'}) }}</p> 
    155      {#{% if can_edit_categories %}#} 
     157{#'<div>'. 
     158                         '<h5 id="label_cat_id">'.__('Category').'</h5>'. 
     159                         '<p><label for="cat_id">'.__('Category:').'</label>'. 
     160                         form::combo('cat_id',$categories_combo,$cat_id,'maximal'). 
     161                         '</p>'. 
     162                         ($core->auth->check('categories', $core->blog->id) ? 
     163                              '<div>'. 
     164                              '<h5 id="create_cat">'.__('Add a new category').'</h5>'. 
     165                              '<p><label for="new_cat_title">'.__('Title:').' '. 
     166                              form::field('new_cat_title',30,255,'','maximal').'</label></p>'. 
     167                              '<p><label for="new_cat_parent">'.__('Parent:').' '. 
     168                              form::combo('new_cat_parent',$categories_combo,'','maximal'). 
     169                              '</label></p>'. 
     170                              '</div>' 
     171                         : ''). 
     172                         '</div>')), 
     173#} 
    156174     <div> 
    157           <p id="new_cat">{{__('Add a new category')}}</p> 
    158           <p>{{ form_field('new_cat_title') }}</p> 
    159           <p>{{ form_field('new_cat_parent') }} </p> 
    160      </div> 
    161      {#{% endif %}#} 
     175          <h5 id="label_cat_id">{{form_field_attr('cat_id','label')}}</h5> 
     176          <p>{{ form_field('cat_id',{},{'label':''})}}</p> 
     177          {% if 1==1 %} 
     178               <div> 
     179                    <h5 id="create_cat">{{__('Add a new category')}}</h5> 
     180                    <p>{{ form_field('new_cat_title',{"class":"maximal"}) }}</p> 
     181                    <p>{{ form_field('new_cat_parent') }} </p> 
     182               </div> 
     183          {% endif %} 
     184     </div> 
    162185{%- endblock %} 
    163186 
  • inc/prepend.php

    r2650 r2654  
    1818if (@is_dir('/usr/lib/clearbricks')) { 
    1919     define('CLEARBRICKS_PATH','/usr/lib/clearbricks'); 
    20 } elseif (is_dir(dirname(__FILE__).'/libs/clearbricks')) { 
    21      define('CLEARBRICKS_PATH',dirname(__FILE__).'/libs/clearbricks'); 
     20} elseif (is_dir(dirname(__FILE__).'/../vendor/dotclear/clearbricks')) { 
     21     define('CLEARBRICKS_PATH',dirname(__FILE__).'/../vendor/dotclear/clearbricks'); 
    2222} elseif (isset($_SERVER['CLEARBRICKS_PATH']) && is_dir($_SERVER['CLEARBRICKS_PATH'])) { 
    2323     define('CLEARBRICKS_PATH',$_SERVER['CLEARBRICKS_PATH']); 
     
    9696if (@is_dir('/usr/lib/twig')) { 
    9797     define('TWIG_PATH','/usr/lib/Twig'); 
    98 } elseif (is_dir(dirname(__FILE__).'/libs/Twig')) { 
    99      define('TWIG_PATH',dirname(__FILE__).'/libs/Twig'); 
     98} elseif (is_dir(dirname(__FILE__).'/../vendor/twig/twig/lib/Twig')) { 
     99     define('TWIG_PATH',dirname(__FILE__).'/../vendor/twig/twig/lib/Twig'); 
    100100} elseif (isset($_SERVER['TWIG_PATH']) && is_dir($_SERVER['TWIG_PATH'])) { 
    101101     define('TWIG_PATH',$_SERVER['TWIG_PATH']); 
     
    311311     # 60 : template processing error 
    312312     # 70 : blog is offline 
    313       
     313 
    314314     if (CLI_MODE) 
    315315     { 
Note: See TracChangeset for help on using the changeset viewer.

Sites map