コード例 #1
0
 /**
  * Definitio of the settings form
  * @param form $mform
  */
 protected function specific_definition($mform)
 {
     // Section header title according to language file.
     $mform->addElement('header', 'configheader', get_string('blocksettings', 'block'));
     // Boolean to enable/disable geolocation.
     $mform->addElement('checkbox', 'config_geolocation', get_string('intuitel_allow_geolocation', 'block_intuitel'));
     $mform->setDefault('config_geolocation', true);
     $mform->setType('config_geolocation', PARAM_BOOL);
 }
コード例 #2
0
 private function process()
 {
     $this->commonProcess();
     $config = services::getService('config');
     $lang = services::getService('lang');
     $params = services::getService('pageParams');
     $pool = new pools();
     $pool->get($params->getParam('pool_id'));
     $this->pool = $pool;
     if ($pool->isMember($this->user->id)) {
         $thread = new forumThreads();
         $thread->id = $params->getParam('thread');
         $thread->find();
         $thread->fetch();
         // new/change entry
         if ($params->getParam('action') == 'new_entry') {
             // formular
             $form = new form('forum_entry');
             $form->addElement('textarea', 'entrytext', $lang->getMsg('home_news_text'), array('rows' => 15, 'cols' => 70));
             $form->addElement('hidden', 'action', 'new_entry');
             $form->addElement('hidden', 'pool_id', $pool->id);
             $form->addElement('hidden', 'thread', $thread->id);
             $form->addElement('submit', 'entrysubmit', $lang->getMsg('home_news_submit'));
             $form->addRule('entrytext', $lang->getMsg('showpool_forum_text_required'), 'required');
             // write entry
             if ($form->validate()) {
                 $new_entry = new forumEntries();
                 $new_entry->thread_id = $thread->id;
                 $new_entry->text = $form->exportValue('entrytext');
                 $new_entry->user_id = $this->user->id;
                 $new_entry->date = time();
                 $threads = clone $thread;
                 $threads->act_date = $new_entry->date;
                 $thread->delete();
                 $threads->insert();
                 $new_entry->insert();
                 $this->switchPage('threadbrowser&pool_id=' . $pool->id . '&thread=' . $threads->id . '&msg=msg_forum_entry_made');
             }
             $this->form = $form;
         }
         // build forum-tabledata
         $this->thread = $thread;
         // fetch entries
         $entries = new forumEntries();
         $entries->thread_id = $thread->id;
         $entries->find();
         while ($entries->fetch()) {
             $entries->fetchUser();
             $this->entries[$entries->id] = clone $entries;
         }
     } else {
         $this->switchPage('showpool&pool_id=' . $pool->id . '&msg=msg_nice_try');
     }
 }
コード例 #3
0
ファイル: avatars.php プロジェクト: Bixls/QatarBackend
 public function CreateNew($input)
 {
     $header = "اضافه صوره رمزيه جديده";
     include "views/form.php";
     $form = new form("index.php", "title");
     $form->addImage('imageID', "imageID", "الصوره الرمزيه");
     $form->addElement('i', "0", "hidden", "");
     $form->addElement('fn', "insert", "hidden", "");
     $form->addElement('c', "Avatars", "hidden", "");
     $body = $form->RenderForm();
     //  $body="fields that will create the new group is here";
     include "views/single.php";
 }
