Example #1
0
 /**
  * Called after the form fields are defined.
  * @param \Backend\Widgets\Form $host The hosting form widget
  * @return void
  */
 public function formExtendFields($host, $fields)
 {
     /** @var FormField $field */
     foreach ($host->getFields() as $field) {
         $field->disabled = true;
     }
 }
Example #2
0
 /**
  * Called after the form fields are defined.
  *
  * @param Form $host
  * @param array $fields
  */
 public function formExtendFields(Form $host, array $fields = [])
 {
     $disableFields = ['from_url', 'to_url', 'cms_page', 'target_type', 'match_type'];
     foreach ($disableFields as $disableField) {
         /** @var FormField $field */
         $field = $host->getField($disableField);
         $field->disabled = $host->model->getAttribute('system');
     }
 }
Example #3
0
File: Google.php Project: jiiis/ptn
 public function extendSettingsForm(Form $form)
 {
     $form->addFields(['noop' => ['type' => 'partial', 'path' => '$/flynsarmy/sociallogin/partials/backend/forms/settings/_google_info.htm', 'tab' => 'Google'], 'providers[Google][enabled]' => ['label' => 'Enabled?', 'type' => 'checkbox', 'default' => 'true', 'tab' => 'Google'], 'providers[Google][app_name]' => ['label' => 'Application Name', 'type' => 'text', 'default' => 'Social Login', 'comment' => 'This appears on the Google login screen. Usually your site name.', 'tab' => 'Google'], 'providers[Google][client_id]' => ['label' => 'Client ID', 'type' => 'text', 'tab' => 'Google'], 'providers[Google][client_secret]' => ['label' => 'Client Secret', 'type' => 'text', 'tab' => 'Google']], 'primary');
 }
Example #4
0
 /**
  * Returns the active session key.
  */
 public function getSessionKey()
 {
     if ($this->sessionKey) {
         return $this->sessionKey;
     }
     if (post('_session_key')) {
         return $this->sessionKey = post('_session_key');
     }
     return $this->sessionKey = FormHelper::getSessionKey();
 }
Example #5
0
 /**
  * Add fields to the MenuItem form
  *
  * @param  Form   $form
  *
  * @return void
  */
 public function extendItemForm(Form $form)
 {
     $form->addFields(['url' => ['label' => 'URL', 'comment' => 'Enter the URL above. Leave blank for #', 'type' => 'text', 'tab' => 'Item']], 'primary');
 }
Example #6
0
 /**
  * Add fields to the MenuItem form
  *
  * @param  Form   $form
  *
  * @return void
  */
 public function extendSettingsForm(Form $form)
 {
     $form->addFields(['blog_post_page' => ['tab' => 'Blog', 'label' => 'Blog Post Page', 'comment' => 'Select the page your blog posts are displayed on', 'type' => 'dropdown', 'options' => DropDownHelper::instance()->pages()]], 'primary');
 }
Example #7
0
 /**
  * Add fields to the MenuItem form
  *
  * @param  Form   $form
  *
  * @return void
  */
 public function extendItemForm(Form $form)
 {
     $form->addFields(['master_object_id' => ['label' => 'Page', 'comment' => 'Select the page you wish to link to.', 'type' => 'dropdown', 'options' => DropDownHelper::instance()->pages(), 'tab' => 'Item'], 'data[params]' => ['label' => 'Slug Parameters', 'comment' => 'If a slug uses a parameter such as :slug, enter a value for it here. Enter valid JSON - for example {"slug":"my-page-slug"}', 'type' => 'text', 'options' => DropDownHelper::instance()->pages(), 'tab' => 'Item']], 'primary');
 }
Example #8
0
 /**
  * Add fields to the MenuItem form
  *
  * @param  Form   $form
  *
  * @return void
  */
 public function extendItemForm(Form $form)
 {
     $form->addFields(['master_object_id' => ['label' => 'Partial', 'comment' => 'Select the partial you wish to render.', 'type' => 'dropdown', 'options' => DropDownHelper::instance()->partials()]], 'primary');
 }
Example #9
0
 public function extendSettingsForm(Form $form)
 {
     $form->addFields(['noop' => ['type' => 'partial', 'path' => '$/flynsarmy/sociallogin/partials/backend/forms/settings/_facebook_info.htm', 'tab' => 'Facebook'], 'providers[Facebook][enabled]' => ['label' => 'Enabled?', 'type' => 'checkbox', 'default' => 'true', 'tab' => 'Facebook'], 'providers[Facebook][app_id]' => ['label' => 'App ID', 'type' => 'text', 'tab' => 'Facebook'], 'providers[Facebook][app_secret]' => ['label' => 'App Secret', 'type' => 'text', 'tab' => 'Facebook']], 'primary');
 }
Example #10
0
 public function extendSettingsForm(Form $form)
 {
     $form->addFields(['noop' => ['type' => 'partial', 'path' => '$/flynsarmy/sociallogin/partials/backend/forms/settings/_twitter_info.htm', 'tab' => 'Twitter'], 'providers[Twitter][enabled]' => ['label' => 'Enabled?', 'type' => 'checkbox', 'default' => 'true', 'tab' => 'Twitter'], 'providers[Twitter][api_key]' => ['label' => 'API Key', 'type' => 'text', 'tab' => 'Twitter'], 'providers[Twitter][api_secret]' => ['label' => 'API Secret', 'type' => 'text', 'tab' => 'Twitter']], 'primary');
 }