示例#1
0
function PrintFormFormForReEntry($Type)
{
    $CurrentPage = htmlspecialchars($_SERVER["PHP_SELF"]);
    //Determinte the introduction to give to the form.
    if ($Type == 0) {
        echo 'Error, Please Compleate form bellow:</br></br>';
    } elseif ($Type == 1) {
        echo 'Error, Incorrect Username or Password:</br></br>';
    }
    require 'FormBuilder.php';
    $FormCreator = new FormBuilder();
    echo '<span id=LogInFormContainer>';
    echo $FormCreator->StartForm($PageCreationInstruction = array("Methord" => "post", "Action" => 1, "id" => "LogInForm"));
    $InputsRequired = array(array("InputLabel" => "UserName: "******"OptInputHTMLSeperator" => "<br>", "Options" => array(array('type', 'text'), array('value', $_POST["RAWUserName"]), array("maxlength", 100), array("name", "RAWUserName"))), array("InputLabel" => "Password: "******"Options" => array(array('type', 'password'), array("maxlength", 100), array("name", "Password"))));
    echo $FormCreator->CreateStandardInput($InputsRequired);
    echo '<br>';
    echo $FormCreator->CreateSubmitButton();
    echo $FormCreator->EndForm();
    echo '<span/>';
    /*
    	//Print the form to the page.
    	echo "<form method=\"post\" action=\"$CurrentPage\" >"; //Submits Data to self
    
    	if(isset($_POST["RAWUserName"])){//Add the submitted user name if avaliable
    	echo 'User: <input type="text" name="RAWUserName" value="' . $_POST["RAWUserName"] . '"/></br>';
    	}else{
    		echo 'User: <input type="text" name="RAWUserName" /></br>';
    	}
    	echo 'Password: <input type="Password" name="Password"/></br>';
    	echo '</br>';
    	echo '<input type="submit" value="Log In"/>';
    	echo "</form>";
    */
}
 /**
  * Handle the form.
  *
  * @param FormBuilder $builder
  */
 public function handle(FormBuilder $builder)
 {
     if (!$builder->canSave()) {
         return;
     }
     $builder->saveForm();
 }
示例#3
0
文件: deploy.php 项目: nhc/agency-cms
 public function index()
 {
     $bDrop = $this->uri->segment(3);
     $aTableNames = modelsToTableNames();
     foreach ($aTableNames as $k => $sTableName) {
         $oSqlBuilder = new SqlBuilder();
         //** Build tables
         $oTableName = new $k();
         $sCreateSql = $oSqlBuilder->setTableName($sTableName)->getCreateTableString($oTableName->db);
         $this->db->query('FLUSH TABLES;');
         if ($bDrop) {
             $this->db->query($oSqlBuilder->getDropTableString());
         }
         if (!tableExists($sTableName)) {
             $this->db->query($sCreateSql);
         }
         //** Add in any default data
         foreach ($oSqlBuilder->getDefaultDataArray($oTableName->data) as $v) {
             //$oTableName->
             $this->db->query($v);
         }
     }
     foreach ($aTableNames as $k => $sTableName) {
         $oTableName = new $k();
         //** Make forms
         if (!empty($oTableName->form)) {
             $oFormBuilder = new FormBuilder();
             $sForm = $oFormBuilder->setTableName($sTableName)->setFormName($sTableName)->setFormData($oTableName->form)->getFormString();
             createFile('views/admin/includes/forms/' . $sTableName . '_form.php', $sForm);
         }
     }
 }
 /**
  * {@inheritdoc}
  */
 protected function registerFormBuilder()
 {
     $this->app->bindShared('form', function ($app) {
         $form = new FormBuilder($app['html'], $app['url'], $app['session.store']->getToken());
         return $form->setSessionStore($app['session.store']);
     });
 }
 /**
  * @param FormBuilder|Form $builder
  */
 public function appendToForm(&$builder, $data, $formArea)
 {
     if ($formArea == 'features') {
         $name = strtolower($this->getName());
         if ($this->factory->serviceExists('mautic.form.type.cloudstorage.' . $name)) {
             $builder->add('provider', 'cloudstorage_' . $name, ['label' => 'mautic.integration.form.provider.settings', 'required' => false, 'data' => isset($data['provider']) ? $data['provider'] : []]);
         }
     }
 }
