Changeset 1491:2b9253624dbe
- Timestamp:
- 08/20/13 10:56:34 (12 years ago)
- Branch:
- twig
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
admin/post.php
r1490 r1491 193 193 new dcFieldCombo('post_status',$core->auth->getInfo('user_post_status'),$status_combo,array( 194 194 'disabled' => !$can_publish, 195 'label' => __('Entry status :'))))195 'label' => __('Entry status')))) 196 196 ->addField( 197 197 new dcFieldCombo('cat_id','',$categories_combo,array( 198 "label" => __('Category:')))) 198 "label" => __('Category')))) 199 ->addField( 200 new dcFieldCombo('new_cat_parent','',$categories_combo,array( 201 "label" => __('Parent:')))) 202 ->addField( 203 new dcFieldText('new_cat_title','', array( 204 'maxlength' => 255, 205 'label' => __('Title')))) 206 199 207 ->addField( 200 208 new dcFieldText('post_dt','',array( 201 "label" => __('Publi shed on:'))))209 "label" => __('Publication date and hour')))) 202 210 ->addField( 203 211 new dcFieldCombo('post_format',$core->auth->getOption('post_format'),$formaters_combo,array( 204 "label" => __('Text formating :'))))212 "label" => __('Text formating')))) 205 213 ->addField( 206 214 new dcFieldCheckbox ('post_open_comment',$core->blog->settings->system->allow_comments,array( … … 302 310 $form->setup(); 303 311 312 $sidebar_blocks = new ArrayObject(array( 313 'status-box' => array( 314 'title' => __('Status'), 315 'items' => array('post_status','post_dt','post_lang','post_format')), 316 'metas-box' => array( 317 'title' => __('Ordering'), 318 'items' => array('post_selected','cat_id')), 319 'options-box' => array( 320 'title' => __('Options'), 321 'items' => array('post_open_comment','post_open_tb','post_password','post_url')) 322 )); 323 324 $main_blocks = new ArrayObject(array( 325 "post_title","post_excerpt","post_content","post_notes" 326 )); 327 328 329 $_ctx->sidebar_blocks = $sidebar_blocks; 330 $_ctx->main_blocks = $main_blocks; 331 304 332 /* DISPLAY 305 333 -------------------------------------------------------- */ … … 321 349 ->default_tab = $default_tab; 322 350 351 352 323 353 $core->tpl->display('post.html.twig'); 324 354 ?> -
inc/admin/class.dc.filter.php
r1158 r1491 87 87 $this->filtered = false; 88 88 parent::__construct($core,$name,$action,'POST'); 89 $this->id = "filters";89 //$this->id = "filters"; 90 90 } 91 91 … … 872 872 protected function addValue($value=NULL) { 873 873 if ($value === NULL) { 874 $value = current( $this->combo);874 $value = current(array_keys($this->combo)); 875 875 } 876 876 $this->field->addValue($value); -
inc/admin/class.dc.form.php
r1489 r1491 165 165 ), 166 166 new Twig_SimpleFunction( 167 'form_field_attr', 168 array($this,'getFieldAttributes'), 169 array('is_safe' => array('html')) 170 ), 171 new Twig_SimpleFunction( 167 172 '_form_is_choice_group', 168 173 array($this,'isChoiceGroup'), … … 286 291 } 287 292 $this->renderWidget( 288 293 $field->getWidgetBlock(), 289 294 array_merge( 290 295 $attr, … … 292 297 ) 293 298 ); 299 } 300 } 301 302 /** 303 * getFieldAttributes - binding for 'form_field_attr' twig function; returns all field attributes 304 * 305 * @param mixed $name field name as defined on php side. 306 * @param mixed $name the attribute name, null to grab all attributes as an array 307 * 308 * @access public 309 * 310 * @return array the field attributes 311 */ 312 public function getFieldAttributes($name,$attr=null) 313 { 314 $field = $this->currentForm->getField($name); 315 if ($field) { 316 $a = $field->getAttributes(); 317 if ($attr !== null) { 318 if (isset($a[$attr])) { 319 return $a[$attr]; 320 } else { 321 return null; 322 } 323 } else { 324 return $field->getAttributes(); 325 } 326 } else { 327 return array(); 294 328 } 295 329 } … … 821 855 } 822 856 857 public function getFieldIDs() { 858 return array_keys($this->fields); 859 } 860 823 861 /** 824 862 * getHiddenFields - returns the list of hidden fields … … 1024 1062 * @return array the attributes. 1025 1063 */ 1026 public function getAttributes($options )1064 public function getAttributes($options=array()) 1027 1065 { 1028 1066 $offset = isset($options['offset']) ? $options['offset'] : 0; … … 1231 1269 } 1232 1270 1233 public function getAttributes($options )1271 public function getAttributes($options=array()) 1234 1272 { 1235 1273 $a = parent::getAttributes($options); … … 1244 1282 public function setup($from) 1245 1283 { 1284 $this->defined = true; 1246 1285 $values = $this->parseValues($from); 1247 1286 foreach ($this->checked as $k=>&$v) { … … 1326 1365 1327 1366 public function getDefaultValue() { 1328 return current( $this->combo);1367 return current(array_keys($this->combo_values)); 1329 1368 } 1330 1369 … … 1342 1381 } 1343 1382 1344 public function getAttributes($options ) {1383 public function getAttributes($options=array()) { 1345 1384 $attr = parent::getAttributes($options); 1346 1385 $attr['options'] = $this->combo; -
inc/admin/class.dc.list.php
r1158 r1491 164 164 public function getOrder() { 165 165 $id = $this->sortby->getFields()->getValue(); 166 167 166 return $this->columns[$id]->getColID().' '.$this->order->getFields()->getValue(); 168 167 } -
inc/admin/default-templates/forms/form_layout.html.twig
r1414 r1491 87 87 {% endspaceless %} 88 88 {% endblock field_combo %} 89 {#90 {% block label %}91 {% spaceless %}92 {% if label is not empty %}93 <label for="{{name}}" {% if required is not empty %}class="required"> <abbr title="{{__('Required field')}}">*</abbr>{% else %}>{% endif %} {{label}}</label>94 {% endif %}95 {% endspaceless %}96 {% endblock label %}97 #}98 89 99 90 {% block startlabel %} -
inc/admin/default-templates/forms/formfilter_layout.html.twig
r1154 r1491 4 4 {% block filterset -%} 5 5 <p> 6 <a href="#" id=" toggle-filters">{{ __('Toggle filters and display options') }} </a>6 <a href="#" id="filter-control" class="form-control">{{ __('Toggle filters and display options') }} </a> 7 7 </p> 8 {% form filtersetname with {'id':'filters-form' } -%} 9 <h3>Filtrer la liste des billets</h3> 10 <div class="table"> 8 11 <div class="two-cols"> 9 12 {% set fenv = _context['filterset_' ~ filtersetname] %} 10 {% form filtersetname with {'class':fenv.hide_filters?'hidden':'opened' } -%}11 13 <div class="col70"> 12 14 <h3>{{__('Entries filters')}}</h3> … … 37 39 <p class="clear margintop"></p> 38 40 {%- endform -%} 41 </div> 39 42 </div> 40 43 {%- endblock %} -
inc/admin/default-templates/post.html.twig
r1319 r1491 1 1 {% extends "layout.html.twig" %} 2 2 {% import "js_helpers.html.twig" as js %} 3 {% macro img_status(status) -%} 4 {% if status == 1 %} 5 {% set title,src = __('Published'),'check-on.png' %} 6 {% elseif status == 0 %} 7 {% set title,src = __('Unpublished'),'check-off.png' %} 8 {% elseif status == -1 %} 9 {% set title,src = __('Pending'),'check-wrn.png' %} 10 {% elseif status == -2 %} 11 {% set title,src = __('Junk'),'junk.png' %} 12 {% endif %} 13 <img alt="{{title}}" title="{{title}}" src="images/{{src}}" /> 14 {%- endmacro %} 3 15 {% block header %} 4 16 {{ parent() }} … … 20 32 <div id="entry-content"> 21 33 <div class="constrained"> 22 <p class="col">{{ form_field('post_title',{'class':'maximal'}) }}</p> 23 <p class="area" id="excerpt-area">{{ form_field('post_excerpt',{'rows':5,'cols':50}) }}</p> 24 <p class="area" id="content-area">{{ form_field('post_content',{'rows':current_user.options.edit_size,'cols':5}) }}</p> 25 <p class="area" id="notes-area">{{ form_field('post_notes',{'rows':5,'cols':50}) }}</p> 34 {% for bl in main_blocks %} 35 {{ block(bl) }} 36 {% endfor %} 26 37 <p>{{ form_field('save')}} 27 38 {% if preview_url is defined %} … … 35 46 </div> 36 47 <div id="entry-sidebar"> 37 <p>{{ form_field('cat_id',{'class':'maximal'})}}</p> 38 <p>{{ form_field('post_status')}}</p> 39 <p>{{ form_field('post_dt')}}</p> 40 <p>{{ form_field('post_format')}}</p> 41 <p>{{ form_field('post_open_comment')}}</p> 42 <p>{{ form_field('post_open_tb')}}</p> 43 <p>{{ form_field('post_selected')}}</p> 44 <p>{{ form_field('post_lang',{"class":"maximal"},{'nestedlabel':true})}}</p> 45 <p>{{ form_field('post_password',{"size":10, "class":"maximal"},{'nestedlabel':true})}}</p> 46 <div class="lockable"> 47 <p>{{ form_field('post_url',{"size":10, "class":"maximal"})}} </p> 48 <p class="form-note warn"> 49 {{ __('Warning: If you set the URL manually, it may conflict with another entry.') }} 50 </p> 51 </div> 48 {% for id,box in sidebar_blocks %} 49 <div id="{{id}}" class="box"> 50 <h4>{{box.title}}</h4> 51 {% for bl in box.items %} 52 {{ block(bl)}} 53 {% endfor %} 54 </div> 55 {% endfor %} 52 56 </div> 53 57 {% endform %} … … 75 79 {% endblock %} 76 80 81 {% block field_post_status %} 82 <p>{{ form_field('post_status',{},{'labelclass':'ib'}) }}</p> 83 {% endblock %} 84 85 {# Field-specific blocks #} 86 87 {% block post_title -%} 88 <p class="col">{{ form_field('post_title',{'class':'maximal'}) }}</p> 89 {%- endblock %} 90 91 {% block post_excerpt -%} 92 <p class="area" id="excerpt-area">{{ form_field('post_excerpt',{'rows':5,'cols':50}) }}</p> 93 {%- endblock %} 94 95 {% block post_content -%} 96 <p class="area" id="content-area">{{ form_field('post_content',{'rows':current_user.options.edit_size,'cols':5}) }}</p> 97 {%- endblock %} 98 99 {% block post_notes -%} 100 <p class="area" id="notes-area">{{ form_field('post_notes',{'rows':5,'cols':50}) }}</p> 101 {%- endblock %} 102 103 {% block post_status -%} 104 <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> 105 {%- endblock %} 106 107 {% block post_dt -%} 108 <p>{{ form_field('post_dt',{},{'labelclass':'ib'})}}</p> 109 {%- endblock %} 110 111 {% block post_lang -%} 112 <p>{{ form_field('post_lang',{"class":"maximal"},{'nestedlabel':true, 'labelclass':'ib'})}}</p> 113 {%- endblock %} 114 115 {% block post_format -%} 116 <p>{{ form_field('post_format',{},{'labelclass':'ib'})}}</p> 117 {% if post_id and form_field_attr('post_format','value')=='xhtml' %} 118 <p><a id="convert-xhtml" class="button maximal" href="post.php?id={{post_id}}&xconv=1"> 119 {{__('Convert to XHTML')}}</a></p> 120 {% endif %} 121 {%- endblock %} 122 123 {% block post_selected -%} 124 <p>{{ form_field('post_selected',{},{'labelclass':'ib'})}}</p> 125 {%- endblock %} 126 127 {% block cat_id -%} 128 <p>{{ form_field('cat_id',{'class':'maximal'},{'labelclass':'ib'}) }}</p> 129 {#{% if can_edit_categories %}#} 130 <div> 131 <p id="new_cat">{{__('Add a new category')}}</p> 132 <p>{{ form_field('new_cat_title') }}</p> 133 <p>{{ form_field('new_cat_parent') }} </p> 134 </div> 135 {#{% endif %}#} 136 {%- endblock %} 137 138 {% block post_open_comment -%} 139 <p>{{ form_field('post_open_comment')}}</p> 140 {% if post_comment_warning is defined -%} 141 <p class="form-note warn">{{post_comment_warning}}</p> 142 {%- endif %} 143 {%- endblock %} 144 145 {% block post_open_tb -%} 146 <p>{{ form_field('post_open_tb')}}</p> 147 {% if post_tb_warning is defined -%} 148 <p class="form-note warn">{{post_tb_warning}}</p> 149 {%- endif %} 150 {%- endblock %} 151 152 {% block post_password -%} 153 <p>{{ form_field('post_password',{"size":10, "class":"maximal"},{'nestedlabel':true, 'labelclass':'ib'})}}</p> 154 {%- endblock %} 155 156 {% block post_url -%} 157 <div class="lockable"> 158 <p>{{ form_field('post_url',{"size":10, "class":"maximal"}, {'labelclass':'ib'})}} </p> 159 <p class="form-note warn"> 160 {{ __('Warning: If you set the URL manually, it may conflict with another entry.') }} 161 </p> 162 </div> 163 {%- endblock %} 164 -
inc/admin/default-templates/posts.html.twig
r1152 r1491 8 8 {{ js.meta_editor }} 9 9 <script type="text/javascript" src="{{theme_url}}js/_posts_list.js"></script> 10 <script type="text/javascript" src="{{theme_url}}js/filter s.js"></script>10 <script type="text/javascript" src="{{theme_url}}js/filter-control.js"></script> 11 11 {{ js.confirm_close(['entry-form','comment-form']) }} 12 12 {{ js.page_tabs(default_tab) }} -
inc/core/class.dc.blog.php
r1490 r1491 91 91 $this->public_path = path::fullFromRoot($this->settings->system->public_path,DC_ROOT); 92 92 93 $this->post_status['-2'] = __(' pending');94 $this->post_status['-1'] = __(' scheduled');95 $this->post_status['0'] = __(' unpublished');96 $this->post_status['1'] = __(' published');97 98 $this->comment_status['-2'] = __(' junk');99 $this->comment_status['-1'] = __(' pending');100 $this->comment_status['0'] = __(' unpublished');101 $this->comment_status['1'] = __(' published');93 $this->post_status['-2'] = __('Pending'); 94 $this->post_status['-1'] = __('Scheduled'); 95 $this->post_status['0'] = __('Unpublished'); 96 $this->post_status['1'] = __('Published'); 97 98 $this->comment_status['-2'] = __('Junk'); 99 $this->comment_status['-1'] = __('Pending'); 100 $this->comment_status['0'] = __('Unpublished'); 101 $this->comment_status['1'] = __('Published'); 102 102 103 103 # --BEHAVIOR-- coreBlogConstruct
Note: See TracChangeset
for help on using the changeset viewer.