コード例 #4
0
ファイル: news.php プロジェクト: Bixls/QatarBackend
 public function CreateNew($input)
 {
     $header = "اضافه خبر جديد";
     include "views/form.php";
     $form = new form("index.php", "title");
     $form->addElement('Subject', "", "text", "عنوان الخير");
     $form->addImage('Image', "group", "صوره الخبر");
     global $db;
     $What = "*";
     $innerJoin = "";
     $db->select('groups', "", $limit = false, $order = false, $where_mode = "AND", $print_query = false, $What, $innerJoin);
     $result = $db->result_array();
     $groups = array("-1" => "الرئيسية");
     foreach ($result as $key) {
         //array_push($group,$key["Gname"]);
         $groups[$key["Gid"]] = $key["Gname"];
     }
     $form->addElement('GroupID', $groups, "select", "القبيله");
     $allowComments = array('1' => "نعم", '0' => "لا");
     $form->addElement('AllowComments', $allowComments, "select", "السماح بالتعليقات");
     $form->addElement('Description', "", "textarea", "تفاصيل الخبر");
     $form->addElement('i', "0", "hidden", "");
     $form->addElement('fn', "insert", "hidden", "");
     $form->addElement('c', "news", "hidden", "");
     $body = $form->RenderForm();
     //  $body="fields that will create the new group is here";
     include "views/single.php";
 }
コード例 #5
0
ファイル: class_proverb.php プロジェクト: ajisantoso/kateglo
 /**
  *
  */
 function show_form()
 {
     $form = new form('entry_form', null, './?mod=comment');
     $form->setup($this->msg);
     $form->addElement('text', 'sender_name', $this->msg['comment_sender'], array('size' => 40, 'maxlength' => '255'));
     $form->addElement('text', 'sender_email', $this->msg['comment_email'], array('size' => 40, 'maxlength' => '255'));
     $form->addElement('textarea', 'comment_text', $this->msg['comment_text'], array('rows' => 10, 'style' => 'width: 100%'));
     $form->addElement('submit', 'save', $this->msg['submit']);
     $form->addRule('sender_name', sprintf($this->msg['required_alert'], $this->msg['comment_sender']), 'required', null, 'client');
     $form->addRule('sender_email', sprintf($this->msg['required_alert'], $this->msg['comment_email']), 'required', null, 'client');
     $form->addRule('sender_email', $this->msg['email_invalid'], 'email', null, 'client');
     $form->addRule('comment_text', sprintf($this->msg['required_alert'], $this->msg['comment_text']), 'required', null, 'client');
     $msg = $this->msg[$this->status == 0 ? 'comment_welcome' : 'comment_sent'];
     $ret .= sprintf('<p>%1$s</p>' . LF, $msg);
     if ($this->status == 0) {
         $ret .= $form->toHtml();
     }
     return $ret;
 }
コード例 #6
0
ファイル: group.php プロジェクト: Bixls/QatarBackend
 public function CreateNew($input)
 {
     $header = "اضافه قبيله جديده";
     include "views/form.php";
     $form = new form("index.php", "title");
     $form->addElement('Gname', "", "text", "اسم القليله");
     $form->addImage('GProfilePic', "group", "صوره القبيله");
     $allowComments = array('0' => "نعم", '1' => "لا");
     $form->addElement('Royal', $allowComments, "select", "قبيله ملكيه ؟");
     $form->addElement('Description', "", "textarea", "تفاصيل القبيله");
     $form->addElement('i', "0", "hidden", "");
     $form->addElement('fn', "insert", "hidden", "");
     $form->addElement('c', "groups", "hidden", "");
     $body = $form->RenderForm();
     //  $body="fields that will create the new group is here";
     include "views/single.php";
 }
