Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Update on View Updates
12-10-2015, 05:13 PM,
#40
RE: Update on View Updates
(03-01-2014, 03:53 PM)serakfalcon Wrote: I've been posting this information out of the general idea that since I'm planning on doing this anyway, I might as well keep you and everyone that might be interested in a more 'modern-looking', responsive and more interactive GUI: of course that will involve extra files. that is an inevitable trade-off but In my estimation the cost is negligible.

As I mentioned, the tablesorter can sort by several columns not just one, which is new functionality, it can also sort by dates, percentages etc. without needing to add a class just to specify what sort of information is in the table. It can also do preset sorts on page load or on click of page elements (e.g. a button). There are other bells and whistles like table pagination that respects sorts but I'll develop that as it goes along.
For simple uses, all you have to do is add a class to the table so the site knows it should be sortable, and you're done. Complicated uses you can see the website, but there's a lot of neat things you can do with the code.

As I continue to mention, merging all the output code into one place does make 'skinning' the site simpler, ensures the output to the user will be more consistent and makes database interactions more obvious since you're not hunting through random outputs of html in every single 'user-facing' file in the project. It also allows some simplification of control flow since you aren't forced to display until the object is fully built.

If there are patterns that repeat themselves often, I will roll those into the classes.

All of that makes the logical flow more obvious instead of having to twist around display logic, and not having to worry about formatting so much reduces the work to add new functionality, which is exactly why I'm doing it.

A prime candidate for abstractification is htmlentities: that will avoid the whole 'storing html entities into the database randomly if you didn't think to unencode something you encoded' problem by restricting html encoding to the view only.

From the form class (updated code to come next week, I will probably add this all to GitHub once I am comfortable with the code):


I've noticed throughout the code sometimes the hidden controls are added before the title, sometimes after, sometimes inbetween other controls. This way they are all inserted into the same place AND it is obvious what part of the site they come from, instead of having to look through the file to see where the input tags are being added.

There is similar inconsistency with the submit button, and random <br /> inserted in some forms and not others for no apparent reason.

Either way, it's always good to look through code just in case, for example, while I was implementing the form class for AccountGroups.php I noticed that
there is a spelling error in line 230 which causes the parent group to not be selected:
Code:
if (isset($_POST['ParentGroupName']) AND $_POST['ParentGroupName']==$RroupRow['groupname']) {

$RroupRow should be $GroupRow.

-Responsiveness

Another advantage is that bootstrap is responsive, or more accurately, it is easily reponsive, and should work fine for tablets and with a few adjustments here and there will work fine for pretty much any smartphone. Once I finish off the forms class they will always fit on your screen and tables will have a scroll bar to scroll horizontally (I will probably use the pagination plugin from tablesorter to fix long vertical tables but that is down the road). Bootstrap also supports 'off-canvas' menus which would allow pretty much full menu functionality for smartphones but that would be something to deal with later.

Cost

-40kb in code, 140kb in fonts (all cache-able)
-code refactoring

The load on the user is ~40kb for the bare minimum files necessary to run bootstrap, jquery and the tablesorter (all the css and js is minified). With browser caches & modern computers being what they are, of course, 40kb is nothing. With an extra 140kb you can add bootstrap glyphicons, which could replace most of the current images of any of the themes for approximately the same cost in size, but will take less http requests to do so.

I of course recommend downloading the whole package for programming purposes, for obvious reasons. (besides minification, a .less compiler sure makes themes a heck of a lot easier to put together!) but those files are purely for template designers to worry about.

To take advantage of the new classes, the old code will have to be rewritten but I'm already doing that so it's not like it's extra trouble for anyone else.

I forgot to mention in my previous post that the file viewcontroller.php would have to be included to make everything work, but I decided to roll the include into the views-header.php file for the next update (for simplicity). I'll post the form & control classes code sometime next week.

appreciate information
Reply


Messages In This Thread
Update on View Updates - by serakfalcon - 02-28-2014, 01:12 AM
RE: Update on View Updates - by serakfalcon - 02-28-2014, 11:37 PM
RE: Update on View Updates - by phil - 03-01-2014, 01:53 PM
RE: Update on View Updates - by serakfalcon - 03-01-2014, 03:53 PM
RE: treating numbers as 'numbers' - by opto - 03-01-2014, 09:50 PM
RE: Update on View Updates - by Forums - 03-01-2014, 07:13 PM
RE: Update on View Updates - by Forums - 03-01-2014, 10:00 PM
RE: Update on View Updates - by Exsonqu_Qu - 03-03-2014, 09:38 AM
RE: Update on View Updates - by opto - 03-03-2014, 10:44 PM
RE: Update on View Updates - by serakfalcon - 03-04-2014, 12:35 PM
RE: Update on View Updates - by opto - 03-04-2014, 05:27 PM
RE: Update on View Updates - by Forums - 03-04-2014, 07:31 PM
RE: Update on View Updates - by serakfalcon - 03-05-2014, 02:17 AM
RE: Update on View Updates - by Forums - 03-05-2014, 04:12 AM
RE: Update on View Updates - by opto - 03-04-2014, 08:15 PM
RE: Update on View Updates - by Exsonqu_Qu - 03-05-2014, 01:40 PM
RE: Update on View Updates - by serakfalcon - 03-05-2014, 04:03 PM
RE: Update on View Updates - by Forums - 03-05-2014, 09:56 PM
RE: Update on View Updates - by Exsonqu_Qu - 03-06-2014, 06:36 PM
RE: Update on View Updates - by Forums - 03-06-2014, 06:47 PM
RE: Update on View Updates - by Forums - 03-05-2014, 06:43 PM
RE: Update on View Updates - by serakfalcon - 03-05-2014, 10:58 PM
RE: Update on View Updates - by opto - 03-05-2014, 08:11 PM
RE: Update on View Updates - by Forums - 03-05-2014, 08:21 PM
RE: Update on View Updates - by Forums - 03-05-2014, 11:21 PM
RE: Update on View Updates - by serakfalcon - 03-06-2014, 12:54 AM
RE: Update on View Updates - by opto - 03-06-2014, 10:15 PM
RE: Update on View Updates - by serakfalcon - 03-08-2014, 03:34 AM
RE: Update on View Updates - by Forums - 03-09-2014, 06:43 AM
RE: Update on View Updates - by icedlava - 03-09-2014, 10:51 PM
RE: Update on View Updates - by Forums - 03-10-2014, 04:58 AM
RE: Update on View Updates - by serakfalcon - 03-10-2014, 04:08 PM
RE: Update on View Updates - by icedlava - 03-10-2014, 04:53 PM
RE: Update on View Updates - by serakfalcon - 03-19-2014, 07:12 PM
RE: Update on View Updates - by serakfalcon - 04-04-2014, 03:03 PM
RE: Update on View Updates - by icedlava - 04-04-2014, 06:12 PM
RE: Update on View Updates - by serakfalcon - 04-04-2014, 07:24 PM
RE: Update on View Updates - by serakfalcon - 05-07-2014, 07:07 PM
RE: Update on View Updates - by wubuer198 - 12-10-2015, 05:13 PM

Forum Jump:


Users browsing this thread: 2 Guest(s)