当前位置: 首页>>代码示例>>PHP>>正文


PHP HTML_QuickForm::setDefaults方法代码示例

本文整理汇总了PHP中HTML_QuickForm::setDefaults方法的典型用法代码示例。如果您正苦于以下问题:PHP HTML_QuickForm::setDefaults方法的具体用法?PHP HTML_QuickForm::setDefaults怎么用?PHP HTML_QuickForm::setDefaults使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在HTML_QuickForm的用法示例。


在下文中一共展示了HTML_QuickForm::setDefaults方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: drawLogin

 /**
  * function_description
  *
  * @author	John.meng
  * @since    version - Jan 5, 2006
  * @param	datatype paramname description
  * @return   datatype description
  */
 function drawLogin()
 {
     global $__Lang__, $UrlParameter, $SiteDB, $AddIPObj, $FlushPHPObj, $form, $smarty;
     include_once PEAR_DIR . 'HTML/QuickForm.php';
     $form = new HTML_QuickForm('firstForm');
     $replace_str = "../";
     $html_code = str_replace(ROOT_DIR, $replace_str, THEMES_DIR);
     echo "<link href='" . $html_code . "style.css' rel='stylesheet' type='text/css'>";
     $renderer =& $form->defaultRenderer();
     $renderer->setFormTemplate("\n<form{attributes}>\n<table border=\"0\" class=\"log_table\" align=\"center\">\n{content}\n</table>\n</form>");
     $renderer->setHeaderTemplate("\n\t<tr>\n\t\t<td class=\"log_table_head\" align=\"left\" valign=\"top\" colspan=\"2\" ><b>{header}</b></td>\n\t</tr>");
     $form->addElement('header', null, "<img src=\"" . $html_code . "images/logo.gif\" border=\"0\" >");
     $form->addElement('text', 'user_name', $__Lang__['langMenuUser'] . $__Lang__['langGeneralName'] . ' : ');
     $form->addElement('password', 'user_passwd', $__Lang__['langMenuUser'] . $__Lang__['langGeneralPassword'] . ' : ');
     $form->addRule('user_name', $__Lang__['langGeneralPleaseEnter'] . " " . $__Lang__['langMenuUser'] . " " . $__Lang__['langGeneralName'], 'required');
     $form->addRule('user_passwd', $__Lang__['langGeneralPleaseEnter'] . " " . $__Lang__['langMenuUser'] . " " . $__Lang__['langGeneralPassword'], 'required');
     $form->addElement('hidden', 'Action', 'LOGON');
     $form->setDefaults(array('user_name' => $_COOKIE['UserName']));
     $form->addElement('submit', null, $__Lang__['langGeneralSubmit']);
     $form->addElement('static', 'login_message');
     if ($form->validate() && $_POST['Action'] == 'LOGON') {
         $user_name = $_POST['user_name'];
         $user_password = md5($_POST['user_passwd']);
         $this->checkAuth($user_name, $user_password);
     }
     $form->display();
     exit;
 }
开发者ID:BackupTheBerlios,项目名称:flushcms,代码行数:36,代码来源:Auth.class.php

示例2: body

 public function body()
 {
     ob_start();
     //create default module form
     print '<div class="title">Select modules to disable</div>';
     print 'Selected modules will be marked as not installed but uninstall methods will not be called. Any database tables and other modifications made by modules\' install methods will not be reverted.<br><br>';
     print 'To uninstall module please use Modules Administration in Application.';
     print '<hr/><br/>';
     $form = new HTML_QuickForm('modulesform', 'post', $_SERVER['PHP_SELF'] . '?' . http_build_query($_GET), '', null, true);
     $states = array(ModuleManager::MODULE_ENABLED => 'Active', ModuleManager::MODULE_DISABLED => 'Inactive');
     $modules = DB::GetAssoc('SELECT * FROM modules ORDER BY state, name');
     foreach ($modules as $m) {
         $name = $m['name'];
         $state = isset($m['state']) ? $m['state'] : ModuleManager::MODULE_ENABLED;
         if ($state == ModuleManager::MODULE_NOT_FOUND) {
             $state = ModuleManager::MODULE_DISABLED;
         }
         $form->addElement('select', $name, $name, $states);
         $form->setDefaults(array($name => $state));
     }
     $form->addElement('button', 'submit_button', 'Save', array('class' => 'button', 'onclick' => 'if(confirm("Are you sure?")) document.modulesform.submit();'));
     //validation or display
     if ($form->validate()) {
         //uninstall
         $vals = $form->exportValues();
         foreach ($vals as $k => $v) {
             if (isset($modules[$k]['state']) && $modules[$k]['state'] != $v) {
                 ModuleManager::set_module_state($k, $v);
             }
         }
     }
     $form->display();
     return ob_get_clean();
 }
开发者ID:cretzu89,项目名称:EPESI,代码行数:34,代码来源:Modules.php

