1
0
mirror of https://github.com/e107inc/e107.git synced 2025-07-31 20:00:37 +02:00

admin UI - introducing textarea auto-height, bugfixes, e-column trigger overall fix

This commit is contained in:
secretr
2009-11-09 16:54:30 +00:00
parent e7f6df0ba4
commit 7edd4ba390
8 changed files with 84 additions and 37 deletions

View File

@@ -11,8 +11,8 @@
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_admin/comment.php,v $
| $Revision: 1.16 $
| $Date: 2009-11-09 12:23:45 $
| $Revision: 1.17 $
| $Date: 2009-11-09 16:54:30 $
| $Author: secretr $
+----------------------------------------------------------------------------+
*/
@@ -82,7 +82,7 @@ class comments_admin_ui extends e_admin_ui
'comment_id' => array('title'=> LAN_ID, 'type' => 'int', 'width' =>'5%', 'forced'=> TRUE),
'comment_item_id' => array('title'=> "item id", 'type' => 'text', 'width' => '5%'),
'comment_subject' => array('title'=> "subject", 'type' => 'text', 'width' => 'auto', 'thclass' => 'left first'), // Display name
'comment_comment' => array('title'=> "comment", 'type' => 'textarea', 'width' => '30%', 'readParms' => 'expand=...&truncate=50&bb=1'), // Display name
'comment_comment' => array('title'=> "comment", 'type' => 'bbarea', 'width' => '30%', 'readParms' => 'expand=...&truncate=50&bb=1'), // Display name
'comment_author_id' => array('title'=> "authorID", 'type' => 'user', 'data' => 'int', 'width' => 'auto'), // User id
'comment_author_name' => array('title'=> "authorName", 'type' => 'text', 'width' => 'auto'), // User name
'user_name' => array('title'=> "System user", 'type' => 'text', 'width' => 'auto', 'table' => 'user', 'noedit' => true), // User name

View File