コード例 #7
0
 /**
  *
  */
 function show_search()
 {
     $operators = array('1' => $this->msg['search_1'], '2' => $this->msg['search_2'], '3' => $this->msg['search_3'], '4' => $this->msg['search_4'], '5' => $this->msg['search_5']);
     $form = new form('search_dict', 'get');
     $form->setup($msg);
     $form->addElement('hidden', 'mod', 'dictionary');
     $form->addElement('select', 'op', null, $operators);
     $form->addElement('text', 'phrase', $this->msg['phrase']);
     $form->addElement('select', 'lex', $this->msg['lex_class'], $this->db->get_row_assoc('SELECT lex_class, lex_class_name FROM lexical_class ORDER BY sort_order', 'lex_class', 'lex_class_name', $this->msg['all']));
     $form->addElement('select', 'type', $this->msg['phrase_type'], $this->db->get_row_assoc('SELECT phrase_type, phrase_type_name FROM phrase_type ORDER BY sort_order', 'phrase_type', 'phrase_type_name', $this->msg['all']));
     $form->addElement('select', 'src', $this->msg['ref_source'], $this->db->get_row_assoc('SELECT ref_source, ref_source_name
             FROM ref_source WHERE dictionary = 1', 'ref_source', 'ref_source_name', $this->msg['all']));
     $form->addElement('submit', 'srch', $this->msg['search_button']);
     $template = '<div class="search_param">%1$s: %2$s</div>' . LF;
     $ret .= $form->begin_form();
     $ret .= '<div class="panel panel-default">' . LF;
     $ret .= '<div class="panel-heading">' . $this->msg['search'] . '</div>' . LF;
     $ret .= '<div class="panel-body">' . LF;
     $ret .= sprintf($template, $this->msg['search_op'], $form->get_element('op'));
     $ret .= sprintf($template, $this->msg['phrase'], $form->get_element('phrase'));
     $ret .= sprintf($template, $this->msg['lex_class'], $form->get_element('lex'));
     $ret .= sprintf($template, $this->msg['phrase_type'], $form->get_element('type'));
     $ret .= sprintf($template, $this->msg['ref_source'], $form->get_element('src'));
     $ret .= $form->get_element('mod');
     $ret .= $form->get_element('srch');
     $ret .= '</div>' . LF;
     $ret .= '</div>' . LF;
     $ret .= $form->end_form();
     return $ret;
 }
コード例 #8
0
 private function process()
 {
     $this->commonProcess();
     $config = services::getService('config');
     $lang = services::getService('lang');
     $params = services::getService('pageParams');
     $mail = services::getService('mail');
     $categories = services::getService('cats');
     $pool = new pools();
     if ($pool->get($params->getParam('pool_id'))) {
         // become member
         if ($params->getParam('action') == 'become_member') {
             if ($params->getParam('become_member_submit') || $pool->is_public) {
                 $new_membership = new poolsUser();
                 $new_membership->user_id = $this->user->id;
                 $new_membership->pool_id = $pool->id;
                 if (!$pool->is_public) {
                     $new_membership->wait = 1;
                 } else {
                     $new_membership->res_to_free = 1;
                     $new_membership->wait = 0;
                 }
                 if ($params->getParam('become_member_comments')) {
                     $new_membership->comments = $params->getParam('become_member_comments');
                 }
                 $new_membership->insert();
                 // compose E-Mails
                 if (!$pool->is_public) {
                     $tos = $pool->getAdmins();
                     foreach ($tos as $to) {
                         $mail->send('new_member', $to, $pool, $this->user, $new_membership->comments);
                     }
                 } else {
                     $this->switchPage('mysite&new_pool=' . $pool->id);
                 }
             } else {
                 $this->become_member_form = true;
             }
         }
         // are you waiting?
         if ($pool->isWaiting($this->user->id)) {
             $this->user_is_waiting = true;
         }
         // loose membership
         if ($params->getParam('action') == 'no_member') {
             // the last admin can't leave the pool
             if (!$pool->isLastAdmin($this->user->id)) {
                 $pool->removeMember($this->user->id);
                 $this->addMsg('msg_leave_pool');
             } else {
                 $this->addMsg('msg_leave_pool_last_admin');
             }
         }
         // build tabledata
         if ($pool->isMember($this->user->id)) {
             $showcats = $categories->getChildren(0);
             foreach ($showcats as $cat_id => $cat_name) {
                 $show_res = new resFetcher();
                 $show_res->_cat = $cat_id;
                 $show_res->_pools = array($pool->id);
                 $rescounter = $show_res->count();
                 if ($rescounter > 0) {
                     $this->cats[$cat_id] = array("name" => $cat_name, "count" => $rescounter);
                 }
             }
             $allcount = 0;
             foreach ($this->cats as $cat) {
                 $allcount += $cat['count'];
             }
             $this->cats[0] = array("name" => $lang->getMsg('cat_all'), "count" => $allcount);
         } else {
             if (!$pool->isMember($this->user->id, true)) {
                 $this->not_member = true;
             }
             $res_counter = new poolsResources();
             $res_counter->pool_id = $pool->id;
             $this->res_counter = 0;
             $res_counter->find();
             while ($res_counter->fetch()) {
                 ++$this->res_counter;
             }
         }
         // build forum-tabledata
         if ($pool->isMember($this->user->id)) {
             // new/change entry
             if ($params->getParam('action') == 'new_entry') {
                 // formular
                 $form = new form('forum_entry');
                 $form->addElement('text', 'entryheader', $lang->getMsg('showpool_forum_headline'), array('size' => 30, 'maxlength' => 100));
                 $form->addElement('textarea', 'entrytext', $lang->getMsg('home_news_text'), array('rows' => 15, 'cols' => 70));
                 $form->addElement('hidden', 'action', 'new_entry');
                 $form->addElement('hidden', 'pool_id', $pool->id);
                 $form->addElement('hidden', 'thread', $thread->id);
                 $form->addElement('submit', 'entrysubmit', $lang->getMsg('home_news_submit'));
                 $form->addRule('entryheader', $lang->getMsg('showpool_forum_headline_required'), 'required');
                 $form->addRule('entrytext', $lang->getMsg('showpool_forum_text_required'), 'required');
                 // write entry
                 if ($form->validate()) {
                     $new_thread = new forumThreads();
                     $new_thread->pool_id = $pool->id;
                     $new_thread->title = $form->exportValue('entryheader');
                     $new_thread->act_date = time();
                     $new_thread->insert();
                     $new_thread->find(true);
                     $new_entry = new forumEntries();
                     $new_entry->thread_id = $new_thread->id;
                     $new_entry->text = $form->exportValue('entrytext');
                     $new_entry->user_id = $this->user->id;
                     $new_entry->date = $new_thread->act_date;
                     $new_entry->insert();
                     $this->switchPage('showpool&pool_id=' . $pool->id . '&msg=msg_forum_entry_made');
                 }
                 $this->form = $form;
             }
             $showthreads = new forumThreads();
             $showthreads->pool_id = $pool->id;
             $showthreads->find();
             while ($showthreads->fetch()) {
                 $showthreads->fetchLastEntry();
                 $showthreads->last_entry->fetchUser();
                 $this->threads[] = array("id" => $showthreads->id, "title" => $showthreads->title, "act_date" => date('j. n. y, H:i', $showthreads->last_entry->date) . ' ' . $lang->getMsg('showpool_forum_lastentry_by') . ' ' . '<a href="./index.php?page=showmember&pool_id=' . $pool->id . '&showmember=' . $showthreads->last_entry->user->id . '">' . $showthreads->last_entry->user->name . '</a>');
             }
         }
         // build userlist
         if ($pool->id != 1) {
             // assotiativ array with object and detail-flag
             if ($pool->isMember($this->user->id)) {
                 $members = array();
                 $pool_users = new poolsUser();
                 $pool_users->pool_id = $pool->id;
                 $pool_users->wait = 0;
                 if ($pool_users->find()) {
                     $detail_id = $params->getParam('showmember');
                     $count = 1;
                     while ($pool_users->fetch()) {
                         if ($pool_users->user_id != $this->user->id) {
                             $pool_users->fetchUser();
                             $member = array("obj" => $pool_users->user, "detail" => $pool_users->user->id == $detail_id, "count" => $count, "admin" => $pool->isAdmin($pool_users->user->id));
                             if ($pool_users->user->name != "") {
                                 $members[] = $member;
                             }
                             ++$count;
                         }
                     }
                     $this->members = $members;
                 }
             }
         }
         $this->pool = $pool;
     } else {
         $this->switchPage('mysite');
     }
 }
コード例 #9
0
ファイル: common.php プロジェクト: mediasahabat/kateglo
/**
 * @return Search form HTML
 */
function show_header()
{
    global $msg, $auth, $db;
    global $_GET;
    $mods = array('dictionary' => $msg['dictionary'], 'glossary' => $msg['glossary'], 'proverb' => $msg['proverb']);
    $navMenu .= sprintf('<a href="./">%1$s</a>', $msg['home']);
    foreach ($mods as $key => $mod) {
        $navMenu .= '&nbsp;&nbsp;&nbsp;';
        $navMenu .= sprintf('<a href="./?mod=%1$s">%2$s</a>', $key, $mod);
    }
    $form = new form('search_form', 'get');
    $form->setup($msg);
    $form->addElement('text', 'phrase', $msg['enter_phrase'], array('size' => 20, 'maxlength' => 255));
    $form->addElement('select', 'mod', null, $mods);
    $form->addElement('submit', 'search', $msg['search_button']);
    $ret .= $form->begin_form();
    // logo
    $ret .= '<div id="header">' . LF;
    $ret .= '<table cellpadding="0" cellspacing="0" width="100%"><tr>' . LF;
    $ret .= '<td width="1%">' . LF;
    $ret .= '<a href="./"><img src="images/kateglo40.png" width="129" height="40" border="0" alt="Kateglo" title="Kateglo" /></a>' . LF;
    $ret .= '</td>' . LF;
    // search form
    $template = '<td style="padding-left:5px;">%1$s</td>' . LF;
    $ret .= '<td align="right"><table cellpadding="0" cellspacing="0"><tr>' . LF;
    $ret .= sprintf($template, $form->get_element('phrase'));
    $ret .= sprintf($template, $msg['search_in']);
    $ret .= sprintf($template, $form->get_element('mod'));
    $ret .= sprintf($template, $form->get_element('search'));
    $ret .= '</tr></table></td>' . LF;
    $ret .= '</tr></table>' . LF;
    $ret .= '</div>' . LF;
    // navigation
    $ret .= '<div id="navbar">' . LF;
    $ret .= '<table cellpadding="0" cellspacing="0" width="100%"><tr>' . LF;
    $ret .= '<td>' . LF;
    $ret .= $navMenu;
    $ret .= '</td>' . LF;
    $ret .= '<td align="right">' . LF;
    if ($auth->checkAuth()) {
        $ret .= sprintf('%3$s&nbsp;&nbsp;&nbsp;<a href="%5$s">%4$s</a>&nbsp;&nbsp;&nbsp;<a href="%2$s">%1$s</a>' . LF, $msg['logout'], './?mod=user&action=logout', $auth->getUsername(), $msg['change_pwd'], './?mod=user&action=password');
    } else {
        $ret .= sprintf('<a href="%2$s">%1$s</a>' . LF, $msg['login'], './?mod=user&action=login');
    }
    $ret .= '</td>' . LF;
    $ret .= '</tr></table>' . LF;
    $ret .= '</div>' . LF;
    $ret .= $form->end_form();
    return $ret;
}
コード例 #10
0
 /**
  *
  */
 function show_form()
 {
     $url_pattern = '/^http(s?):\\/\\/([\\w-]+\\.)+[\\w-]+(\\/[\\w-\\.\\/\\?\\+%&=]*)?$/';
     $form = new form('entry_form', null, './?mod=comment');
     $form->setup($this->msg);
     $form->addElement('text', 'sender_name', $this->msg['comment_sender'], array('size' => 40, 'maxlength' => '255'));
     $form->addElement('text', 'sender_email', $this->msg['comment_email'], array('size' => 40, 'maxlength' => '255'));
     $form->addElement('text', 'url', $this->msg['url'], array('size' => 40, 'maxlength' => '255'));
     $form->addElement('textarea', 'comment_text', $this->msg['comment_text'], array('rows' => 10, 'style' => 'width: 100%'));
     $form->addElement('submit', 'save', $this->msg['submit']);
     $form->addRule('sender_name', sprintf($this->msg['required_alert'], $this->msg['comment_sender']), 'required', null, 'client');
     $form->addRule('sender_email', sprintf($this->msg['required_alert'], $this->msg['comment_email']), 'required', null, 'client');
     $form->addRule('sender_email', $this->msg['email_invalid'], 'email', null, 'client');
     $form->addRule('url', $this->msg['url_invalid'], 'regex', $url_pattern, 'client');
     $form->addRule('comment_text', sprintf($this->msg['required_alert'], $this->msg['comment_text']), 'required', null, 'client');
     $form->setDefaults(array('url' => 'http://'));
     $msg = $this->msg[$this->status == 0 ? 'comment_welcome' : 'comment_sent'];
     $ret .= sprintf('<p>%1$s</p>' . LF, $msg);
     if ($this->status == 0) {
         $ret .= $form->toHtml();
     }
     return $ret;
 }
コード例 #11
0
ファイル: search.php プロジェクト: BackupTheBerlios/molecms
// +----------------------------------------------------------------------+
// | MoleCMS                                                              |
// +----------------------------------------------------------------------+
// | Copyright (c) 2000-2002 MoleManMedia Tim Franz                       |
// +----------------------------------------------------------------------+
// | Authors: Tim Franz <*****@*****.**>                               |
// +----------------------------------------------------------------------+
//
// $Id: search.php,v 1.1 2002/08/07 09:25:42 moleman Exp $
require_once 'HTML_OOH_Form/form.php';
define('TPL_SEARCH', 'modules/' . $module . "/search.tpl.html");
$tpl2 = new IntegratedTemplateExtension();
$tpl2->loadTemplateFile(TPL_SEARCH);
$tbl_artikel = $table["artikel"];
$frm = new form("", "GET", url(array('module' => 'news', 'action' => 'search')), "");
$frm->addElement(array('type' => "text", 'name' => "wort1"));
$frm->addElement(array('type' => "hidden", 'name' => "module", 'value' => 'news'));
$frm->addElement(array('type' => "hidden", 'name' => 'action', 'value' => 'search'));
$frm->addElement(array("type" => "radio", "name" => "verknuepfung", "elname" => "verknuepfung_and", 'checked' => true, "value" => "AND"));
$frm->addElement(array("type" => "radio", "name" => "verknuepfung", "elname" => "verknuepfung_or", "value" => "OR"));
$frm->addElement(array("type" => "submit", "name" => "go", "value" => "suchen"));
$tpl2->setVariable(array("FORMULARSTART" => $frm->getStart() . $frm->getElement('module') . $frm->getElement('action'), "SUCHFELD" => $frm->getElement("wort1"), "SUCHE_UND" => $frm->getElement("verknuepfung", "verknuepfung_and") . "and", "SUCHE_ODER" => $frm->getElement("verknuepfung", "verknuepfung_or") . "or", "GO" => $frm->getElement("go"), "FORMULARENDE" => $frm->getFinish()));
if ($go) {
    function baueSuchabfrage($suchworte = "", $verknuepfung = "AND")
    {
        global $cfg;
        $tbl_artikel = $cfg['table']['news'];
        //falls nichts eingetragen wurde
        if (empty($suchworte)) {
            return false;
        }
コード例 #12
0
ファイル: class_user.php プロジェクト: ajisantoso/kateglo
 /**
  * Return HTML code of change password form
  */
 function change_password_form()
 {
     if ($this->auth->checkAuth()) {
         // welcome message
         $msg = $this->msg['pwd_welcome'];
         if ($this->status == PROCESS_FAILED) {
             $msg = $this->msg['pwd_chg_failed'] . ' ' . $msg;
         }
         if ($this->status == PROCESS_SUCCEED) {
             $msg = $this->msg['pwd_chg_succeed'];
         }
         $ret .= sprintf('<h1>' . $this->msg['change_pwd'] . '</h1>') . LF;
         $ret .= sprintf('<p>' . $msg . '</p>') . LF;
         // form
         if ($this->status != PROCESS_SUCCEED) {
             $form = new form('change_password_form', null, './?mod=user&action=password');
             $form->setup($this->msg);
             $form->addElement('password', 'pwd_current', $this->msg['pwd_current']);
             $form->addElement('password', 'pwd_new', $this->msg['pwd_new']);
             $form->addElement('password', 'pwd_retype', $this->msg['pwd_retype']);
             $form->addElement('submit', null, $this->msg['submit']);
             $form->addRule('pwd_current', sprintf($this->msg['required_alert'], $this->msg['pwd_current']), 'required', null, 'client');
             $form->addRule('pwd_new', sprintf($this->msg['required_alert'], $this->msg['pwd_new']), 'required', null, 'client');
             $form->addRule('pwd_retype', sprintf($this->msg['required_alert'], $this->msg['pwd_retype']), 'required', null, 'client');
             $form->addRule(array('pwd_new', 'pwd_retype'), $this->msg['pwd_nomatch'], 'compare', null, 'client');
             $ret .= $form->toHtml();
         }
         return $ret;
     }
     return $ret;
 }
コード例 #13
0
    /**
     *
     */
    function show_form()
    {
        $query = 'SELECT a.* FROM glossary a
			WHERE a.glo_uid = ' . $this->db->quote($_GET['uid']);
        $this->entry = $this->db->get_row($query);
        $is_new = is_array($this->entry) ? 0 : 1;
        $form = new form('entry_form', null, './' . $this->get_url_param());
        $form->setup($this->msg);
        $form->addElement('text', 'original', $this->msg['en'], array('size' => 40, 'maxlength' => '255'));
        $form->addElement('text', 'phrase', $this->msg['id'], array('size' => 40, 'maxlength' => '255'));
        $form->addElement('select', 'discipline', $this->msg['discipline'], $this->db->get_row_assoc('SELECT * FROM discipline ORDER BY discipline_name', 'discipline', 'discipline_name'));
        $form->addElement('select', 'ref_source', $this->msg['ref_source'], $this->db->get_row_assoc('SELECT * FROM ref_source WHERE glossary = 1', 'ref_source', 'ref_source_name'));
        $form->addElement('text', 'wpen', $this->msg['wpen'], array('size' => 40, 'maxlength' => '255'));
        $form->addElement('text', 'wpid', $this->msg['wpid'], array('size' => 40, 'maxlength' => '255'));
        $form->addElement('hidden', 'glo_uid');
        $form->addElement('hidden', 'is_new', $is_new);
        $form->addElement('submit', 'save', $this->msg['save']);
        $form->addRule('phrase', sprintf($this->msg['required_alert'], $this->msg['id']), 'required', null, 'client');
        $form->addRule('original', sprintf($this->msg['required_alert'], $this->msg['en']), 'required', null, 'client');
        $form->addRule('discipline', sprintf($this->msg['required_alert'], $this->msg['discipline']), 'required', null, 'client');
        $form->addRule('ref_source', sprintf($this->msg['required_alert'], $this->msg['ref_source']), 'required', null, 'client');
        $form->setDefaults($this->entry);
        $ret .= sprintf('<h1>%1$s</h1>' . LF, ($is_new ? $this->msg['new'] : $this->msg['edit']) . ' - ' . $this->msg['glossary']);
        $ret .= $form->toHtml();
        return $ret;
    }
コード例 #14
0
ファイル: class_abbr.php プロジェクト: ajisantoso/kateglo
 /**
  *
  */
 function show_form()
 {
     $query = 'SELECT a.* FROM abbr_entry a
         WHERE a.abbr_idx = ' . $this->db->quote($_GET['uid']);
     $this->entry = $this->db->get_row($query);
     $is_new = is_array($this->entry) ? 0 : 1;
     $form = new form('entry_form', null, './' . $this->get_url_param());
     $form->setup($this->msg);
     $form->addElement('text', 'abbr_key', $this->msg['abbr_acr'], array('size' => 20, 'maxlength' => '20'));
     $form->addElement('text', 'abbr_id', $this->msg['abbr_id'], array('size' => 40, 'maxlength' => '4000'));
     $form->addElement('text', 'abbr_en', $this->msg['abbr_en'], array('size' => 40, 'maxlength' => '4000'));
     $form->addElement('text', 'abbr_type', $this->msg['phrase_type'], array('size' => 20, 'maxlength' => '255'));
     $form->addElement('text', 'lang', $this->msg['lang'], array('size' => 20, 'maxlength' => '255'));
     $form->addElement('text', 'redirect_to', $this->msg['actual_phrase'], array('size' => 20, 'maxlength' => '255'));
     $form->addElement('text', 'source', $this->msg['ref_source'], array('size' => 20, 'maxlength' => '255'));
     $form->addElement('text', 'url', $this->msg['url'], array('size' => 40, 'maxlength' => '255'));
     $form->addElement('textarea', 'notes', $this->msg['notes'], array('style' => 'width:100%'));
     $form->addElement('hidden', 'abbr_idx');
     $form->addElement('hidden', 'is_new', $is_new);
     $form->addElement('submit', 'save', $this->msg['save']);
     $form->addRule('abbr_key', sprintf($this->msg['required_alert'], $this->msg['abbr_key']), 'required', null, 'client');
     $form->setDefaults($this->entry);
     $ret .= sprintf('<h1>%1$s</h1>' . LF, ($is_new ? $this->msg['new'] : $this->msg['edit']) . ' - ' . $this->msg['abbr']);
     $ret .= $form->toHtml();
     return $ret;
 }
コード例 #15
0
 /**
  *
  */
 function show_search()
 {
     $operators = array('1' => $this->msg['search_1'], '2' => $this->msg['search_2'], '3' => $this->msg['search_3'], '4' => $this->msg['search_4'], '5' => $this->msg['search_5']);
     $form = new form('search_dict', 'get');
     $form->setup($msg);
     $form->addElement('hidden', 'mod', 'dictionary');
     $form->addElement('select', 'op', null, $operators);
     $form->addElement('text', 'phrase', $this->msg['phrase']);
     $form->addElement('select', 'lex', $this->msg['lex_class'], $this->db->get_row_assoc('SELECT lex_class, lex_class_name FROM lexical_class ORDER BY sort_order', 'lex_class', 'lex_class_name', $this->msg['all']));
     $form->addElement('select', 'type', $this->msg['phrase_type'], $this->db->get_row_assoc('SELECT phrase_type, phrase_type_name FROM phrase_type ORDER BY sort_order', 'phrase_type', 'phrase_type_name', $this->msg['all']));
     $form->addElement('submit', 'srch', $this->msg['search_button']);
     $template = '<span class="search_param">%1$s: %2$s</span>' . LF;
     $ret .= '<fieldset>' . LF;
     $ret .= '<legend>' . $this->msg['search'] . '</legend>' . LF;
     $ret .= $form->begin_form();
     $ret .= sprintf($template, $this->msg['search_op'], $form->get_element('op'));
     $ret .= sprintf($template, $this->msg['phrase'], $form->get_element('phrase'));
     $ret .= sprintf($template, $this->msg['lex_class'], $form->get_element('lex'));
     $ret .= sprintf($template, $this->msg['phrase_type'], $form->get_element('type'));
     $ret .= $form->get_element('mod');
     $ret .= $form->get_element('srch');
     $ret .= $form->end_form();
     $ret .= '</fieldset>' . LF;
     return $ret;
 }