false, 'sort' => false, 'time' => false); $ezin_opts['url'] = array('images' => 'icons/'); $ezin_opts['language'] = 'EN'; $ezin_opts['encoding'] = $ezin_cfg['encoding']; $ezin_opts['ext_hsc'] = false; $poll_id = intval($_REQUEST['poll_id']); if ($poll_id > 0) { /* {{{ */ // General options $ezin_opts['tb'] = $ezin_sys['db']['tables']['poll_answers']; $ezin_opts['sort_field'] = array('-votes', 'id'); $ezin_opts['filters'] = 'poll_id = '.$poll_id; $ezin_opts['cgi']['persist'] = array('poll_id' => $poll_id); // Triggers $ezin_opts['triggers']['insert']['after'] = 'inc-db/triggers/polls.after'; $ezin_opts['triggers']['update']['after'] = 'inc-db/triggers/polls.after'; $ezin_opts['triggers']['delete']['after'] = 'inc-db/triggers/polls.after'; // Field definitions $ezin_opts['fdd']['id'] = array( 'name'=>Platon::htmlspecialchars2('Answer ID'), 'select'=>'T', 'sort'=>true, 'size'=>5, 'default'=>'', 'options'=>'LDVFPCR', 'mask'=>'%03d', 'escape' => false, 'colattrs|LF'=>'align="center"', ); $ezin_opts['fdd']['poll_id'] = array( 'name'=>'Poll', 'select'=>'D', 'options'=>'ALDVFPCR', 'sqlw'=>$poll_id, 'sort'=>true, 'required'=>true, 'strip_tags'=>true, 'values'=>array( 'table' => $ezin_sys['db']['tables']['polls'], 'column' => 'id', 'description' => array( 'columns' => array('question', 'id'), 'divs' => array(' (POLL #', ')'))) ); $ezin_opts['fdd']['answer'] = array( 'name'=>'Answer', 'select'=>'T', 'maxlen'=>255, 'sort'=>true, 'js'=>array('required' => true) ); $ezin_opts['fdd']['votes'] = array( 'name'=>'Votes', 'select'=>'T', 'default'=>'0', 'maxlen'=>5, 'sort'=>true ); } /* }}} */ else { /* {{{ */ // General options $ezin_opts['tb'] = $ezin_sys['db']['tables']['polls']; $ezin_opts['sort_field'] = array('-dt_valid_from', '-id'); // Triggers // Field definitions $ezin_opts['fdd']['id'] = array( 'name'=>Platon::htmlspecialchars2('Poll ID'), 'select'=>'T', 'sort'=>true, 'size'=>5, 'default'=>'', 'options'=>'LDVFPCR', 'mask'=>'%03d', 'escape' => false, 'URLprefix' => '?poll_id=', 'colattrs|LF'=>'align="center"', ); $ezin_opts['fdd']['section_id'] = array( 'name'=>'Section', 'select'=>'D', 'sort'=>true, 'required'=>true, 'strip_tags'=>true, 'values'=>array( 'table' => $ezin_sys['db']['tables']['sections'], 'column' => 'id', 'description' => array( 'columns' => array('name', 'id', 'type'), 'divs' => array(' (SECTION #', '; ', ')'))) ); $ezin_opts['fdd']['dt_valid_from'] = array( 'name'=>Platon::htmlspecialchars2('Valid From'), 'select'=>'T', 'sort'=>true, 'required'=>true, 'mask'=>'%.10s', 'default'=>date('Y-m-d'), 'colattrs|LF'=>'align="center"', ); $ezin_opts['fdd']['dt_valid_to'] = array( 'name'=>Platon::htmlspecialchars2('Valid To'), 'select'=>'T', 'sort'=>true, 'required'=>true, 'mask'=>'%.10s', 'default'=>date('Y-m-d', time() + 2592000), 'colattrs|LF'=>'align="center"', ); $ezin_opts['fdd']['votes'] = array( 'name'=>'Votes', 'options'=>'ALDVFPCR', 'select'=>'T', 'default'=>'0', 'maxlen'=>5, 'sort'=>true ); $ezin_opts['fdd']['answers'] = array( 'name'=>'Answers', 'options'=>'ALDVFPCR', 'select'=>'T', 'default'=>'0', 'maxlen'=>5, 'sort'=>true ); $ezin_opts['fdd']['question'] = array( 'name'=>'Question', 'select'=>'T', 'maxlen'=>255, 'sort'=>true, //'trimlen|LF'=>35, 'sql|LFVD' => "CONCAT('', question, '')", 'escape'=>false, 'js'=>array('required' => true) ); $ezin_opts['fdd']['description'] = array( 'name'=>'Description', 'select'=>'T', 'textarea'=>array( 'rows'=>8, 'cols'=>65, ), 'options'=>'ACPV', ); include dirname(__FILE__).'/_credentials.inc.php'; } /* }}} */ // Execution code if (! ezin_admin_check_list_privileges($ezin_opts['options'])) { require 'inc-html/permdenied.html'; } else { require_once 'phpMyEdit/phpMyEdit.class.php'; new phpMyEdit($ezin_opts); } /* Modeline for ViM {{{ * vim: set ts=4: * vim600: fdm=marker fdl=0 fdc=0: * }}} */ ?>