function drawEventForm() { global $page; $f = new form('cal_events', @$_GET['id'], $page['title']); if (url_id()) { $f->set_title_prefix(drawHeader(false, ' ')); } if ($page['is_admin']) { $f->set_field(array('name' => 'created_user', 'class' => 'admin', 'type' => 'select', 'sql' => 'SELECT id, CONCAT_WS(", ", lastname, firstname) FROM users WHERE is_active = 1 ORDER BY lastname, firstname', 'default' => $_SESSION['user_id'], 'required' => true, 'label' => getString('posted_by'))); } $f->set_field(array('name' => 'title' . langExt(), 'label' => getString('title'), 'type' => 'text')); $f->set_field(array('name' => 'start_date', 'label' => getString('start_date'), 'type' => 'datetime', 'required' => true)); $f->set_field(array('name' => 'end_date', 'label' => getString('end_date'), 'type' => 'datetime', 'required' => true)); $f->set_field(array('name' => 'type_id', 'type' => 'select', 'sql' => 'SELECT id, description' . langExt() . ' FROM cal_events_types ORDER BY description', 'label' => getString('category'), 'required' => 'true')); $f->set_field(array('name' => 'description' . langExt(), 'label' => getString('description'), 'type' => 'textarea', 'class' => 'tinymce')); langUnsetFields($f, 'title,description'); formAddChannels($f, 'cal_events', 'event_id'); $f->set_order('created_user,title, start_date, end_date, type_id, description, channels'); langTranslateCheckbox($f, url_id()); return $f->draw(false, false); }
db_delete('organizations', $_GET['delete_id']); url_drop('delete_id,action'); } echo drawTop(); if (url_id()) { //form $f = new form('organizations', @$_GET['id']); $f->set_field(array('type' => 'text', 'name' => 'title' . langExt(), 'label' => getString('title'))); langUnsetFields($f, 'title'); langTranslateCheckbox($f); echo $f->draw(); } else { //modules list $t = new table('organizations', drawHeader()); $t->set_column('draggy', 'd', ' '); $t->set_column('title', 'l', getString('title')); $t->set_column('delete', 'd', ' '); $result = db_table('SELECT id, title' . langExt() . ' title FROM organizations WHERE is_active = 1 ORDER BY precedence'); foreach ($result as &$r) { $r['draggy'] = draw_img('/images/icons/move.png'); $r['title'] = draw_link('organizations.php?id=' . $r['id'], $r['title']); $r['delete'] = drawColumnDelete($r['id']); } echo $t->draw($result, 'No organizations'); //add new $f = new form('organizations'); $f->set_field(array('type' => 'text', 'name' => 'title' . langExt(), 'label' => getString('title'))); langUnsetFields($f, 'title'); echo $f->draw(false, false); } echo drawBottom();
//$r["title"] = str_replace("The Associated Press: ", "", $r["title"]); } elseif ($url["domainname"] == "google" && $url["subfolder"] == "afp") { $r["publication"] = "AFP"; $r["title"] = str_replace("Afp: ", "", $r["title"]); } elseif ($url["domainname"] == "google" && $url["subfolder"] == "ap") { $r["publication"] = "AP"; $r["title"] = str_replace("The Associated Press: ", "", $r["title"]); } } } //to control return_to redirects. i'm not sure how i should handle this generally. it's a problem mainly when the page is included if ($referrer && $referrer["host"] == $request["host"]) { $_josh["referrer"] = false; } $f = new form('press_clips', @$_GET['id'], $action); if (!$included) { $f->set_title_prefix($page['breadcrumbs']); } $f->set_field(array('name' => 'title' . langExt(), 'type' => 'text', 'label' => getString('title'))); $f->set_field(array('name' => 'url', 'type' => 'text', 'label' => getString('url'))); $f->set_field(array('name' => 'publication' . langExtT(), 'type' => 'text', 'label' => getString('publication'))); $f->set_field(array('name' => 'pub_date', 'type' => 'date', 'label' => getString('published'), 'required' => true)); $f->set_field(array('name' => 'description' . langExt(), 'type' => 'textarea', 'label' => getString('description'), 'class' => 'tinymce')); $f->set_field(array('name' => 'type_id', 'label' => getString('category'), 'type' => 'select', 'sql' => 'SELECT id, title' . langExt() . ' title FROM press_clips_types ORDER BY precedence', 'required' => true)); formAddChannels($f, 'press_clips', 'clip_id'); langUnsetFields($f, 'title,description,publication'); langTranslateCheckbox($f, url_id()); echo $f->draw(@$r, !$included); if (!$included) { echo drawBottom(); }
<?php include '../../include.php'; if ($posting) { format_post_bits('is_selected'); langTranslatePost('name,description'); $id = db_save('soc_members'); url_change_post('../'); } echo drawTop(); $f = new form('soc_members', @$_GET['id'], $page['title']); $f->set_field(array('name' => 'name' . langExt(), 'type' => 'text', 'label' => getString('title'))); $f->set_field(array('name' => 'country_id', 'type' => 'select', 'sql' => 'SELECT id, en FROM jr_countries ORDER BY en')); $f->set_field(array('name' => 'description' . langExt(), 'type' => 'textarea', 'class' => 'tinymce', 'label' => getString('description'))); langUnsetFields($f, 'name,description'); langTranslateCheckbox($f); $f->set_title_prefix($page['breadcrumbs']); echo $f->draw(); echo drawBottom();
<?php include '../../include.php'; if ($posting) { langTranslatePost('title,description'); db_save('pages'); url_change_post('./'); } echo drawTop(); $f = new form('pages', @$_GET['id']); $f->set_field(array('type' => 'text', 'name' => 'title' . langExt(), 'label' => getString('title'))); $f->set_field(array('type' => 'textarea', 'class' => 'tinymce', 'name' => 'description' . langExt(), 'label' => getString('description'))); $f->unset_fields('url,isSecure'); if (url_id('module_id')) { $f->set_field(array('type' => 'hidden', 'name' => 'module_id', 'value' => $_GET['module_id'])); } else { $f->unset_fields('module_id'); } if (url_id('modulette_id')) { $f->set_field(array('type' => 'hidden', 'name' => 'modulette_id', 'value' => $_GET['modulette_id'])); } else { $f->unset_fields('modulette_id'); } if (isset($_GET['url'])) { $f->set_field(array('type' => 'hidden', 'name' => 'url', 'value' => $_GET['url'])); } langUnsetFields($f, 'title,description'); langTranslateCheckbox($f); echo $f->draw(); echo drawBottom();
$sql = 'SELECT id, title' . langExt() . ' FROM modules WHERE is_active = 1'; } $f->set_field(array('type' => 'checkboxes', 'name' => 'modules', 'label' => getString('module_permissions'), 'sql' => $sql, 'position' => increment())); $f->set_field(array('type' => 'checkboxes', 'name' => 'modulettes', 'label' => getString('modulette_permissions'), 'options_table' => 'modulettes', 'linking_table' => 'users_to_modulettes', 'option_title' => 'title' . langExt(), 'option_id' => 'modulette_id', 'object_id' => 'user_id', 'position' => increment())); } else { $f->unset_fields('is_admin'); } //administrative info (admin) if ($page['is_admin']) { $f->set_group(getString('administrative_info'), increment()); formAddChannels($f, 'users', 'user_id'); $f->set_field(array('name' => 'startDate', 'label' => getString('start_date'), 'type' => 'date', 'required' => true, 'position' => increment())); $f->set_field(array('name' => 'endDate', 'label' => getString('end_date'), 'type' => 'date', 'required' => false, 'position' => increment())); if (getOption('staff_showrank')) { $f->set_field(array('name' => 'rankID', 'label' => getString('rank'), 'type' => 'select', 'sql' => 'SELECT id, description FROM intranet_ranks ORDER BY sequence', 'default' => db_grab('SELECT id FROM intranet_ranks WHERE isPayroll = 1'), 'required' => true, 'position' => increment())); } else { $f->unset_fields('rankID'); } //if (getOption('staff_ldcode')) { //$f->set_field(array('name'=>'longDistanceCode', 'label'=>getString('ldcode'), 'type'=>'text', 'position'=>increment())); //} else { $f->unset_fields('longDistanceCode'); //} } else { $f->unset_fields('startDate,endDate'); } $f->unset_fields('isPayroll,isImagePublic,help'); langUnsetFields($f, 'title,bio'); langTranslateCheckbox($f, url_id()); echo $f->draw($values); echo drawBottom();
<?php include '../../../include.php'; if ($posting) { langTranslatePost('content'); $id = db_save('guide', 1); url_change('../'); } echo drawTop(); $f = new form('guide', 1); langUnsetFields($f, 'content'); langTranslateCheckbox($f, true); echo $f->draw(); echo drawBottom();
function drawTopicForm() { global $page; $f = new form('bb_topics', @$_GET['id'], getString('topic_new')); if ($page['is_admin']) { $f->set_field(array('name' => 'created_user', 'class' => 'admin', 'type' => 'select', 'sql' => 'SELECT id, CONCAT_WS(", ", lastname, firstname) FROM users WHERE is_active = 1 ORDER BY lastname, firstname', 'default' => user(), 'required' => true, 'label' => getString('posted_by'))); } if ($page['is_admin'] && !getOption('bb_notifypost')) { $f->set_field(array('name' => 'is_admin', 'class' => 'admin', 'type' => 'checkbox', 'label' => getString('is_admin'))); } else { $f->unset_fields('is_admin'); } $f->set_field(array('name' => 'title' . langExt(), 'type' => 'text', 'label' => getString('title'))); if (getOption('bb_types')) { $f->set_field(array('name' => 'type_id', 'type' => 'select', 'sql' => 'SELECT id, title' . langExt() . ' title FROM bb_topics_types', 'label' => getString('category'))); } formAddChannels($f, 'bb_topics', 'topic_id'); $f->set_field(array('name' => 'description' . langExt(), 'type' => 'textarea', 'label' => getString('description'), 'class' => 'tinymce')); $f->set_order('created_user,is_admin,title' . langExt() . ',type_id,channels,description' . langExt()); $f->unset_fields('thread_date,type_id,replies'); langUnsetFields($f, 'title,description'); langTranslateCheckbox($f, url_id()); return $f->draw(false, false); }