Load Notifications
Function: loadNotifs
Visibility: public
Parameter: loadNotifs($fileName)
Description:
To enable the ability to show on the fly notifications, we have to load the notification file first. The way to do it, is with this function. Usually all notification files will be located under: text\notifs\{language code}\ directory. Inside this directory we can locate the notification file in any language we choose according to it's directory.
- There are 2 formats that the translation file can be saved: php array or xml.
- This function will use the format that have been given in loadMethod.
- Use of this function will be logged in log directory according to it's type, can be changed from logLocation.
notifTypes - Alerts have 5 different types/levels and color meaning as follow:
1 - "green"; notification only
2 - "orange"; notification that is not stacking the system
3 - "red"; notification that can stack the system - Or acute problem
4 - "blue"; db/mySql notifications
5 - "purple"; connection and outside connection problems - Like: no connection/mail
authLevels - Alerts have 6 different authLevel as follow:
0 - Not registered anymore
1 - Regular level
2 - Editor level
3 - Supervisor level
4 - Dev/tech level
5 - Master level
The notifications file have to be located in the designated directory mentioned above. The text that will be stored there must exist in array named:
[notifNum] - The notification number
[notifType] - The number of the color
[authLevel] - The next children will be the authLevel number
Like this:
- There are 2 formats that the translation file can be saved: php array or xml.
- This function will use the format that have been given in loadMethod.
- Use of this function will be logged in log directory according to it's type, can be changed from logLocation.
notifTypes - Alerts have 5 different types/levels and color meaning as follow:
1 - "green"; notification only
2 - "orange"; notification that is not stacking the system
3 - "red"; notification that can stack the system - Or acute problem
4 - "blue"; db/mySql notifications
5 - "purple"; connection and outside connection problems - Like: no connection/mail
authLevels - Alerts have 6 different authLevel as follow:
0 - Not registered anymore
1 - Regular level
2 - Editor level
3 - Supervisor level
4 - Dev/tech level
5 - Master level
The notifications file have to be located in the designated directory mentioned above. The text that will be stored there must exist in array named:
$notifs
. It's children array will have:
[notifNum] - The notification number
[notifType] - The number of the color
[authLevel] - The next children will be the authLevel number
Like this:
$notifs[notifNum][notifType][authLevel][] = "text";
. The last children array is for entering more then 1 notification text. If more then 1 array entered, the notification will be choose randomly. For that reason: if you enter more then 1 notification text for the same notification, [notifType][authLevel]
must be the same.
Parameters:
(required) - string - $fileName - The name of the file we want to load the notifications from (without extention), located at: \text\notifs\{language code}\ (actual file will be with php/xml extention).
Return:
array - The notifications from file.
Callable from (extended classes):
application: controller,view
advanced: controller,view
operators: controller,view
api: controller,view
example: 1
Let's say that we want to load a notification file, it must be located first in the designated directory mentioned above. The text that will be stored there must be in array named:
$notifs
.
How to call (example):
Possible outcome (example):
Output: