MAWI Class

MAWI class is used to manage all the basic functions of a website.



MAWI class documentation index



  • MAWI class manages the following

  • Actual language based on GET, Cookie, browser set, and default set language
  • Skeleton for many domains and websites
  • Virtual pages from a db (no real pages are used)
  • Virtual websites and domains
  • HTML page generation from skeletons and content files
  • Text and rich text content blocks on many languages
  • Dynamic page info from db
  • Dynamic and static sitemaps
  • File cache for speed up static contents


 

MAWI public methods

$mawi class is initialized automatically from loader.

$mawi->getReferer(); //Returns one array with |http_referer|referer|uri_str|uri|domain|page|query|
$mawi->getQueryStr(); //Create array with (name => value) data of URI query string
$mawi->captureGetVars(); //Set global vars captured and filtered from GET with a given size 
$mawi->capturePostVars(); //Set global vars captured and filtered from POST with a given size
$mawi->captureGlobalGet(); //Filtered $_GET vars with $key = value if $key is not previously defined.
$mawi->captureGlobalPost(); //Filtered $_POST vars with $key = value if $key is not previously defined.
$mawi->move2SSL(); //If not https, redirect domain to SSL
$mawi->formatDate(); //Returns a formated date, depending on int used in $opt
$mawi->pageBenchmark(); //Measure the page loading speed and memory consumption
$mawi->download(); //Download a file
$mawi->allLanguages(); //(array) Returns array with all MAWI enabled languages
$mawi->SetCookieLang(); //(bool)Set the cookie lang if GET var detected. Return true if cookies is set
$mawi->chkLang(); //(bool)Check if supplied iso lang code is enabled. Return true if lang is enabled
$mawi->getBreadcrumb(); //(string) Draw entire HTML breadcrumb formated with bootstrap breadcrumb CSS class
$mawi->showBreadcrumb(); //Show breadcrumb with bootstrap styles
$mawi->getQueryStr(); //(array) Generate from URI query string "?name=value" an array with ("name" => "value")
$mawi->pageId2Alias(); //(array) list of all pages in (page id => page alias) format.
$mawi->getAllText(); //(array) All the text for current page and language in (keyword => text) format.
$mawi->getText(); //(string) Return text value for current language for given $key
$mawi->showText(); //Show text value for current language for given $key
$mawi->getBlock(); //(string) Get a rich format html content block for $blockID into a string var
$mawi->showBlock(); //(string) Show a rich format html content block for $blockID
$mawi->redirect301(); //(array) Redirect old pages to new ones using configuration array $mawi_redir
$mawi->fileCacheChk(); //(bool)Check if current page must be cached. Return true if file must be cached
$mawi->fileCacheRead(); //(string)Read cache file if exist and delete expired cache files
$mawi->fileCacheWrite(); //(bool)Write the $obcontent to file cache. Return true if cache file is written
$mawi->headers(); //(bool) Generate status, cache, charset, frame and other http headers
$mawi->filterUsername(); //Filter the login form username POST field
$mawi->isCountry(); //Detect UE and LATAM countries
$mawi->readCookiesAgree(); //Read cookies_agree cookie
$mawi->setCookiesAgree(); //Set de cookies_agree cookie
$mawi->getMsg(); //Create a system message or error from array
$mawi->showMsg(); //Show the message created by createMsg
$mawi->getShiftDate(); //Get a shifted date by seconds, minutes, hours, days, weeks, months or years



 

MAWI public objects

$mawi objects generated automatically on every page loaded

$mawi->lang; //(string) Actual selected language two letters ISO code

$mawi->pageInfo->skeleton_above; //(string) Skeleton elements above the content with path
$mawi->pageInfo->skeleton_below; //(string) Skeleton elements below the content with path
$mawi->pageInfo->content; //(string) Contente file with path
$mawi->pageInfo->page_id; //(int) Id of current page
$mawi->pageInfo->file_name; //(string) Content file name of current page
$mawi->pageInfo->alias; //(string) Page alias taken from files db table alias value
$mawi->pageInfo->group;  //(int) Group ID of actual page
$mawi->pageInfo->group_up; //(int) Group id of precedent page of actual page
$mawi->pageInfo->dir; //(string) Directory name relative to web root of current page content file
$mawi->pageInfo->page_title; //(string) Title of current file in the selected language
$mawi->pageInfo->meta_description; //(string) Meta description of current file in the selected language
$mawi->pageInfo->meta_keyword; //(string) Meta keyword of current file in the selected language
$mawi->pageInfo->http_header; //(string) HTTP status code of curren page.
$mawi->pageInfo->trail_id; //(int) Trail page id of current file (Id of precedent page)
$mawi->pageInfo->owner_id; //(int) Id of owner user for actual page
$mawi->pageInfo->priority; //(int) Priority of file (1 to 10), used to generate sutemap.xml
$mawi->pageInfo->no_header; //(bool) Page do not generate header, footer or http headers.