示例#6
0
 public function testStringModel()
 {
     $this->markTestskipped();
     $builder = new FormBuilder();
     $model = new TestModel();
     $form = $builder->createFormBuilder($model)->add('string', 'text')->getForm();
     $form->handle(['string' => 'test']);
     $classMetadata = new ClassMetadata(TestModel::class);
     $classMetadata->mapField(array('name' => 'string', 'type' => 'string'));
     $validatorMetadata = new ClassMetadata(TestModel::class);
     $validatorMetadata->addConstraint();
 }
 /**
  * Register the honeypot form macro
  *
  * @param  Illuminate\Html\FormBuilder|null $form
  * @return void
  */
 public function registerFormMacro(FormBuilder $form = null)
 {
     $honeypotMacro = function ($honey_name, $honey_time) {
         $honeypot = new Honeypot();
         return $honeypot->getFormHTML($honey_name, $honey_time);
     };
     // Add a custom honeypot macro to Laravel's form
     if ($form) {
         $form->macro('honeypot', $honeypotMacro);
     } else {
         FormBuilder::macro('honeypot', $honeypotMacro);
     }
 }
示例#8
0
 /**
  *
  * @param Symfony\Component\Form\FormBuilder $formBuilder
  * @param string $elementId
  *
  * @return array
  */
 private function generateElementId(FormBuilder $formBuilder, $elementId)
 {
     $nameBase = $formBuilder->getName();
     $elementId = $nameBase . "_" . $elementId;
     foreach (new FormBuilderIterator($formBuilder) as $name => $formBuilder) {
         $nameClean = substr($name, strlen($nameBase) + 1);
         if (strpos($elementId, $name) === 0) {
             if (strlen($name) == strlen($elementId)) {
                 return array($nameClean);
             }
             return array_merge(array($nameClean), $this->generateElementId($formBuilder, substr($elementId, strlen($name) + 1)));
         }
     }
 }
/**
 * Shows the settings page for the plugin.
 */
