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


PHP Form::show方法代码示例

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


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

示例1: show

 /**
  * Show the extended profile, or the edit form
  */
 public function show()
 {
     if ($this->editable) {
         parent::show();
     } else {
         $this->showSections();
     }
 }
开发者ID:bashrc,项目名称:gnusocial-debian,代码行数:11,代码来源:extendedprofilewidget.php

示例2: index

 /**
  * Default dispatcher
  *
  * @param string $action
  * @param string $subaction
  */
 public function index($action = '')
 {
     template('Install/templates/header')->show('info');
     new Menu_Tabs(array('name' => 'install', 'render' => 'content', 'elements' => array(array('label' => t('1. Начало'), 'link' => '', 'active' => check_route('install$')), array('label' => t('2. Проверка'), 'link' => '', 'active' => check_route('check$')), array('label' => t('3. Настройки'), 'link' => '', 'active' => check_route('site$')), array('label' => t('4. Завершение'), 'link' => '', 'active' => check_route('finish$')))));
     switch ($action) {
         case 'check':
             $tpl = new Template('Install/templates/check');
             $tpl->show();
             break;
         case 'site':
             append('content', '<p class="alert alert-info">' . t('Определите базовые настройки сайта.') . '</p>');
             $form = new Form('Install/forms/site');
             if ($result = $form->result()) {
                 $site = new Config(SITE . DS . 'site' . EXT);
                 $config = new Config(SITE . DS . 'config' . EXT);
                 $config->site->name = $result->sitename;
                 $site->key or $site->key = md5(md5(time()) + time() + $site->site->name);
                 $result->port or $result->port = 3306;
                 $site->database = array('driver' => config('database.driver'), 'host' => $result->host, 'base' => $result->base, 'user' => $result->user, 'pass' => $result->pass, 'port' => $result->port, 'prefix' => $result->prefix);
                 $db = Db::factory('temp', $site->database);
                 if (!$db->connect()) {
                     if ($result->create_db && $db->connect(FALSE)) {
                         $db->query("CREATE DATABASE `{$site->database->base}` DEFAULT  CHARACTER SET utf8 COLLATE utf8_general_ci;\n                CREATE USER '{$site->database->user}'@'{$site->database->host}' IDENTIFIED BY '{$site->database->pass}';\n                GRANT ALL ON `{$site->database->base}`.* TO '{$site->database->user}'@'localhost';\n                FLUSH PRIVILEGES;");
                     }
                     $db->connect();
                 }
                 if ($db->is_connected) {
                     $site->store(TRUE);
                     $config->store(TRUE);
                     if ($db->import($this->dir . DS . 'cogear.sql', $site->database->prefix)) {
                         redirect(l('/install/finish'));
                     }
                 } else {
                     error(t("Не удалось установить подключение к базе данных."), '', 'content');
                 }
             } else {
                 $form->save->label = t('Попробуйте снова');
             }
             $form->show();
             break;
         case 'finish':
             $tpl = new Template('Install/templates/finish');
             $tpl->show();
             break;
         case 'done':
             //                $site = new Config(SITE . DS . 'site' . EXT);
             //                $site->store(TRUE);
             flash_success(t('Ваш сайт успешно настроен! <p> Данные для входа – логин <b>admin</b> и пароль <b>password</b>.'), '', 'info');
             $this->disable();
             redirect();
             break;
         default:
         case 'welcome':
             $tpl = new Template('Install/templates/welcome');
             $tpl->show();
     }
 }
开发者ID:brussens,项目名称:cogear2,代码行数:63,代码来源:Gear.php

示例3: admin_action

 /**
  * Настройки
  */
 public function admin_action()
 {
     $form = new Form(array('#name' => 'admin.parser', 'title' => array('label' => t('Настройки')), 'nl2br' => array('type' => 'checkbox', 'label' => t('Автоматическая обработка строк'), 'value' => config('Parser.nl2br')), 'save' => array()));
     if ($result = $form->result()) {
         $this->set('Parser.nl2br', $result->nl2br);
         flash_success(t('Настройки сохранены!'));
         reload();
     }
     $form->show();
 }
