Exemplo n.º 1
0
}
if ($edited_Itemtype->is_special()) {
    // Don't edit a name of special post types
    $Form->info(T_('Name'), $edited_Itemtype->name);
} else {
    // Display a field to edit a name
    $Form->text_input('ityp_name', $edited_Itemtype->name, 50, T_('Name'), '', array('maxlength' => 30, 'required' => true));
}
$Form->textarea_input('ityp_description', $edited_Itemtype->description, 2, T_('Description'), array('cols' => 47));
$Form->radio('ityp_perm_level', $edited_Itemtype->perm_level, array(array('standard', T_('Standard')), array('restricted', T_('Restricted')), array('admin', T_('Admin'))), T_('Permission level'));
$Form->text_input('ityp_backoffice_tab', $edited_Itemtype->backoffice_tab, 25, T_('Back-office tab'), T_('Items of this type will be listed in this back-office tab. If empty, items will be found only in the "All" tab.'), array('maxlength' => 30));
$Form->text_input('ityp_template_name', $edited_Itemtype->template_name, 25, T_('Template name'), T_('b2evolution will automatically append .main.php or .disp.php'), array('maxlength' => 40));
$Form->end_fieldset();
$options = array(array('required', T_('Required')), array('optional', T_('Optional')), array('never', T_('Never')));
// Check if current type is intro and set specific params for the fields "ityp_allow_breaks" and "ityp_allow_featured":
$intro_type_disabled = ItemType::is_intro($edited_Itemtype->ID);
$intro_type_note = $intro_type_disabled ? T_('This feature is not compatible with Intro posts.') : '';
$Form->begin_fieldset(T_('Features') . get_manual_link('item-type-features'), array('id' => 'itemtype_features'));
$Form->radio('ityp_use_title', $edited_Itemtype->use_title, $options, T_('Use title'));
$Form->radio('ityp_use_text', $edited_Itemtype->use_text, $options, T_('Use text'));
$Form->checkbox('ityp_allow_html', $edited_Itemtype->allow_html, T_('Allow HTML'), T_('Check to allow HTML in posts.') . ' (' . T_('HTML code will pass several sanitization filters.') . ')');
$Form->checkbox('ityp_allow_breaks', $edited_Itemtype->allow_breaks, T_('Allow Teaser and Page breaks'), $intro_type_note, '', 1, $intro_type_disabled);
$Form->checkbox('ityp_allow_attachments', $edited_Itemtype->allow_attachments, T_('Allow attachments'));
$Form->checkbox('ityp_allow_featured', $edited_Itemtype->allow_featured, T_('Allow featured'), $intro_type_note, '', 1, $intro_type_disabled);
$Form->end_fieldset();
$Form->begin_fieldset(T_('Use of Advanced Properties') . get_manual_link('item-type-advanced-properties'), array('id' => 'itemtype_advprops'));
$Form->radio('ityp_use_tags', $edited_Itemtype->use_tags, $options, T_('Use tags'));
$Form->radio('ityp_use_excerpt', $edited_Itemtype->use_excerpt, $options, T_('Use excerpt'));
$Form->radio('ityp_use_url', $edited_Itemtype->use_url, $options, T_('Use URL'));
$Form->radio('ityp_use_parent', $edited_Itemtype->use_parent, $options, T_('Use Parent ID'));
$Form->radio('ityp_use_title_tag', $edited_Itemtype->use_title_tag, $options, htmlspecialchars(T_('Use <title> tag')));
Exemplo n.º 2
0
 /**
  * Is this an Intro post
  *
  * @return boolean
  */
 function is_intro()
 {
     return ItemType::is_intro($this->ityp_ID);
 }