function WPCW_showPage_Settings_load()
{
    $page = new PageBuilder(true);
    $page->showPageHeader(__('Training Courses - Settings', 'wp_courseware'), '75%', WPCW_icon_getPageIconURL());
    // Check for update flag
    if (isset($_POST['update']) && $_POST['update'] == 'tables_force_upgrade') {
        $page->showMessage(__('Upgrading WP Courseware Tables...', 'wp_courseware'));
        flush();
        $installed_ver = get_option(WPCW_DATABASE_KEY) + 0;
        WPCW_database_upgradeTables($installed_ver, true, true);
        $page->showMessage(sprintf(__('%s tables have successfully been upgraded.', 'wp_courseware'), 'WP Courseware'));
    }
    $settingsFields = array('section_access_key' => array('type' => 'break', 'html' => WPCW_forms_createBreakHTML(__('Licence Key Settings', 'wp_courseware'))), 'licence_key' => array('label' => __('Licence Key', 'wp_courseware'), 'type' => 'text', 'desc' => __('Your licence key for the WP Courseware plugin.', 'wp_courseware'), 'validate' => array('type' => 'string', 'maxlen' => 32, 'minlen' => 32, 'regexp' => '/^[A-Za-z0-9]+$/', 'error' => __('Please enter your 32 character licence key, which contains only letters and numbers.', 'wp_courseware'))), 'license_activation' => array('label' => __('Licence Activation', 'wp_courseware'), 'type' => 'radio', 'required' => 'true', 'data' => array('activate_license' => sprintf('<b>%s</b>', __('Activate', 'wp_courseware')), 'deactivate_license' => sprintf('<b>%s</b>', __('Deactivate', 'wp_courseware'))), 'desc' => __('If you want to receive updates to this plugin, select "Activate". Otherwise, select "Deactivate" to deactivate license. Selecting "Deactivate" will disable any future updates. Deactivating your license allows you to move your plugin to another site.', 'wp_courseware')), 'section_default_css' => array('type' => 'break', 'html' => WPCW_forms_createBreakHTML(__('Style &amp; Design Settings', 'wp_courseware'))), 'use_default_css' => array('label' => __('Use Default CSS?', 'wp_courseware'), 'type' => 'radio', 'required' => 'true', 'data' => array('show_css' => sprintf('<b>%s</b> - %s', __('Yes', 'wp_courseware'), __('Use default stylesheet for the frontend of the website.', 'wp_courseware')), 'hide_css' => sprintf('<b>%s</b> - %s', __('No', 'wp_courseware'), __('Don\'t use the default stylesheet for the frontend of the website (you\'ll write your own CSS)', 'wp_courseware'))), 'desc' => __('If you want to style your training course material yourself, you can disable the default stylesheet. If in doubt, select <b>Yes</b>.', 'wp_courseware')), 'section_link' => array('type' => 'break', 'html' => WPCW_forms_createBreakHTML(__('Powered By Link', 'wp_courseware'))), 'show_powered_by' => array('label' => __('Show Powered By Link?', 'wp_courseware'), 'type' => 'radio', 'required' => 'true', 'data' => array('show_link' => sprintf('<b>%s</b> - %s', __('Yes', 'wp_courseware'), __('Show the <em>\'Powered By WP Courseware\'</em> link.', 'wp_courseware')), 'hide_link' => sprintf('<b>%s</b> - %s', __('No', 'wp_courseware'), __('Don\'t show any powered-by links.', 'wp_courseware'))), 'desc' => __("Do you want to show a 'Powered By WP Courseware' link at the bottom of course outlines?", 'wp_courseware')), 'affiliate_id' => array('label' => __('Your Affiliate ID', 'wp_courseware'), 'type' => 'text', 'desc' => __("(Optional) Earn some money by providing your Affiliate ID, which will turn the <b>Powered By WP Courseware</b> into an affiliate link that earns you a percentage of every sale! If you are not an affiliate, login to the member portal to register and get your ID.", 'wp_courseware'), 'validate' => array('type' => 'string', 'maxlen' => 15, 'minlen' => 1, 'regexp' => '/^[A-Za-z0-9\\-_]+$/', 'error' => __('Please enter your Affiliate ID, which is only a number..', 'wp_courseware'))));
    // Remove licence key for child multi-sites
    if (!WPCW_plugin_hasAdminRights()) {
        unset($settingsFields['section_access_key']);
        unset($settingsFields['licence_key']);
    }
    $settings = new SettingsForm($settingsFields, WPCW_DATABASE_SETTINGS_KEY, 'wpcw_form_settings_general');
    $settings->setSaveButtonLabel(__('Save ALL Settings', 'wp_courseware'));
    // Update messages for translation
    $settings->msg_settingsSaved = __('Settings successfully saved.', 'wp_courseware');
    $settings->msg_settingsProblem = __('There was a problem saving the settings.', 'wp_courseware');
    $settings->customFormErrorMsg = __('Sorry, but unfortunately there were some errors saving the course details. Please fix the errors and try again.', 'wp_courseware');
    $settings->setAllTranslationStrings(WPCW_forms_getTranslationStrings());
    // Form event handlers - processes the saved settings in some way
    $settings->afterSaveFunction = 'WPCW_showPage_Settings_afterSave';
    $settings->afterSaveFunction = 'edd_activate_license_WPCW';
    $settings->show();
    // Create little form to force upgrading tables if something went wrong during update.
    echo WPCW_forms_createBreakHTML(__("Upgrade Tables", 'wp_courseware'), false, true, 'wpcw_upgrade_tables');
    ?>
	
	<p><?php 
    _e("If you're getting any errors with WP Courseware relating to database tables when you've updated, you can force an upgrade of the database tables using the button below.", 'wp_courseware');
    ?>
</p>
	<?php 
    $form = new FormBuilder('tables_force_upgrade');
    $form->setSubmitLabel(__('Force Table Upgrade', 'wp_courseware'));
    echo $form->toString();
    // RHS Support Information
    $page->showPageMiddle('23%');
    WPCW_docs_showSupportInfo($page);
    WPCW_docs_showSupportInfo_News($page);
    WPCW_docs_showSupportInfo_Affiliate($page);
    $page->showPageFooter();
}
示例#10
0
 /**
  * Add a new field to the group
  * @param string $fn
  * @param array $args
  * @return FormField
  */
 function __call($fn, $args)
 {
     $name = $args[0];
     $fullname = $this->name . '[' . $name . ']';
     $this->fields[$name] = \FormBuilder::field($this->form, $fullname, $fn);
     return $this->fields[$name];
 }