开发者ID:brussens,项目名称:cogear2,代码行数:13,代码来源:Gear.php

示例4: settings

 /**
  * Настройки
  */
 public function settings()
 {
     $form = new Form(array('#name' => 'widget.html', 'content' => array('type' => 'editor', 'validate' => array('Required'), 'value' => $this->options->content), 'actions' => array('#class' => 'form-actions', 'save' => array())));
     if ($result = $form->result()) {
         $this->options->title = $result->title;
         $this->options->content = $result->content;
         if ($this->save()) {
             return TRUE;
         }
     }
     $form->show();
 }
开发者ID:brussens,项目名称:cogear2,代码行数:15,代码来源:HTML.php

示例5: showFullname

 function showFullname()
 {
     $fp = new Text($this->getPath(), 3, true);
     $btnDel = new Button("clearLog", "Log leeren");
     $hdnDel = new Hiddenfield("clearLogFile", $this->FULLPATH);
     $frmDel = new Form();
     $tblTtl = new Table(array("", ""));
     $tblTtl->setColSizes(array(null, 100));
     $tblTtl->setAlignments(array("left", "right"));
     $rTtl = $tblTtl->createRow();
     $rTtl->setAttribute(0, $fp);
     $rTtl->setAttribute(1, $btnDel);
     $tblTtl->addRow($rTtl);
     $frmDel->add($tblTtl);
     $frmDel->add($hdnDel);
     $frmDel->show();
 }
开发者ID:CyborgOne,项目名称:cybihomecontrol_ui,代码行数:17,代码来源:LogFile.php

示例6: settings

 /**
  * Настройки
  */
 public function settings()
 {
     $handler = menu();
     $menus = array();
     if ($result = $handler->findAll()) {
         foreach ($result as $menu) {
             $menus[$menu->id] = $menu->name;
         }
     }
     $form = new Form(array('#name' => 'widget.menu', 'id' => array('type' => 'select', 'validate' => array('Required'), 'label' => t('Выберите меню'), 'value' => $this->options->id, 'values' => $menus), 'actions' => array('#class' => 'form-actions', 'save' => array())));
     if ($result = $form->result()) {
         $this->options->id = $result->id;
         if ($this->save()) {
             return TRUE;
         }
     }
     $form->show();
 }
开发者ID:brussens,项目名称:cogear2,代码行数:21,代码来源:Widget.php

示例7: showForm

 /**
  * Show comment post form
  * 
  * @param object $Page 
  */
 public function showForm($Page)
 {
     if (access('comments post')) {
         $form = new Form('Comments.add');
         if ($result = $form->result()) {
             $comment = new Comments_Object();
             $comment->pid = $Page->id;
             $comment->aid = $this->user->id;
             $comment->created_date = time();
             $comment->body = $result->body;
             $comment->ip = $this->session->ip;
             if ($comment->save()) {
                 $Page->comments = $this->db->where('pid', $Page->id)->count('comments');
                 $Page->save();
                 flash_success(t('Your comment has been successfully posted!'));
                 redirect($Page->getUrl());
             }
         }
         $form->show();
     }
 }
开发者ID:romartyn,项目名称:cogear,代码行数:26,代码来源:Gear.php

示例8: settings

    /**
     * Настройки
     */
    public function settings()
    {
        $form = new Form(array('#name' => 'widget.pages.list', 'root' => array('type' => 'select', 'validate' => array('Required'), 'value' => $this->options->root, 'values' => page()->getSelectValues(), 'label' => t('Выберите корневую страницу')), 'current' => array('type' => 'checkbox', 'label' => t('Использовать текущую страницу как корневую'), 'value' => $this->options->current), 'template' => array('type' => 'text', 'value' => $this->options->template, 'label' => t('Шаблон для вывода'), 'description' => t('Будьте внимательны! Указывайте только существующий шаблон во избежание ошибок.')), 'actions' => array('#class' => 'form-actions', 'save' => array())));
        inline_js('$(document).ready(function(){
            $("input[type=checkbox]").on("change",function(){
                if($(this).attr("checked")){
                    $("#form-widget-pages-list-root").slideUp("fast");
                }
                else {
                    $("#form-widget-pages-list-root").slideDown("fast");
                }
            }).trigger("change");

        })');
        if ($result = $form->result()) {
            $this->options->root = $result->root;
            $this->options->template = $result->template;
            $this->options->current = (bool) $result->current;
            if ($this->save()) {
                return TRUE;
            }
        }
        $form->show();
    }
