Open Jimmi08 opened 5 years ago
There is a new data field: safestr without mention in the documentation:
'news_render_type' => array('title' => LAN_LOCATION, 'type' => 'dropdown', 'data'=>'safestr', 'tab'=>2, 'inline'=>true, 'readParms'=>array('type'=>'checkboxes'), 'width' => 'auto', 'thclass' => 'left', 'class' => 'left', 'nosort' => false, 'batch'=>true, 'filter'=>true),
There is mistake in example of theme.xml
There is mistake in example of theme.xml
Fixed
Under User data is:
$userData = e107::user(); // Example - currently logged in user.
this doesn't work. I had to use
$userData = e107::user(USERID); // Example - currently logged in user.
Fixed this in the docs and in the comments.
There is a new data field: safestr without mention in the documentation:
'news_render_type' => array('title' => LAN_LOCATION, 'type' => 'dropdown', 'data'=>'safestr', 'tab'=>2, 'inline'=>true, 'readParms'=>array('type'=>'checkboxes'), 'width' => 'auto', 'thclass' => 'left', 'class' => 'left', 'nosort' => false, 'batch'=>true, 'filter'=>true),
safestr
was added in 2013 but not often used. Added to documentation now.
Thanks
With the hero plugin there is a new option how to insert demo data for plugin: create xml folder and add file instal.xml (that is simply exported from Database/Tools/Export xml)
But be aware of this: https://github.com/e107inc/e107/issues/4483
And maybe before starting to use widely - why theme uses "install" folder but the plugin uses "xml" folder?
Missing from documentation:
$frm->checkboxes($name, $option_array=array(), $checked=null, $options=array())
or another way how to create multicheckboxes dropdown on frontend (without ADMIN UI) - select() + parameter 'multiple'
Missing from documentation
$frm->renderElement($key, $value, $attributes, $required_data = array(), $id = 0)
This method can be used without Admin UI. And it is often used in methods() in Admin UI forms. There is renderValue() for displaying value too.
This is not used only for Admin UI, it can be very handy for the frontend if you have to do forms or listing on the fly (not hardcoded elements).
Missing from documentation:
Stuff related to breadcrumbs:
{---BREADCUMB---}
Only information about rendering is here:
return e107::getForm()->breadcrumb($array);
See: https://github.com/e107inc/e107/issues/2488
Creating breadcrumbs:
e107::breadcrumb($breadcrumb_array);
see download plugin
How to get breadcrumb array: (answer in documentation can close those issues) see: https://github.com/e107inc/e107/issues/2488 https://github.com/e107inc/e107/issues/3955
snippets implementation for custom checkboxes and radios. Result:
You use a snippet in your theme and all checkboxes/radios should be changed (I think that except contact form).
Hi, this is not some fix, it is something I am still missing and I am aware I should know this stuff, but I always forget. With rewriting old code native PHP functions are often used and to have some list of e107 replacement would be nice. I know that before saving to database e107::getParser()->toDb() should be used, but there are other places too.
If this doesn't belong to the doc, I can create a separate issue.
htmlentities($value) - it displays $value in editing form
addslashes(strip_tags($value)) - used after loading value from db
stripslashes($val) + htmlspecialchars($val) - used after loading value from db
stripslashes($val) - used after loading value from db
escapestring(descript(strip_tags(($_POST["value"]))) - used for post value
escapestring(descript($_POST["value"])) - used for post value
And can I remove this with e107?:
// Cleans these two variables of possible XSS attacks.
if(isset($_SERVER['PHP_SELF'])) $_SERVER['PHP_SELF'] = htmlspecialchars(descript($_SERVER['PHP_SELF']), ENT_QUOTES);
if(isset($PHP_SELF)) $PHP_SELF = htmlspecialchars(descript($PHP_SELF), ENT_QUOTES);
Thanks
There is a new option to send class as the parameter for {NAVIGATION} shortcode without need to creating theme template file.
in template {NAVBAR_CLASS}
using: {NAVIGATION: class=mx-auto}
'readonly' => 2,
- used in gsitemap plugin
Docs:
Missing from documentation
@Moc Ad this: https://devguide.e107.org/classes-and-methods/events#user-event-triggers
Trigger 'login' was not working for me, so I found that there is a new trigger:
e107::getEvent()->trigger('user_login', $userdata);
This one worked.
And those triggers are not mentioned either:
e107::getEvent()->trigger('user_ban_failed_login', array('time'=>$time, 'ip'=>$this->userIP, 'other'=>$extra_text));
'e107::getEvent()->trigger('userNotNew', $edata_li);'
e107::getEvent()->trigger('usersupprov', $userdata);
e107::getEvent()->trigger('user_ip_changed', $edata);
Under User data is:
$userData = e107::user(); // Example - currently logged in user.
this doesn't work. I had to use
$userData = e107::user(USERID); // Example - currently logged in user.