@@ -1945,7 +1945,7 @@ class e_admin_ui extends e_admin_controller_ui
public function ListObserver()
{
$this->getTreeModel()->setParam('db_query', $this->_modifyListQry())->load();
$this->addTitle('List');
$this->addTitle('List'); // FIXME - get captions from dispatch list
//var_dump($_POST, $this->getParam('enable_triggers'));
}
@@ -2043,6 +2043,26 @@ class e_admin_ui extends e_admin_controller_ui
$this->CreateSubmitTrigger();
}
/**
* Edit - send JS to page Header
* @return
*/
function EditHeader()
{
// TODO - make it part of e_from::textarea/bbarea(), invoke it on className (not all textarea elements)
e107::getJs()->requireCoreLib('core/admin.js')
->footerInline("
\$\$('textarea').each(function(textarea) {
//auto options
var options = {}, autoopt = '__' + textarea.name + '_opt', autooptel = textarea.next('input[name=autoopt]');
if(autooptel) {
options['max_length'] = parseInt(autooptel.value);
}
new e107Admin.Nicearea(textarea, options);
});
");
}
/**
* Generic Edit page
* @return string
@@ -2094,6 +2114,26 @@ class e_admin_ui extends e_admin_controller_ui
}
/**
* Create - send JS to page Header
* @return
*/
function CreateHeader()
{
// TODO - make it part of e_from::textarea/bbarea(), invoke it on className (not all textarea elements)
e107::getJs()->requireCoreLib('core/admin.js')
->footerInline("
\$\$('textarea').each(function(textarea) {
//auto options
var options = {}, autoopt = '__' + textarea.name + '_opt', autooptel = textarea.next('input[name=autoopt]');
if(autooptel) {
options['max_length'] = parseInt(autooptel.value);
}
new e107Admin.Nicearea(textarea, options);
});
");
}
/**
*
* @return
@@ -2765,7 +2805,7 @@ class e_admin_form_ui extends e_form
'head_query' => $request->buildQueryString('field=[FIELD]&asc=[ASC]&from=[FROM]', false), // without field, asc and from vars, REQUIRED
'np_query' => $request->buildQueryString(array(), false, 'from'), // without from var, REQUIRED for next/prev functionality
'legend' => $controller->getPluginTitle(), // hidden by default
'form_pre' => $this->renderFilter($tp->post_toForm(array($controller->getQuery('searchquery'), $controller->getQuery('filter_options')), $controller->getMode().'/'.$controller->getAction())), // needs to be visible when a search returns nothing
'form_pre' => $this->renderFilter($tp->post_toForm(array($controller->getQuery('searchquery'), $controller->getQuery('filter_options'))), $controller->getMode().'/'.$controller->getAction()), // needs to be visible when a search returns nothing
'form_post' => '', // markup to be added after closing form element
'fields' => $controller->getFields(), // see e_admin_ui::$fields
'fieldpref' => $controller->getFieldPref(), // see e_admin_ui::$fieldpref
@@ -2790,9 +2830,6 @@ class e_admin_form_ui extends e_form
}
$l = explode('/', $location);
//FIXME - this data is incorrect and always returns 'main/xxxx'.
echo "Debug: LOCATION = ".$location;
$text = "
<form method='get' action='".e_SELF."?".e_QUERY."'>
<fieldset class='e-filter'>
@@ -3180,4 +3217,9 @@ class e_admin_ui_dummy extends e_form
* 7. clean up/document all object vars (e_admin_ui, e_admin_dispatcher)
* 8. clean up/document all parameters (get/setParm()) in controller and model classes
* 9. [DONE] 'ip' field type - convert to human readable format while showing/editing record
* 10. draggable ordering (list view)
* 11. realtime search filter (typing text) - like downloads currently
* 12. autosubmit when 'filter' dropdown is changed (quick fix?)
* 13. tablerender captions
* 14. [ALMOST - see Edit/CreateHeader() comments] textareas auto-height
*/

View File

@@ -9,8 +9,8 @@
* Form Handler
*
* $Source: /cvs_backup/e107_0.8/e107_handlers/form_handler.php,v $
* $Revision: 1.74 $
* $Date: 2009-11-09 12:23:44 $
* $Revision: 1.75 $
* $Date: 2009-11-09 16:54:29 $
* $Author: secretr $
*
*/
@@ -198,10 +198,11 @@ class e_form
';
}
//'.$this->text($id_fld, $default_id, 10, array('id' => false, 'readonly'=>true, 'class'=>'tbox number')).'
$ret = '
<div class="e-autocomplete-c">
'.$this->text($name, $default_name, 150, array('id' => false, 'readonly' => vartrue($options['readonly']) ? true : false)).'
'.$this->text($id_fld, $default_id, 10, array('id' => false, 'readonly'=>true, 'class'=>'tbox number')).'
'.$this->hidden($id_fld, $default_id, array('id' => false)).'
'.$reset.'
<span class="indicator" style="display: none;">
<img src="'.e_IMAGE_ABS.'generic/loading_16.gif" class="icon action S16" alt="Loading..." />
@@ -1194,7 +1195,7 @@ class e_form
break;
case 'bbarea':
return $this->bbarea($key, $value, vartrue($parms['help']), vartrue($parms['helptag']), vartrue($parms['size']));
return $this->bbarea($key, $value, vartrue($parms['help']), vartrue($parms['helptag']), vartrue($parms['size'], 'medium'));
break;
case 'image': //TODO - thumb, image list shortcode, js tooltip...
@@ -1223,7 +1224,7 @@ class e_form
case 'userclass':
case 'userclasses':
$uc_options = vartrue($parms['classlist'], ''); // defaults to 'public,guest,nobody,member,classes' (userclass handler)
$uc_options = vartrue($parms['classlist'], 'public,guest,nobody,member,classes,admin,main'); // defaults to 'public,guest,nobody,member,classes' (userclass handler)
unset($parms['classlist']);
$method = $attributes['type'] == 'userclass' ? 'uc_select' : 'uc_checkbox';
return $this->$method($key, $value, $uc_options, vartrue($parms['__options'], array()));

View File

@@ -10,9 +10,9 @@
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_plugins/download/handlers/adminDownload_class.php,v $
| $Revision: 1.22 $
| $Date: 2009-11-07 02:10:46 $
| $Author: e107coders $
| $Revision: 1.23 $
| $Date: 2009-11-09 16:54:29 $
| $Author: secretr $
+----------------------------------------------------------------------------+
*/
if (!e107::isInstalled('download')) { exit(); }
@@ -1895,7 +1895,7 @@ class adminDownload extends download
// {
// $this->_observe_newsCommentsRecalc();
// }
if(isset($_POST['submit-e-columns']))
if(isset($_POST['etrigger_ecolumns']))
{
$this->_observe_saveColumns();
}

View File

@@ -11,9 +11,9 @@
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_plugins/faqs/admin_config.php,v $
| $Revision: 1.1 $
| $Date: 2009-11-09 12:57:34 $
| $Author: e107coders $
| $Revision: 1.2 $
| $Date: 2009-11-09 16:54:28 $
| $Author: secretr $
+----------------------------------------------------------------------------+
*/
require_once("../../class2.php");
@@ -101,13 +101,13 @@ class faq_main_ui extends e_admin_ui
'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' => 'textarea', 'width' => '30%', 'readParms' => 'expand=...&truncate=50&bb=1'), // Display name
'faq_parent' => array('title'=> "Category", 'type' => 'method', 'width' => '5%', 'filter'=>TRUE, 'batch'=>TRUE),
'faq_question' => array('title'=> "Question", 'type' => 'text', 'data'=> 'str', 'width' => 'auto', 'thclass' => 'left first'), // Display name
'faq_answer' => array('title'=> "Answer", 'type' => 'bbarea', 'data'=> 'str','width' => '30%', 'readParms' => 'expand=...&truncate=50&bb=1'), // Display name
'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', 'width' => 'auto'), // User date
'faq_datestamp' => array('title'=> "datestamp", 'type' => 'datestamp', 'data'=> 'int','width' => 'auto'), // User date
'faq_author' => array('title'=> LAN_USER, 'type' => 'user', 'data'=> 'int', 'thclass' => 'center', 'class'=>'center', 'filter' => true, 'batch' => true, 'width' => 'auto'), // Photo
'faq_order' => array('title'=> "Order", 'type' => 'int', 'width' => '5%', 'thclass' => 'center' ), // Real name (no real vetting)
'faq_order' => array('title'=> "Order", 'type' => 'int', 'data'=> 'int','width' => '5%', 'thclass' => 'center' ), // Real name (no real vetting)
'options' => array('title'=> LAN_OPTIONS, 'type' => null, 'forced'=>TRUE, 'width' => '10%', 'thclass' => 'center last', 'class' => 'center')
);