示例#11
0
 function preforward()
 {
     $this->af->setApp('params', $this->af->getArray(false));
     $this->af->setApp('options', array('いいえ', 'はい'));
     $this->af->setApp('group_options', array('いいえ', 'はい(一行)', 'はい(改行)'));
     $this->af->setApp('custom_options', array('' => 'なし', 'checkHiragana' => 'ふりがな', 'checkKatakana' => 'フリガナ', 'checkMailaddress' => 'メールアドレス ( 例: info@example.com )', 'checkMailaddress_r' => 'メールアドレス ( このアドレスに控えメールを送信します。 )', 'checkRepeat' => '上段のフォーム内容の再入力 ( 確認の為に再度入力して下さい。 )', 'checkURL' => 'URL ( 例: http://www.example.com/ )', 'checkAlphabet' => '英字 ( 英字を入力して下さい。 )', 'checkAlphanum' => '英数字 ( 英数字を入力して下さい。 )', 'checkNumber' => '数字', 'checkInteger' => '正整数', 'checkZipcode' => '郵便番号 ( 例: 000-1111 )', 'checkZipcode_d' => '郵便番号 ( 例: 0001111 (ハイフン不要) )', 'checkPhone' => '固定電話 ( 例: 03-111-2222 )', 'checkPhone_d' => '固定電話 ( 例: 031112222 (ハイフン不要) )', 'checkMbphone' => '携帯電話 ( 例: 090-1111-2222 )', 'checkMbphone_d' => '携帯電話 ( 例: 09011112222 (ハイフン不要) )'));
     if ($this->af->getApp('attr') != null) {
         $params = $this->af->getArray();
         $params['id'] = 'none';
         $values =& $params['values'];
         $values = preg_replace('/\\r\\n?/', "\n", $values);
         $form = FormBuilder::build($params);
         $default = $params['default'];
         $t = $params['type_name'][0];
         // 初期値代入
         if ($t == 't' || $t == 'f') {
             $form = str_replace('<?=$none_v?>', $default, $form);
         } else {
             $selected = $t == 's' ? ' selected="selected"' : ' checked="checked"';
             $value = $t == 'c' ? preg_split('/[、,]/u', $default) : array($default);
             $values = explode("\n", $values);
             foreach ($values as $i => $v) {
                 $v = in_array($v, $value) ? $selected : '';
                 $form = str_replace(sprintf('<?=$none%d_v?>', $i), $v, $form);
             }
         }
         $this->af->setAppNE('form', $form);
     }
 }
示例#12
0
 /**
  * Подключаем в начале
  *
  * @param $formBuilder
  */
 static function autoload($formBuilder)
 {
     FormBuilder::jsAdd('jquery');
     FormBuilder::jsAdd('js/vendor/jquery.ui.widget', 'upload');
     FormBuilder::jsAdd('js/jquery.iframe-transport', 'upload');
     FormBuilder::jsAdd('js/jquery.fileupload', 'upload');
 }
示例#13
0
文件: Form.php 项目: rizabudi/plansys
 public function validateSubForm()
 {
     $class = get_class($this);
     $fb = FormBuilder::load($class);
     $listView = $fb->findAllField(['type' => 'ListView']);
     foreach ($listView as $k => $lv) {
         ## if listview is valid
         if ((@$lv['fieldTemplate'] == "datasource" || @$lv["fieldTemplate"] == "form") && @$lv['templateForm'] != '') {
             if (isset($this->attributes[$lv['name']])) {
                 $items = $this->attributes[$lv['name']];
                 foreach ($items as $k => $item) {
                     Yii::import($lv['templateForm']);
                     $newClass = Helper::explodeLast(".", $lv['templateForm']);
                     $new = new $newClass();
                     $new->attributes = $item;
                     $new->validate();
                     if ($new->hasErrors()) {
                         foreach ($new->errors as $name => $errors) {
                             $this->addError($name, implode("<br> &bull; ", $errors));
                         }
                     }
                 }
             }
         }
     }
 }
示例#14
0
 /**
  * Подключаем в начале
  *
  * @param $formBuilder
  */
 static function autoload($formBuilder)
 {
     FormBuilder::jsAdd('jquery');
     FormBuilder::jsAdd('jquery.mask.min', 'mask');
     $v = \View::make('formbuilder::extends/mask/js')->with('form', $formBuilder->config['id']);
     $formBuilder->setJs($v->render(), $v->getPath());
 }
