<?php

    global $page , $tpl;

    @html::editor();

    if( core::POST() ) $page->valid();
    
    $page->field('name',array(
        'name' => 'Tytuł',
        'strip_tags' => true,
        'max_len' => 100,
        'min_len' => 2
    ));

    $page->field('desc',array(
        'name' => 'Treść',
        'min_len' => 10
    ));
    //505x172

    
    /**
    $page->field('image',array(
        'field_valid'
    ));
    **/
    
    $page->field('keywords',array(
        'name' => 'Keywords',
        'strip_tags' => true,
        'max_len' => 255
    ));

    $page->field('description',array(
        'name' => 'Krótki opis i Tag description',
        'strip_tags' => true,
        'max_len' => 255
    ));
    
    $page->field('status',array(
        'empty' => true
    ));


    $page->StdValid('article');
    
    $tpl->assign(array(
        'data' => array_merge( db::$i->row("select * from `article` where `id`='".core::$i->id."'") , $_POST ),
        'other_arts' => db::$i->converted("select `id`,`name` from `article` order by `crt` desc limit 50")
    ));
    
    admin::$i->on();

?>