1
0
mirror of https://github.com/e107inc/e107.git synced 2025-01-17 20:58:30 +01:00

Submit button drop-down options.

This commit is contained in:
Cameron 2012-12-12 22:39:18 -08:00
parent e0a27eede8
commit 24a1d695d4
4 changed files with 30 additions and 15 deletions

View File

@ -2121,7 +2121,10 @@ class e107
$path = e_PLUGIN.$plugin.'/languages/'.$fname.'.php';
}
e107::getMessage()->addDebug("Attempting to Load: ".$path);
if(E107_DBG_INCLUDES)
{
e107::getMessage()->addDebug("Attempting to Load: ".$path);
}
e107::setRegistry($cstring, true);

View File

@ -810,7 +810,7 @@ class e_form
$ret .= e107::getBB()->renderButtons($template,$help_tagid);
$ret .= $this->textarea($name, $value, $rows, 50, $options, $counter);
$ret .= $this->textarea($name, $value, $rows, 150, $options, $counter);
$ret .= "</div>\n";
@ -2242,14 +2242,14 @@ class e_form
return $this->renderValue($key, $value, $attributes).$this->hidden($key, $value); //
}
if(vartrue($required_data[0])) // HTML5 'required' field.
if(vartrue($required_data[0]) || vartrue($attributes['required'])) // HTML5 'required' attribute
{
$parms['required'] = 1;
}
if(vartrue($required_data[3])) // HTML5 'pattern' field.
if(vartrue($required_data[3]) || vartrue($attributes['pattern'])) // HTML5 'pattern' attribute
{
$parms['pattern'] = $required_data[3];
$parms['pattern'] = vartrue($attributes['pattern'], $required_data[3]) ;
}
switch($attributes['type'])
@ -2273,7 +2273,7 @@ class e_form
case 'password': // encrypts to md5 when saved.
$maxlength = vartrue($parms['maxlength'], 255);
unset($parms['maxlength']);
$ret = vartrue($parms['pre']).$this->text($key, $value, $maxlength, vartrue($parms['__options'])).vartrue($parms['post']);
$ret = vartrue($parms['pre']).$this->text($key, $value, $maxlength, $parms).vartrue($parms['post']); // vartrue($parms['__options']) is limited. See 'required'=>true
break;
case 'textarea':
@ -2850,11 +2850,7 @@ class e_form
if($submitopt)
{
$selected = isset($fdata['after_submit_default']) && array_key_exists($fdata['after_submit_default'], $submitopt) ? $fdata['after_submit_default'] : '';
$text .= '
<div class="options">
After submit: '.$this->radio_multi('__after_submit_action', $submitopt, $selected, false).'
</div>
';
}
$triggers = vartrue($fdata['triggers'], 'auto');
@ -2874,7 +2870,21 @@ class e_form
foreach ($triggers as $trigger => $tdata)
{
$text .= ($trigger == 'submit') ? "<div class=' btn-group'>" : "";
$text .= $this->admin_button('etrigger_'.$trigger, $tdata[0], $tdata[1]);
$text .= ($trigger == 'submit' && $submitopt) ?'<button class="btn btn-success dropdown-toggle left" data-toggle="dropdown">
<span class="caret"></span>
</button>
<ul class="dropdown-menu">
<li>
<div class="options left" style="padding:5px">
<b>After submit:</b><br />'.$this->radio_multi('__after_submit_action', $submitopt, $selected, true).'
</div>
</li>
</ul>': ''; //FIXME Find better Bootstrap classes/styling.
$text .= ($trigger == 'submit') ?"</div>" : "";
if(isset($tdata[2]))
{
$text .= $this->hidden($trigger.'_value', $tdata[2]);

View File

@ -167,15 +167,15 @@ class faq_main_ui extends e_admin_ui
protected $fields = array(
'checkboxes' => array('title'=> '', 'type' => null, 'width' =>'5%', 'forced'=> TRUE, 'thclass'=>'center', 'class'=>'center'),
'faq_id' => array('title'=> LAN_ID, 'type' => 'int', 'width' =>'5%', 'forced'=> TRUE),
'faq_question' => array('title'=> "Question", 'type' => 'text', 'width' => 'auto', 'thclass' => 'left first'), // Display name
'faq_answer' => array('title'=> "Answer", 'type' => 'bbarea', 'width' => '30%', 'readParms' => 'expand=...&truncate=50&bb=1'), // Display name
'faq_question' => array('title'=> "Question", 'type' => 'text', 'width' => 'auto', 'thclass' => 'left first', 'required'=>TRUE),
'faq_answer' => array('title'=> "Answer", 'type' => 'bbarea', 'width' => '30%', 'readParms' => 'expand=...&truncate=50&bb=1'),
'faq_parent' => array('title'=> "Category", 'type' => 'method', 'data'=> 'int','width' => '5%', 'filter'=>TRUE, 'batch'=>TRUE),
'faq_comment' => array('title'=> "Comment", 'type' => 'userclass', 'data' => 'int', 'width' => 'auto'), // User id
'faq_datestamp' => array('title'=> "datestamp", 'type' => 'datestamp', 'data'=> 'int','width' => 'auto', 'noedit' => TRUE), // User date
'faq_datestamp' => array('title'=> "datestamp", 'type' => 'datestamp', 'data'=> 'int','width' => 'auto', 'noedit' => TRUE),
'faq_author' => array('title'=> LAN_USER, 'type' => 'user', 'data'=> 'int', 'width' => 'auto', 'thclass' => 'center', 'class'=>'center', 'writeParms' => 'currentInit=1', 'filter' => true, 'batch' => true, 'nolist' => true ), // Photo
'u.user_name' => array('title'=> "User name", 'type' => 'user', 'width' => 'auto', 'noedit' => true, 'readParms'=>'idField=faq_author&link=1'), // User name
'u.user_loginname' => array('title'=> "User login", 'type' => 'user', 'width' => 'auto', 'noedit' => true, 'readParms'=>'idField=faq_author&link=1'), // User login name
'faq_order' => array('title'=> "Order", 'type' => 'number', 'data'=> 'int','width' => '5%', 'thclass' => 'center','nolist' => true ),
'faq_order' => array('title'=> "Order", 'type' => 'number', 'data'=> 'int','width' => '5%', 'thclass' => 'center','nolist' => true, 'noedit'=>true),
'options' => array('title'=> LAN_OPTIONS, 'type' => null, 'forced'=>TRUE, 'width' => '10%', 'thclass' => 'center last', 'class' => 'center','readParms'=>'sort=1')
);

View File

@ -23,6 +23,8 @@
.clear-r { clear: left }
.smalltext { font-size: 11px; }
.nowrap { white-space:nowrap; }
.field-spacer { margin-bottom: 3px; } /* multi-fields per row separator */
.e-tabs { padding:0px }
e-tabs fieldset { padding:0px ; padding-left:3px; border-top:0px;}