示例3: opAdd

 /**
  * function_description
  *
  * @author	John.meng
  * @since    version - Jan 19, 2006
  * @param	datatype paramname description
  * @return   datatype description
  */
 function opAdd()
 {
     global $__Lang__, $UrlParameter, $SiteDB, $AddIPObj, $__SITE_VAR__, $form, $FlushPHPObj, $thisDAO, $smarty, $class_path;
     include_once PEAR_DIR . 'HTML/QuickForm.php';
     $form = new HTML_QuickForm('firstForm', 'post', '', '_self', "onsubmit='save_in_textarea_all();'");
     $renderer =& $form->defaultRenderer();
     $renderer->setFormTemplate("\n<form{attributes}>\n<table border=\"0\" class=\"new_table\" width='100%'>\n{content}\n</table>\n</form>");
     $renderer->setHeaderTemplate("\n\t<tr>\n\t\t<td class=\"grid_table_head\" align=\"left\" valign=\"top\" colspan=\"2\"><b>{header}</b></td>\n\t</tr>");
     $Content = $_POST['Content'];
     if ($_REQUEST['Action'] == 'Update') {
         $this_data = $this->_DAO->getRowByID(SITE_NEWS_TABLE, "NewsID", $_REQUEST['ID']);
         $form->setDefaults(array("Title" => $this_data['Title'], "Summary" => $this_data['Summary'], "Source" => $this_data['Source'], "Author" => $this_data['Author']));
         $Content = $this_data['Content'];
         $form->addElement('hidden', 'ID', $this_data['NewsID']);
     }
     $class_path = INCLUDE_DIR . "editor/";
     $CurrentUserPathImages = HTML_IMAGES_DIR;
     $SiteCssFile = CURRENT_HTML_DIR . "style.css";
     $ed_4 =& new rich("", 'Content', $Content, "380", "350", "../../" . $CurrentUserPathImages, "../../" . $CurrentUserPathImages, false, false);
     $ed_4->set_default_stylesheet($SiteCssFile);
     $ed_4->myModule(true);
     $editors = $ed_4->draw();
     $smarty->assign("class_path_editor", $class_path);
     $form->addElement('header', null, $__Lang__['langGeneralAdd'] . " " . $__Lang__['langSiteModuleNews']);
     $form->addElement('text', 'Title', $__Lang__['langModuleNewsTitle'] . ' : ', array('size' => 40));
     $form->addElement('textarea', 'Summary', $__Lang__['langModuleNewsSummary'] . ' : ', array('rows' => 5, 'cols' => 40));
     $form->addElement('static', 'Content', NULL, $editors);
     $form->addElement('text', 'Source', $__Lang__['langModuleNewsSource'] . ' : ', array('size' => 30));
     $form->addElement('text', 'Author', $__Lang__['langModuleNewsAuthor'] . ' : ', array('size' => 20));
     $form->addElement('submit', null, $__Lang__['langGeneralSubmit']);
     $form->addRule('Title', $__Lang__['langGeneralPleaseEnter'] . " " . $__Lang__['langModuleNewsTitle'], 'required');
     $form->addElement('hidden', 'Module', $_REQUEST['Module']);
     $form->addElement('hidden', 'Page', $_REQUEST['Page']);
     $form->addElement('hidden', 'Action', $_REQUEST['Action']);
     $form->addElement('hidden', 'MenuID', $_GET['MenuID']);
     if ($form->validate()) {
         if (get_magic_quotes_gpc()) {
             $record["Content"] = stripslashes($_POST['Content']);
         } else {
             $record["Content"] = $_POST['Content'];
         }
         $record["Title"] = $_POST['Title'];
         $record["Summary"] = $_POST['Summary'];
         $record["Source"] = $_POST['Source'];
         $record["Author"] = $_POST['Author'];
         $record["SiteMenuID"] = $_POST['MenuID'];
         $record = $record + $this->_DAO->baseField();
         if ($_POST['ID'] && $_POST['Action'] == 'Update') {
             $this->_DAO->opUpdate(SITE_NEWS_TABLE, $record, " NewsID = " . $_POST['ID']);
         } else {
             $this->_DAO->opAdd(SITE_NEWS_TABLE, $record);
         }
         echo "<SCRIPT LANGUAGE='JavaScript'>opener.window.location.reload();window.close();</SCRIPT>";
     }
     $html_code = "<link rel=\"StyleSheet\" type=\"text/css\" href=\"" . $class_path . "rich_files/rich.css\"><script language=\"JScript.Encode\" src=\"" . $class_path . "rich_files/rich.js\"></script>" . $form->toHTML();
     $smarty->assign("Main", str_replace(ROOT_DIR, "../", $html_code));
 }
开发者ID:BackupTheBerlios,项目名称:flushcms,代码行数:65,代码来源:ModuleNews.class.php

