phpvms / phpvms_v2

Virtual Airline Management (not maintained)
http://www.phpvms.net
BSD 3-Clause "New" or "Revised" License
41 stars 46 forks source link

Normalize template variables #38

Closed nabeelio closed 13 years ago

nabeelio commented 13 years ago

Some templates are using $userinfo, some are $pilotinfo, some are $user........ normalize all of these, which are available in templates and the usage within controllers:

For pilots:

$pilot - The current pilot this template refers to

$pilot_list - A list of pilots

For PIREPs:

$pirep - A single PIREP

$pirep_list - A list of PIREPs

For schedules:

$schedule - A single schedule

$schedule_list - A list of Schedules

And any other variables used have to follow the same naming schema. Loops are changed to something like:

foreach($pirep_list as $pirep)

and

foreach($pilot_list as $pilot)

Etc, to keep them consistent with the single-row templates. Both are depending on context. Profile template (for viewing and the current user) should use $pilot... etc.

The old variables will still work. This is for new people as of 3.0, or those who are starting from scratch. Should reduce confusion...