开发者ID:brussens,项目名称:cogear2,代码行数:27,代码来源:List.php

示例9: getSearchMask

 function getSearchMask()
 {
     $ft = new FontType();
     $ft->setFontsize(2);
     $table = new Table(array(""));
     $table->setFonttypes(array($ft));
     $table->setHeadEnabled(false);
     $table->setDesignJN("J");
     $r = $table->createRow();
     $r->setAttribute(0, new Text("Geben Sie hier ihren Suchbegriff ein"));
     $table->addRow($r);
     $r = $table->createRow();
     $r->setAttribute(0, new Textfield("SuchString"));
     $table->addRow($r);
     $hidden = new Hiddenfield($this->TABLENAME . "SEARCH", "doSearch");
     $form = new Form($_SERVER['SCRIPT_NAME']);
     $form->add($hidden);
     $form->add($table);
     $form->show();
 }
开发者ID:CyborgOne,项目名称:cybihomecontrol_ui,代码行数:20,代码来源:DbTable.php

示例10: tools_action

 /**
  * Импорт и экспорт
  */
 public function tools_action()
 {
     $this->hookSiteSettingsMenu();
     template('Admin/templates/tools')->show();
     $form = new Form('Admin/forms/import');
     if ($result = $form->result()) {
         if ($file = $result->file) {
             $zip = new Zip(array('file' => $file->path, 'check' => array('type' => 'config')));
             if ($zip->extract(ROOT)) {
                 success(t('<b>Архив успешно распакован!</b> Новый файл конфигурации установлен.'));
             }
             $zip->close();
             unlink($file->path);
         }
     }
     $form->show();
 }
开发者ID:brussens,项目名称:cogear2,代码行数:20,代码来源:Gear.php

示例11: show

 function show()
 {
     if ($this->EDIT_MODE) {
         echo "<a href=\"?editControl=" . $this->ID . "\" style=\"position:absolute; left:" . $this->X . "px; top:" . ($this->Y + $_SESSION['additionalLayoutHeight']) . "px; width:" . $this->CONTROL_IMAGE_WIDTH . "px; height:" . $this->CONTROL_IMAGE_HEIGHT . "px;\">";
         echo $this->getControlArtIconSrc();
         echo "</a>";
     } else {
         echo "<div style=\"position:absolute; left:" . $this->X . "px; top:" . ($this->Y + $_SESSION['additionalLayoutHeight']) . "px; width:" . $this->CONTROL_IMAGE_WIDTH . "px; height:" . $this->CONTROL_IMAGE_HEIGHT . "px;\">";
         echo $this->getControlArtIconSrc();
         if ($_SESSION['config']->PUBLICVARS['switchButtonsOnIconActive'] == "J") {
             $this->getSwitchButtons()->show();
         }
         echo "</div>";
         if ($this->DIMMER == "J") {
             $f = new Form();
             $cobDimmLvl = new Combobox("dimmer", getNumberComboArray(1, 16), "", " ");
             $cobDimmLvl->setDirectSelect(true);
             $cobDimmLvl->setStyle("position", "absolute");
             $cobDimmLvl->setStyle("left", $this->X . "px");
             $cobDimmLvl->setStyle("top", $this->Y + $this->CONTROL_IMAGE_HEIGHT - 3 + $_SESSION['additionalLayoutHeight'] . "px");
             $f->add($cobDimmLvl);
             $f->add(new Hiddenfield("schalte", $this->FUNK_ID));
             $f->show();
         }
     }
 }
开发者ID:CyborgOne,项目名称:cybihomecontrol_ui,代码行数:26,代码来源:HomeControlItem.php