示例4: handle

 function handle(&$params)
 {
     $app =& Dataface_Application::getInstance();
     $query =& $app->getQuery();
     $this->table =& Dataface_Table::loadTable($query['-table']);
     $translations =& $this->table->getTranslations();
     foreach (array_keys($translations) as $trans) {
         $this->table->getTranslation($trans);
     }
     //print_r($translations);
     if (!isset($translations) || count($translations) < 2) {
         // there are no translations to be made
         trigger_error('Attempt to translate a record in a table "' . $this->table->tablename . '" that contains no translations.', E_USER_ERROR);
     }
     $this->translatableLanguages = array_keys($translations);
     $translatableLanguages =& $this->translatableLanguages;
     $this->languageCodes = new I18Nv2_Language($app->_conf['lang']);
     $languageCodes =& $this->languageCodes;
     $currentLanguage = $languageCodes->getName($app->_conf['lang']);
     if (count($translatableLanguages) < 2) {
         return PEAR::raiseError(df_translate('Not enough languages to translate', 'There aren\'t enough languages available to translate.'), DATAFACE_E_ERROR);
     }
     //$defaultSource = $translatableLanguages[0];
     //$defaultDest = $translatableLanguages[1];
     $options = array();
     foreach ($translatableLanguages as $lang) {
         $options[$lang] = $languageCodes->getName($lang);
     }
     unset($options[$app->_conf['default_language']]);
     $tt = new Dataface_TranslationTool();
     $form = new HTML_QuickForm('StatusForm', 'POST');
     $form->addElement('select', '--language', 'Translation', $options);
     $form->addElement('select', '--status', 'Status', $tt->translation_status_codes);
     //$form->setDefaults( array('-sourceLanguage'=>$defaultSource, '-destinationLanguage'=>$defaultDest));
     $form->addElement('submit', '--set_status', 'Set Status');
     foreach ($query as $key => $value) {
         $form->addElement('hidden', $key);
         $form->setDefaults(array($key => $value));
     }
     if ($form->validate()) {
         $res = $form->process(array(&$this, 'processForm'));
         if (PEAR::isError($res)) {
             return $res;
         } else {
             header('Location: ' . $app->url('-action=list&-sourceLanguage=&-destinationLanguage=&-translate=') . '&--msg=' . urlencode('Translation status successfully set.'));
             exit;
         }
     }
     ob_start();
     $form->display();
     $out = ob_get_contents();
     ob_end_clean();
     $records =& $this->getRecords();
     df_display(array('form' => $out, 'translationTool' => &$tt, 'records' => &$records, 'translations' => &$options, 'context' => &$this), 'Dataface_set_translation_status.html');
 }
开发者ID:promoso,项目名称:HVAC,代码行数:55,代码来源:set_translation_status.php

示例5: getForm

 function getForm()
 {
     if ($this->form) {
         return $this->form;
     }
     $form = new HTML_QuickForm('', 'post', $this->url());
     $form->addElement('text', 'email', 'E-mail');
     $radio[0] =& HTML_QuickForm::createElement('radio', null, null, 'tilmeld', '1');
     $radio[1] =& HTML_QuickForm::createElement('radio', null, null, 'frameld', '2');
     $form->addGroup($radio, 'mode', null, null);
     $form->addElement('submit', null, 'Gem');
     $form->setDefaults(array('mode' => 1));
     $form->addRule('email', 'Du skal skrive en e-mail-adresse', 'required', null);
     return $this->form = $form;
 }
开发者ID:vih,项目名称:kursuscenter.vih.dk,代码行数:15,代码来源:index.php

示例6: getForm

 function getForm()
 {
     if ($this->form) {
         return $this->form;
     }
     $form = new HTML_QuickForm('calendar', 'post', 'http://kalendersiden.dk/generate.php');
     $form->addElement('text', 'month', 'Første måned');
     $form->addElement('text', 'months', 'Antal måneder');
     $form->addElement('text', 'year', 'Årstal');
     $form->addElement('hidden', 'pages');
     $form->addElement('hidden', 'format');
     $form->addElement('hidden', 'head');
     $form->addElement('hidden', 'color');
     $form->addElement('hidden', 'weeks');
     $form->addElement('hidden', 'userdata');
     $form->setDefaults(array('month' => date('m'), 'months' => 6, 'year' => date('Y'), 'pages' => 2, 'format' => 'portrait', 'head' => 'Vejle Idrætshøjskole', 'color' => '90 90 100:100 100 100:', 'weeks' => 't', 'userdata' => $this->getUserData()));
     $form->addElement('submit', null, 'Hent kalender');
     return $this->form = $form;
 }
开发者ID:vih,项目名称:intranet.vih.dk,代码行数:19,代码来源:Index.php

示例7: addElement

$form -> addElement('select', 'import_type', _IMPORTTYPE, array('efront'    => _EFRONTFILE,
'scorm2004' => _SCORM2004,
'scorm12'   => _SCORM12,
//'aicc'      => _AICC,
//'csv'       => _CSV,
'pdf'       => _PDF,
//'doc'       => _DOC,
'html'      => _HTML,
'xml'       => _XML,
'auto'      => _AUTODETECT));
*/
$form->addElement('advcheckbox', 'folders_to_hierarchy', _CONVERTFOLDERSTOHIERARCHY, null, 'class = "inputCheckbox"', array(0, 1));
$form->addElement('advcheckbox', 'uncompress_recursive', _UNCOMPRESSRECURSIVELYIMPORT, null, 'class = "inputCheckbox"', array(0, 1));
$form->addElement('advcheckbox', 'prompt_download', _FORCEDOWNLOADFILE, null, 'class = "inputCheckbox"', array(0, 1));
$form->addElement('static', 'note', _FORCEDOWNLOADFILEINFO);
$form->setDefaults(array('folders_to_hierarchy' => true));
//$form -> addElement('select', 'import_method', _IMPORTMETHOD, array(_UPLOADFILE, _FROMURL, _FROMPATH), 'onchange = "selectBox(this);"');
$form->addElement('file', 'import_file[0]', _IMPORTFILE);
for ($i = 1; $i < 10; $i++) {
    $form->addElement('file', "import_file[{$i}]", null);
}
$form->addElement('text', "import_url[0]", _IMPORTFROMURL, 'class = "inputText"');
for ($i = 1; $i < 10; $i++) {
    $form->addElement('text', "import_url[{$i}]", null, 'class = "inputText"');
}
$form->addElement('text', "import_path[0]", _IMPORTFROMPATH, 'class = "inputText"');
for ($i = 1; $i < 10; $i++) {
    $form->addElement('text', "import_path[{$i}]", null, 'class = "inputText"');
}
$form->setMaxFileSize(FileSystemTree::getUploadMaxSize() * 1024);
//getUploadMaxSize returns size in KB
开发者ID:jiangjunt,项目名称:efront_open_source,代码行数:31,代码来源:import.php

