示例#1
0
function cat_event_category_edit($evname)
{
    pagetop(gTxt('categories'));
    $id = assert_int(gps('id'));
    $parent = doSlash(gps('parent'));
    $row = safe_row("*", "txp_category", "id={$id}");
    if ($row) {
        extract($row);
        $out = stackRows(fLabelCell($evname . '_category_name') . fInputCell('name', $name, 1, 20), fLabelCell('parent') . td(cat_parent_pop($parent, $evname, $id)), fLabelCell($evname . '_category_title') . fInputCell('title', $title, 1, 30), pluggable_ui('category_ui', 'extend_detail_form', '', $row), hInput('id', $id), tdcs(fInput('submit', '', gTxt('save_button'), 'smallerbox'), 2));
    }
    $out .= eInput('category') . sInput('cat_' . $evname . '_save') . hInput('old_name', $name);
    echo '<div id="category_container" class="txp-container txp-edit">' . form(startTable('edit', '', 'edit-pane') . $out . endTable(), '', '', 'post', 'edit-form') . '</div>';
}
示例#2
0
/**
 * Renders and outputs a category editor panel.
 *
 * @param string $evname Type of category
 */
function cat_event_category_edit($evname, $message = '')
{
    $id = assert_int(gps('id'));
    $parent = doSlash(gps('parent'));
    $row = safe_row("*", 'txp_category', "id = {$id}");
    if ($row) {
        pagetop(gTxt('edit_category'), $message);
        extract($row);
        list($parent_widget, $has_parent) = cat_parent_pop($parent, $evname, $id);
        $out = hed(gTxt('edit_category'), 2) . inputLabel('category_name', fInput('text', 'name', $name, '', '', '', INPUT_REGULAR, '', 'category_name'), $evname . '_category_name', '', array('class' => 'txp-form-field edit-category-name')) . inputLabel('category_parent', $parent_widget, 'parent', '', array('class' => 'txp-form-field edit-category-parent')) . inputLabel('category_title', fInput('text', 'title', $title, '', '', '', INPUT_REGULAR, '', 'category_title'), $evname . '_category_title', '', array('class' => 'txp-form-field edit-category-title')) . inputLabel('category_description', '<textarea id="category_description" name="description" cols="' . INPUT_LARGE . '" rows="' . TEXTAREA_HEIGHT_SMALL . '">' . $description . '</textarea>', $evname . '_category_description', 'category_description', array('class' => 'txp-form-field txp-form-field-textarea edit-category-description')) . pluggable_ui('category_ui', 'extend_detail_form', '', $row) . hInput('id', $id) . graf(sLink('category', '', gTxt('cancel'), 'txp-button') . fInput('submit', '', gTxt('save'), 'publish'), array('class' => 'txp-edit-actions')) . eInput('category') . sInput('cat_' . $evname . '_save') . hInput('old_name', $name);
        echo form($out, '', '', 'post', 'txp-edit');
    } else {
        cat_category_list(array(gTxt('category_not_found'), E_ERROR));
    }
}
示例#3
0
/**
 * Renders and outputs a category editor.
 *
 * @param string $evname Type of category
 */
function cat_event_category_edit($evname)
{
    $id = assert_int(gps('id'));
    $parent = doSlash(gps('parent'));
    $row = safe_row('*', 'txp_category', "id={$id}");
    if ($row) {
        pagetop(gTxt('edit_category'));
        extract($row);
        list($parent_widget, $has_parent) = cat_parent_pop($parent, $evname, $id);
        $out = n . '<section class="txp-edit">' . hed(gTxt('edit_category'), 2) . inputLabel('category_name', fInput('text', 'name', $name, '', '', '', INPUT_REGULAR, '', 'category_name'), $evname . '_category_name') . ($has_parent ? inputLabel('category_parent', $parent_widget, 'parent') : inputLabel('category_parent', $parent_widget)) . inputLabel('category_title', fInput('text', 'title', $title, '', '', '', INPUT_REGULAR, '', 'category_title'), $evname . '_category_title') . inputLabel('category_description', text_area('description', 0, 0, $description, 'category_description', TEXTAREA_HEIGHT_SMALL, INPUT_LARGE), $evname . '_category_description') . pluggable_ui('category_ui', 'extend_detail_form', '', $row) . hInput('id', $id) . graf(fInput('submit', '', gTxt('save'), 'publish')) . eInput('category') . sInput('cat_' . $evname . '_save') . hInput('old_name', $name) . n . '</section>';
        echo n . '<div id="category_container" class="txp-container">' . form($out, '', '', 'post', 'edit-form') . n . '</div>';
    } else {
        cat_category_list(array(gTxt('category_not_found'), E_ERROR));
    }
}
示例#4
0
function cat_event_category_edit($evname)
{
    pagetop(gTxt('categories'));
    $id = assert_int(gps('id'));
    $parent = doSlash(gps('parent'));
    $row = safe_row("*", "txp_category", "id={$id}");
    if ($row) {
        extract($row);
        $out = stackRows(fLabelCell($evname . '_category_name') . fInputCell('name', $name, 1, 20), fLabelCell('parent') . td(cat_parent_pop($parent, $evname, $id)), fLabelCell($evname . '_category_title') . fInputCell('title', $title, 1, 30), hInput('id', $id), tdcs(fInput('submit', '', gTxt('save_button'), 'smallerbox'), 2));
    }
    $out .= eInput('category') . sInput('cat_' . $evname . '_save') . hInput('old_name', $name);
    echo form(startTable('edit') . $out . endTable());
}
function cat_event_category_edit($evname)
{
    $id = assert_int(gps('id'));
    $parent = doSlash(gps('parent'));
    $row = safe_row('*', 'txp_category', "id={$id}");
    if ($row) {
        pagetop(gTxt('edit_category'));
        extract($row);
        list($parent_widget, $has_parent) = cat_parent_pop($parent, $evname, $id);
        $out = '<div class="txp-edit">' . n . hed(gTxt('edit_category'), 2) . n . inputLabel('category_name', fInput('text', 'name', $name, '', '', '', INPUT_REGULAR, '', 'category_name'), $evname . '_category_name') . n . ($has_parent ? inputLabel('category_parent', $parent_widget, 'parent') : graf('<span class="edit-label">' . gTxt('parent') . '</span><span class="edit-value">' . $parent_widget . '</span>')) . n . inputLabel('category_title', fInput('text', 'title', $title, '', '', '', INPUT_REGULAR, '', 'category_title'), $evname . '_category_title') . n . pluggable_ui('category_ui', 'extend_detail_form', '', $row) . n . hInput('id', $id) . graf(fInput('submit', '', gTxt('save'), 'publish')) . eInput('category') . sInput('cat_' . $evname . '_save') . hInput('old_name', $name) . '</div>';
        echo '<div id="category_container" class="txp-container">' . form($out, '', '', 'post', 'edit-form') . '</div>';
    } else {
        cat_category_list(array(gTxt('category_not_found'), E_ERROR));
    }
}