示例12: show

 public function show()
 {
     global $MAIN_ROOT, $hooksObj;
     $hooksObj->run($this->formName);
     uasort($this->components, array("Form", "sortForm"));
     $countRichTextbox = 0;
     $blnFileUploadForm = false;
     $displayForm = "";
     $afterJS = $this->embedJS;
     foreach ($this->components as $componentName => $componentInfo) {
         $dispAttributes = $this->convertAttributes($componentInfo['attributes']);
         $displayForm .= $componentInfo['before_html'];
         // Output Component Name
         if ($componentInfo['display_name'] != "") {
             $dispToolTip = $componentInfo['tooltip'] != "" ? " <a href='javascript:void(0)' onmouseover=\"showToolTip('" . addslashes($componentInfo['tooltip']) . "')\" onmouseout='hideToolTip()'>(?)</a>" : "";
             $displayForm .= "\n\t\t\t\t\t\t<label class='formLabel' style='display: inline-block'>" . $componentInfo['display_name'] . ":" . $dispToolTip . "</label>\t\t\n\t\t\t\t\t";
         }
         // Output input
         switch ($componentInfo['type']) {
             case "autocomplete":
                 $afterJS .= $this->autocompleteJS($componentInfo['options']['list'], $componentInfo['options']['real_id'], $componentInfo['options']['fake_id']);
                 $fakeComponentName = "fake" . $componentName;
                 $displayForm .= "<input type='text' name='" . $fakeComponentName . "' value='" . filterText($_POST[$fakeComponentName]) . "' " . $dispAttributes . " id='" . $componentInfo['options']['fake_id'] . "'><input type='hidden' name='" . $componentName . "' value='" . $componentInfo['value'] . "' id='" . $componentInfo['options']['real_id'] . "'>";
                 break;
             case "textarea":
                 $displayForm .= "<textarea name='" . $componentName . "' " . $dispAttributes . ">" . $componentInfo['value'] . "</textarea>";
                 break;
             case "richtextbox":
                 $afterJS .= $this->richTextboxJS($componentInfo['attributes']['id'], $componentInfo['allowHTML']);
                 $displayForm .= "\n\t\t\t\t\t\t\t<div class='formInput' style='width: 100%'>\n\t\t\t\t\t\t\t\t<textarea name='" . $componentName . "' " . $dispAttributes . ">" . $componentInfo['value'] . "</textarea>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t";
                 $countRichTextbox++;
                 unset($GLOBALS['richtextEditor']);
                 break;
             case "codeeditor":
                 $afterJS .= $this->codeEditorJS($componentInfo['attributes']['id']);
                 $displayForm .= "\n\t\t\t\t\t\t\t<div style='background-color: white; position: relative; margin-top: 10px'><div id='" . $componentInfo['attributes']['id'] . "' class='codeEditor'>" . $componentInfo['value'] . "</div></div>\n\t\t\t\t\t\t\t<textarea id='" . $componentInfo['attributes']['id'] . "_code' name='" . $componentName . "' style='display: none'></textarea>\n\t\t\t\t\t\t";
                 break;
             case "datepicker":
                 $datePick = new DateTime();
                 $datePick->setTimestamp($componentInfo['value'] / 1000);
                 $datePick->setTimezone(new DateTimeZone("UTC"));
                 $formatDatePick = $datePick->format("n-j-Y");
                 $afterJS .= $this->datepickerJS($componentInfo['attributes']['id'], $componentInfo['options']);
                 $displayForm .= "<input type='text' value='" . $componentInfo['options']['defaultDate'] . "' " . $dispAttributes . " readonly='readonly'><input type='hidden' id='" . $componentInfo['options']['altField'] . "' name='" . $componentName . "' value='" . $formatDatePick . "'>";
                 break;
             case "select":
                 $displayForm .= "<select name='" . $componentName . "' " . $dispAttributes . ">";
                 foreach ($componentInfo['options'] as $optionValue => $displayValue) {
                     $dispSelected = "";
                     if ($optionValue == $componentInfo['value']) {
                         $dispSelected = " selected";
                     }
                     if (in_array($optionValue, $componentInfo['non_selectable_items'])) {
                         $dispSelected = " disabled class='disabledSelectItem'";
                     }
                     $displayForm .= "<option value='" . $optionValue . "'" . $dispSelected . ">" . $displayValue . "</option>";
                 }
                 $displayForm .= "</select>";
                 break;
             case "checkbox":
                 // Checkbox and radio are basically same thing, so checkbox falls through to radio section
             // Checkbox and radio are basically same thing, so checkbox falls through to radio section
             case "radio":
                 if (is_array($componentInfo['options'])) {
                     $componentCounter = 1;
                     foreach ($componentInfo['options'] as $optionValue => $displayValue) {
                         $dispSelected = "";
                         $newComponentName = $componentName;
                         if (count($componentInfo['options']) > 1) {
                             $newComponentName .= "_" . $componentCounter;
                             if ($componentCounter > 1) {
                                 $displayForm .= "<label class='formLabel' style='display: inline-block'></label> ";
                             }
                             $componentCounter++;
                         }
                         if ($optionValue == $componentInfo['value']) {
                             $dispSelected = " checked";
                         }
                         $dispLabel = $displayValue != "" ? "<label class='formLabel formInput'>" . $displayValue . "</label><br>" : "";
                         $displayForm .= "<input name='" . $newComponentName . "' type='" . $componentInfo['type'] . "' value='" . $optionValue . "' " . $dispAttributes . " " . $dispSelected . "> " . $dispLabel;
                     }
                 } else {
                     $dispChecked = "";
                     if ($componentInfo['checked']) {
                         $dispChecked = " checked";
                     }
                     $displayForm .= "<input name='" . $componentName . "' type='" . $componentInfo['type'] . "' value='" . $componentInfo['value'] . "' " . $dispAttributes . $dispChecked . ">";
                 }
                 break;
             case "file":
                 $blnFileUploadForm = true;
                 $displayForm .= "\n\t\t\t\t\t\t\t<div class='formInput' style='margin-bottom: 20px'>\n\t\t\t\t\t\t\t\tFile:<br>\n\t\t\t\t\t\t\t\t<input type='file' name='" . $componentName . "_file' " . $dispAttributes . ">\n\t\t\t\t\t\t\t\t<ul class='tinyFont' style='margin-top: 0px'>";
                 if (is_array($componentInfo['options']['file_types'])) {
                     $displayForm .= "<li>File Types: " . implode(", ", $componentInfo['options']['file_types']) . "</li>";
                 }
                 if ($componentInfo['options']['default_dimensions'] != "") {
                     $displayForm .= "<li>Dimensions: " . $componentInfo['options']['default_dimensions'] . "</li>";
                 }
                 $displayForm .= "<li><a href='javascript:void(0)' onmouseover=\"showToolTip('The file size upload limit is controlled by your PHP settings in the php.ini file.')\" onmouseout='hideToolTip()'>File Size: " . ini_get("upload_max_filesize") . "B or less</a></li></ul>";
                 $displayForm .= "<p><b><i>OR</i></b></p>";
//.........这里部分代码省略.........
开发者ID:nsystem1,项目名称:clanscripts,代码行数:101,代码来源:form.php

示例13: PasswordField

    $dbTblBenutzer->doUpdate();
}
if ($dbTblBenutzer->isDeleteInUpdate()) {
    $deleteMask = $dbTblBenutzer->doDeleteFromUpdatemask() ? null : $dbTblBenutzer->doDeleteFromUpdatemask();
    if ($deleteMask != null) {
        $lS = $tblMain->createRow();
        $lS->setSpawnAll(true);
        $lS->setAttribute(0, $deleteMask);
        $tblMain->addRow($lS);
    }
}
if (isset($_REQUEST["showUpdateMask" . $dbTblBenutzer->TABLENAME]) && strlen($_REQUEST["showUpdateMask" . $dbTblBenutzer->TABLENAME]) > 0) {
    $dbTblBenutzer->setAdditionalUpdateFields(array("Passwort" => new PasswordField("Pw" . $_REQUEST["showUpdateMask" . $dbTblBenutzer->TABLENAME])));
}
$tblArduinoBenutzeres = $dbTblBenutzer->getUpdateMask();
$tblMain->addSpacer(0, 20);
$lS = $tblMain->createRow();
$lS->setSpawnAll(true);
$lS->setAttribute(0, $tblArduinoBenutzeres);
$tblMain->addRow($lS);
$lS = $tblMain->createRow();
$lS->setSpawnAll(true);
$lS->setAttribute(0, $newBenutzerBtn);
$tblMain->addRow($lS);
$tblMain->addSpacer(0, 20);
$tblMain->addSpacer(1, 15);
$tblMain->addSpacer(0, 20);
$f = new Form();
$f->add($tblMain);
$f->show();
开发者ID:CyborgOne,项目名称:cybihomecontrol_ui,代码行数:30,代码来源:UserConfig.inc.php

示例14: show

 /**
  * Show the form
  *
  * Uses a recipe to output the form.
  *
  * @return void
  * @see Widget::show()
  */
 function show()
 {
     $this->elementStart('div', 'input_forms');
     $this->elementStart('div', array('id' => 'input_form_direct', 'class' => 'input_form current nonav'));
     parent::show();
     $this->elementEnd('div');
     $this->elementEnd('div');
 }
开发者ID:Grasia,项目名称:bolotweet,代码行数:16,代码来源:messageform.php

示例15: items_action

 /**
  * Управление элементами отдельного меню
  *
  * @param mixed $id
  */
 public function items_action($menu_id, $id = NULL)
 {
     $this->theme->hookAdminMenu();
     $this->hookAdminMenu();
     if ($menu = menu($menu_id)) {
         append('content', '<div class="page-header"><h2>' . $menu->name . '</h2></div>');
     } else {
         return event('empty');
     }
     $pills = new Menu_Pills(array('name' => 'admin.menu.items', 'render' => FALSE, 'elements' => array(array('label' => icon('list') . ' ' . t('Список пунктов'), 'link' => l('/admin/theme/menu/' . $menu_id . '/items')), array('label' => icon('plus') . ' ' . t('Добавить'), 'link' => l('/admin/theme/menu/' . $menu_id . '/item/add'), 'class' => 'fl_r'), array('label' => icon('pencil') . ' ' . t('Редактировать'), 'link' => l('/admin/theme/menu/' . $menu_id . '/item/' . $this->router->getSegments(5)), 'access' => check_route('admin/theme/menu/\\d+/item/\\d+'), 'class' => 'fl_r'))));
     append('content', $pills->render());
     if (NULL === $id) {
         $handler = new Menu_Db_Item();
         $handler->menu_id = $menu->id;
         if ($items = $handler->findAll()) {
             $tree = new Db_Tree_DDList(array('items' => $items, 'saveUri' => l('/admin/theme/menu/ajax/saveItemsTree/')));
         } else {
             return event('empty');
         }
     } else {
         $form = new Form('Menu/forms/item');
         $item = new Menu_Db_Item();
         if ($id != 'add' && is_numeric($id)) {
             $item->id = $id;
             if ($item->find()) {
                 $form->object($item);
             } else {
                 return event('empty');
             }
         } else {
             $form->remove('delete');
             $item->menu_id = $menu_id;
         }
         $form->pid->setValues($item->getSelectValues('label'));
         if ($result = $form->result()) {
             if ($result->delete && $item->delete()) {
                 flash_success(t('Элемент меню <b>«%s»</b> был удалён!', $item->label), '', 'growl');
                 redirect(l('admin/theme/menu/' . $menu_id . '/items'));
             }
             $item->object()->extend($result);
             if ($id !== 'add') {
                 $item->branching();
             }
             if ($item->save()) {
                 flash_success($id == 'add' ? t('Элемент меню <b>«%s»</b> успешно создан!', $item->label) : t('Элемент меню <b>«%s»</b> успешно отредактирован!', $item->label), '', 'growl');
                 redirect(l('admin/theme/menu/' . $menu_id . '/items'));
             }
         }
         $form->show();
     }
 }
开发者ID:brussens,项目名称:cogear2,代码行数:56,代码来源:Gear.php


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