View File

@@ -11,9 +11,9 @@
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_plugins/poll/admin_config.php,v $
| $Revision: 1.9 $
| $Date: 2009-09-22 18:28:45 $
| $Author: e107coders $
| $Revision: 1.10 $
| $Date: 2009-11-09 16:54:29 $
| $Author: secretr $
+----------------------------------------------------------------------------+
*/
require_once("../../class2.php");
@@ -165,7 +165,7 @@ function poll_list()
global $user_pref;
if(isset($_POST['submit-e-columns'])) //TODO User
if(isset($_POST['etrigger_ecolumns'])) //TODO User
{
$user_pref['admin_poll_columns'] = $_POST['e-columns'];
save_prefs('user');

View File

@@ -9,8 +9,8 @@
* Release Plugin Administration UI
*
* $Source: /cvs_backup/e107_0.8/e107_plugins/release/includes/admin.php,v $
* $Revision: 1.6 $
* $Date: 2009-11-05 17:32:18 $
* $Revision: 1.7 $
* $Date: 2009-11-09 16:54:28 $
* $Author: secretr $
*/
@@ -118,8 +118,9 @@ class plugin_release_admin_ui extends e_admin_ui
* - title (string) Human readable field title, constant name will be accpeted as well (multi-language support
*
* - type (string) null (means system), number, text, dropdown, url, image, icon, datestamp, userclass, userclasses, user[_name|_loginname|_login|_customtitle|_email],
* boolean, method
* boolean, method, ip
* full/most recent reference list - e_form::renderTableRow(), e_form::renderElement(), e_admin_form_ui::renderBatchFilter()
* for list of possible read/writeParms per type see below
*
* - data (string) Data type, one of the following: int, integer, string, str, float, bool, boolean, model, null
* Used only if $dataFields is not set
@@ -163,6 +164,9 @@ class plugin_release_admin_ui extends e_admin_ui
* - number -> read: (array) [optional] 'point' => '.', [optional] 'sep' => ' ', [optional] 'decimals' => 2, [optional] 'pre' => '&euro; ', [optional] 'post' => 'LAN_CURRENCY'
* -> write: (array) [optional] 'pre' => '&euro; ', [optional] 'post' => 'LAN_CURRENCY', [optional] 'maxlength' => 50, [optional] '__options' => array(...) see e_form class description for __options format
*
* - ip -> read: n/a
* -> write: [optional] element options array (see e_form class description for __options format)
*
* - text -> read: (array) [optional] 'htmltruncate' => 100, [optional] 'truncate' => 100, [optional] 'pre' => '', [optional] 'post' => ' px'
* -> write: (array) [optional] 'pre' => '', [optional] 'post' => ' px', [optional] 'maxlength' => 50 (default - 255), [optional] '__options' => array(...) see e_form class description for __options format
*
@@ -170,7 +174,7 @@ class plugin_release_admin_ui extends e_admin_ui
* -> write: (array) [optional] 'rows' => '' default 15, [optional] 'cols' => '' default 40, [optional] '__options' => array(...) see e_form class description for __options format
*
* - bbarea -> read: same as textarea type
* -> write: (array) [optional] 'pre' => '', [optional] 'post' => ' px', [optional] 'maxlength' => 50 (default - 255), [optional] '__options' => array(...) see e_form class description for __options format
* -> write: (array) [optional] 'pre' => '', [optional] 'post' => ' px', [optional] 'maxlength' => 50 (default - 0), [optional] 'size' => [optional] - medium, small, large - default is medium
*
* - image -> read: [optional] 'title' => 'SOME_LAN' (default - LAN_PREVIEW), [optional] 'pre' => '{e_PLUGIN}myplug/images/'
* -> write: (array) [optional] 'label' => '', [optional] '__options' => array(...) see e_form::imagepicker() for allowed options

View File

@@ -9,9 +9,9 @@
* Plugin Administration - gsitemap
*
* $Source: /cvs_backup/e107_0.8/e107_plugins/tinymce/admin_config.php,v $
* $Revision: 1.9 $
* $Date: 2009-10-20 21:02:02 $
* $Author: e107coders $
* $Revision: 1.10 $
* $Date: 2009-11-09 16:54:30 $
* $Author: secretr $
*
*/
require_once("../../class2.php");
@@ -75,7 +75,7 @@ else
$ef->listRecords();
}
if(isset($_POST['submit-e-columns']))
if(isset($_POST['etrigger_ecolumns']))
{
$user_pref['admin_release_columns'] = $_POST['e-columns'];
save_prefs('user');