示例#15
0
 /**
  * render
  * Fungsi ini untuk me-render layout
  * @param array $layout
  * @param array $sections
  * @param array $model
  * @param boolean $return
  * @return mixed me-return sebuah layout
  */
 public static function render($layout, $sections = null, $model = null, $return = false)
 {
     $formpath = @$sections['editor'] ? '//layouts/forms_editor/' : "//layouts/forms/";
     if (count($sections) > 0) {
         foreach ($sections as $k => $section) {
             switch (@$section['type']) {
                 case "menu":
                     if (@$section['file'] == "") {
                         continue;
                     }
                     $options = ['title' => @$section['title'], 'icon' => @$section['icon'], 'sections' => $sections, 'options' => @$section['menuOptions'], 'inlineJS' => @$section['inlineJS']];
                     $mt = MenuTree::load($section['file'], $options);
                     if ($mt != null) {
                         $sections[$k]['content'] = $mt->render(false);
                     }
                     break;
                 case "form":
                     if (@$section['class'] == "") {
                         continue;
                     }
                     $fb = FormBuilder::load(@$section['class']);
                     if ($fb != null) {
                         $sections[$k]['content'] = $fb->render($model, ['renderInAjax' => true]);
                     }
                     break;
             }
         }
     }
     return Yii::app()->controller->renderPartial($formpath . $layout, $sections, $return);
 }
示例#16
0
 public function actionRenderProperties()
 {
     $properties = FormBuilder::load('RepoProperties');
     if ($this->beginCache('RepoProperties', array('dependency' => new CFileCacheDependency(Yii::getPathOfAlias('application.forms.RepoProperties') . ".php")))) {
         echo $properties->render();
         $this->endCache();
     }
 }
示例#17
0
 /**
  * Render the form as HTML and return it.
  * @return String The HTML for the form.
  */
 public function getHTML()
 {
     if ($this->formObj) {
         $this->processPost();
         return $this->messages . $this->formObj->toString();
     }
     return false;
 }
示例#18
0
 /**
  * Generates form field.
  *
  * @param array $args
  *
  * @return string
  */
 public function input($args)
 {
     $value = FormBuilder::get_value($args['name'], $this->data);
     if (!empty($this->prefix)) {
         $args['name'] = array_merge($this->prefix, (array) $args['name']);
     }
     return FormBuilder::input_with_value($args, $value);
 }
示例#19
0
 public function actionCellTemplate()
 {
     $postdata = file_get_contents("php://input");
     $post = CJSON::decode($postdata);
     $fb = FormBuilder::load($post['class']);
     $field = $fb->findField(['name' => $post['name']]);
     $this->attributes = $field;
     $post['item'] = $this->processSingleColumn($post['item']);
     echo $this->getRowTemplate($post['item'], $post['idx']);
 }
 /**
  * Make custom validation messages.
  *
  * @param FormBuilder $builder
  * @return array
  */
 public function make(FormBuilder $builder)
 {
     $messages = [];
     foreach ($builder->getEnabledFormFields() as $field) {
         foreach ($field->getValidators() as $rule => $validator) {
             $message = trans(array_get($validator, 'message'));
             if ($message && str_contains($message, '::')) {
                 $message = trans($message);
             }
             $messages[$rule] = $message;
         }
         foreach ($field->getMessages() as $rule => $message) {
             if ($message && str_contains($message, '::')) {
                 $message = trans($message);
             }
             $messages[$rule] = $message;
         }
     }
     return $messages;
 }
示例#21
0
 public function actionSubform($c, $f)
 {
     Yii::import($c);
     $class = Helper::explodeLast(".", $c);
     $fb = FormBuilder::load($class);
     $field = $fb->findField(['name' => $f]);
     if (!!$field) {
         $this->attributes = $field;
         $this->renderSubForm();
     }
 }
示例#22
0
 static function autoload($formBuilder)
 {
     FormBuilder::jsAdd('jquery');
     FormBuilder::jsAdd('jquery.form', 'ajax');
     $config = $formBuilder->config;
     if (isset($config['ajax']) && is_array($config['ajax'])) {
         //dd( \View::make('formbuilder::extends/ajax/js')->render() );
         $v = \View::make('formbuilder::extends/ajax/js')->with('formName', $config['id'])->with('formAction', $config['ajax']['url']);
         $formBuilder->setJs($v->render(), $v->getPath());
     }
 }
示例#23
0
 /**
  * Подключаем в начале
  *
  * @param $formBuilder
  */
 static function autoload($formBuilder)
 {
     FormBuilder::jsAdd('jquery');
     FormBuilder::jsAdd('jquery.validate.min', 'validate');
     $lang = \App::getLocale();
     if ($lang != 'en') {
         FormBuilder::jsAdd('languages/validettaLang-' . \App::getLocale(), 'validate');
     }
     FormBuilder::cssAdd('validetta', 'validate');
     $v = \View::make('formbuilder::extends/validate/js')->with('form', $formBuilder->config['id']);
     $formBuilder->setJs($v->render(), $v->getPath());
 }
