From 196aed907ed5e2e678d9964630e3fbda6840bd0b Mon Sep 17 00:00:00 2001 From: Cameron Date: Fri, 15 Mar 2013 21:50:03 -0700 Subject: [PATCH] Tag styling and admin-ui type='tags' added. --- e107_handlers/form_handler.php | 8 +++++++- e107_plugins/faqs/admin_config.php | 4 ++-- e107_themes/bootstrap/admin_style.css | 9 ++++++++- e107_web/js/bootstrap-tag/bootstrap-tag.js | 2 +- 4 files changed, 18 insertions(+), 5 deletions(-) diff --git a/e107_handlers/form_handler.php b/e107_handlers/form_handler.php index bab5bb429..0d8508e07 100644 --- a/e107_handlers/form_handler.php +++ b/e107_handlers/form_handler.php @@ -166,7 +166,8 @@ class e_form function tags($name, $value, $maxlength = 200, $options = array()) { if(is_string($options)) parse_str($options, $options); - $options['class'] = 'tbox input-text e-tags'; + $options['class'] = 'tbox span1 e-tags'; + $options['size'] = 7; return $this->text($name, $value, $maxlength, $options); } @@ -2337,6 +2338,7 @@ class e_form $value = vartrue($attributes['writeParms']['__options']['pre']).vartrue($attributes['writeParms'][$value]).vartrue($attributes['writeParms']['__options']['post']); break; + case 'tags': case 'text': if(vartrue($parms['truncate'])) @@ -2773,6 +2775,10 @@ class e_form unset($parms['maxlength']); $ret = vartrue($parms['pre']).$this->text($key, $value, $maxlength, $parms).vartrue($parms['post']); // vartrue($parms['__options']) is limited. See 'required'=>true break; + + case 'tags': + $ret = vartrue($parms['pre']).$this->tags($key, $value, $maxlength, $parms).vartrue($parms['post']); // vartrue($parms['__options']) is limited. See 'required'=>true + break; case 'textarea': $text = ""; diff --git a/e107_plugins/faqs/admin_config.php b/e107_plugins/faqs/admin_config.php index e2607e85f..c096faebc 100644 --- a/e107_plugins/faqs/admin_config.php +++ b/e107_plugins/faqs/admin_config.php @@ -182,11 +182,11 @@ 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, 'tab' => 0, 'type' => 'int', 'width' =>'5%', 'forced'=> TRUE), - 'faq_question' => array('title'=> LANA_FAQ_QUESTION, 'tab' => 0, 'type' => 'text', 'width' => 'auto', 'thclass' => 'left first', 'required'=>TRUE, 'readParms'=>'editable=1'), + 'faq_question' => array('title'=> LANA_FAQ_QUESTION, 'tab' => 0, 'type' => 'text', 'width' => 'auto', 'thclass' => 'left first', 'required'=>TRUE, 'readParms'=>'editable=1', 'writeParms'=>'size=xxlarge'), 'faq_answer' => array('title'=> LANA_FAQ_ANSWER, 'tab' => 0, 'type' => 'bbarea', 'width' => '30%', 'readParms' => 'expand=1&truncate=50&bb=1'), 'faq_parent' => array('title'=> LAN_CATEGORY, 'tab' => 0, 'type' => 'dropdown', 'data'=> 'int', 'inline'=>true,'width' => '10%', 'filter'=>TRUE, 'batch'=>TRUE), - 'faq_tags' => array('title'=> LANA_FAQ_TAGS, 'tab' => 1, 'type' => 'text', 'data' => 'str', 'width' => 'auto', 'inline'=> true, 'help' => LANA_FAQ_TAGS_HELP), // User id + 'faq_tags' => array('title'=> LANA_FAQ_TAGS, 'tab' => 1, 'type' => 'tags', 'data' => 'str', 'width' => 'auto', 'inline'=> true, 'help' => LANA_FAQ_TAGS_HELP), // User id 'faq_comment' => array('title'=> LANA_FAQ_COMMENT, 'tab' => 1, 'type' => 'userclass', 'data' => 'int', 'width' => 'auto', 'inline'=> true), // User id 'faq_datestamp' => array('title'=> LAN_DATE, 'tab' => 1, 'type' => 'datestamp', 'data'=> 'int','width' => 'auto', 'noedit' => false,'writeParms'=>'auto=1'), diff --git a/e107_themes/bootstrap/admin_style.css b/e107_themes/bootstrap/admin_style.css index e13249675..cc2f689af 100644 --- a/e107_themes/bootstrap/admin_style.css +++ b/e107_themes/bootstrap/admin_style.css @@ -761,6 +761,13 @@ ul#e-latest li a:hover { text-decoration: none; } /* Bootstrap tags */ .tags { display: inline-block; + margin-bottom:0px; + max-width:640px; +} + +.tags input { + margin-bottom: 0px; + width: 100px; } .tag { @@ -770,7 +777,7 @@ ul#e-latest li a:hover { text-decoration: none; } margin-left: 0; vertical-align:top; margin-top:3px; - + } span.tag button.close { diff --git a/e107_web/js/bootstrap-tag/bootstrap-tag.js b/e107_web/js/bootstrap-tag/bootstrap-tag.js index 7c54becfe..89eecdf6f 100644 --- a/e107_web/js/bootstrap-tag/bootstrap-tag.js +++ b/e107_web/js/bootstrap-tag/bootstrap-tag.js @@ -38,7 +38,7 @@ that.element.parent().prepend(that.element.detach().attr('type', 'hidden')) that.element - .wrap($('
')) + .wrap($('
')) .parent() .on('click', function () { that.input.focus()