示例8: array

        $values = $form->process(array(&$this, 'formValues'), false);
        $menuBar['back'] = '/ushop/tax/overview';
        //check then enter the record.
        $res = $this->update($values, $ushop->db_name . 'tax_rates', array('where' => 'tax_rate_id=' . $this->registry->params['id']));
        if ($res) {
            $params['TYPE'] = 'pass';
            $params['MESSAGE'] = '<h2>Tax rate was successfully edited.</h2>';
        } else {
            $params['TYPE'] = 'error';
            $params['MESSAGE'] = '<h2>Tax rate could not be edited due to an error.</h2>';
        }
        // done!
    } else {
        $menuBar = array('cancel' => '/ushop/tax/overview', 'save' => null);
        $this->content .= $this->makeToolbar($menuBar, 24);
        $form->setDefaults(array('tax_rate' => $rate[0]->tax_rate));
        $renderer = new UthandoForm(TEMPLATES . $template);
        $renderer->setFormTemplate('form');
        $renderer->setHeaderTemplate('header');
        $renderer->setElementTemplate('element');
        $form->accept($renderer);
        // output the form
        $this->content .= $renderer->toHtml();
    }
    if (isset($params)) {
        $params['CONTENT'] = $this->makeMessageBar($menuBar, 24);
        $this->content .= $this->message($params);
    }
} else {
    header("Location:" . $this->get('config.server.web_url'));
    exit;
开发者ID:shaunfreeman,项目名称:Uthando-CMS,代码行数:31,代码来源:edit_tax_rate.php

示例9: limitsForm

 /**
  * limitsForm 
  * 
  * Create limits form
  * 
  * @access protected
  * @return HTML_QuickForm object
  */
 protected function limitsForm()
 {
     $defaults = $this->user->getLimits($this->domain);
     // To MB
     if ($defaults['default_quota'] > 0) {
         $defaults['default_quota'] = $defaults['default_quota'] / 1024 / 1024;
     }
     $url = './?module=Main&class=Limits&event=modifyLimitsNow&domain=';
     $url .= $this->domain;
     $form = new HTML_QuickForm('limitsForm', 'post', $url);
     $form->setDefaults($defaults);
     $form->addElement('text', 'max_aliases', _('Maximum Aliases (-1 for unlimited)'), array('size' => 4));
     $form->addElement('text', 'max_forwards', _('Maximum Forwards (-1 for unlimited)'), array('size' => 4));
     $form->addElement('text', 'max_autoresponders', _('Maximum Mail Robots (-1 for unlimited)'), array('size' => 4));
     $form->addElement('text', 'max_mailinglists', _('Maximum EZMLM-IDX Mailing Lists (-1 for unlimited)'), array('size' => 4));
     $form->addElement('text', 'default_quota', _('Default Quota in MB (0 for unlimited)'), array('size' => 4));
     $form->addElement('text', 'default_maxmsgcount', _('Default Message Count Limit (0 for unlimited)'), array('size' => 4));
     $form->addElement('checkbox', 'disable_pop', _('Disable POP'));
     $form->addElement('checkbox', 'disable_imap', _('Disable IMAP'));
     $form->addElement('checkbox', 'disable_dialup', _('Disable Dial-Up'));
     $form->addElement('checkbox', 'disable_password_changing', _('Disable Password Changing'));
     $form->addElement('checkbox', 'disable_webmail', _('Disable Webmail (SqWebmail)'));
     $form->addElement('checkbox', 'disable_external_relay', _('Disable Relaying'));
     $form->addElement('checkbox', 'disable_smtp', _('Disable SMTP-AUTH'));
     $form->addElement('submit', 'submit', _('Modify'));
     $form->registerRule('minusOne', 'regex', '/^(-1|[0-9]+)$/');
     $form->registerRule('zero', 'regex', '/^(0|[1-9][0-9]+)$/');
     $form->addRule('max_aliases', _('Error: only integers of -1 and greater allowed here'), 'minusOne', null, 'client');
     $form->addRule('max_forwards', _('Error: only integers of -1 and greater allowed here'), 'minusOne', null, 'client');
     $form->addRule('max_autoresponders', _('Error: only integers of -1 and greater allowed here'), 'minusOne', null, 'client');
     $form->addRule('max_mailinglists', _('Error: only integers of -1 and greater allowed here'), 'minusOne', null, 'client');
     $form->addRule('default_quota', _('Error: only integers of 0 and greater allowed here'), 'zero', null, 'client');
     $form->addRule('default_maxmsgcount', _('Error: only integers of 0 and greater allowed here'), 'zero', null, 'client');
     $form->applyFilter('__ALL__', 'trim');
     return $form;
 }
开发者ID:shupp,项目名称:toasteradmin,代码行数:44,代码来源:Limits.php

示例10: ic2_display

function ic2_display($path, $params)
{
    global $_conf, $ini, $thumb, $dpr, $redirect, $id, $uri, $file, $thumbnailer;
    if (P2_OS_WINDOWS) {
        $path = str_replace('\\', '/', $path);
    }
    if (strncmp($path, '/', 1) == 0) {
        $s = empty($_SERVER['HTTPS']) ? '' : 's';
        $to = 'http' . $s . '://' . $_SERVER['HTTP_HOST'] . $path;
    } else {
        $dir = dirname(P2Util::getMyUrl());
        if (strncasecmp($path, './', 2) == 0) {
            $to = $dir . substr($path, 1);
        } elseif (strncasecmp($path, '../', 3) == 0) {
            $to = dirname($dir) . substr($path, 2);
        } else {
            $to = $dir . '/' . $path;
        }
    }
    $name = basename($path);
    $ext = strrchr($name, '.');
    switch ($redirect) {
        case 1:
            header("Location: {$to}");
            exit;
        case 2:
            switch ($ext) {
                case '.jpg':
                    header("Content-Type: image/jpeg; name=\"{$name}\"");
                    break;
                case '.png':
                    header("Content-Type: image/png; name=\"{$name}\"");
                    break;
                case '.gif':
                    header("Content-Type: image/gif; name=\"{$name}\"");
                    break;
                default:
                    if (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false || strpos($_SERVER['HTTP_USER_AGENT'], 'Opera') !== false) {
                        header("Content-Type: application/octetstream; name=\"{$name}\"");
                    } else {
                        header("Content-Type: application/octet-stream; name=\"{$name}\"");
                    }
            }
            header("Content-Disposition: inline; filename=\"{$name}\"");
            header('Content-Length: ' . filesize($path));
            readfile($path);
            exit;
        default:
            if (!class_exists('HTML_Template_Flexy', false)) {
                require 'HTML/Template/Flexy.php';
            }
            if (!class_exists('HTML_QuickForm', false)) {
                require 'HTML/QuickForm.php';
            }
            if (!class_exists('HTML_QuickForm_Renderer_ObjectFlexy', false)) {
                require 'HTML/QuickForm/Renderer/ObjectFlexy.php';
            }
            if (isset($uri)) {
                $img_o = 'uri';
                $img_p = $uri;
            } elseif (isset($id)) {
                $img_o = 'id';
                $img_p = $id;
            } else {
                $img_o = 'file';
                $img_p = $file;
            }
            $img_q = $img_o . '=' . rawurlencode($img_p);
            // QuickFormの初期化
            $_size = explode('x', $thumbnailer->calc($params['width'], $params['height']));
            $_constants = array('o' => sprintf('原寸 (%dx%d)', $params['width'], $params['height']), 's' => '作成', 't' => $thumb, 'd' => $dpr, 'u' => $img_p, 'v' => $img_o, 'x' => $_size[0], 'y' => $_size[1]);
            $_defaults = array('q' => $ini["Thumb{$thumb}"]['quality'], 'r' => '0');
            $mobile = Net_UserAgent_Mobile::singleton();
            $qa = 'size=3 maxlength=3';
            if ($mobile->isDoCoMo()) {
                $qa .= ' istyle=4';
            } elseif ($mobile->isEZweb()) {
                $qa .= ' format=*N';
            } elseif ($mobile->isSoftBank()) {
                $qa .= ' mode=numeric';
            }
            $_presets = array('' => 'サイズ・品質');
            foreach ($ini['Dynamic']['presets'] as $_preset_name => $_preset_params) {
                $_presets[$_preset_name] = $_preset_name;
            }
            $qf = new HTML_QuickForm('imgmaker', 'get', 'ic2_mkthumb.php');
            $qf->setConstants($_constants);
            $qf->setDefaults($_defaults);
            $qf->addElement('hidden', 't');
            $qf->addElement('hidden', 'u');
            $qf->addElement('hidden', 'v');
            $qf->addElement('text', 'x', '高さ', $qa);
            $qf->addElement('text', 'y', '横幅', $qa);
            $qf->addElement('text', 'q', '品質', $qa);
            $qf->addElement('select', 'p', 'プリセット', $_presets);
            $qf->addElement('select', 'r', '回転', array('0' => 'なし', '90' => '右に90°', '270' => '左に90°', '180' => '180°'));
            $qf->addElement('checkbox', 'w', 'トリム');
            $qf->addElement('checkbox', 'z', 'DL');
            $qf->addElement('submit', 's');
            $qf->addElement('submit', 'o');
//.........这里部分代码省略.........
开发者ID:nyarla,项目名称:fluxflex-rep2ex,代码行数:101,代码来源:ic2.php

示例11: Smarty

require_once 'HTML/QuickForm/Renderer/ArraySmarty.php';
/*
 * Smarty template Init
 */
$path = "./modules/centreon-open-tickets/views/logs/templates/";
$tpl = new Smarty();
$tpl = initSmartyTpl($path, $tpl);
/*
 * Form begin
 */
$form = new HTML_QuickForm('FormTicketLogs', 'get', "?p=" . $p);
$periods = array("" => "", "10800" => _("Last 3 Hours"), "21600" => _("Last 6 Hours"), "43200" => _("Last 12 Hours"), "86400" => _("Last 24 Hours"), "172800" => _("Last 2 Days"), "302400" => _("Last 4 Days"), "604800" => _("Last 7 Days"), "1209600" => _("Last 14 Days"), "2419200" => _("Last 28 Days"), "2592000" => _("Last 30 Days"), "2678400" => _("Last 31 Days"), "5184000" => _("Last 2 Months"), "10368000" => _("Last 4 Months"), "15552000" => _("Last 6 Months"), "31104000" => _("Last Year"));
$form->addElement('select', 'period', _("Log Period"), $periods);
$form->addElement('text', 'StartDate', '', array("id" => "StartDate", "class" => "datepicker", "size" => 8));
$form->addElement('text', 'StartTime', '', array("id" => "StartTime", "class" => "timepicker", "size" => 5));
$form->addElement('text', 'EndDate', '', array("id" => "EndDate", "class" => "datepicker", "size" => 8));
$form->addElement('text', 'EndTime', '', array("id" => "EndTime", "class" => "timepicker", "size" => 5));
$form->addElement('text', 'subject', _("Subject"), array("id" => "subject", "style" => "width: 203px;", "size" => 15, "value" => ''));
$form->addElement('text', 'ticket_id', _("Ticket ID"), array("id" => "ticket_id", "style" => "width: 203px;", "size" => 15, "value" => ''));
$form->addElement('submit', 'graph', _("Apply"), array("onclick" => "return applyForm();", "class" => "btc bt_success"));
$attrHosts = array('datasourceOrigin' => 'ajax', 'allowClear' => false, 'availableDatasetRoute' => './include/common/webServices/rest/internal.php?object=centreon_configuration_host&action=list', 'multiple' => true);
$attrHost1 = array_merge($attrHosts);
$form->addElement('select2', 'host_filter', _("Hosts"), array(), $attrHost1);
$attrService = array('datasourceOrigin' => 'ajax', 'allowClear' => false, 'availableDatasetRoute' => './include/common/webServices/rest/internal.php?object=centreon_configuration_service&action=list', 'multiple' => true);
$attrService1 = array_merge($attrService);
$form->addElement('select2', 'service_filter', _("Services"), array(), $attrService1);
$form->setDefaults(array("period" => '10800'));
$renderer = new HTML_QuickForm_Renderer_ArraySmarty($tpl);
$form->accept($renderer);
$tpl->assign('form', $renderer->toArray());
$tpl->display("viewLog.ihtml");
开发者ID:centreon,项目名称:centreon-open-tickets,代码行数:31,代码来源:index.php

示例12: urlencode

     $message_type = 'failure';
     eF_redirect(basename($_SERVER['PHP_SELF']) . '?message=' . urlencode($message) . '&message_type=' . $message_type);
 }
 $smarty->assign('T_CTG', 'contact');
 $form = new HTML_QuickForm("contact_form", "post", basename($_SERVER['PHP_SELF']) . "?ctg=contact", "", "class = 'indexForm'", true);
 $form->registerRule('checkParameter', 'callback', 'eF_checkParameter');
 //Register this rule for checking user input with our function, eF_checkParameter
 $form->addElement('text', 'email', _YOUREMAIL, 'class = "inputText"');
 $form->addRule('email', _THEFIELD . ' "' . _EMAIL . '" ' . _ISMANDATORY, 'required');
 $form->addRule('email', _INVALIDFIELDDATA, 'checkParameter', 'email');
 $form->addElement('text', 'message_subject', _MESSAGESUBJECT, 'class = "inputText"');
 //$form -> addRule('message_subject', _INVALIDFIELDDATA, 'checkParameter', 'text');
 $form->addElement('textarea', 'message_body', _TEXT, 'class = "inputText" id = "contact"');
 $form->addElement('submit', 'submit_contact', _SUBMIT, 'class = "flatButton"');
 if ($_GET['limit_reached']) {
     $form->setDefaults(array('message_subject' => _IWANTTOSIGNUPBUTMAXIMUMUSERSLIMITREACHED, 'message_body' => _IWANTTOSIGNUPBUTMAXIMUMUSERSLIMITREACHEDBODY));
 }
 if ($_SESSION['s_login']) {
     $form->setDefaults(array('email' => $currentUser->user['email']));
 }
 if ($form->isSubmitted()) {
     $fields_insert = array('users_LOGIN' => 'visitor', 'timestamp' => time(), 'action' => 'forms', 'comments' => 'contact', 'session_ip' => eF_encodeIP(eF_getRemoteAddress()));
     eF_insertTableData("logs", $fields_insert);
     if ($form->validate()) {
         $to = $form->exportValue("email");
         $subject = $form->exportValue("message_subject");
         $body = $form->exportValue("message_body") . "\r\n\r\n(" . $subject . " [" . _FROM . ": " . $to . "])";
         if (eF_mail($to, $GLOBALS['configuration']['system_email'], $subject . " [" . _FROM . ": " . $to . "]", $body, false, true)) {
             $copied_body = _THANKYOUFORCONTACTINGUSBODY . "<br/><hr/><br/>" . $form->exportValue("message_body");
             eF_mail($GLOBALS['configuration']['system_email'], $to, _THANKYOUFORCONTACTINGUS, $copied_body, false, false);
             $message = _SENDSUCCESS;
开发者ID:bqq1986,项目名称:efront,代码行数:31,代码来源:index.php

示例13: array

 }
 //These are the entities that will be automatically replaced in custom header/footer
 $systemEntities = array('logo.png', '#siteName', '#siteMoto', '#languages', '#path', '#version');
 $smarty->assign("T_SYSTEM_ENTITIES", $systemEntities);
 //And these are the replacements of the above entities
 $systemEntitiesReplacements = array('{$T_LOGO}', '{$T_CONFIGURATION.site_name}', '{$T_CONFIGURATION.site_motto}', '{$smarty.capture.header_language_code}', '{$title}', '{$smarty.const.G_VERSION_NUM}');
 $load_editor = true;
 $layout_form = new HTML_QuickForm("add_block_form", "post", basename($_SERVER['PHP_SELF']) . "?ctg=themes&theme=" . $layoutTheme->{$layoutTheme->entity}['id'] . (isset($_GET['edit_block']) ? '&edit_block=' . $_GET['edit_block'] : '&add_block=1') . (isset($_GET['theme_layout']) ? '&theme_layout=' . $_GET['theme_layout'] : ''), "", null, true);
 $layout_form->registerRule('checkParameter', 'callback', 'eF_checkParameter');
 $layout_form->addElement('text', 'title', _BLOCKTITLE, 'class = "inputText"');
 $layout_form->addElement('textarea', 'content', _BLOCKCONTENT, 'id="editor_data" class = "mceEditor" style = "width:100%;height:300px;"');
 $layout_form->addElement('submit', 'submit_block', _SAVE, 'class = "flatButton"');
 $layout_form->addRule('title', _THEFIELD . ' "' . _BLOCKTITLE . '" ' . _ISMANDATORY, 'required', null, 'client');
 if (isset($_GET['edit_block'])) {
     $customBlocks[$_GET['edit_block']]['content'] = file_get_contents($basedir . $customBlocks[$_GET['edit_block']]['name'] . '.tpl');
     $layout_form->setDefaults($customBlocks[$_GET['edit_block']]);
     $layout_form->freeze(array('name'));
 }
 if ($layout_form->isSubmitted() && $layout_form->validate()) {
     $values = $layout_form->exportValues();
     if (isset($_GET['edit_block'])) {
         // not rename blocks by editing. It created many unused files
         $values['name'] = $customBlocks[$_GET['edit_block']]['name'];
     } else {
         $values['name'] = time();
         //Use the timestamp as name
     }
     $block = array('name' => $values['name'], 'title' => $values['title']);
     file_put_contents($basedir . $values['name'] . '.tpl', applyEditorOffset($values['content']));
     if (isset($_GET['edit_block'])) {
         $customBlocks[$_GET['edit_block']] = $block;
开发者ID:kaseya-university,项目名称:efront,代码行数:31,代码来源:themes.php

示例14: getModule

 /**
  * The main functionality
  *
  * (non-PHPdoc)
  * @see libraries/EfrontModule#getModule()
  */
 public function getModule()
 {
     $smarty = $this->getSmartyVar();
     $currentUser = $this->getCurrentUser();
     $directionsTree = new EfrontDirectionsTree();
     $directionsPaths = $directionsTree->toPathString();
     $smarty->assign("T_MODULE_OUTLOOK_INVITATION_DIRECTION_PATHS", $directionsPaths);
     $temp = eF_getTableData("module_outlook_invitation as m,courses as c", "m.*,c.name,c.directions_ID", "m.courses_ID=c.id");
     $events = array();
     foreach ($temp as $value) {
         $events[$value['courses_ID']] = $value;
     }
     if (isset($_GET['delete_event']) && eF_checkParameter($_GET['delete_event'], 'id') && in_array($_GET['delete_event'], array_keys($events))) {
         try {
             $event = $events[$_GET['delete_event']];
             $course = new EfrontCourse($event['courses_ID']);
             $users = $course->getCourseUsers(array('active' => true, archive => false, 'return_objects' => false));
             $recipients = array();
             foreach ($users as $value) {
                 $recipients[] = $value['email'];
             }
             $this->cancelInvitation($course->course['id'], $recipients);
             eF_deleteTableData("module_outlook_invitation", "courses_ID=" . $_GET['delete_event']);
         } catch (Exception $e) {
             header("HTTP/1.0 500 ");
             echo $e->getMessage() . ' (' . $e->getCode() . ')';
         }
         exit;
     }
     if ($_SESSION['s_type'] != 'administrator') {
         $userCourses = $currentUser->getUserCourses(array('archive' => 0, 'active' => true, 'return_objects' => false));
         if (G_VERSIONTYPE == 'enterprise') {
             if ($_SESSION['s_current_branch']) {
                 $result = eF_getTableData("module_hcd_course_to_branch", "courses_ID", "branches_ID='{$_SESSION['s_current_branch']}'");
             } else {
                 if ($currentUser->aspects['hcd']->isSupervisor()) {
                     $result = eF_getTableData("module_hcd_course_to_branch", "courses_ID", "branches_ID in (select branches_ID from module_hcd_employee_works_at_branch where users_login='{$currentUser->user['login']}' and supervisor=1)");
                 }
             }
             $branchCourses = array();
             foreach ($result as $value) {
                 $branchCourses[$value['courses_ID']] = $value['courses_ID'];
             }
             foreach ($events as $key => $value) {
                 if (!isset($branchCourses[$key]) && !isset($userCourses[$key])) {
                     unset($events[$key]);
                 }
             }
         } else {
             foreach ($events as $key => $value) {
                 if (!isset($userCourses[$key])) {
                     unset($events[$key]);
                 }
             }
         }
     }
     if (!isset($_GET['course'])) {
         $dataSource = $events;
         $tableName = 'outlookInvitationsTable';
         isset($_GET['limit']) && eF_checkParameter($_GET['limit'], 'uint') ? $limit = $_GET['limit'] : ($limit = G_DEFAULT_TABLE_SIZE);
         if (isset($_GET['sort']) && eF_checkParameter($_GET['sort'], 'text')) {
             $sort = $_GET['sort'];
             isset($_GET['order']) && $_GET['order'] == 'desc' ? $order = 'desc' : ($order = 'asc');
         } else {
             $sort = 'login';
         }
         $dataSource = eF_multiSort($dataSource, $sort, $order);
         $smarty->assign("T_TABLE_SIZE", sizeof($dataSource));
         if (isset($_GET['filter'])) {
             $dataSource = eF_filterData($dataSource, $_GET['filter']);
         }
         if (isset($_GET['limit']) && eF_checkParameter($_GET['limit'], 'int')) {
             isset($_GET['offset']) && eF_checkParameter($_GET['offset'], 'int') ? $offset = $_GET['offset'] : ($offset = 0);
             $dataSource = array_slice($dataSource, $offset, $limit);
         }
         $smarty->assign("T_DATA_SOURCE", $dataSource);
     } else {
         $course = new EfrontCourse($_GET['course']);
         $form = new HTML_QuickForm("import_outlook_invitation_form", "post", $this->moduleBaseUrl . "&course={$course->course['id']}&add_event=1" . (isset($_GET['popup']) ? '&popup=1' : ''), "", null, true);
         $form->registerRule('checkParameter', 'callback', 'eF_checkParameter');
         //Register this rule for checking user input with our function, eF_checkParameter
         $form->addElement('text', 'email', _SENDER, 'class = "inputText"');
         $form->addElement('text', 'location', _LOCATION, 'class = "inputText"');
         $form->addElement('text', 'subject', _SUBJECT, 'class = "inputText"');
         $form->addElement('textarea', 'description', _DESCRIPTION, 'class = "inputTestTextarea" style = "width:80%;height:6em;"');
         //$form -> addElement('checkbox', 'calendar', _MODULE_OUTLOOK_INVITATION_CREATE_CALENDAR);
         //$form -> addElement('static', 'static', _MODULE_OUTLOOK_INVITATION_INFO);
         $form->addElement('submit', 'submit_event_all', _MODULE_OUTLOOK_INVITATION_SENDALL, 'class=flatButton');
         $form->addElement('submit', 'submit_event_new', _MODULE_OUTLOOK_INVITATION_SENDNEW, 'class=flatButton');
         if (empty($events[$course->course['id']])) {
             //new invitation
             $currentEvent = null;
             $form->setDefaults(array('email' => $currentUser->user['email'], 'subject' => 'Invitation to attend training: ' . $course->course['name']));
         } else {
//.........这里部分代码省略.........
开发者ID:kaseya-university,项目名称:efront,代码行数:101,代码来源:module_outlook_invitation.class.php

示例15: array

<?php

/**
 * Example of usage for HTML_QuickForm with ITDynamic renderer
 *
 * @author Alexey Borzov <borz_off@cs.msu.su>
 *
 * $Id: ITDynamic_example.php,v 1.3 2003/09/09 10:46:51 avb Exp $ 
 */
require_once 'HTML/QuickForm.php';
require_once 'HTML/QuickForm/Renderer/ITDynamic.php';
// can use either HTML_Template_Sigma or HTML_Template_ITX
require_once 'HTML/Template/ITX.php';
// require_once 'HTML/Template/Sigma.php';
$form = new HTML_QuickForm('frmTest', 'post');
$form->setDefaults(array('itxtTest' => 'Test Text Box', 'itxaTest' => 'Hello World', 'iselTest' => array('B', 'C'), 'name' => array('first' => 'Alexey', 'last' => 'Borzov'), 'iradYesNo' => 'Y', 'ichkABCD' => array('A' => true, 'D' => true)));
$form->addElement('header', '', 'Normal Elements');
$form->addElement('hidden', 'ihidTest', 'hiddenField');
// will be rendered in default qf_element block
$form->addElement('text', 'itxtTest', 'Test Text:');
// will be rendered in qf_textarea block, as it exists in template
$form->addElement('textarea', 'itxaTest', 'Test TextArea:', array('rows' => 5, 'cols' => 40));
// will be later assigned to qf_green, note that an array of labels is passed
$form->addElement('password', 'ipwdTest', array('Test Password:', 'The password is expected to be long enough.'));
$select =& $form->addElement('select', 'iselTest', 'Test Select:', array('A' => 'A', 'B' => 'B', 'C' => 'C', 'D' => 'D'));
$select->setSize(5);
$select->setMultiple(true);
$form->addElement('submit', 'isubTest', 'Test Submit');
$form->addElement('header', '', 'Grouped Elements');
// will be rendered in default qf_group block
$checkbox[] =& HTML_QuickForm::createElement('checkbox', 'A', null, 'A');
开发者ID:bobah,项目名称:acbdb,代码行数:31,代码来源:ITDynamic_example.php


注:本文中的HTML_QuickForm::setDefaults方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。