示例#24
0
 public function renderSubForm()
 {
     if ($this->subFormClass == get_class($this)) {
         return '<center><i class="fa fa-warning"></i> Error Rendering SubForm: Subform can not be the same as its parent</center>';
     } else {
         ## render
         Yii::import($this->subForm);
         $fb = FormBuilder::load($this->subFormClass);
         $render = $fb->render($fb->model, ['wrapForm' => false]);
         return $render;
     }
 }
示例#25
0
 /**
  * Show the user profile.
  *
  * @return Response
  */
 public function profile()
 {
     try {
         $user = User::with('groups')->findOrFail(Auth::user()->id);
         Debugbar::info($user->toArray());
         $user_form = \FormBuilder::create('Isabry\\Gatekeeper\\Forms\\UserForm', ['model' => $user])->remove('password')->remove('password_confirmation');
         return view('gatekeeper::home.profile')->with(compact('user_form'))->with('user', $user);
     } catch (ModelNotFoundException $e) {
         Session::flash('error', 'User not found (id: ' . $id . ')');
         return Redirect::intended('/');
     }
 }
示例#26
0
 /**
  * Display the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function show($id)
 {
     try {
         $user = User::with('groups')->findOrFail($id);
         Debugbar::info($user->toArray());
         $user_form = \FormBuilder::create('Isabry\\Gatekeeper\\Forms\\UserForm', ['model' => $user])->remove('password')->remove('password_confirmation');
         $url = '<a role="button" href="' . route('users.index') . '" class="btn btn-primary">' . '  <i class="fa fa-mail-reply"></i> Back to Users List' . '</a>';
         return view('gatekeeper::users.view')->with('title', 'User (' . $user->name . ')')->with(compact('user_form'))->with('url', $url);
     } catch (ModelNotFoundException $e) {
         Session::flash('error', 'User not found (id: ' . $id . ')');
         return Redirect::intended('users');
     }
 }
示例#27
0
 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function edit($id)
 {
     $class = $this->params['model'];
     $entry = $class::find($id);
     $form = \FormBuilder::create($this->params['form'], ['method' => 'PUT', 'model' => $entry, 'url' => route("{$this->params['route']}.update", [$id]), 'data' => $this->params['form_data']]);
     $tplPath = base_path('resources/views/' . $this->params['tpl_path']);
     if (is_dir($tplPath)) {
         $view = "{$this->params['tpl_path']}.edit";
     } else {
         $view = 'crud::entry.edit';
     }
     return view($view, compact('form'));
 }
示例#28
0
 public function actionResizeCol($col, $name, $size, $alias)
 {
     $fb = FormBuilder::load($alias);
     $field = $fb->findField(['name' => $name]);
     if (isset($field) && isset($field['columns'][$col])) {
         if (!isset($field['columns'][$col]['options'])) {
             $field['columns'][$col]['options'] = [];
         }
         $field['columns'][$col]['options']['width'] = $size;
     }
     $fields = $fb->updateField(['name' => $name], $field);
     $fb->setFields($fields);
 }
示例#29
0
 /**
  * (non-PHPdoc)
  * @see \views\bootstrap\widgets\FormBuilder::initElements()
  */
 public function initElements()
 {
     $columns = isset($this->_tplVars['columns']) ? (array) $this->_tplVars['columns'] : array();
     if ($columns === array()) {
         return $this;
     }
     $this->_tplVars['elements'] = isset($this->_tplVars['elements']) ? (array) $this->_tplVars['elements'] : array();
     foreach ($columns as $columnName) {
         $this->_tplVars['elements'][$columnName]['readonly'] = true;
         $this->_tplVars['elements'][$columnName]['disabled'] = true;
     }
     parent::initElements();
 }
示例#30
0
 /**
  * Attributes name from field label
  *
  * @return [string]
  */
 public function attributes()
 {
     if ($this->form) {
         $attributes = [];
         $formFields = \FormBuilder::create($this->form)->getFields();
         foreach ($formFields as $name => $fields) {
             if ($fields->getOptions()['label']) {
                 $attributes[$name] = $fields->getOptions()['label'];
             }
         }
         return $attributes;
     }
     return [];
 }