function get_form() { return array( 'catid'=>array( 'selecttype'=>'select', 'select'=>form::arraytoselect(category::option(0,'tolast')), 'default'=>intval(get('catid')), 'regex'=>'/\d+/', 'filter'=>'is_numeric', ), 'typeid'=>array( 'selecttype'=>'select', 'select'=>form::arraytoselect(type::option(0,'tolast')), 'default'=>intval(get('typeid')), 'regex'=>'/\d+/', 'filter'=>'is_numeric', ), 'toppost'=>array( 'selecttype'=>'select', 'select'=>form::arraytoselect(array(0=>'不置顶',2=>'栏目置顶',3=>'全站置顶')), 'default'=>0, 'regex'=>'/\d+/', 'filter'=>'is_numeric', ), 'ishtml'=>array( 'selecttype'=>'radio', 'select'=>form::arraytoselect(array(0=>'继承',1=>'生成',2=>'不生成')), ), 'checked'=>array( 'selecttype'=>'radio', 'select'=>form::arraytoselect(form::yesornotoarray('审核')), ), 'image'=>array( 'filetype'=>'image', ), 'thumb'=>array( 'filetype'=>'thumb', ), 'displaypos'=>array( 'selecttype'=>'checkbox', //'select'=>form::arraytoselect(array(1=>'首页推荐',2=>'首页焦点',3=>'首页头条',4=>'列表页推荐',5=>'内容页推荐')), ), 'htmlrule'=>array( //'tips'=>" 默认:{?category::gethtmlrule(get('id'),'showhtmlrule')}", ), 'template'=>array( 'selecttype'=>'select', 'select'=>form::arraytoselect(front::$view->archive_tpl_list('archive/show')), //'tips'=>" 默认:{?category::gettemplate(get('id'),'showtemplate')}", ), 'showform'=>array( 'selecttype'=>'select', 'select'=>form::arraytoselect(get_my_tables_list()), 'default'=>"0", ), 'introduce_len'=>array( 'default'=>config::get('archive_introducelen') ), 'attr1'=>array( 'selecttype'=>'checkbox', 'select'=>form::arraytoselect($this->getattrs(1)), ), 'grade'=>array( 'selecttype'=>'radio', 'select'=>form::arraytoselect(array(0,1,2,3,4,5)), ), 'pics'=>array( 'filetype'=>'image2', ), 'author'=>array( 'tips'=>' ', ), 'attr3'=>array( 'tips'=>' ', ), 'htmlrule'=>array( 'selecttype'=>'select', 'select'=>form::arraytoselect(getHtmlRule('archive')), 'default'=>'', ), 'tag_option'=>array( 'selecttype'=>'select', 'select'=>form::arraytoselect(tag::getTags()), ), ); }
// see if the form require the user to upload something if ($control->isFile()) { $control->setValue($entityId); if (!$control->fileUploaded()) { $registry['controls']->missingRequiredUpload = true; } } } } else { $data = $model->getEntity($entityId); if ($data === null) { throw new Exception('This entity does not exist. Have you deleted it, or are you just shiting us?'); } foreach ($registry['controls'] as $control) { if ($control->name == 'tags') { $data['tags'] = implode(' ', tag::getTags($registry['modelLabel'], $entityId)); } // state of the password form? if ($control->name == 'passwd') { $control->editable = isset($_SESSION['changePasswd']) && $_SESSION['changePasswd'] == 'active'; $control->generated = isset($_SESSION['generatedPasswd']); } if ($control->editable == true && !$control->isFile() && $control->type != "passwd") { $control->setValue($data[$control->name]); } if ($control->isFile()) { $control->setValue($entityId); if ($control->fileUploaded() === false) { $registry['controls']->missingRequiredUpload = true; } }
// see if the form require the user to upload something if ($control->isFile()) { $control->setValue($entityId); if (!$control->fileUploaded()) { $registry['controls']->missingRequiredUpload = true; } } } } else { $data = $model->getEntity($entityId); if ($data === null) { throw new Exception('This entity does not exist. Have you deleted it, or are you just shiting us?'); } foreach ($registry['controls'] as $control) { if ($control->name == 'tags') { $data['tags'] = implode(' ', tag::getTags($registry['parentModel'], $entityId)); } // state of the password form? if ($control->name == 'passwd') { $control->editable = isset($_SESSION['changePasswd']) && $_SESSION['changePasswd'] == 'active'; $control->generated = isset($_SESSION['generatedPasswd']); } if ($control->editable == true && !$control->isFile() && $control->type != "passwd") { $control->setValue($data[$control->name]); } if ($control->isFile()) { $control->setValue($entityId); if ($control->fileUploaded() === false) { $registry['controls']->missingRequiredUpload = true; } }